Click or drag to resize
AB4D logo

BaseCameraStopRotation Method (Double, BaseCameraEasingFunctionDelegate)

StopRotation slowly stops the animation of the camera with preserving the rotation inertia.

Namespace:  Ab3d.Cameras
Assembly:  Ab3d.PowerToys (in Ab3d.PowerToys.dll) Version: 10.1.8147.1045
Syntax
C#
public void StopRotation(
	double decelerationSpeed,
	BaseCameraEasingFunctionDelegate 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.CamerasBaseCameraEasingFunctionDelegate
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 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.

See Also