Click or drag to resize
SphericalCameraStopRotation Method (Double, SphericalCameraEasingFunctionDelegate)
StopRotation slowly stops the animation of the camera with preserving the rotation inertia.

Namespace: Ab3d.Cameras
Assembly: Ab3d.PowerToys (in Ab3d.PowerToys.dll) Version: 7.0.0.0
Syntax
C#
public void StopRotation(
	double decelerationSpeed,
	SphericalCameraEasingFunctionDelegate easingFunction
)

Parameters

decelerationSpeed
Type: SystemDouble
number of degrees the velocity will change per one second (if no easing function would be used)
easingFunction
Type: Ab3d.CamerasSphericalCameraEasingFunctionDelegate
if not null the delegate will be used to ease the deceleration value
Remarks

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 SphericalCameraEasingFunctionDelegate 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, SphericalCameraEasingFunctionDelegate) 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, SphericalCameraEasingFunctionDelegate) methods.

See Also