Table of Contents

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

viewport Viewport3DX

Properties

ActualCamera

Gets ActualCamera.

public Camera? ActualCamera { get; set; }

Property Value

Camera

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

Vector3

CameraMode

Gets or sets CameraMode.

public CameraMode CameraMode { get; set; }

Property Value

CameraMode

CameraPosition

Gets or sets CameraPosition.

public Vector3 CameraPosition { get; set; }

Property Value

Vector3

CameraRotationMode

Gets or sets CameraRotationMode.

public CameraRotationMode CameraRotationMode { get; set; }

Property Value

CameraRotationMode

CameraTarget

Gets or sets CameraTarget.

public Vector3 CameraTarget { get; set; }

Property Value

Vector3

CameraUpDirection

Gets or sets CameraUpDirection.

public Vector3 CameraUpDirection { get; set; }

Property Value

Vector3

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

bool

EnableThreeFingerPan

public bool EnableThreeFingerPan { get; set; }

Property Value

bool

EnableTouchRotate

public bool EnableTouchRotate { get; set; }

Property Value

bool

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

true if [fixed rotation point enabled]; otherwise, false.

InertiaFactor

Gets or sets InertiaFactor.

public double InertiaFactor { get; set; }

Property Value

double

InfiniteSpin

Gets or sets a value indicating whether InfiniteSpin.

public bool InfiniteSpin { get; set; }

Property Value

bool

InputController

public InputController? InputController { get; set; }

Property Value

InputController

IsChangeFieldOfViewEnabled

Gets or sets a value indicating whether field of view can be changed.

public bool IsChangeFieldOfViewEnabled { get; set; }

Property Value

bool

IsInertiaEnabled

Gets or sets a value indicating whether inertia is enabled for the camera manipulations.

public bool IsInertiaEnabled { get; set; }

Property Value

bool

true if inertia is enabled; otherwise, false.

IsMoveEnabled

Gets or sets a value indicating whether move is enabled.

public bool IsMoveEnabled { get; set; }

Property Value

bool

true if move is enabled; otherwise, false .

IsOrthographicCamera

Gets a value indicating whether IsOrthographicCamera.

protected bool IsOrthographicCamera { get; }

Property Value

bool

IsPanEnabled

Gets or sets a value indicating whether pan is enabled.

public bool IsPanEnabled { get; set; }

Property Value

bool

IsPerspectiveCamera

Gets a value indicating whether IsPerspectiveCamera.

protected bool IsPerspectiveCamera { get; }

Property Value

bool

IsRotationEnabled

Gets or sets a value indicating whether IsRotationEnabled.

public bool IsRotationEnabled { get; set; }

Property Value

bool

IsZoomEnabled

Gets or sets a value indicating whether IsZoomEnabled.

public bool IsZoomEnabled { get; set; }

Property Value

bool

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

Vector3

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

OrthographicCamera

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

PerspectiveCamera

PinchZoomAtCenter

public bool PinchZoomAtCenter { get; set; }

Property Value

bool

RotateAroundMouseDownPoint

Gets or sets a value indicating whether to rotate around the mouse down point.

public bool RotateAroundMouseDownPoint { get; set; }

Property Value

bool

true if 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

bool

SpinReleaseTime

Gets or sets the max duration of mouse drag to activate spin.

public int SpinReleaseTime { get; set; }

Property Value

int

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

Viewport3DX

ZoomAroundMouseDownPoint

Gets or sets a value indicating whether to zoom around mouse down point.

public bool ZoomAroundMouseDownPoint { get; set; }

Property Value

bool

true if 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

double

Methods

AddMoveForce(Vector3)

Adds the specified move force.

public void AddMoveForce(Vector3 delta)

Parameters

delta Vector3

The delta.

AddPanForce(double, double)

Adds the specified pan force.

public void AddPanForce(double dx, double dy)

Parameters

dx double

The delta x.

dy double

The delta y.

AddPanForce(Vector3)

The add pan force.

public void AddPanForce(Vector3 pan)

Parameters

pan Vector3

The pan.

AddRotateForce(double, double)

The add rotate force.

public void AddRotateForce(double dx, double dy)

Parameters

dx double

The delta x.

dy double

The delta y.

AddRotateForce(Vector2)

Adds the rotate force.

public void AddRotateForce(Vector2 force)

Parameters

force Vector2

The force.

AddZoomForce(double)

Adds the zoom force.

public void AddZoomForce(double delta)

Parameters

delta double

The delta.

AddZoomForce(double, Vector3)

Adds the zoom force.

public void AddZoomForce(double delta, Vector3 zoomOrigin)

Parameters

delta double

The delta.

zoomOrigin Vector3

The zoom origin.

ChangeDirection(Vector3, Vector3, double)

Changes the direction of the camera.

public void ChangeDirection(Vector3 lookDir, Vector3 upDir, double animationTime = 500)

Parameters

lookDir Vector3

The look direction.

upDir Vector3

The up direction.

animationTime double

The animation time.

IsModelUpDirectionY()

Determines whether the model up direction is (0,1,0).

public bool IsModelUpDirectionY()

Returns

bool

true if the up direction is (0,1,0); otherwise, false.

OnManipulationCompleted(ManipulationCompletedRoutedEventArgs)

Called when the ManipulationCompleted event occurs.

public void OnManipulationCompleted(ManipulationCompletedRoutedEventArgs e)

Parameters

e ManipulationCompletedRoutedEventArgs

The data for the event.

OnManipulationDelta(ManipulationDeltaRoutedEventArgs)

Called when the ManipulationDelta event occurs.

public void OnManipulationDelta(ManipulationDeltaRoutedEventArgs e)

Parameters

e ManipulationDeltaRoutedEventArgs

The data for the event.

OnManipulationStarted(ManipulationStartedRoutedEventArgs)

Called when the ManipulationStarted event occurs.

public void OnManipulationStarted(ManipulationStartedRoutedEventArgs e)

Parameters

e ManipulationStartedRoutedEventArgs

The 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

e PointerRoutedEventArgs

The 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

e PointerRoutedEventArgs

OnMouseWheel(PointerRoutedEventArgs)

public void OnMouseWheel(PointerRoutedEventArgs e)

Parameters

e PointerRoutedEventArgs

OnTimeStep(long)

The on time step.

public void OnTimeStep(long ticks)

Parameters

ticks long

The 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

speed Vector2

The speed.

position Point

The position.

aroundPoint Vector3

The spin around point.

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

delta double

The delta value.

ZoomExtents(double)

Zooms to the extents of the model.

public void ZoomExtents(double animationTime = 200)

Parameters

animationTime double

The animation time (milliseconds).