Class TCastleGrabJoint

Unit

Declaration

type TCastleGrabJoint = class(TCastleAbstractOneBodyJoint)

Description

Grab joint pulls the rigid body Anchor towards a TargetWorld defined in the world coordinates. The pull is not instant, rather it works like a flexible spring / elastic rope.

Hierarchy

Overview

Fields

Public nested const DefaultFrequencyHz = 5.0;
Public nested const DefaultDampingRatio = 0.7;

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 TargetWorld: TVector3 read FTargetWorld write SetTargetWorld;
Published property FrequencyHz: Single read FFrequencyHz write SetFrequencyHz default DefaultFrequencyHz;
Published property DampingRatio: Single read FDampingRatio write SetDampingRatio default DefaultDampingRatio;
Published property MaxForce: Single read FMaxForce write SetMaxForce default 0.0;
Published property AnchorPersistent: TCastleVector3Persistent read FAnchorPersistent ;
Published property TargetWorldPersistent: TCastleVector3Persistent read FTargetWorldPersistent ;

Description

Fields

Public nested const DefaultFrequencyHz = 5.0;
 
Public nested const DefaultDampingRatio = 0.7;
 

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;

Point, in local coordinates, that will be pulled to TargetWorld.

Public property TargetWorld: TVector3 read FTargetWorld write SetTargetWorld;

Point, in world coordinates, that pulls Anchor. With time, Anchor (in local coords) will match TargetWorld (in world coords).

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

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 DefaultDampingRatio;

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

Published property MaxForce: Single read FMaxForce write SetMaxForce default 0.0;

Maximal force that will be aplied to the body to move it. Zero (default) means "unlimited".

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
Point, in local coordinates, that will be pulled to TargetWorld.
Published property TargetWorldPersistent: TCastleVector3Persistent read FTargetWorldPersistent ;

TargetWorld 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 TargetWorld directly.

See also
TargetWorld
Point, in world coordinates, that pulls Anchor.

Generated by PasDoc 0.16.0.