Description | Hierarchy | Fields | Methods | Properties |
type TSceneNodeAnimatorCollisionResponse = class(TSceneNodeAnimator)
Special scene node animator for doing automatic collision detection and response.
This scene node animator can be attached to any single scene node and will then prevent it from moving through specified collision geometry (e.g. walls and floors of the) world, as well as having it fall under gravity. This animator provides a simple implementation of first person shooter cameras. Attach it to a camera, and the camera will behave as the player control in a first person shooter game: The camera stops and slides at walls, walks up stairs, falls down if there is no floor under it, and so on.
The animator will treat any change in the position of its target scene node as movement, including setting Position, as movement. If you want to teleport the target scene node manually to a location without it being effected by collision geometry, then call SetTargetNode(node) after setting node.Position.
![]() |
constructor Create(NReference: Pointer; NSceneManager: TReferenceCounted; AutoDrop: Boolean = False); |
![]() |
function GetCollisionNode: TSceneNode; inline; |
![]() |
function GetTargetNode: TSceneNode; inline; |
![]() |
function GetWorld: TTriangleSelector; inline; |
![]() |
function IsFalling: Boolean; inline; |
![]() |
procedure Jump(JumpSpeed: Single); inline; |
![]() |
procedure SetCollisionCallback(Callback: TCollisionCallback); inline; |
![]() |
procedure SetTargetNode(Node: TSceneNode); inline; |
![]() |
procedure SetWorld(World: TTriangleSelector); inline; |
![]() |
property AnimateTarget: Boolean read GetAnimateTarget write SetAnimateTarget; |
![]() |
property CollisionOccurred: Boolean read GetCollisionOccurred; |
![]() |
property CollisionPoint: TVector3D read GetCollisionPoint; |
![]() |
property CollisionResultPosition: TVector3D read GetCollisionResultPosition; |
![]() |
property CollisionTriangle: TTriangle read GetCollisionTriangle; |
![]() |
property EllipsoidRadius: TVector3D read GetEllipsoidRadius write SetEllipsoidRadius; |
![]() |
property EllipsoidTranslation: TVector3D read GetEllipsoidTranslation
write SetEllipsoidTranslation; |
![]() |
property Gravity: TVector3D read GetGravity write SetGravity; |
![]() |
property SceneManager: TReferenceCounted read FSceneManager; |
![]() |
constructor Create(NReference: Pointer; NSceneManager: TReferenceCounted; AutoDrop: Boolean = False); |
Constructor. Only used internally. |
![]() |
function GetCollisionNode: TSceneNode; inline; |
The translation of the ellipsoid for collision detection. |
![]() |
function GetTargetNode: TSceneNode; inline; |
The single node that this animator is acting on. |
![]() |
function GetWorld: TTriangleSelector; inline; |
The current triangle selector containing all triangles for collision detection. |
![]() |
function IsFalling: Boolean; inline; |
Checks if the attached scene node is falling. ReturnsTrue if the scene node is falling, false if not. |
![]() |
procedure Jump(JumpSpeed: Single); inline; |
' Parameters
|
![]() |
procedure SetCollisionCallback(Callback: TCollisionCallback); inline; |
Sets a callback interface which will be called if a collision occurs. occurs. Set this to nil to disable the callback. Parameters
|
![]() |
procedure SetTargetNode(Node: TSceneNode); inline; |
Set the single node that this animator will act on. Parameters
|
![]() |
procedure SetWorld(World: TTriangleSelector); inline; |
Sets a triangle selector holding all triangles of the world with which the scene node may collide. Parameters
|
![]() |
property AnimateTarget: Boolean read GetAnimateTarget write SetAnimateTarget; |
Specifies whether the target should react to a collision. |
![]() |
property CollisionOccurred: Boolean read GetCollisionOccurred; |
True if a collision occurred during the last AnimateNode(). |
![]() |
property CollisionPoint: TVector3D read GetCollisionPoint; |
The last point of collision. |
![]() |
property CollisionResultPosition: TVector3D read GetCollisionResultPosition; |
The position that the target node will be moved to, unless the collision is consumed in a callback. |
![]() |
property CollisionTriangle: TTriangle read GetCollisionTriangle; |
The last triangle that caused a collision. |
![]() |
property EllipsoidRadius: TVector3D read GetEllipsoidRadius write SetEllipsoidRadius; |
The radius of the ellipsoid for collision detection and response. |
![]() |
property EllipsoidTranslation: TVector3D read GetEllipsoidTranslation
write SetEllipsoidTranslation; |
The translation of the ellipsoid for collision detection. |
![]() |
property Gravity: TVector3D read GetGravity write SetGravity; |
The |
![]() |
property SceneManager: TReferenceCounted read FSceneManager; |
The owning scene manager. |