Class TCastleBillboard

Unit

Declaration

type TCastleBillboard = class(TCastleBehavior)

Description

Behavior to make parent TCastleTransform a billboard, that always rotates to face the current camera.

The front of the parent, that always turns to the camera, is determined by the TCastleTransform.Orientation, which in turn by default is taken from TCastleTransform.DefaultOrientation, which by default just means "positive Z axis" (otUpYDirectionZ). The idea is that TCastleTransform.Direction is updated to point toward the camera.

The axis around which billboard rotates is determined by AxisOfRotation. When non-zero, this axis is set as TCastleTransform.Up.

Hierarchy

Overview

Methods

Protected function CanAttachToParent(const NewParent: TCastleTransform; out ReasonWhyCannot: String): Boolean; override;
Public constructor Create(AOwner: TComponent); override;
Public destructor Destroy; override;
Public procedure Update(const SecondsPassed: Single; var RemoveMe: TRemoveType); override;
Public function PropertySections(const PropertyName: String): TPropertySections; override;

Properties

Public property AxisOfRotation: TVector3 read FAxisOfRotation write FAxisOfRotation;
Published property AxisOfRotationPersistent: TCastleVector3Persistent read FAxisOfRotationPersistent ;

Description

Methods

Protected function CanAttachToParent(const NewParent: TCastleTransform; out ReasonWhyCannot: String): Boolean; override;
 
Public constructor Create(AOwner: TComponent); override;
 
Public destructor Destroy; override;
 
Public procedure Update(const SecondsPassed: Single; var RemoveMe: TRemoveType); override;
 
Public function PropertySections(const PropertyName: String): TPropertySections; override;
 

Properties

Public property AxisOfRotation: TVector3 read FAxisOfRotation write FAxisOfRotation;

Axis around which the billboard rotates to face the camera. The rotation is free in 3D (with undefined up vector) when this is zero.

When non-zero, this axis is set as TCastleTransform.Up.

Similar to X3D TBillboardNode.AxisOfRotation. By default +Y (that is, (0, 1, 0)).

Note that this axis is expressed in the coordinate system of "parent of our parent" transform. That is, if you have instance X of a TCastleTransform, with TCastleBehavior attached, and it is a child of TCastleTransform instance Y, then you can rotate Y and it effectively rotates also the billboard's axis of rotation. The billboard still works correctly (it will rotate the X to look at camera as much as possible, though it cannot change rotation on Y).

Published property AxisOfRotationPersistent: TCastleVector3Persistent read FAxisOfRotationPersistent ;

AxisOfRotation that can be visually edited in Castle Game Engine Editor, Lazarus and Delphi. Normal user code does not need to deal with this, instead read or write AxisOfRotation directly.

See also
AxisOfRotation
Axis around which the billboard rotates to face the camera.

Generated by PasDoc 0.16.0.