|
CameraController Class |
CameraController is an abstract class that provides the basic code for camera controller for camera rotation, movement and quick zoom.
Usually this class is first used by the
ManualPointerCameraController and that is used by the
platform specific PointerCameraController that is defined in per-platform assembly (for example Ab4d.SharpEngine.Wpf, Ab4d.SharpEngine.WinUI, Ab4d.SharpEngine.AvaloniaUI).
Inheritance Hierarchy Namespace: Ab4d.SharpEngine.UtilitiesAssembly: Ab4d.SharpEngine (in Ab4d.SharpEngine.dll) Version: 2.0.8956+4c7684e186ca1be74e7a284fbe739d9a1b843d3c
Syntax public abstract class CameraController
The CameraController type exposes the following members.
Constructors Properties | Name | Description |
---|
| Camera |
Gets the camera from the used SceneView.
|
| CapturePointerAction | |
| EventsSourceElementRotationChange |
Gets or sets a float value that specifies for how many degrees the camera is rotates when the pointer or mouse moves from one side of theSceneView to another size.
Default value is 270.
|
| IsAttitudeRotationEnabled |
Gets or sets a Boolean that specifies if attitude rotation (around x axis) is enabled. Default value is true.
|
| IsCameraAnimationStoppedOnUserAction |
Gets or sets a boolean that specifies if camera animation is stopped if user start rotating or moving the camera with pointer or mouse.
If false then animation is not stopped and this prevents user from rotating or moving the camera with pointer or mouse. Default value is true.
This value does not have any effect on camera rotation that is started with StartRotation(Single, Single) method.
|
| IsEnabled |
True when the camera controller is enabled
|
| IsHeadingRotationEnabled |
Gets or sets a Boolean that specifies if heading rotation (when changing the pointer or mouse in x direction) is enabled. Default value is true.
|
| IsPointerWheelZoomEnabled |
Gets or sets if zooming (moving camera forward and backward) by pointer or mouse wheel is enabled. Default value is true.
|
| IsXAxisInverted |
Gets or sets if x axis (heading) is inverted. Default value is false.
|
| IsXMovementEnabled |
Gets or sets a Boolean that specifies if movement the pointer or mouse in x direction is processed by this PointerCameraController. Default value is true.
|
| IsYAxisInverted |
Gets or sets if y axis (attitude) is inverted. Default value is false.
|
| IsYMovementEnabled |
Gets or sets a Boolean that specifies if movement the mouse in y direction is processed by this PointerCameraController. Default value is true.
|
| MaxCameraDistance |
Gets or sets a float value that when set to a value that is not float.NaN, than it specifies the maximum Distance of the camera or the maximum CameraWidth when OrthographicCamera is used.
This property can be set to a reasonable number to prevent float imprecision when the camera distance is very big. Default value is float.NaN.
|
| PointerMoveThreshold |
Gets or sets a float value that specifies how much user needs to move the pointer or mouse before rotation, movement or quick zoom are started.
Until pointer or mouse is moved for the specified amount, the PointerCameraController does not handle events so they can be get for other processing (for example to handle pointer click).
When 0, then rotation, movement or quick zoom are started immediately when the correct pointer or mouse buttons and keyboard modifiers are pressed (no pointer or mouse movement needed).
Default value is 2.
|
| PointerWheelDistanceChangeFactor |
Gets or sets a float value that specifies a value that used when zooming with pointer or mouse wheel.
When zooming out the Camera's Distance or CameraWidth is multiplied with this value.
When zooming in the Camera's Distance or CameraWidth is divided with this value.
Default value is 1.05. Bigger value increases the speed of zooming with pointer or mouse wheel. The value should be bigger than 1.
|
| QuickZoomMaxFactorScreenDistance |
QuickZoomZoomOutFactor is used when QuickZoom are satisfied and defines the zoom out speed.
The QuickZoomMaxFactorScreenDistance defines how much the pointer or mouse needs to travel in the forward or backward direction to reach the QuickZoomMaxZoomInFactor or QuickZoomZoomOutFactor.
Default value is 200.
|
| QuickZoomMaxZoomInFactor |
QuickZoomMaxZoomInFactor is used when QuickZoom are satisfied and defines the maximum zoom in factor.
The maximum zoom in factor is reached when the user moves the pointer or mouse for the QuickZoomMaxFactorScreenDistance distance in the forward direction.
If user moves the pointer or mouse farther away the zooming is not performed anymore. Default value is 20 and means that the max zoom in factor is 20x - the Camera.Distance will be reduced to its 0.05 (1/20) initial value.
|
| QuickZoomZoomOutFactor |
QuickZoomZoomOutFactor is used when QuickZoom are satisfied and defines the zoom out speed.
The property defines the zoom out factor that is used when the pointer or mouse travels for the QuickZoomMaxFactorScreenDistance amount in the backwards pointer or mouse direction.
Zoom out does not stop at this zoom factor as with zooming in (see QuickZoomMaxZoomInFactor).
Default value is 10 and means that the zoom out factor is 10x - the Camera.Distance will be increased to 10 times its initial value after the pointer or mouse moves for the QuickZoomMaxFactorScreenDistance amount in the backwards mouse direction.
|
| ReleasePointerCaptureAction | |
| RotateAroundPointerPosition |
Gets or sets a Boolean that specifies if TargetPositionCamera or FreeCamera is rotated around a 3D position that is "behind" current pointer position.
When RotateAroundPointerPosition is true and user starts cameras rotation, PointerCameraController sets the TargetPositionCamera.RotationCenterPosition or FreeCamera.RotationCenterPosition property.
Default value is false.
|
| SceneView |
SceneView that is used by this CameraController
|
| UsePointerPositionForMovementSpeed |
When true then the camera movement speed is determined by the distance to the 3D object behind the pointer or mouse.
When no 3D object is behind the pointer or mouse or when UsePointerPositionForMovementSpeed is set to false, then movement speed is determined by the distance from the camera to the TargetPosition is used.
Default value is true.
|
| ZoomMode |
Gets or sets a value from a CameraZoomMode enum that specifies the location into which camera is zoomed.
Note that PointerPosition and CameraRotationCenterPosition work only for TargetPositionCamera and FreeCamera.
Default value is ViewCenter.
|
TopMethods Events Fields See Also