Function lerpAngleShortest
-
Parameters
- current: number
The current angle, in radians.
- goal: number
The goal angle, in radians.
- t: number
The interpolation weight (typically from expDampFactor).
Returns number
The new angle, stepped
tof the way along the shortest arc. - current: number
Blend an angle (radians) toward a goal along the shortest arc, correctly handling wrap-around past
±PI(e.g.3.1 -> -3.1takes the short way). This is the lightweight alternative to quaternion slerp when only a single angle is being interpolated. The result is not normalized to any particular range.