Class TAbstractViewpointNode

Unit

Declaration

type TAbstractViewpointNode = class(TAbstractBindableNode)

Description

Common ancestor for both VRML 1.0 camera nodes and VRML/X3D >= 2.0 viewpoint nodes.

Hierarchy

Overview

Methods

Public procedure CreateNode; override;
Public function TransformationChange: TNodeTransformationChange; override;
Public class function ProjectionType: TProjectionType; virtual; abstract;
Public procedure GetView(out CamPos, CamDir, CamUp, GravityUp: TVector3);
Public function SmartDescription: string; virtual;

Properties

Public property FdOrientation: TSFRotation read FFdOrientation;
Public property Orientation: TVector4 read GetOrientation write SetOrientation;
Public property FdDirection: TMFVec3f read FFdDirection;
Public property FdUp: TMFVec3f read FFdUp;
Public property FdGravityUp: TSFVec3f read FFdGravityUp;
Public property EventCameraMatrix: TSFMatrix4fEvent read FEventCameraMatrix;
Public property EventCameraInverseMatrix: TSFMatrix4fEvent read FEventCameraInverseMatrix;
Public property EventCameraRotationMatrix: TSFMatrix3fEvent read FEventCameraRotationMatrix;
Public property EventCameraRotationInverseMatrix: TSFMatrix3fEvent read FEventCameraRotationInverseMatrix;
Public property FdCameraMatrixSendAlsoOnOffscreenRendering: TSFBool read FFdCameraMatrixSendAlsoOnOffscreenRendering;
Public property Position: TVector3 read GetPosition write SetPosition;
Public property FdDescription: TSFString read FFdDescription;

Description

Methods

Public procedure CreateNode; override;
 
Public function TransformationChange: TNodeTransformationChange; override;
 
Public class function ProjectionType: TProjectionType; virtual; abstract;
 
Public procedure GetView(out CamPos, CamDir, CamUp, GravityUp: TVector3);

Calculate camera vectors (position, direction, up, gravity up). Follows VRML/X3D specification:

  • position is taken directly from FdPosition field,

  • direction and up are (respectively) -Z and +Y rotated by FdOrientation,

  • gravity up is +Y.

They are all then transformed by the current viewpoint transformation (determined by parent nodes like Transform).

One conclusion from the above is that the only way to change the gravity up vector (this determines in which direction viewer falls down) is to use the Transform node around the viewpoint node.

Additionally, as an extension, we also look at FdDirection and FdUp and FdGravityUp vectors. See https://castle-engine.io/x3d_extensions.php#section_ext_cameras_alt_orient

Returned CamDir, CamUp, GravityUp are always normalized.

Public function SmartDescription: string; virtual;

Description generated smart (trying to use FdDescription field, falling back on other information to help user identify the node).

Properties

Public property FdOrientation: TSFRotation read FFdOrientation;
 
Public property Orientation: TVector4 read GetOrientation write SetOrientation;
 
Public property FdDirection: TMFVec3f read FFdDirection;
 
Public property FdUp: TMFVec3f read FFdUp;
 
Public property FdGravityUp: TSFVec3f read FFdGravityUp;
 
Public property EventCameraMatrix: TSFMatrix4fEvent read FEventCameraMatrix;
 
Public property EventCameraInverseMatrix: TSFMatrix4fEvent read FEventCameraInverseMatrix;
 
Public property EventCameraRotationMatrix: TSFMatrix3fEvent read FEventCameraRotationMatrix;
 
Public property EventCameraRotationInverseMatrix: TSFMatrix3fEvent read FEventCameraRotationInverseMatrix;
 
Public property FdCameraMatrixSendAlsoOnOffscreenRendering: TSFBool read FFdCameraMatrixSendAlsoOnOffscreenRendering;
 
Public property Position: TVector3 read GetPosition write SetPosition;

Position of the viewpoint.

Public property FdDescription: TSFString read FFdDescription;
 

Generated by PasDoc 0.15.0.