Click or drag to resize
AB4D logo

MouseCameraController Methods

The MouseCameraController type exposes the following members.

Methods
 NameDescription
Public methodChangeCameraDistance ChangeCameraDistance method change the distance of the TargetCamera by multiplying it by the changeFactor. When RotationCenterPosition is set in the TargetPositionCamera or FreeCamera, then we zoom into the specified RotationCenterPosition (if this is not disabled by setting the zoomToRotationCenterPosition parameters to false).
Public methodStatic memberCubicEaseOut Simple cubic easing function used to decelerate the rotation: y = (x - 1) * (x - 1) * (x - 1) + 1x
Protected methodEndMouseProcessing EndMouseProcessing is called when the mouse button that started rotation or movement is released.
Protected methodGetEventsSourceElementSize GetEventsSourceElementSize returns size of EventsSourceElement. This method can be overridden to provide custom size (for example when used with SharpDX.RenderForm)
Protected methodGetIsHeadingAngleChangeInverted GetIsHeadingAngleChangeInverted returns true if mouse position is in such location that we need to invert the heading rotation direction.
Protected methodGetManipulationActions GetManipulationActions method gets the ManipulationDeltaEventArgs and based on that sets which actions should be performed by MouseCameraController. This method can be overridden to specify custom behavior with touch events.
Protected methodGetRotationCenterPositionFromMousePosition GetRotationPivotPointFromMousePosition methods returns a Point3D that is get by 3D hit testing of specified mousePosition with the 3D objects defined in the Viewport3D. If no 3D object is hit and calculatePositionWhenNoObjectIsHit parameter is set to true, then the returned Point3D is calculated with creating a ray from mouse position and advancing in the ray direction for the distance from camera's position and camera target position. The method is called when the RotateAroundMousePosition property is true. The method can be overridden to provide custom logic to get rotation pivot point.
Public methodHideRotationAdorner HideRotationAdorner hides the shown RotationCenterAdorner.
Protected methodIsKeyboardConditionTrue IsKeyboardConditionTrue returns true when the correct keyboard modifier is pressed according to the specified conditions (only keyboard part of the conditions are checked).
Protected methodIsMouseButtonsConditionTrue IsMouseButtonsConditionTrue returns true when the correct mouse button is pressed according to the specified conditions (only mouse part of the conditions are checked; keyboard part is checked in IsKeyboardConditionTrue).
Protected methodLoadRotateCursor LoadRotateCursor loads the rotate cursor from assembly resources
Public methodMoveCamera Moves the camera for the mouse change defined by mouseDx and mouseDy parameters.
Protected methodOnCameraMoveEnded Fires CameraMoveEnded event
Protected methodOnCameraMoveStarted Fires CameraMoveStarted event
Protected methodOnCameraQuickZoomEnded Fires CameraQuickZoomEnded event
Protected methodOnCameraQuickZoomStarted Fires CameraQuickZoomStarted event
Protected methodOnCameraRotateEnded Fires CameraRotateEnded event
Protected methodOnCameraRotateStarted Fires OnCameraRotateStarted event
Protected methodOnManipulationCompleted OnManipulationCompleted is called when touch event is completed. This method starts rotation easing or resumes the suspended camera rotation. Users can override the method but it is highly recommended to call this method from the overridden method.
Protected methodOnManipulationDelta OnManipulationDelta handles the manipulation events. The method can be overridden.
Protected methodOnManipulationStarted OnManipulationStarted is called when the touch event is started. Users can override the method but it is highly recommended to call this method from the overridden method.
Protected methodOnMouseButtonDown OnMouseButtonDown processes mouse down event.
Protected methodOnMouseButtonUp OnMouseButtonUp processes mouse up event.
Protected methodOnMouseMove OnMouseMove processes mouse move event.
Protected methodOnMouseWheel OnMouseWheel processes mouse wheel event.
Protected methodOnTargetCameraChanged virtual OnTargetCameraChanged
(Overrides BaseControllerControlOnTargetCameraChanged(BaseCamera, BaseCamera))
Protected methodProcessMouseMove(Double, Double, MouseEventArgs) ProcessMouseMove handles mouse moves and calls the RotateCamera or the MoveCamera method based on the MouseCameraController settings and pressed modifier keys. The method can be overridden to move the camera based on some custom logic.
Protected methodProcessMouseMove(Double, Double, Point, Boolean, Boolean, Boolean, ModifierKeys) ProcessMouseMove handles mouse moves and calls the RotateCamera or the MoveCamera method based on the MouseCameraController settings and pressed modifier keys. The method can be overridden to move the camera based on some custom logic.
Public methodStatic memberQuadraticEaseOut Simple quadratic easing function used to decelerate the rotation: y = -1 * x * x + 2 * x
Public methodQuickZoomCamera Quickly zooms the camera for the mouse change defined by mouseDx and mouseDy parameters.
Public methodRotateCamera RotateCamera method rotates the camera for the mouse change defined by mouseDx and mouseDy parameters. The method can be overridden in a derived class to provide custom camera rotation implementation.
Public methodShowRotationAdorner ShowRotationAdorner method shows the RotationCenterAdorner at the specified rotationCenterPosition. The method can be overridden to show some other shape when rotation is started (you also need to override the HideRotationAdorner method.
Public methodStartCameraMovement Starts the camera movement by changing the changing cursor to MovementCursor. To stop mouse processing call StopCurrentMouseProcessing.
Public methodStartCameraQuickZoom Starts the camera quick zoom by changing cursor (to QuickZoomCursor) and updating the zoom target position (when ZoomMode is MousePosition or CameraRotationCenterPosition). To stop mouse processing call StopCurrentMouseProcessing.
Public methodStartCameraRotation Starts the camera rotation by showing the rotation center marker (when ShowRotationCenterMarker is true), changing cursor (to RotationCursor) and updating the rotation center position (when RotateAroundMousePosition is true). To stop mouse processing call StopCurrentMouseProcessing.
Protected methodStartMouseProcessing(Point) StartMouseProcessing is called when the correct mouse button and keyboard is pressed to start rotating or moving the camera.
Protected methodStartMouseProcessing(Point, Boolean, Boolean, Boolean, ModifierKeys) StartMouseProcessing is called when the correct mouse button and keyboard is pressed to start rotating or moving the camera.
Public methodStopCurrentMouseProcessing StopCurrentMouseProcessing can be called after calling StartCameraRotation(Point), StartCameraMovement or StartCameraQuickZoom(Point) to stop the started mouse processing.
Protected methodSubscribeEvents SubscribeEvents method subscribe mouse events to the newEventsSourceElement. The method can be overridden.
Protected methodUnsubscribeEvents UnsubscribeEvents unsubscribes from the mouse events on the subscribedEventsSourceElement.
Protected methodUpdateEnabled UpdateEnabled method checks the Target Camera's IsEnabled property and enable or disable this controller.
(Overrides BaseControllerControlUpdateEnabled)
Top
See Also