Table of Contents

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

camera Camera

The camera.

newLookDir Vector3

The new look direction.

newUpDirection Vector3

The new up direction.

animationTime double

The 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

source ICameraModel

The source camera.

dest Camera

The 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

camera Camera

The camera.

dx double

The delta x.

dy double

The delta y.

Returns

Vector3

The Vector3 .

GetInfo(Camera)

Gets an information string about the specified camera.

public static string GetInfo(this Camera camera)

Parameters

camera Camera

The camera.

Returns

string

The get info.

GetInverseViewProjectionMatrix(CameraCore?, double)

Gets the inverse camera transform.

public static Matrix4x4 GetInverseViewProjectionMatrix(this CameraCore? camera, double aspectRatio)

Parameters

camera CameraCore

The camera.

aspectRatio double

The 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

camera Camera

The camera.

aspectRatio double

The aspect ratio.

Returns

Matrix4x4

The inverse transform.

GetInversedViewMatrix(Camera)

public static Matrix4x4 GetInversedViewMatrix(this Camera camera)

Parameters

camera Camera

Returns

Matrix4x4

GetInversedViewMatrix(CameraCore?)

public static Matrix4x4 GetInversedViewMatrix(this CameraCore? camera)

Parameters

camera CameraCore

Returns

Matrix4x4

GetProjectionMatrix(CameraCore?, double)

Gets the projection matrix for the specified camera.

public static Matrix4x4 GetProjectionMatrix(this CameraCore? camera, double aspectRatio)

Parameters

camera CameraCore

The camera.

aspectRatio double

The 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

camera Camera

The camera.

aspectRatio double

The aspect ratio.

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

camera CameraCore

Camera 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

camera Camera

Camera 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

camera CameraCore

The camera.

aspectRatio double

The 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

camera Camera

The camera.

aspectRatio double

The aspect ratio.

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

camera Camera

The camera.

target Vector3

The target point.

distance double

The distance to the camera.

animationTime double

The 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

camera ICameraModel

The camera.

target Vector3

The target.

animationTime double

The 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

camera ICameraModel

The camera.

target Vector3

The target.

newLookDirection Vector3

The new look direction.

animationTime double

The 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

camera ICameraModel

The camera.

target Vector3

The target.

newLookDirection Vector3

The new look direction.

newUpDirection Vector3

The new up direction.

animationTime double

The animation time.

MoveCameraPosition(Camera, Vector3)

Moves the camera position.

public static void MoveCameraPosition(this Camera camera, Vector3 delta)

Parameters

camera Camera

The camera.

delta Vector3

The delta.

Reset(Camera)

Resets the specified camera.

public static void Reset(this Camera camera)

Parameters

camera Camera

The camera.

Reset(OrthographicCamera)

Resets the specified orthographic camera.

public static void Reset(this OrthographicCamera camera)

Parameters

camera OrthographicCamera

The camera.

Reset(PerspectiveCamera)

Resets the specified perspective camera.

public static void Reset(this PerspectiveCamera camera)

Parameters

camera PerspectiveCamera

The 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

camera Camera

The actual camera.

viewport Viewport3DX

The viewport.

bounds BoundingBox

The bounding rectangle.

animationTime double

The 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

camera Camera

The actual camera.

viewport Viewport3DX

The viewport.

animationTime double

The 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

camera Camera

The camera.

viewport Viewport3DX

The viewport.

center Vector3

The center of the sphere.

radius double

The radius of the sphere.

animationTime double

The 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

camera Camera

The camera.

viewport Viewport3DX

The viewport.

zoomRectangle Rect

The zoom rectangle.