Class TMakeX3DViewpoint

Unit

Declaration

type TMakeX3DViewpoint = class(TObject)

Description

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

Source: src/scene/x3dcamerautils.pas (line 54).

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.

Source: src/scene/x3dcamerautils.pas (line 70).

Methods

Public constructor Create;

This item has no description.

Source: src/scene/x3dcamerautils.pas (line 112).

Public function ToString: String; override;

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

Source: src/scene/x3dcamerautils.pas (line 116).

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.

Source: src/scene/x3dcamerautils.pas (line 124).

Public function ToNode: TAbstractChildNode; overload;

This item has no description.

Source: src/scene/x3dcamerautils.pas (line 125).

Properties

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

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

Source: src/scene/x3dcamerautils.pas (line 73).

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

Whether to use XML encoding in ToString.

Source: src/scene/x3dcamerautils.pas (line 75).

Public property Position: TVector3 read FPosition write FPosition;

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

Source: src/scene/x3dcamerautils.pas (line 79).

Public property Direction: TVector3 read FDirection write FDirection;

Direction of the camera. By default it is DefaultX3DCameraDirection.

Source: src/scene/x3dcamerautils.pas (line 82).

Public property Up: TVector3 read FUp write FUp;

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

Source: src/scene/x3dcamerautils.pas (line 85).

Public property GravityUp: TVector3 read FGravityUp write FGravityUp;

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

Source: src/scene/x3dcamerautils.pas (line 88).

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.

Source: src/scene/x3dcamerautils.pas (line 92).

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.

Source: src/scene/x3dcamerautils.pas (line 96).

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

Perspective field of view, in radians.

Source: src/scene/x3dcamerautils.pas (line 100).

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.

Source: src/scene/x3dcamerautils.pas (line 106).

Public property OrthographicFieldOfView: TFloatRectangle read FOrthographicFieldOfView write FOrthographicFieldOfView;

This item has no description.

Source: src/scene/x3dcamerautils.pas (line 108).


Generated by PasDoc 0.17.0.snapshot.