Class CameraExtensions
- Namespace
- HelixToolkit.Avalonia.SharpDX
- Assembly
- HelixToolkit.Avalonia.SharpDX.dll
Provides extension methods for the cameras.
public static class CameraExtensions
- Inheritance
-
CameraExtensions
- Inherited Members
Methods
ChangeDirection(Camera, Vector3, Vector3, double)
Changes the direction of a camera.
public static void ChangeDirection(this Camera camera, Vector3 newLookDir, Vector3 newUpDirection, double animationTime)
Parameters
cameraCameraThe camera.
newLookDirVector3The new look direction.
newUpDirectionVector3The new up direction.
animationTimedoubleThe animation time.
CopyTo(ICameraModel, Camera)
Copies the specified camera, converts field of view/width if necessary.
public static void CopyTo(this ICameraModel source, Camera dest)
Parameters
sourceICameraModelThe source camera.
destCameraThe destination camera.
CreateDefaultCamera()
Creates a default perspective camera.
public static Camera CreateDefaultCamera()
Returns
- Camera
A perspective camera.
FindPanVector(Camera, double, double)
Finds the pan vector.
public static Vector3 FindPanVector(this Camera camera, double dx, double dy)
Parameters
Returns
GetInfo(Camera)
Gets an information string about the specified camera.
public static string GetInfo(this Camera camera)
Parameters
cameraCameraThe camera.
Returns
- string
The get info.
GetInverseViewProjectionMatrix(CameraCore?, double)
Gets the inverse camera transform.
public static Matrix4x4 GetInverseViewProjectionMatrix(this CameraCore? camera, double aspectRatio)
Parameters
cameraCameraCoreThe camera.
aspectRatiodoubleThe aspect ratio.
Returns
- Matrix4x4
The inverse transform.
GetInverseViewProjectionMatrix3D(Camera, double)
Gets the inverse camera transform.
public static Matrix4x4 GetInverseViewProjectionMatrix3D(this Camera camera, double aspectRatio)
Parameters
Returns
- Matrix4x4
The inverse transform.
GetInversedViewMatrix(Camera)
public static Matrix4x4 GetInversedViewMatrix(this Camera camera)
Parameters
cameraCamera
Returns
GetInversedViewMatrix(CameraCore?)
public static Matrix4x4 GetInversedViewMatrix(this CameraCore? camera)
Parameters
cameraCameraCore
Returns
GetProjectionMatrix(CameraCore?, double)
Gets the projection matrix for the specified camera.
public static Matrix4x4 GetProjectionMatrix(this CameraCore? camera, double aspectRatio)
Parameters
cameraCameraCoreThe camera.
aspectRatiodoubleThe aspect ratio.
Returns
- Matrix4x4
The projection matrix.
GetProjectionMatrix3D(Camera, double)
Gets the projection matrix for the specified camera.
public static Matrix4x4 GetProjectionMatrix3D(this Camera camera, double aspectRatio)
Parameters
Returns
- Matrix4x4
The projection matrix.
GetViewMatrix(CameraCore?)
Obtains the view transform matrix for a camera. (see page 327)
public static Matrix4x4 GetViewMatrix(this CameraCore? camera)
Parameters
cameraCameraCoreCamera to obtain the ViewMatrix for
Returns
- Matrix4x4
A Matrix object with the camera view transform matrix, or a Matrix with all zeros if the "camera" is null.
GetViewMatrix3D(Camera)
Obtains the view transform matrix for a camera. (see page 327)
public static Matrix4x4 GetViewMatrix3D(this Camera camera)
Parameters
cameraCameraCamera to obtain the ViewMatrix for
Returns
- Matrix4x4
A Matrix object with the camera view transform matrix, or a Matrix with all zeros if the "camera" is null.
GetViewProjectionMatrix(CameraCore?, double)
Get the combined view and projection transform
public static Matrix4x4 GetViewProjectionMatrix(this CameraCore? camera, double aspectRatio)
Parameters
cameraCameraCoreThe camera.
aspectRatiodoubleThe aspect ratio.
Returns
- Matrix4x4
The total view and projection transform.
GetViewProjectionMatrix3D(Camera, double)
Get the combined view and projection transform
public static Matrix4x4 GetViewProjectionMatrix3D(this Camera camera, double aspectRatio)
Parameters
Returns
- Matrix4x4
The total view and projection transform.
LookAt(Camera, Vector3, double, double)
Set the camera target point and camera distance.
public static void LookAt(this Camera camera, Vector3 target, double distance, double animationTime)
Parameters
cameraCameraThe camera.
targetVector3The target point.
distancedoubleThe distance to the camera.
animationTimedoubleThe animation time.
LookAt(ICameraModel, Vector3, double)
Set the camera target point without changing the look direction.
public static void LookAt(this ICameraModel camera, Vector3 target, double animationTime)
Parameters
cameraICameraModelThe camera.
targetVector3The target.
animationTimedoubleThe animation time.
LookAt(ICameraModel, Vector3, Vector3, double)
Set the camera target point and look direction
public static void LookAt(this ICameraModel camera, Vector3 target, Vector3 newLookDirection, double animationTime)
Parameters
cameraICameraModelThe camera.
targetVector3The target.
newLookDirectionVector3The new look direction.
animationTimedoubleThe animation time.
LookAt(ICameraModel, Vector3, Vector3, Vector3, double)
Set the camera target point and directions
public static void LookAt(this ICameraModel camera, Vector3 target, Vector3 newLookDirection, Vector3 newUpDirection, double animationTime)
Parameters
cameraICameraModelThe camera.
targetVector3The target.
newLookDirectionVector3The new look direction.
newUpDirectionVector3The new up direction.
animationTimedoubleThe animation time.
MoveCameraPosition(Camera, Vector3)
Moves the camera position.
public static void MoveCameraPosition(this Camera camera, Vector3 delta)
Parameters
Reset(Camera)
Resets the specified camera.
public static void Reset(this Camera camera)
Parameters
cameraCameraThe camera.
Reset(OrthographicCamera)
Resets the specified orthographic camera.
public static void Reset(this OrthographicCamera camera)
Parameters
cameraOrthographicCameraThe camera.
Reset(PerspectiveCamera)
Resets the specified perspective camera.
public static void Reset(this PerspectiveCamera camera)
Parameters
cameraPerspectiveCameraThe camera.
ZoomExtents(Camera, Viewport3DX, BoundingBox, double)
Zooms to fit the specified bounding rectangle.
public static void ZoomExtents(this Camera camera, Viewport3DX viewport, BoundingBox bounds, double animationTime = 0)
Parameters
cameraCameraThe actual camera.
viewportViewport3DXThe viewport.
boundsBoundingBoxThe bounding rectangle.
animationTimedoubleThe animation time.
ZoomExtents(Camera, Viewport3DX, double)
Zooms to fit the extents of the specified viewport.
public static void ZoomExtents(this Camera camera, Viewport3DX viewport, double animationTime = 0)
Parameters
cameraCameraThe actual camera.
viewportViewport3DXThe viewport.
animationTimedoubleThe animation time.
ZoomExtents(Camera, Viewport3DX, Vector3, double, double)
Zooms to fit the specified sphere.
public static void ZoomExtents(this Camera camera, Viewport3DX viewport, Vector3 center, double radius, double animationTime = 0)
Parameters
cameraCameraThe camera.
viewportViewport3DXThe viewport.
centerVector3The center of the sphere.
radiusdoubleThe radius of the sphere.
animationTimedoubleThe animation time.
ZoomToRectangle(Camera, Viewport3DX, Rect)
Zooms the camera to the specified rectangle.
public static void ZoomToRectangle(this Camera camera, Viewport3DX viewport, Rect zoomRectangle)
Parameters
cameraCameraThe camera.
viewportViewport3DXThe viewport.
zoomRectangleRectThe zoom rectangle.