smoothDampAngle

open fun smoothDampAngle(current: Measure<Angle>, target: Measure<Angle>, currentVelocity: Reference<Double>, smoothTime: Measure<Time>, maxVelocity: Double, deltaTime: Measure<Time>): Measure<Angle>

Gradually changes an angle towards a desired goal over time.

Return

The new angle following the smooth damp. The new ang. 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 angle.

target

The angle we want to be at.

currentVelocity

The current angular 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.

smoothTime

Approximately the time it will take to reach the target.

maxVelocity

The maximum velocity that may be achieved when moving current->target.

deltaTime

The time since the last call to this method.