Click or drag to resize
AB4D logo

MouseCameraControllerRotationInertiaRatio Property

Gets or sets a double that specifies how strong the camera rotation inertial is. When set to 0 (or negative value), camera does not have any inertia. Default value is 1. Values bigger than 1, increase the time it takes to stop the camera.

Namespace: Ab3d.Controls
Assembly: Ab3d.PowerToys (in Ab3d.PowerToys.dll) Version: 11.1.8864.1045
Syntax
C#
public double RotationInertiaRatio { get; set; }

Property Value

Double
Remarks

RotationInertiaRatio gets or sets a double that specifies how strong the camera rotation inertial is. When set to 0, camera does not have any inertia. Default value is 1. Values bigger than 1 increase the time it takes to stop the camera.

The RotationInertiaRatio value is used in the following way:
Number 1000 is divided by RotationInertiaRatio to get the deceleration speed - number of degrees the velocity will change per one second (if no easing function would be used). This number is than used to call the camera's StopRotation(Double, BaseCameraEasingFunctionDelegate) method.

The actual deceleration of rotation speed is also determined by the easing function. By default a simple cubic easing function is used (y = (x - 1) * (x - 1) * (x - 1) + 1). The function can be changed (or set to null) by changing the RotationEasingFunction delegate.

For example the MouseCameraController is using the following cubic function to ease the camera rotation inertia:

C#
public static double CubicEaseOut(double x)
{
    return (x - 1) * (x - 1) * (x - 1) + 1;
}
See Also