Class TAbstractViewpointNode

Unit

Declaration

type TAbstractViewpointNode = class(TAbstractBindableNode)

Description

Base type for viewpoints in X3D, which are locations from which the user may view the scene.

Hierarchy

Overview

Methods

Public constructor Create(const AX3DName: string = ''; const ABaseUrl: String = ''); override;
Public function TransformationChange: TNodeTransformationChange; override;
Public class function ProjectionType: TProjectionType; virtual; abstract;
Public procedure GetView(out CamPos, CamDir, CamUp, GravityUp: TVector3); overload;
Public procedure GetView(out CamView: TViewVectors); overload;
Public function SmartDescription: string; virtual;
Public function ProjectionMatrix: TMatrix4; virtual;
Public function ModelviewMatrix: TMatrix4;
Public function GetProjectorMatrix: TMatrix4;
Public procedure CreateNode; override;
Public class function ClassX3DType: String; override;

Properties

Public property Position: TVector3 read GetPosition write SetPosition;
Public property FdAutoCenterOfRotation: TSFBool read FFdAutoCenterOfRotation;
Public property AutoCenterOfRotation: Boolean read GetAutoCenterOfRotation write SetAutoCenterOfRotation;
Public property FdCenterOfRotation: TSFVec3f read FFdCenterOfRotation;
Public property CenterOfRotation: TVector3 read GetCenterOfRotation write SetCenterOfRotation;
Public property FdDescription: TSFString read FFdDescription;
Public property Description: String read GetDescription write SetDescription;
Public property FdJump: TSFBool read FFdJump;
Public property Jump: Boolean read GetJump write SetJump;
Public property FdOrientation: TSFRotation read FFdOrientation;
Public property Orientation: TVector4 read GetOrientation write SetOrientation;
Public property FdRetainUserOffsets: TSFBool read FFdRetainUserOffsets;
Public property RetainUserOffsets: Boolean read GetRetainUserOffsets write SetRetainUserOffsets;
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 CameraMatrixSendAlsoOnOffscreenRendering: Boolean read GetCameraMatrixSendAlsoOnOffscreenRendering write SetCameraMatrixSendAlsoOnOffscreenRendering;
Public property FdDirection: TMFVec3f read FFdDirection;
Public property FdUp: TMFVec3f read FFdUp;
Public property FdGravityUp: TSFVec3f read FFdGravityUp;
Public property GravityUp: TVector3 read GetGravityUp write SetGravityUp;
Public property FdGravityTransform: TSFBool read FFdGravityTransform;
Public property GravityTransform: Boolean read GetGravityTransform write SetGravityTransform;

Description

Methods

Public constructor Create(const AX3DName: string = ''; const ABaseUrl: String = ''); override;

This item has no description. Showing description inherited from TX3DNode.Create.

Constructor. Initializes various properties:

  • Name, BaseUrl are initialized from given parameters.

  • The Fields, Events lists are filled in every descendant, to have all the fields/events defined by the specification.

  • DefaultContainerField, and other node-specific stuff, is filled in descendants. This is actually implemented in CreateNode, that is called at the end of this constructor.

Public function TransformationChange: TNodeTransformationChange; override;

This item has no description.

Public class function ProjectionType: TProjectionType; virtual; abstract;

This item has no description.

Public procedure GetView(out CamPos, CamDir, CamUp, GravityUp: TVector3); overload;

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 TTransformNode).

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.

TODO: This may need transform to world space, not just scene space, just like TAbstractLightNode.GetView does. Test how it behaves in TCastleScene that has some transformation.

Public procedure GetView(out CamView: TViewVectors); overload;

This item has no description.

Public function SmartDescription: string; virtual;

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

Public function ProjectionMatrix: TMatrix4; virtual;

Matrices for projecting texture from this viewpoint, for ProjectedTextureCoordinate. Override ProjectionMatrix for subclasses (ModelviewMatrix is already correctly defined here).

Public function ModelviewMatrix: TMatrix4;

This item has no description.

Public function GetProjectorMatrix: TMatrix4;

This item has no description.

Public procedure CreateNode; override;

Create node fields and events.

Public class function ClassX3DType: String; override;

This item has no description. Showing description inherited from TX3DNode.ClassX3DType.

Node type name in VRML/X3D, for this class. Normal VRML/X3D node classes should override this to return something non-empty, and then X3DType automatically will return the same value.

Empty for classes that don't have a hardcoded VRML/X3D node name, like a special TX3DUnknownNode. Such special classes should override then X3DType to return actual non-empty name there.

You usually should call X3DType. The only use of this method is that it works on classes (it's "class function"), without needing at actual instance.

Properties

Public property Position: TVector3 read GetPosition write SetPosition;

Position of the viewpoint.

Public property FdAutoCenterOfRotation: TSFBool read FFdAutoCenterOfRotation;

Internal wrapper for property AutoCenterOfRotation. This wrapper API may change, we advise to access simpler AutoCenterOfRotation instead, if it is defined (TODO: for now, some field types do not have a simpler counterpart).

Public property AutoCenterOfRotation: Boolean read GetAutoCenterOfRotation write SetAutoCenterOfRotation;

When True, the center of rotation is automatically calculated looking at the middle of scene bounding box. The CenterOfRotation value is ignored then.

This field is a Castle Game Engine extension of the X3D standard. The default value (False) makes behavior compatible with X3D standard. Note that, in contrast, TCastleExamineNavigation.AutoCenterOfRotation default is True – because TCastleExamineNavigation doesn't have to match X3D standard, and the default True makes it work out-of-the-box on more scenes.

Public property FdCenterOfRotation: TSFVec3f read FFdCenterOfRotation;

Internal wrapper for property CenterOfRotation. This wrapper API may change, we advise to access simpler CenterOfRotation instead, if it is defined (TODO: for now, some field types do not have a simpler counterpart).

Public property CenterOfRotation: TVector3 read GetCenterOfRotation write SetCenterOfRotation;

This item has no description.

Public property FdDescription: TSFString read FFdDescription;

Internal wrapper for property Description. This wrapper API may change, we advise to access simpler Description instead, if it is defined (TODO: for now, some field types do not have a simpler counterpart).

Public property Description: String read GetDescription write SetDescription;

This item has no description.

Public property FdJump: TSFBool read FFdJump;

Internal wrapper for property Jump. This wrapper API may change, we advise to access simpler Jump instead, if it is defined (TODO: for now, some field types do not have a simpler counterpart).

Public property Jump: Boolean read GetJump write SetJump;

This item has no description.

Public property FdOrientation: TSFRotation read FFdOrientation;

Internal wrapper for property Orientation. This wrapper API may change, we advise to access simpler Orientation instead, if it is defined (TODO: for now, some field types do not have a simpler counterpart).

Public property Orientation: TVector4 read GetOrientation write SetOrientation;

Orientation of the viewpoint, expressed as rotation to transform default direction and up (DefaultX3DCameraDirection, DefaultX3DCameraUp).

Public property FdRetainUserOffsets: TSFBool read FFdRetainUserOffsets;

Internal wrapper for property RetainUserOffsets. This wrapper API may change, we advise to access simpler RetainUserOffsets instead, if it is defined (TODO: for now, some field types do not have a simpler counterpart).

Public property RetainUserOffsets: Boolean read GetRetainUserOffsets write SetRetainUserOffsets;

This item has no description.

Public property EventCameraMatrix: TSFMatrix4fEvent read FEventCameraMatrix;

This item has no description.

Public property EventCameraInverseMatrix: TSFMatrix4fEvent read FEventCameraInverseMatrix;

This item has no description.

Public property EventCameraRotationMatrix: TSFMatrix3fEvent read FEventCameraRotationMatrix;

This item has no description.

Public property EventCameraRotationInverseMatrix: TSFMatrix3fEvent read FEventCameraRotationInverseMatrix;

This item has no description.

Public property FdCameraMatrixSendAlsoOnOffscreenRendering: TSFBool read FFdCameraMatrixSendAlsoOnOffscreenRendering;

Internal wrapper for property CameraMatrixSendAlsoOnOffscreenRendering. This wrapper API may change, we advise to access simpler CameraMatrixSendAlsoOnOffscreenRendering instead, if it is defined (TODO: for now, some field types do not have a simpler counterpart).

Public property CameraMatrixSendAlsoOnOffscreenRendering: Boolean read GetCameraMatrixSendAlsoOnOffscreenRendering write SetCameraMatrixSendAlsoOnOffscreenRendering;

This item has no description.

Public property FdDirection: TMFVec3f read FFdDirection;

Internal wrapper for property Direction. This wrapper API may change, we advise to access simpler Direction instead, if it is defined (TODO: for now, some field types do not have a simpler counterpart).

Public property FdUp: TMFVec3f read FFdUp;

Internal wrapper for property Up. This wrapper API may change, we advise to access simpler Up instead, if it is defined (TODO: for now, some field types do not have a simpler counterpart).

Public property FdGravityUp: TSFVec3f read FFdGravityUp;

Internal wrapper for property GravityUp. This wrapper API may change, we advise to access simpler GravityUp instead, if it is defined (TODO: for now, some field types do not have a simpler counterpart).

Public property GravityUp: TVector3 read GetGravityUp write SetGravityUp;

Warning: this symbol is deprecated.

Specify the gravity vector explicitly. See https://castle-engine.io/x3d_implementation_navigation_extensions.php .

Public property FdGravityTransform: TSFBool read FFdGravityTransform;

Internal wrapper for property GravityTransform. This wrapper API may change, we advise to access simpler GravityTransform instead, if it is defined (TODO: for now, some field types do not have a simpler counterpart).

Public property GravityTransform: Boolean read GetGravityTransform write SetGravityTransform;

Should the gravity vector be affected by the viewpoint transformation, that is by the TTransformNode instances that contain this TAbstractViewpointNode.


Generated by PasDoc 0.16.0-snapshot.