QuaternionExtensions.SmoothDamp
Extension Method in QuaternionExtensions
Declaration
public static Quaternion SmoothDamp(this Quaternion current, Quaternion target, ref Quaternion currentVelocity, float smoothTime, float maxSpeed = default(float))
Description
Gradually changes a quaternion towards a desired goal over time. The quaternion is smoothed by some spring-damper like function, which will never overshoot.
Parameters
current | The current position. |
target | The position we are trying to reach. |
currentVelocity | The current velocity, this value is modified by the function every time you call it. |
smoothTime | Approximately the time it will take to reach the target. A smaller value will reach the target faster. |
maxSpeed | Optionally allows the maximum speed to be clamped. |
Returns
Quaternion | The smoothed quaternion. |