Click or drag to resize
Ab4d.SharpEngine logo

ICamera Interface

ICamera is base interface that defines a 3D camera in DXEngine

Namespace: Ab4d.SharpEngine.Cameras
Assembly: Ab4d.SharpEngine (in Ab4d.SharpEngine.dll) Version: 2.0.8956+4c7684e186ca1be74e7a284fbe739d9a1b843d3c
Syntax
C#
public interface ICamera

The ICamera type exposes the following members.

Properties
 NameDescription
Public propertyAspectRatio Gets or sets the camera's aspect ratio - 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. By default NearPlaneDistance is automatically calculated from the 3D scene bounding box and camera position. This can be disabled by manually setting the value of this property or by setting IsAutomaticFarPlaneDistanceCalculation to false.
Public propertyName Gets the name of the camera
Public propertyNearPlaneDistance Gets or sets a value that specifies the distance from the camera of the camera's near clip plane. By default NearPlaneDistance is automatically calculated from the 3D scene bounding box and camera position. This can be disabled by manually setting the value of this property or by setting IsAutomaticNearPlaneDistanceCalculation to false.
Public propertyProjectionType Gets or sets the type of projection (Perspective or Orthographic)
Public propertySceneView Gets the SceneView that this camera belongs to. This property is set from the SceneView when the camera is assigned to its Camera property.
Public propertyVersion Gets the version number of this Camera. Version is increased each time the camera is changed. This can be used to check if the camera was changed between two points in time. Note: When camera is changed a lot of times, the Version value can overflow from positive to negative numbers (to prevent problems do not check for bigger value but for not equal value)
Top
Methods
 NameDescription
Public methodGetCameraMatrices GetCameraMatrices method gets the camera's view and projection matrices. When the optional parameter updateIfDirty is true (by default) then the Update(Boolean) method is called if the camera was changed after the last matrices were calculated.
Public methodGetCameraPlaneOrientation GetCameraPlaneOrientation gets plane's normal, width and height vectors that can be used to orient the plane 3D model so that it is aligned with the camera view.
Public methodGetCameraPosition Returns the current position of the camera.
Public methodGetLookDirection Returns the normalized look direction of the camera.
Public methodGetUpDirection Returns the normalized up direction of the camera.
Public methodGetViewProjectionMatrix Gets a pre-calculated View * Projection matrix.
Public methodRotateCamera Rotates the camera for the specified heading and attitude.
Public methodSerializeToJson SerializeToJson serializes the specified camera into a json string. The returned string starts with assembly qualified camera type name. To create a camera from json string use the static DeserializeJson(String) method.
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.
Public methodUpdateAnimations UpdateAnimations method updates the camera's rotation when it is animated.
Top
Events
 NameDescription
Public eventCameraChanged CameraChanged event occurs after the camera was changed.
Top
See Also