smooth Damp
open fun smoothDamp(current: Double, target: Double, @NonNull currentVelocity: Reference<Double>, smoothTime: Measure<Time>, maxVelocity: Double, deltaTime: Measure<Time>): Double
open fun smoothDamp(current: Float, target: Float, currentVelocity: Reference<Double>, smoothTime: Measure<Time>, maxVelocity: Float, deltaTime: Measure<Time>): Float
Gradually changes a value towards a desired goal over time.
Return
The new position following the smooth damp. The new velocity is stored in the currentVelocity reference, for when this method is called again. Any clamping of this value to minimum limits is left to your discretion.
Parameters
current
The current position.
target
The position we want to be at.
current Velocity
The current velocity of the current position moving towards the target. This ref is modified by this function and should be passed back into it on subsequent calls.
smooth Time
Approximately the time it will take to reach the target.
max Velocity
The maximum velocity that may be achieved when moving current->target.
delta Time
The time since the last call to this method.