Click or drag to resize
AB4D logo

BaseCameraStartRotation(Double, Double, Double, BaseCameraEasingFunctionDelegate) Method

StartRotation method slowly starts the camera rotation (changing Heading and Attitude) and than accelerates the rotation. To immediately start rotation for this camera, use the StartRotation(Double, Double) method.

Namespace: Ab3d.Cameras
Assembly: Ab3d.PowerToys (in Ab3d.PowerToys.dll) Version: 11.1.8864.1045
Syntax
C#
public void StartRotation(
	double headingChangeInSecond,
	double attitudeChangeInSecond,
	double accelerationSpeed,
	BaseCameraEasingFunctionDelegate easingFunction
)

Parameters

headingChangeInSecond  Double
How many degrees the heading will be changed in one second
attitudeChangeInSecond  Double
How many degrees the attitude will be changed in one second
accelerationSpeed  Double
number of degrees the velocity will change per one second (if no easing function would be used)
easingFunction  BaseCameraEasingFunctionDelegate
if not null the delegate will be used to ease the acceleration value
Remarks

StartRotation method slowly starts the camera rotation (changing Heading and Attitude) and than accelerates the rotation.

To immediately start rotation for this camera, use the StartRotation(Double, Double) method.

In contrast to the WPF animation, the Heading and Attitude values are not locked during animation. This way the camera can be still freely controlled by user with MouseCameraController or CameraControlPanel.

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 stopped by StopRotation or StopRotation(Double, BaseCameraEasingFunctionDelegate) methods. It is also automatically stopped when the camera is Unloaded (when the Unload even occurs).

When StartRotation is called when the rotation is already animated, StopRotation will be called and than the animation will start again.

Controlling the acceleration speed

The acceleration speed is configured by accelerationSpeed and easingFunction parameters.

accelerationSpeed specifies the number of degrees the velocity will change per one second (if no easing function would be used).

easingFunction can be set to null to disable easing or set to a delegate of type BaseCameraEasingFunctionDelegate to specify the easing function.

See Also