Class TCastleMoving
Unit
Declaration
type TCastleMoving = class(TCastleTransform)
Description
Warning: this symbol is deprecated: the usefullness of this class is low, as in a typical application you can implement something similar yourself, adjusted to your particular case
Transformation moving and potentially pushing other objects. Good for elevators, doors and such.
Other objects may be pushed, if Pushes. There are two methods of pushing available, see PushesEverythingInside. Only the objects with TCastleTransform.CollidesWithMoving are ever pushed by this object (the rest of the world is treated as static, does not interact with elevators / doors or such).
You can also stop/reverse the move to prevent some collisions from occuring at all. This way you can e.g. prevent the door from automatically closing, if someone/something blocks the way. You do this by overriding BeforeTimeIncrease. See TDoomLevelDoor.BeforeTimeIncrease in "The Castle" for example how to do this.
Hierarchy
- TObject
- TPersistent
- TComponent
- TCastleComponent
- TCastleTransform
- TCastleMoving
Overview
Methods
![]() |
function GetTranslationFromTime(const AnAnimationTime: TFloatTime): TVector3; virtual; abstract; |
![]() |
procedure BeforeTimeIncrease(const NewAnimationTime: TFloatTime); virtual; |
![]() |
constructor Create(AOwner: TComponent); override; |
![]() |
procedure Update(const SecondsPassed: Single; var RemoveMe: TRemoveType); override; |
Properties
![]() |
property AnimationTime: TFloatTime read FAnimationTime; |
![]() |
property Pushes: boolean read FPushes write FPushes default true; |
![]() |
property PushesEverythingInside: boolean
read FPushesEverythingInside write FPushesEverythingInside default true; |
Description
Methods
![]() |
function GetTranslationFromTime(const AnAnimationTime: TFloatTime): TVector3; virtual; abstract; |
![]() |
procedure BeforeTimeIncrease(const NewAnimationTime: TFloatTime); virtual; |
|
Do something right before animation progresses. Called at the beginning of our Update, right before AnimationTime changes to NewAnimationTime. Useful for taking care of collision detection issues, as our assumption always is that "nothing collides". Which means that if you don't want your TCastleMoving to collide with e.g. player or creatures or items, then you should prevent the collision before it happens. This is the place to do it. | |
![]() |
constructor Create(AOwner: TComponent); override; |
![]() |
procedure Update(const SecondsPassed: Single; var RemoveMe: TRemoveType); override; |
Properties
![]() |
property AnimationTime: TFloatTime read FAnimationTime; |
|
Local object time, always increasing, used to track animations. | |
![]() |
property Pushes: boolean read FPushes write FPushes default true; |
|
Are other 3D objects pushed when this object moves. Only the 3D objects with TCastleTransform.CollidesWithMoving are ever pushed by this object (the rest of 3D world is treated as static, does not interact with elevators / doors or such). Only relevant if GetCollides. Non-colliding objects never push others. | |
![]() |
property PushesEverythingInside: boolean
read FPushesEverythingInside write FPushesEverythingInside default true; |
|
If Pushes is
Neither method is really perfect.
On the other hand, In practice: | |
Generated by PasDoc 0.16.0.


