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).

Source: transform/castletransform_joints.inc (line 29).

Hierarchy

Overview

Fields

Protected FParentRigidBody: TCastleRigidBody;
Protected FBreakThresholdForce: Single;
Protected FBreakThresholdTorque: Single;
Protected FBreakable: Boolean;

Methods

Protected procedure CreateKraftJoint; virtual; abstract;
Protected function GetKraftJoint: TKraftConstraintJoint; virtual; abstract;
Protected procedure RecreateKraftJoint;
Protected procedure InitializeKraftJoint; virtual;
Protected procedure DeinitializeKraftJoint; virtual; abstract;
Protected function AllNeededKraftObjectsInitialized: Boolean; virtual;
Protected procedure OnParentTransformAddBehavior(const Component: TComponent); virtual;
Protected procedure OnBeforeParentTransfromRemoveBehavior(const Component: TComponent); virtual;
Protected procedure OnParentRigidBodyInitialized(const Component: TComponent); virtual;
Protected procedure OnBeforeParentRigidBodyDeinitialized(const Component: TComponent); virtual;
Protected procedure SetParentRigidBodyEvents;
Protected procedure RemoveParentRigidBodyEvents;
Protected procedure UpdateBreakThresholdForceInKraft;
Protected procedure UpdateBreakThresholdTorqueInKraft;
Protected procedure UpdateBreakableInKraft;
Protected procedure SetBreakThresholdForce(const AValue: Single);
Protected procedure SetBreakThresholdTorque(const AValue: Single);
Protected procedure SetBreakable(const AValue: Boolean);
Public destructor Destroy; override;
Public procedure WorldAfterAttach; override;
Public procedure WorldBeforeDetach; override;
Public function PropertySections(const PropertyName: String): TPropertySections; override;
Public procedure InternalCreateGizmos; virtual;
Public procedure InternalDestroyGizmos; virtual;

Properties

Published property Breakable: Boolean read FBreakable write SetBreakable default false;
Published property BreakThresholdForce: Single read FBreakThresholdForce write SetBreakThresholdForce default 0.0;
Published property BreakThresholdTorque: Single read FBreakThresholdTorque write SetBreakThresholdTorque default 0.0;

Description

Fields

Protected 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.

Source: transform/castletransform_joints.inc (line 34).

Protected FBreakThresholdForce: Single;

This item has no description.

Source: transform/castletransform_joints.inc (line 35).

Protected FBreakThresholdTorque: Single;

This item has no description.

Source: transform/castletransform_joints.inc (line 36).

Protected FBreakable: Boolean;

This item has no description.

Source: transform/castletransform_joints.inc (line 37).

Methods

Protected procedure CreateKraftJoint; virtual; abstract;

Create physics engine (Kraft) joint and set its specialized properties.

Source: transform/castletransform_joints.inc (line 40).

Protected function GetKraftJoint: TKraftConstraintJoint; virtual; abstract;

Get physics engine (Kraft) joint instance.

Source: transform/castletransform_joints.inc (line 43).

Protected procedure RecreateKraftJoint;

This item has no description.

Source: transform/castletransform_joints.inc (line 45).

Protected procedure InitializeKraftJoint; virtual;

This item has no description.

Source: transform/castletransform_joints.inc (line 46).

Protected procedure DeinitializeKraftJoint; virtual; abstract;

This item has no description.

Source: transform/castletransform_joints.inc (line 47).

Protected function AllNeededKraftObjectsInitialized: Boolean; virtual;

Can we create joint object.

Source: transform/castletransform_joints.inc (line 50).

Protected procedure OnParentTransformAddBehavior(const Component: TComponent); virtual;

Event callback when TCastleRigidBody is added to the parent transform.

Source: transform/castletransform_joints.inc (line 53).

Protected procedure OnBeforeParentTransfromRemoveBehavior(const Component: TComponent); virtual;

Event callback when TCastleRigidBody is removed from the parent transform.

Source: transform/castletransform_joints.inc (line 56).

Protected procedure OnParentRigidBodyInitialized(const Component: TComponent); virtual;

Event callback when TCastleRigidBody behavior is initialized.

Source: transform/castletransform_joints.inc (line 59).

Protected procedure OnBeforeParentRigidBodyDeinitialized(const Component: TComponent); virtual;

Event callback when TCastleRigidBody behavior is deinitialized.

Source: transform/castletransform_joints.inc (line 62).

Protected procedure SetParentRigidBodyEvents;

Sets TCastleRigidBody behavior initialize/deinitialize callbacks.

Source: transform/castletransform_joints.inc (line 65).

Protected procedure RemoveParentRigidBodyEvents;

Removes TCastleRigidBody behavior initialize/deinitialize callbacks.

Source: transform/castletransform_joints.inc (line 68).

Protected procedure UpdateBreakThresholdForceInKraft;

This item has no description.

Source: transform/castletransform_joints.inc (line 70).

Protected procedure UpdateBreakThresholdTorqueInKraft;

This item has no description.

Source: transform/castletransform_joints.inc (line 71).

Protected procedure UpdateBreakableInKraft;

This item has no description.

Source: transform/castletransform_joints.inc (line 72).

Protected procedure SetBreakThresholdForce(const AValue: Single);

This item has no description.

Source: transform/castletransform_joints.inc (line 74).

Protected procedure SetBreakThresholdTorque(const AValue: Single);

This item has no description.

Source: transform/castletransform_joints.inc (line 75).

Protected procedure SetBreakable(const AValue: Boolean);

This item has no description.

Source: transform/castletransform_joints.inc (line 76).

Public destructor Destroy; override;

This item has no description.

Source: transform/castletransform_joints.inc (line 78).

Public procedure WorldAfterAttach; override;

This item has no description. Showing description inherited from TCastleBehavior.WorldAfterAttach.

Called after Parent became part of World. Called only if ListenWorldChange is True.

Source: transform/castletransform_joints.inc (line 79).

Public procedure WorldBeforeDetach; override;

This item has no description. Showing description inherited from TCastleBehavior.WorldBeforeDetach.

Called before Parent stops being part of World. Called only if ListenWorldChange is True.

This is also called at the destruction of behavior (more precisely from BeforeDestruction now). Even in this case, we guarantee that Parent is still valid during this call, and not in half-destroyed state. Before the actual destructor of TCastleBehavior we do BeforeParentDetach and BeforeWorldDetach and set Parent to Nil.

Source: transform/castletransform_joints.inc (line 80).

Public function PropertySections(const PropertyName: String): TPropertySections; override;

This item has no description. Showing description inherited from TCastleComponent.PropertySections.

Section where to show property in the editor.

Source: transform/castletransform_joints.inc (line 81).

Public 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 True.

Source: transform/castletransform_joints.inc (line 88).

Public procedure InternalDestroyGizmos; virtual;

Destroy design-time stuff. You can destroy any component, just be sure to set InternalCastleDesignInvalidate to True.

Source: transform/castletransform_joints.inc (line 93).

Properties

Published property Breakable: Boolean read FBreakable write SetBreakable default false;

Makes the joint breakable when force is greater than BreakThresholdForce or torque is greater than BreakThresholdTorque.

Source: transform/castletransform_joints.inc (line 97).

Published property BreakThresholdForce: Single read FBreakThresholdForce write SetBreakThresholdForce default 0.0;

Force threshold to break joint.

Source: transform/castletransform_joints.inc (line 100).

Published property BreakThresholdTorque: Single read FBreakThresholdTorque write SetBreakThresholdTorque default 0.0;

Torque threshold to break joint.

Source: transform/castletransform_joints.inc (line 103).


Generated by PasDoc 0.17.0.snapshot.