Class TCastleAbstractJoint
Unit
Declaration
type TCastleAbstractJoint = class(TCastleBehavior)
Description
Base class for physics joints, that connects two physics bodies and constraints their relative movement.
This class provides useful virtual methods to create joints (observing the existence of rigid body and parent) and some common properties to all joints (allowing all joints to be breakable).
Hierarchy
- TObject
- TPersistent
- TComponent
- TCastleComponent
- TCastleBehavior
- TCastleAbstractJoint
Overview
Fields
![]() |
FParentRigidBody: TCastleRigidBody; |
![]() |
FBreakThresholdForce: Single; |
![]() |
FBreakThresholdTorque: Single; |
![]() |
FBreakable: Boolean; |
Methods
![]() |
procedure CreateKraftJoint; virtual; abstract; |
![]() |
function GetKraftJoint: TKraftConstraintJoint; virtual; abstract; |
![]() |
procedure RecreateKraftJoint; |
![]() |
procedure InitializeKraftJoint; virtual; |
![]() |
procedure DeinitializeKraftJoint; virtual; abstract; |
![]() |
function AllNeededKraftObjectsInitialized: Boolean; virtual; |
![]() |
procedure OnParentTransformAddBehavior(const Component: TComponent); virtual; |
![]() |
procedure OnBeforeParentTransfromRemoveBehavior(const Component: TComponent); virtual; |
![]() |
procedure OnParentRigidBodyInitialized(const Component: TComponent); virtual; |
![]() |
procedure OnBeforeParentRigidBodyDeinitialized(const Component: TComponent); virtual; |
![]() |
procedure SetParentRigidBodyEvents; |
![]() |
procedure RemoveParentRigidBodyEvents; |
![]() |
procedure UpdateBreakThresholdForceInKraft; |
![]() |
procedure UpdateBreakThresholdTorqueInKraft; |
![]() |
procedure UpdateBreakableInKraft; |
![]() |
procedure SetBreakThresholdForce(const AValue: Single); |
![]() |
procedure SetBreakThresholdTorque(const AValue: Single); |
![]() |
procedure SetBreakable(const AValue: Boolean); |
![]() |
destructor Destroy; override; |
![]() |
procedure WorldAfterAttach; override; |
![]() |
procedure WorldBeforeDetach; override; |
![]() |
function PropertySections(const PropertyName: String): TPropertySections; override; |
![]() |
procedure InternalCreateGizmos; virtual; |
![]() |
procedure InternalDestroyGizmos; virtual; |
Properties
![]() |
property Breakable: Boolean read FBreakable write SetBreakable default false; |
![]() |
property BreakThresholdForce: Single read FBreakThresholdForce write SetBreakThresholdForce default 0.0; |
![]() |
property BreakThresholdTorque: Single read FBreakThresholdTorque write SetBreakThresholdTorque default 0.0; |
Description
Fields
![]() |
FParentRigidBody: TCastleRigidBody; |
When joint is added to world we need to find parent rigid body and set callbacks for its initialize/deinitialize events. If this pointer is not nil that means that we've done that. |
![]() |
FBreakThresholdForce: Single; |
![]() |
FBreakThresholdTorque: Single; |
![]() |
FBreakable: Boolean; |
Methods
![]() |
procedure CreateKraftJoint; virtual; abstract; |
Create physics engine (Kraft) joint and set its specialized properties. |
![]() |
function GetKraftJoint: TKraftConstraintJoint; virtual; abstract; |
Get physics engine (Kraft) joint instance. |
![]() |
procedure RecreateKraftJoint; |
![]() |
procedure InitializeKraftJoint; virtual; |
![]() |
procedure DeinitializeKraftJoint; virtual; abstract; |
![]() |
function AllNeededKraftObjectsInitialized: Boolean; virtual; |
Can we create joint object. |
![]() |
procedure OnParentTransformAddBehavior(const Component: TComponent); virtual; |
Event callback when TCastleRigidBody is added to the parent transform. |
![]() |
procedure OnBeforeParentTransfromRemoveBehavior(const Component: TComponent); virtual; |
Event callback when TCastleRigidBody is removed from the parent transform. |
![]() |
procedure OnParentRigidBodyInitialized(const Component: TComponent); virtual; |
Event callback when TCastleRigidBody behavior is initialized. |
![]() |
procedure OnBeforeParentRigidBodyDeinitialized(const Component: TComponent); virtual; |
Event callback when TCastleRigidBody behavior is deinitialized. |
![]() |
procedure SetParentRigidBodyEvents; |
Sets TCastleRigidBody behavior initialize/deinitialize callbacks. |
![]() |
procedure RemoveParentRigidBodyEvents; |
Removes TCastleRigidBody behavior initialize/deinitialize callbacks. |
![]() |
procedure UpdateBreakThresholdForceInKraft; |
![]() |
procedure UpdateBreakThresholdTorqueInKraft; |
![]() |
procedure UpdateBreakableInKraft; |
![]() |
procedure SetBreakThresholdForce(const AValue: Single); |
![]() |
procedure SetBreakThresholdTorque(const AValue: Single); |
![]() |
procedure SetBreakable(const AValue: Boolean); |
![]() |
destructor Destroy; override; |
![]() |
procedure WorldAfterAttach; override; |
![]() |
procedure WorldBeforeDetach; override; |
![]() |
function PropertySections(const PropertyName: String): TPropertySections; override; |
![]() |
procedure InternalCreateGizmos; virtual; |
Create design-time transformations that are displayed in the hierarchy to visualize physics joints 3D points. If you want to visualize the behavior using a visible TCastleTransform, then create and add to Parent a descendant of TCastleJointTool, and set InternalCastleDesignInvalidate to |
![]() |
procedure InternalDestroyGizmos; virtual; |
Destroy design-time stuff. You can destroy any component, just be sure to set InternalCastleDesignInvalidate to |
Properties
![]() |
property Breakable: Boolean read FBreakable write SetBreakable default false; |
Makes the joint |
![]() |
property BreakThresholdForce: Single read FBreakThresholdForce write SetBreakThresholdForce default 0.0; |
Force threshold to break joint. |
![]() |
property BreakThresholdTorque: Single read FBreakThresholdTorque write SetBreakThresholdTorque default 0.0; |
Torque threshold to break joint. |
Generated by PasDoc 0.16.0.