Class TCastleStickToSurface
Unit
Declaration
type TCastleStickToSurface = class(TCastleBehavior)
Description
Behavior to make parent TCastleTransform stick to a surface of another TCastleTransform Target. The example use-case is to stick things to the surface of the terrain underneath.
Hierarchy
- TObject
- TPersistent
- TComponent
- TCastleComponent
- TCastleBehavior
- TCastleStickToSurface
Overview
Methods
function CanAttachToParent(const NewParent: TCastleTransform; out ReasonWhyCannot: String): Boolean; override; |
|
constructor Create(AOwner: TComponent); override; |
|
destructor Destroy; override; |
|
procedure Update(const SecondsPassed: Single; var RemoveMe: TRemoveType); override; |
|
function PropertySections(const PropertyName: String): TPropertySections; override; |
Properties
property Direction: TVector3 read FDirection write FDirection; |
|
property Target: TCastleTransform read FTarget write SetTarget; |
|
property OnlyAtDesign: Boolean read FOnlyAtDesign write FOnlyAtDesign default true; |
|
property DirectionPersistent: TCastleVector3Persistent read FDirectionPersistent ; |
Description
Methods
function CanAttachToParent(const NewParent: TCastleTransform; out ReasonWhyCannot: String): Boolean; override; |
|
This item has no description. Showing description inherited from TCastleBehavior.CanAttachToParent.
Check can this behavior be added to NewParent. When this returns function TCastleBillboard.CanAttachToParent(const NewParent: TCastleTransform; out ReasonWhyCannot: String): Boolean; begin Result := inherited; if not Result then Exit; if NewParent.FindBehavior(TCastleBillboard) <> nil then begin ReasonWhyCannot := 'Only one TCastleBillboard behavior can be added to a given TCastleTransform'; Result := false; end; end; |
constructor Create(AOwner: TComponent); override; |
|
This item has no description. |
destructor Destroy; override; |
|
This item has no description. |
procedure Update(const SecondsPassed: Single; var RemoveMe: TRemoveType); override; |
|
This item has no description. Showing description inherited from TCastleBehavior.Update. Continuously occuring event, for various tasks. |
function PropertySections(const PropertyName: String): TPropertySections; override; |
|
This item has no description. Showing description inherited from TCastleComponent.PropertySections. Section where to show property in the editor. |
Properties
property Direction: TVector3 read FDirection write FDirection; |
|
Direction in which we check for collisions to stick the parent to Target. The default direction is -Y (that is, (0, 1, 0)) which makes the parent stick to the object under it, as if the gravity was forcing it down immediately. |
property Target: TCastleTransform read FTarget write SetTarget; |
|
Target to which Parent of this behavior sticks. TODO: Rotating the target right now doesn't make proper behavior, test by rotating terrain in examples/terrain/. |
property DirectionPersistent: TCastleVector3Persistent read FDirectionPersistent ; |
|
Direction 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 Direction directly. See also |
Generated by PasDoc 0.16.0-snapshot.