Class TRenderingCamera

DescriptionHierarchyFieldsMethodsProperties

Unit

Declaration

type TRenderingCamera = class(TObject)

Description

Current camera used for rendering.

Hierarchy

  • TObject
  • TRenderingCamera

Overview

Fields

Public Matrix: TMatrix4Single;
Public InverseMatrix: TMatrix4Single;
Public InverseMatrixDone: boolean;
Public RotationMatrix: TMatrix4Single;
Public RotationInverseMatrix: TMatrix4Single;
Public RotationInverseMatrixDone: boolean;
Public Frustum: TFrustum;

Methods

Public constructor Create;
Public destructor Destroy; override;
Public procedure InverseMatrixNeeded;
Public procedure RotationInverseMatrixNeeded;
Public function RotationMatrix3: TMatrix3Single;
Public function RotationInverseMatrix3: TMatrix3Single;
Public procedure FromCameraObject(const ACamera: TCamera; const Viewpoint: TAbstractViewpointNode);
Public procedure FromMatrix(const AMatrix, ARotationMatrix, ProjectionMatrix: TMatrix4Single; const Viewpoint: TAbstractViewpointNode);
Public procedure Changed(const Viewpoint: TAbstractViewpointNode);

Properties

Public property Target: TRenderTarget read FTarget write FTarget;
Public property OnChanged: TCameraChangedEventList read FOnChanged;

Description

Fields

Public Matrix: TMatrix4Single;

Current camera matrix. Transforms from world space (normal 3D space) to camera space (camera space is the space where you're always standing on zero point, looking in -Z, and so on).

This is needed for various things, like TextureCoordinateGenerator.mode = "WORLDSPACE*" or generating Viewpoint.camera[Inverse]Matrix event.

Always after changing this, change also all other camera fields, and then call Changed.

Public InverseMatrix: TMatrix4Single;

Inverse of Matrix.

Always call InverseMatrixNeeded before using it, InverseMatrixNeeded will check InverseMatrixDone and eventually will calculate inverse and set InverseMatrixDone to True.

Public InverseMatrixDone: boolean;
 
Public RotationMatrix: TMatrix4Single;

Camera rotation matrix. That is, this is like Matrix but it doesn't move the camera, only rotates it.

It's guaranteed that this is actually only 3x3 matrix, the 4th row and 4th column are all zero except the lowest right item which is 1.0.

Public RotationInverseMatrix: TMatrix4Single;

Inverse of RotationMatrix.

Always call RotationInverseMatrixNeeded before using it, RotationInverseMatrixNeeded will check RotationInverseMatrixDone and eventually will calculate inverse and set RotationInverseMatrixDone to True.

Public RotationInverseMatrixDone: boolean;
 
Public Frustum: TFrustum;
 

Methods

Public constructor Create;
 
Public destructor Destroy; override;
 
Public procedure InverseMatrixNeeded;
 
Public procedure RotationInverseMatrixNeeded;
 
Public function RotationMatrix3: TMatrix3Single;

Camera rotation matrix, as a 3x3 matrix.

Public function RotationInverseMatrix3: TMatrix3Single;
 
Public procedure FromCameraObject(const ACamera: TCamera; const Viewpoint: TAbstractViewpointNode);

Set all properties (except Target) from TCamera instance in ACamera. See FromMatrix for comments about Target property and Viewpoint parameter.

Public procedure FromMatrix(const AMatrix, ARotationMatrix, ProjectionMatrix: TMatrix4Single; const Viewpoint: TAbstractViewpointNode);

Set all properties (except Target) from explict matrices. ProjectionMatrix is needed to calculate frustum.

Remember that Target must be already set correctly when calling this, registered OnChanged callbacks may read it.

Viewpoint is only passed to the Changed and OnChanged. It should be non-nil to indicate that the view comes from non-standard (not currently bound) VRML/X3D Viewpoint node.

Public procedure Changed(const Viewpoint: TAbstractViewpointNode);

Always called after camera changed. This will call all registered OnChanged events. Remember that Target must be already set correctly when calling this, registered OnChanged callbacks may read it.

Properties

Public property Target: TRenderTarget read FTarget write FTarget;
 
Public property OnChanged: TCameraChangedEventList read FOnChanged;
 

Generated by PasDoc 0.13.0 on 2014-08-30 12:10:39