oriels/app/dofs/stretch-cursor/og/
2022-10-03 08:54:32 -04:00

22 lines
No EOL
307 B
Text

input
to = [pos, ori]
from = [pos, ori]
data
cursor
init
cursor = to.pos
frame
vec = to.pos - from.pos
len = vec.len
stretch = max(len - deadzone, 0)
dir = pointer ? to.ori * v3.fwd : vec / len
cursor = to.pos + dir * stretch * strength
design
pointer = false
deadzone = 0.1
strength = 3