IRotating |
void StopRotation( float decelerationSpeed, Func<float, float>? easingFunction )
StopRotation slowly stops the animation of the camera with preserving the rotation inertia.
To check if the camera is currently being rotated, see the value of the IsRotating property. Note that after calling StopRotation(Single, FuncSingle, Single) method and specifying the decelerationSpeed, the IsRotating is still true until the camera rotation is stopped.
The animation can be started with StartRotation(Single, Single) or StartRotation(Single, Single, Single, FuncSingle, Single) methods.
The inertia is configured by decelerationSpeed and easingFunction parameters.
decelerationSpeed specifies the number of degrees the velocity will change per one second.
easingFunction can be set to null to disable easing or set to a delegate of type Func<float, float> to specify the easing function.
Some of the most common easing functions are defined in the EasingFunctions class. For example the CubicEaseInOutFunction(Single) is defined by the following code:
public static float CubicEaseInOutFunction(float x) { t *= 2; if (t < 1) return t * t * t * 0.5f; t -= 2; return 0.5f * (t * t * t + 2); }