Class CameraController
- Namespace
- HelixToolkit.WinUI.SharpDX
- Assembly
- HelixToolkit.WinUI.SharpDX.dll
public class CameraController
- Inheritance
-
CameraController
- Inherited Members
Constructors
CameraController(Viewport3DX)
public CameraController(Viewport3DX viewport)
Parameters
viewportViewport3DX
Properties
ActualCamera
Gets ActualCamera.
public Camera? ActualCamera { get; set; }
Property Value
AllowRotateXY
Gets or sets to allow rotate x direction and y direction globally. X, Y is screen space.
X = 1: Allow left/right rotation. Y = 1: Allow up/down rotation
Default is (1, 1)
public Vector2 AllowRotateXY { get; set; }
Property Value
- Vector2
The allow rotate xy.
CameraLookDirection
Gets or sets CameraLookDirection.
public Vector3 CameraLookDirection { get; set; }
Property Value
CameraMode
Gets or sets CameraMode.
public CameraMode CameraMode { get; set; }
Property Value
CameraPosition
Gets or sets CameraPosition.
public Vector3 CameraPosition { get; set; }
Property Value
CameraRotationMode
Gets or sets CameraRotationMode.
public CameraRotationMode CameraRotationMode { get; set; }
Property Value
CameraTarget
Gets or sets CameraTarget.
public Vector3 CameraTarget { get; set; }
Property Value
CameraUpDirection
Gets or sets CameraUpDirection.
public Vector3 CameraUpDirection { get; set; }
Property Value
ChangeFieldOfViewCursor
Gets or sets the change field of view Cursor
public CoreCursorType ChangeFieldOfViewCursor { get; set; }
Property Value
- CoreCursorType
The change field of view Cursor.
DefaultCamera
Gets or sets the default camera (used when resetting the view).
public Camera? DefaultCamera { get; set; }
Property Value
- Camera
The default camera.
EnablePinchZoom
public bool EnablePinchZoom { get; set; }
Property Value
EnableThreeFingerPan
public bool EnableThreeFingerPan { get; set; }
Property Value
EnableTouchRotate
public bool EnableTouchRotate { get; set; }
Property Value
FixedRotationPoint
Gets or sets the fixed rotation point.
public Vector3 FixedRotationPoint { get; set; }
Property Value
- Vector3
The fixed rotation point.
FixedRotationPointEnabled
Gets or sets a value indicating whether [fixed rotation point enabled].
public bool FixedRotationPointEnabled { get; set; }
Property Value
- bool
trueif [fixed rotation point enabled]; otherwise,false.
InertiaFactor
Gets or sets InertiaFactor.
public double InertiaFactor { get; set; }
Property Value
InfiniteSpin
Gets or sets a value indicating whether InfiniteSpin.
public bool InfiniteSpin { get; set; }
Property Value
InputController
public InputController? InputController { get; set; }
Property Value
IsChangeFieldOfViewEnabled
Gets or sets a value indicating whether field of view can be changed.
public bool IsChangeFieldOfViewEnabled { get; set; }
Property Value
IsInertiaEnabled
Gets or sets a value indicating whether inertia is enabled for the camera manipulations.
public bool IsInertiaEnabled { get; set; }
Property Value
- bool
trueif inertia is enabled; otherwise,false.
IsMoveEnabled
Gets or sets a value indicating whether move is enabled.
public bool IsMoveEnabled { get; set; }
Property Value
- bool
trueif move is enabled; otherwise,false.
IsOrthographicCamera
Gets a value indicating whether IsOrthographicCamera.
protected bool IsOrthographicCamera { get; }
Property Value
IsPanEnabled
Gets or sets a value indicating whether pan is enabled.
public bool IsPanEnabled { get; set; }
Property Value
IsPerspectiveCamera
Gets a value indicating whether IsPerspectiveCamera.
protected bool IsPerspectiveCamera { get; }
Property Value
IsRotationEnabled
Gets or sets a value indicating whether IsRotationEnabled.
public bool IsRotationEnabled { get; set; }
Property Value
IsZoomEnabled
Gets or sets a value indicating whether IsZoomEnabled.
public bool IsZoomEnabled { get; set; }
Property Value
LeftRightPanSensitivity
Gets or sets the sensitivity for pan by the left and right keys.
public double LeftRightPanSensitivity { get; set; }
Property Value
- double
The pan sensitivity.
Remarks
Use -1 to invert the pan direction.
LeftRightRotationSensitivity
Gets or sets the sensitivity for rotation by the left and right keys.
public double LeftRightRotationSensitivity { get; set; }
Property Value
- double
The rotation sensitivity.
Remarks
Use -1 to invert the rotation direction.
MaximumFieldOfView
Gets or sets the maximum field of view.
public double MaximumFieldOfView { get; set; }
Property Value
- double
The maximum field of view.
MinimumFieldOfView
Gets or sets the minimum field of view.
public double MinimumFieldOfView { get; set; }
Property Value
- double
The minimum field of view.
ModelUpDirection
Gets or sets the model up direction.
public Vector3 ModelUpDirection { get; set; }
Property Value
MoveSensitivity
Gets or sets the move sensitivity.
public double MoveSensitivity { get; set; }
Property Value
- double
The move sensitivity.
OrthographicCamera
Gets OrthographicCamera.
protected OrthographicCamera? OrthographicCamera { get; }
Property Value
PageUpDownZoomSensitivity
Gets or sets the sensitivity for zoom by the page up and page down keys.
public double PageUpDownZoomSensitivity { get; set; }
Property Value
- double
The zoom sensitivity.
Remarks
Use -1 to invert the zoom direction.
PanCursor
Gets or sets the pan Cursor.
public CoreCursorType PanCursor { get; set; }
Property Value
- CoreCursorType
The pan Cursor.
PerspectiveCamera
Gets PerspectiveCamera.
protected PerspectiveCamera? PerspectiveCamera { get; }
Property Value
PinchZoomAtCenter
public bool PinchZoomAtCenter { get; set; }
Property Value
RotateAroundMouseDownPoint
Gets or sets a value indicating whether to rotate around the mouse down point.
public bool RotateAroundMouseDownPoint { get; set; }
Property Value
- bool
trueif rotation around the mouse down point is enabled; otherwise,false.
RotateCursor
Gets or sets the rotate Cursor.
public CoreCursorType RotateCursor { get; set; }
Property Value
- CoreCursorType
The rotate Cursor.
RotationSensitivity
Gets or sets the rotation sensitivity (degrees/pixel).
public double RotationSensitivity { get; set; }
Property Value
- double
The rotation sensitivity.
ShowCameraTarget
Gets or sets a value indicating whether to show a target adorner when manipulating the camera.
public bool ShowCameraTarget { get; set; }
Property Value
SpinReleaseTime
Gets or sets the max duration of mouse drag to activate spin.
public int SpinReleaseTime { get; set; }
Property Value
Remarks
If the time between mouse down and mouse up is less than this value, spin is activated.
UpDownPanSensitivity
Gets or sets the sensitivity for pan by the up and down keys.
public double UpDownPanSensitivity { get; set; }
Property Value
- double
The pan sensitivity.
Remarks
Use -1 to invert the pan direction.
UpDownRotationSensitivity
Gets or sets the sensitivity for rotation by the up and down keys.
public double UpDownRotationSensitivity { get; set; }
Property Value
- double
The rotation sensitivity.
Remarks
Use -1 to invert the rotation direction.
Viewport
public Viewport3DX Viewport { get; }
Property Value
ZoomAroundMouseDownPoint
Gets or sets a value indicating whether to zoom around mouse down point.
public bool ZoomAroundMouseDownPoint { get; set; }
Property Value
- bool
trueif zooming around the mouse down point is enabled; otherwise,false.
ZoomCursor
Gets or sets the zoom Cursor.
public CoreCursorType ZoomCursor { get; set; }
Property Value
- CoreCursorType
The zoom CursorType.
ZoomDistanceLimitFar
Gets or sets the zoom distance limit far.
public double ZoomDistanceLimitFar { get; set; }
Property Value
- double
The zoom distance limit far.
ZoomDistanceLimitNear
Gets or sets the zoom distance limit near.
public double ZoomDistanceLimitNear { get; set; }
Property Value
- double
The zoom distance limit near.
ZoomRectangleCursor
Gets or sets the zoom rectangle Cursor.
public CoreCursorType ZoomRectangleCursor { get; set; }
Property Value
- CoreCursorType
The zoom rectangle Cursor.
ZoomSensitivity
Gets or sets ZoomSensitivity.
public double ZoomSensitivity { get; set; }
Property Value
Methods
AddMoveForce(Vector3)
Adds the specified move force.
public void AddMoveForce(Vector3 delta)
Parameters
deltaVector3The delta.
AddPanForce(double, double)
Adds the specified pan force.
public void AddPanForce(double dx, double dy)
Parameters
AddPanForce(Vector3)
The add pan force.
public void AddPanForce(Vector3 pan)
Parameters
panVector3The pan.
AddRotateForce(double, double)
The add rotate force.
public void AddRotateForce(double dx, double dy)
Parameters
AddRotateForce(Vector2)
Adds the rotate force.
public void AddRotateForce(Vector2 force)
Parameters
forceVector2The force.
AddZoomForce(double)
Adds the zoom force.
public void AddZoomForce(double delta)
Parameters
deltadoubleThe delta.
AddZoomForce(double, Vector3)
Adds the zoom force.
public void AddZoomForce(double delta, Vector3 zoomOrigin)
Parameters
ChangeDirection(Vector3, Vector3, double)
Changes the direction of the camera.
public void ChangeDirection(Vector3 lookDir, Vector3 upDir, double animationTime = 500)
Parameters
lookDirVector3The look direction.
upDirVector3The up direction.
animationTimedoubleThe animation time.
IsModelUpDirectionY()
Determines whether the model up direction is (0,1,0).
public bool IsModelUpDirectionY()
Returns
- bool
trueif the up direction is (0,1,0); otherwise,false.
OnManipulationCompleted(ManipulationCompletedRoutedEventArgs)
Called when the ManipulationCompleted event occurs.
public void OnManipulationCompleted(ManipulationCompletedRoutedEventArgs e)
Parameters
eManipulationCompletedRoutedEventArgsThe data for the event.
OnManipulationDelta(ManipulationDeltaRoutedEventArgs)
Called when the ManipulationDelta event occurs.
public void OnManipulationDelta(ManipulationDeltaRoutedEventArgs e)
Parameters
eManipulationDeltaRoutedEventArgsThe data for the event.
OnManipulationStarted(ManipulationStartedRoutedEventArgs)
Called when the ManipulationStarted event occurs.
public void OnManipulationStarted(ManipulationStartedRoutedEventArgs e)
Parameters
eManipulationStartedRoutedEventArgsThe data for the event.
OnMouseDown(PointerRoutedEventArgs)
Invoked when an unhandled MouseDown attached event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.
public void OnMouseDown(PointerRoutedEventArgs e)
Parameters
ePointerRoutedEventArgsThe MouseButtonEventArgs that contains the event data. This event data reports details about the mouse button that was pressed and the handled state.
OnMouseUp(PointerRoutedEventArgs)
public void OnMouseUp(PointerRoutedEventArgs e)
Parameters
OnMouseWheel(PointerRoutedEventArgs)
public void OnMouseWheel(PointerRoutedEventArgs e)
Parameters
OnTimeStep(long)
The on time step.
public void OnTimeStep(long ticks)
Parameters
tickslongThe time.
PushCameraSetting()
Push the current camera settings on an internal stack.
public void PushCameraSetting()
ResetCamera()
Resets the camera.
public void ResetCamera()
ResetCameraUpDirection()
Resets the camera up direction.
public void ResetCameraUpDirection()
RestoreCameraSetting()
Restores the most recent camera setting from the internal stack.
public bool RestoreCameraSetting()
Returns
- bool
The restore camera setting.
StartSpin(Vector2, Point, Vector3)
Starts the spin.
public void StartSpin(Vector2 speed, Point position, Vector3 aroundPoint)
Parameters
StopAnimations()
The stop animations.
public void StopAnimations()
StopPanning()
Stops the panning.
public void StopPanning()
StopSpin()
Stops the spin.
public void StopSpin()
StopZooming()
Stops the zooming inertia
public void StopZooming()
Zoom(double)
Zooms by the specified delta value.
public void Zoom(double delta)
Parameters
deltadoubleThe delta value.
ZoomExtents(double)
Zooms to the extents of the model.
public void ZoomExtents(double animationTime = 200)
Parameters
animationTimedoubleThe animation time (milliseconds).