Aether.Physics2D  1.6
RopeJoint Class Reference

A rope joint enforces a maximum distance between two points on two bodies. It has no other effect. It can be used on ropes that are made up of several connected bodies, and if there is a need to support a heavy body. This joint is used for stabiliation of heavy objects on soft constraint joints. More...

Inheritance diagram for RopeJoint:
Collaboration diagram for RopeJoint:

Public Member Functions

 RopeJoint (Body bodyA, Body bodyB, Vector2 anchorA, Vector2 anchorB, bool useWorldCoordinates=false)
 Constructor for RopeJoint. More...
 
override Vector2 GetReactionForce (float invDt)
 Get the reaction force on body at the joint anchor in Newtons. More...
 
override float GetReactionTorque (float invDt)
 Get the reaction torque on the body at the joint anchor in N*m. More...
 
- Public Member Functions inherited from Joint
bool IsFixedType ()
 Return true if the joint is a fixed type. More...
 

Properties

Vector2 LocalAnchorA [get, set]
 The local anchor point on BodyA More...
 
Vector2 LocalAnchorB [get, set]
 The local anchor point on BodyB More...
 
override sealed Vector2 WorldAnchorA [get, set]
 
override sealed Vector2 WorldAnchorB [get, set]
 
float MaxLength [get, set]
 Get or set the maximum length of the rope. By default, it is the distance between the two anchor points. More...
 
LimitState State [get]
 Gets the state of the joint. More...
 
- Properties inherited from Joint
World World [get]
 
JointType JointType [get, protected set]
 Gets or sets the type of the joint. More...
 
Body BodyA [get, set]
 Get the first body attached to this joint. More...
 
Body BodyB [get, set]
 Get the second body attached to this joint. More...
 
abstract Vector2 WorldAnchorA [get, set]
 Get the anchor point on bodyA in world coordinates. On some joints, this value indicate the anchor point within the world. More...
 
abstract Vector2 WorldAnchorB [get, set]
 Get the anchor point on bodyB in world coordinates. On some joints, this value indicate the anchor point within the world. More...
 
bool CollideConnected [get, set]
 Set this flag to true if the attached bodies should collide. More...
 
float Breakpoint [get, set]
 The Breakpoint simply indicates the maximum Value the JointError can be before it breaks. The default value is float.MaxValue, which means it never breaks. More...
 

Additional Inherited Members

- Public Attributes inherited from Joint
bool Enabled = true
 Indicate if this join is enabled or not. Disabling a joint means it is still in the simulation, but inactive. More...
 
object Tag
 Set the user data pointer. More...
 
- Protected Member Functions inherited from Joint
 Joint (Body bodyA, Body bodyB)
 
 Joint (Body body)
 Constructor for fixed joint More...
 
void WakeBodies ()
 
- Events inherited from Joint
Action< Joint, float > Broke
 Fires when the joint is broken. More...
 

Detailed Description

A rope joint enforces a maximum distance between two points on two bodies. It has no other effect. It can be used on ropes that are made up of several connected bodies, and if there is a need to support a heavy body. This joint is used for stabiliation of heavy objects on soft constraint joints.

Warning: if you attempt to change the maximum length during the simulation you will get some non-physical behavior. Use the DistanceJoint instead if you want to dynamically control the length.

Constructor & Destructor Documentation

◆ RopeJoint()

RopeJoint ( Body  bodyA,
Body  bodyB,
Vector2  anchorA,
Vector2  anchorB,
bool  useWorldCoordinates = false 
)

Constructor for RopeJoint.

Parameters
bodyAThe first body
bodyBThe second body
anchorAThe anchor on the first body
anchorBThe anchor on the second body
useWorldCoordinatesSet to true if you are using world coordinates as anchors.

Member Function Documentation

◆ GetReactionForce()

override Vector2 GetReactionForce ( float  invDt)
virtual

Get the reaction force on body at the joint anchor in Newtons.

Parameters
invDtThe inverse delta time.

Implements Joint.

◆ GetReactionTorque()

override float GetReactionTorque ( float  invDt)
virtual

Get the reaction torque on the body at the joint anchor in N*m.

Parameters
invDtThe inverse delta time.

Implements Joint.

Property Documentation

◆ LocalAnchorA

Vector2 LocalAnchorA
getset

The local anchor point on BodyA

◆ LocalAnchorB

Vector2 LocalAnchorB
getset

The local anchor point on BodyB

◆ MaxLength

float MaxLength
getset

Get or set the maximum length of the rope. By default, it is the distance between the two anchor points.

◆ State

LimitState State
get

Gets the state of the joint.


The documentation for this class was generated from the following file: