Class TMakeX3DViewpoint

Unit

Declaration

type TMakeX3DViewpoint = class(TObject)

Description

Utility class to set various viewpoint properties, and then generate given viewpoint node.

Hierarchy

  • TObject
  • TMakeX3DViewpoint

Overview

Fields

Public nested const DefaultPerspectiveFieldOfView = Pi / 4;

Methods

Public constructor Create;
Public function ToString: String; override;
Public function ToNode(out ViewpointNode: TAbstractViewpointNode): TAbstractChildNode; overload;
Public function ToNode: TAbstractChildNode; overload;

Properties

Public property Version: TX3DCameraVersion read FVersion write FVersion default cvVrml2_X3d;
Public property Xml: Boolean read FXml write FXml default true;
Public property Position: TVector3 read FPosition write FPosition;
Public property Direction: TVector3 read FDirection write FDirection;
Public property Up: TVector3 read FUp write FUp;
Public property GravityUp: TVector3 read FGravityUp write FGravityUp;
Public property CenterOfRotation: TVector3 read FCenterOfRotation write FCenterOfRotation;
Public property AutoCenterOfRotation: Boolean read FAutoCenterOfRotation write FAutoCenterOfRotation default false;
Public property PerspectiveFieldOfView: Single read FPerspectiveFieldOfView write FPerspectiveFieldOfView default DefaultPerspectiveFieldOfView;
Public property ProjectionType: TProjectionType read FProjectionType write FProjectionType default ptPerspective;
Public property OrthographicFieldOfView: TFloatRectangle read FOrthographicFieldOfView write FOrthographicFieldOfView;

Description

Fields

Public nested const DefaultPerspectiveFieldOfView = Pi / 4;

Matches X3D default TViewpointNode.FieldOfView.

It also matches TCastlePerspective.DefaultFieldOfView, which is good – our TCastleCamera and friends (like TCastlePerspective) is consistent with X3D in this regard.

Methods

Public constructor Create;

This item has no description.

Public function ToString: String; override;

Construct string with VRML/X3D node defining Viewpoint with given properties.

Public function ToNode(out ViewpointNode: TAbstractViewpointNode): TAbstractChildNode; overload;

Construct X3D nodes that define viewpoint (maybe with some transformation) with given properties.

Overloaded version with ViewpointNode parameter returns the TAbstractViewpointNode descendant that is for sure somewhere within the returned node. But the returned node may be a transformation node.

Public function ToNode: TAbstractChildNode; overload;

This item has no description.

Properties

Public property Version: TX3DCameraVersion read FVersion write FVersion default cvVrml2_X3d;

Version of VRML or X3D to generate (in ToNode or ToString).

Public property Xml: Boolean read FXml write FXml default true;

Whether to use XML encoding in ToString.

Public property Position: TVector3 read FPosition write FPosition;

Position of the camera. By default it is DefaultX3DCameraPosition[cvVrml2_X3d].

Public property Direction: TVector3 read FDirection write FDirection;

Direction of the camera. By default it is DefaultX3DCameraDirection.

Public property Up: TVector3 read FUp write FUp;

Up vector of the camera. By default it is DefaultX3DCameraUp.

Public property GravityUp: TVector3 read FGravityUp write FGravityUp;

Gravity up vector of the camera. By default it is DefaultX3DGravityUp.

Public property CenterOfRotation: TVector3 read FCenterOfRotation write FCenterOfRotation;

Center of rotation, as should be specified in viewpoint node. By default it is zero, just like TAbstractViewpointNode.CenterOfRotation.

Public property AutoCenterOfRotation: Boolean read FAutoCenterOfRotation write FAutoCenterOfRotation default false;

Automatically calculate center of rotation based on scene bounding box. The default (False) makes X3D default of TAbstractViewpointNode.AutoCenterOfRotation.

Public property PerspectiveFieldOfView: Single read FPerspectiveFieldOfView write FPerspectiveFieldOfView default DefaultPerspectiveFieldOfView;

Perspective field of view, in radians.

Public property ProjectionType: TProjectionType read FProjectionType write FProjectionType default ptPerspective;

TODO: This does not support yet choice perspective/orthographic camera, we always generate perspective node. But we expose relevant properties and they will be used in the future.

Public property OrthographicFieldOfView: TFloatRectangle read FOrthographicFieldOfView write FOrthographicFieldOfView;

This item has no description.


Generated by PasDoc 0.16.0-snapshot.