Class TRigidBody
Unit
Declaration
type TRigidBody = class(TComponent)
Description
Rigid body properties for the physics engine, see TCastleTransform.RigidBody.
TODO: For now all the properties of this class, including the Collider and all properties of Collider, must be assigned before setting TCastleTransform.RigidBody .
Hierarchy
- TObject
- TPersistent
- TComponent
- TRigidBody
Overview
Methods
![]() |
constructor Create(AOwner: TComponent); override; |
![]() |
destructor Destroy; override; |
![]() |
procedure Setup2D; |
![]() |
procedure InitializeTransform(const Transform: TCastleTransform); |
![]() |
procedure DeinitializeTransform(const Transform: TCastleTransform); |
![]() |
procedure Update(const Transform: TCastleTransform; const SecondsPassed: Single); |
![]() |
function GetCollidingTransforms: TCastleTransformList; |
Properties
![]() |
property AngularVelocity: TVector3 read FAngularVelocity write SetAngularVelocity; |
![]() |
property AngularVelocityDamp: Single read FAngularVelocityDamp write SetAngularVelocityDamp; |
![]() |
property MaximalAngularVelocity: Single read FMaximalAngularVelocity write SetMaximalAngularVelocity; |
![]() |
property LinearVelocity: TVector3 read FLinearVelocity write SetLinearVelocity; |
![]() |
property LinearVelocityDamp: Single read FLinearVelocityDamp write SetLinearVelocityDamp; |
![]() |
property MaximalLinearVelocity: Single read FMaximalLinearVelocity write SetMaximalLinearVelocity; |
![]() |
property InitialAngularVelocity: TVector3 read FAngularVelocity write SetAngularVelocity; deprecated 'use AngularVelocity'; |
![]() |
property InitialLinearVelocity: TVector3 read FLinearVelocity write SetLinearVelocity; deprecated 'use LinearVelocity'; |
![]() |
property OnCollisionEnter: TOnCollision read FOnCollisionEnter write SetOnCollisionEnter; |
![]() |
property OnCollisionExit: TOnCollision read FOnCollisionExit write SetOnCollisionExit; |
![]() |
property OnCollisionStay: TOnCollision read FOnCollisionStay write SetOnCollisionStay; |
![]() |
property Dynamic: Boolean read FDynamic write FDynamic default true; |
![]() |
property Animated: Boolean read FAnimated write FAnimated default false; |
![]() |
property Trigger: Boolean read FTrigger write SetTrigger default false; |
![]() |
property Collider: TCollider read FCollider; |
![]() |
property Gravity: Boolean read FGravity write FGravity default true; |
![]() |
property LockTranslation: T3DCoords read FLockTranslation write FLockTranslation; |
![]() |
property LockRotation: T3DCoords read FLockRotation write FLockRotation; |
![]() |
property Exists: Boolean read FExists write SetExists default true; |
Description
Methods
![]() |
constructor Create(AOwner: TComponent); override; |
![]() |
destructor Destroy; override; |
![]() |
procedure Setup2D; |
|
Utility function to set common values for physics in 2D games. Locks moving along the Z axis, locks rotating along the X and Y axes. | |
![]() |
procedure InitializeTransform(const Transform: TCastleTransform); |
|
Connect this rigid body with Transform and Transform.World. | |
![]() |
procedure DeinitializeTransform(const Transform: TCastleTransform); |
|
Disconnect from Transform.World, if was connected. | |
![]() |
procedure Update(const Transform: TCastleTransform; const SecondsPassed: Single); |
![]() |
function GetCollidingTransforms: TCastleTransformList; |
|
Transformations that we collide with currently. | |
Properties
![]() |
property AngularVelocity: TVector3 read FAngularVelocity write SetAngularVelocity; |
![]() |
property AngularVelocityDamp: Single read FAngularVelocityDamp write SetAngularVelocityDamp; |
![]() |
property MaximalAngularVelocity: Single read FMaximalAngularVelocity write SetMaximalAngularVelocity; |
![]() |
property LinearVelocity: TVector3 read FLinearVelocity write SetLinearVelocity; |
![]() |
property LinearVelocityDamp: Single read FLinearVelocityDamp write SetLinearVelocityDamp; |
![]() |
property MaximalLinearVelocity: Single read FMaximalLinearVelocity write SetMaximalLinearVelocity; |
![]() |
property InitialAngularVelocity: TVector3 read FAngularVelocity write SetAngularVelocity; deprecated 'use AngularVelocity'; |
|
Warning: this symbol is deprecated: use AngularVelocity | |
![]() |
property InitialLinearVelocity: TVector3 read FLinearVelocity write SetLinearVelocity; deprecated 'use LinearVelocity'; |
|
Warning: this symbol is deprecated: use LinearVelocity | |
![]() |
property OnCollisionEnter: TOnCollision read FOnCollisionEnter write SetOnCollisionEnter; |
|
Occurs when TRigidBody starts colliding with another TRigidBody. It can occur repeatedly for the same body (in the same time instant) if the collision has many points of contact. Warning: Do not free the TCastleTransform instances that collide during this event. It would free the rigid body instance, which will crash the physics engine for now. Instead, you can set TCastleTransform.Exists to | |
![]() |
property OnCollisionExit: TOnCollision read FOnCollisionExit write SetOnCollisionExit; |
|
Occurs when TRigidBody stops colliding with another TRigidBody. Warning: Do not free the TCastleTransform instances that collide during this event. It would free the rigid body instance, which will crash the physics engine for now. Instead, you can set TCastleTransform.Exists to | |
![]() |
property OnCollisionStay: TOnCollision read FOnCollisionStay write SetOnCollisionStay; |
|
Occurs when TRigidBody still collides with another TRigidBody. Warning: Do not free the TCastleTransform instances that collide during this event. It would free the rigid body instance, which will crash the physics engine for now. Instead, you can set TCastleTransform.Exists to | |
![]() |
property Dynamic: Boolean read FDynamic write FDynamic default true; |
|
Does the physics simulation move and rotate this object (because of gravity, or because it collides with others).
| |
![]() |
property Animated: Boolean read FAnimated write FAnimated default false; |
|
Is the transformation of this object updated often (relevant only when Dynamic = This property is taken into account only if Dynamic =
| |
![]() |
property Trigger: Boolean read FTrigger write SetTrigger default false; |
|
Triggers report when other object collides with them, but still allow the other object to pass through. In other words, colliding with a They are useful as sensors. E.g. a Triggers report collisions through the same events as other rigid bodies: (TRigidBody.OnCollisionEnter, TRigidBody.OnCollisionStay, TRigidBody.OnCollisionExit). | |
![]() |
property Collider: TCollider read FCollider; |
|
Shape used for collisions with this object. You cannot assign this property directly, it is automatically assigned when you create a TCollider specifying this TRigidBody as it's parent. | |
![]() |
property Gravity: Boolean read FGravity write FGravity default true; |
|
Is this object affected by gravity. | |
![]() |
property LockTranslation: T3DCoords read FLockTranslation write FLockTranslation; |
|
Disable motion (TCastleTransform.Translation change) along the particular (world) axis. For 2D games, you will usually want to disable motion along the Z axis. Instead of directly changing this property, you can achieve this by calling Setup2D. | |
![]() |
property LockRotation: T3DCoords read FLockRotation write FLockRotation; |
|
Disable rotation (TCastleTransform.Rotation change) along the particular (world) axis. For 2D games, you will usually want to disable rotation along the X and Y axes. Instead of directly changing this property, you can achieve this by calling Setup2D. | |
Generated by PasDoc 0.16.0.

