Base |
public void StopRotation( double decelerationSpeed, BaseCameraEasingFunctionDelegate easingFunction )
StopRotation slowly stops the animation of the camera with preserving the rotation inertia.
The inertia is configured by decelerationSpeed and easingFunction parameters.
decelerationSpeed specifies the number of degrees the velocity will change per one second (if no easing function would be used). For example the default value used by MouseCameraController is 1000.
easingFunction can be set to null to disable easing or set to a delegate of type BaseCameraEasingFunctionDelegate to specify the easing function.
For example the MouseCameraController is using the following cubic function to ease the camera rotation inertia:
public static double CubicEaseOut(double x) { return (x - 1) * (x - 1) * (x - 1) + 1; }
To check if the camera is currently being rotated, see the value of the IsRotating property. Note that after calling StopRotation(Double, BaseCameraEasingFunctionDelegate) method and specifying the decelerationSpeed, the IsRotating is still true until the camera rotation is stopped.
The animation can be started with StartRotation(Double, Double) or StartRotation(Double, Double, Double, BaseCameraEasingFunctionDelegate) methods.