|
MouseCameraControllerGetRotationCenterPositionFromMousePosition Method |
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.
Namespace: Ab3d.ControlsAssembly: Ab3d.PowerToys (in Ab3d.PowerToys.dll) Version: 11.2.9104.2045
Syntax protected virtual Point3D? GetRotationCenterPositionFromMousePosition(
Point mousePosition,
bool calculatePositionWhenNoObjectIsHit
)
Parameters
- mousePosition Point
- mouse position inside Viewport3D element
- calculatePositionWhenNoObjectIsHit Boolean
- when true and no 3D object is hit ("behind the mouse"), the the position is from mouse ray and camera's distance.
Return Value
NullablePoint3DPoint3D that is get by 3D hit testing of specified mousePosition with the 3D objects defined in the Viewport3D. If no 3D object is hit, then null is returned.
See Also