DistanceJoint Class Referenceabstract

Description

A joint that maintains an upper or lower (or both) bound on the distance between two bodies.

Inherits Joint.

Inherited by PhysXDistanceJoint.

Methods

 DistanceJoint (const DISTANCE_JOINT_DESC &desc)
 
virtual float getDistance () const =0
 Returns the current distance between the two joint bodies. More...
 
virtual float getMinDistance () const =0
 Returns the minimum distance the bodies are allowed to be at, they will get no closer. More...
 
virtual void setMinDistance (float value)=0
 Sets the minimum distance the bodies are allowed to be at, they will get no closer. More...
 
virtual float getMaxDistance () const =0
 Returns the maximum distance the bodies are allowed to be at, they will get no further. More...
 
virtual void setMaxDistance (float value)=0
 Sets the maximum distance the bodies are allowed to be at, they will get no further. More...
 
virtual float getTolerance () const =0
 Returns the error tolerance of the joint at which the joint becomes active. More...
 
virtual void setTolerance (float value)=0
 Sets the error tolerance of the joint at which the joint becomes active. More...
 
virtual Spring getSpring () const =0
 Returns a spring that controls how the joint responds when a limit is reached. More...
 
virtual void setSpring (const Spring &value)=0
 Sets a spring that controls how the joint responds when a limit is reached. More...
 
virtual void setFlag (Flag flag, bool enabled)=0
 Enables or disables a flag that controls joint behaviour. More...
 
virtual bool hasFlag (Flag flag) const =0
 Checks whether a certain joint flag is enabled. More...
 
- Methods inherited from Joint
RigidbodygetBody (JointBody body) const
 Returns one of the bodies managed by the joint. More...
 
void setBody (JointBody body, Rigidbody *value)
 Sets a body managed by the joint. More...
 
Vector3 getPosition (JointBody body) const
 Returns the position relative to the body, at which the body is anchored to the joint. More...
 
Quaternion getRotation (JointBody body) const
 Returns the rotation relative to the body, at which the body is anchored to the joint. More...
 
void setTransform (JointBody body, const Vector3 &position, const Quaternion &rotation)
 Sets the position and rotation relative to the body, at which the body is anchored to the joint. More...
 
float getBreakForce () const
 Returns the maximum force the joint can apply before breaking. More...
 
void setBreakForce (float force)
 Sets the maximum force the joint can apply before breaking. More...
 
float getBreakTorque () const
 Returns the maximum torque the joint can apply before breaking. More...
 
void setBreakTorque (float torque)
 Sets the maximum torque the joint can apply before breaking. More...
 
bool getEnableCollision () const
 Checks whether collisions between the two bodies managed by the joint are enabled. More...
 
void setEnableCollision (bool value)
 Sets whether collision between the two bodies managed by the joint are enabled. More...
 
void _setOwner (PhysicsOwnerType type, void *owner)
 Sets the object that owns this physics object, if any. More...
 
void * _getOwner (PhysicsOwnerType type) const
 Gets the object that owns this physics object, if any. More...
 

Static methods

static SPtr< DistanceJointcreate (const DISTANCE_JOINT_DESC &desc)
 Creates a new distance joint. More...
 

Public Types

enum  Flag { MinDistance = 0x1, MaxDistance = 0x2, Spring = 0x4 }
 Controls distance joint options. More...
 

Additional Inherited Members

- Fields inherited from Joint
Event< void()> onJointBreak
 Triggered when the joint's break force or torque is exceeded. More...
 

Method documentation

static SPtr<DistanceJoint> create ( const DISTANCE_JOINT_DESC desc)
static

Creates a new distance joint.

virtual float getDistance ( ) const
pure virtual

Returns the current distance between the two joint bodies.

Implemented in PhysXDistanceJoint.

virtual float getMaxDistance ( ) const
pure virtual

Returns the maximum distance the bodies are allowed to be at, they will get no further.

You must enable max distance flag in order for this limit to be applied.

Implemented in PhysXDistanceJoint.

virtual float getMinDistance ( ) const
pure virtual

Returns the minimum distance the bodies are allowed to be at, they will get no closer.

You must enable min distance flag in order for this limit to be applied.

Implemented in PhysXDistanceJoint.

virtual Spring getSpring ( ) const
pure virtual

Returns a spring that controls how the joint responds when a limit is reached.

You must enable the spring flag on the joint in order for this to be recognized.

See also
Spring

Implemented in PhysXDistanceJoint.

virtual float getTolerance ( ) const
pure virtual

Returns the error tolerance of the joint at which the joint becomes active.

This value slightly extends the lower and upper limit.

Implemented in PhysXDistanceJoint.

virtual bool hasFlag ( Flag  flag) const
pure virtual

Checks whether a certain joint flag is enabled.

Implemented in PhysXDistanceJoint.

virtual void setFlag ( Flag  flag,
bool  enabled 
)
pure virtual

Enables or disables a flag that controls joint behaviour.

Implemented in PhysXDistanceJoint.

virtual void setMaxDistance ( float  value)
pure virtual

Sets the maximum distance the bodies are allowed to be at, they will get no further.

You must enable max distance flag in order for this limit to be applied.

Implemented in PhysXDistanceJoint.

virtual void setMinDistance ( float  value)
pure virtual

Sets the minimum distance the bodies are allowed to be at, they will get no closer.

You must enable min distance flag in order for this limit to be applied.

Implemented in PhysXDistanceJoint.

virtual void setSpring ( const Spring value)
pure virtual

Sets a spring that controls how the joint responds when a limit is reached.

You must enable the spring flag on the joint in order for this to be recognized.

See also
Spring

Implemented in PhysXDistanceJoint.

virtual void setTolerance ( float  value)
pure virtual

Sets the error tolerance of the joint at which the joint becomes active.

This value slightly extends the lower and upper limit.

Implemented in PhysXDistanceJoint.

Member Enumeration Documentation

enum Flag
strong

Controls distance joint options.

Enumerator
MinDistance 

Enables minimum distance limit.

MaxDistance 

Enables maximum distance limit.

Spring 

Enables spring when maintaining limits.