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

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 Direction: TVector3 read FDirection write FDirection;
Published property Target: TCastleTransform read FTarget write SetTarget;
Published property OnlyAtDesign: Boolean read FOnlyAtDesign write FOnlyAtDesign default true;
Published property DirectionPersistent: TCastleVector3Persistent read FDirectionPersistent ;

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

Published 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/.

Published property OnlyAtDesign: Boolean read FOnlyAtDesign write FOnlyAtDesign default true;

Perform stickiness only at design-time. This is True by default and makes this behavior trivially optimized at runtime.

Published 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
Direction
Direction in which we check for collisions to stick the parent to Target.

Generated by PasDoc 0.16.0.