Class TCastleDistanceJoint

Unit

Declaration

type TCastleDistanceJoint = class(TCastleAbstractTwoBodiesJoint)

Description

Distance joint tries to maintain a certain distance between two rigid bodies, with certain flexibility (like a spring). Anchor and ConnectedAnchor actually determine the points between which the distance is observed.

Hierarchy

Overview

Methods

Protected function GetKraftJoint: TKraftConstraintJoint; override;
Protected procedure CreateKraftJoint; override;
Protected procedure DeinitializeKraftJoint; override;
Protected procedure SetName(const Value: TComponentName); override;
Public constructor Create(AOwner: TComponent); override;
Public destructor Destroy; override;
Public procedure WorldBeforeDetach; override;
Public procedure InternalCreateGizmos; override;
Public procedure InternalDestroyGizmos; override;
Public function PropertySections(const PropertyName: String): TPropertySections; override;

Properties

Public property Anchor: TVector3 read FAnchor write SetAnchor;
Public property ConnectedAnchor: TVector3 read FConnectedAnchor write SetConnectedAnchor;
Published property FrequencyHz: Single read FFrequencyHz write SetFrequencyHz default 0.0;
Published property DampingRatio: Single read FDampingRatio write SetDampingRatio default 0.0;
Published property AnchorPersistent: TCastleVector3Persistent read FAnchorPersistent ;
Published property ConnectedAnchorPersistent: TCastleVector3Persistent read FConnectedAnchorPersistent ;

Description

Methods

Protected function GetKraftJoint: TKraftConstraintJoint; override;
 
Protected procedure CreateKraftJoint; override;
 
Protected procedure DeinitializeKraftJoint; override;
 
Protected procedure SetName(const Value: TComponentName); override;
 
Public constructor Create(AOwner: TComponent); override;
 
Public destructor Destroy; override;
 
Public procedure WorldBeforeDetach; override;
 
Public procedure InternalCreateGizmos; override;
 
Public procedure InternalDestroyGizmos; override;
 
Public function PropertySections(const PropertyName: String): TPropertySections; override;
 

Properties

Public property Anchor: TVector3 read FAnchor write SetAnchor;

First point from which the distance is measured.

Public property ConnectedAnchor: TVector3 read FConnectedAnchor write SetConnectedAnchor;

Second point from which the distance is measured.

Published property FrequencyHz: Single read FFrequencyHz write SetFrequencyHz default 0.0;

Frequency controls how fast the oscillations occur. The smaller the value, the longer the oscillation movement. This may not seem intuitive, but a higher value causes the oscillation in specified time to be faster and therefore the movement is shorter.

So if you want longer movement make this value smaller.

See live example: https://gamedev.stackexchange.com/questions/98772/b2distancejoint-with-frequency-equal-to-0-vs-b2weldjoint

Published property DampingRatio: Single read FDampingRatio write SetDampingRatio default 0.0;

How fast the oscillations are damped, large values can cause the body to not do even one oscillation.

Published property AnchorPersistent: TCastleVector3Persistent read FAnchorPersistent ;

Anchor that can be visually edited in Castle Game Engine Editor, Lazarus and Delphi. Normal user code does not need to deal with this, instead read or write Anchor directly.

See also
Anchor
First point from which the distance is measured.
Published property ConnectedAnchorPersistent: TCastleVector3Persistent read FConnectedAnchorPersistent ;

ConnectedAnchor that can be visually edited in Castle Game Engine Editor, Lazarus and Delphi. Normal user code does not need to deal with this, instead read or write ConnectedAnchor directly.

See also
ConnectedAnchor
Second point from which the distance is measured.

Generated by PasDoc 0.16.0.