Class TCastleStickToSurface
Unit
CastleBehaviors
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
Properties
Description
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; |
|
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 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.
|
|
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.