Smooth damp - spring-like movement with velocity
Current value
Target value
Current velocity (modified in place via return)
Approximate time to reach target
Time since last call
Maximum speed (default: Infinity)
Tuple of [new position, new velocity]
let pos = 0;let vel = 0;[pos, vel] = smoothDamp(pos, 100, vel, 0.3, 0.016); Copy
let pos = 0;let vel = 0;[pos, vel] = smoothDamp(pos, 100, vel, 0.3, 0.016);
Smooth damp - spring-like movement with velocity