Click or drag to resize
AB4D logo

MatrixCamera Class

MatrixCamera is a simple camera that provides the View and Projection matrices.
Inheritance Hierarchy
SystemObject
  Ab3d.DirectX.CamerasMatrixCamera

Namespace: Ab3d.DirectX.Cameras
Assembly: Ab3d.DXEngine (in Ab3d.DXEngine.dll) Version: 7.0.8865.1045
Syntax
C#
public class MatrixCamera : ICamera

The MatrixCamera type exposes the following members.

Constructors
 NameDescription
Public methodMatrixCamera Constructor
Public methodMatrixCamera(Matrix, Matrix) Constructor
Top
Properties
 NameDescription
Public propertyAspectRatio Gets or sets the camera's aspect ration - calculated as viewport's width / height.
Public propertyFarPlaneDistance Gets or sets a value that specifies the distance from the camera of the camera's far clip plane.
Public propertyNearPlaneDistance Gets or sets a value that specifies the distance from the camera of the camera's near clip plane.
Public propertyParentDXScene Gets or sets the DXScene that this camera belong to.
Public propertyParentSceneNode Gets or sets a parent SceneNode that can be used to adjust the camera's View matrix with the SceneNode's world matrix. This can be used to animate the camera with SceneNode.
Public propertyProjection Gets the camera's projection matrix.
Public propertyProjectionType Gets type of projection (Perspective or Orthographic)
Public propertyView Gets the camera's view matrix.
Top
Methods
 NameDescription
Public methodGetCameraPosition Gets the camera's position. The position is calculating with inverting the view matrix and extracting the values from 4th row. The invert operation can be skipped with calling SetCameraPosition(Vector3) method.
Public methodGetViewProjection Gets a pre-calculated View * Projection matrix.
Public methodGetWorldViewProjection Returns WorldViewProjection matrix. Calculating this matrix is faster inside Camera because here we can access matrixes by reference.
Public methodSetCameraPosition Sets camera's position. This prevents calling invert on view matrix when the GetCameraPosition is called. This method should be called after setting View matrix.
Public methodUpdate Update method updates the camera matrices when needed (when there were any change in the camera properties) or when forceMatrixUpdate is set to true.
Top
Events
 NameDescription
Public eventCameraChanged CameraChanged event occurs after the camera was changed.
Top
See Also