Property | Type | Description | |
---|---|---|---|
dampingRatio | float | ||
frequency | float | ||
length | float | ||
localAnchorA | Vector2 | ||
localAnchorB | Vector2 |
Method | Description | |
---|---|---|
DistanceJoint ( Body bodyA, Body bodyB, Vector2 anchorA, Vector2 anchorB, bool useWorldCoordinates = false ) : System |
This requires defining an anchor point on both bodies and the non-zero length of the distance joint. If you don't supply a length, the local anchor points is used so that the initial configuration can violate the constraint slightly. This helps when saving and loading a game. Warning Do not use a zero or short length.
|
|
getReactionForce ( float invDt ) : Vector2 |
Get the reaction force given the inverse time step. Unit is N.
|
|
getReactionTorque ( float invDt ) : float |
Get the reaction torque given the inverse time step. Unit is N*m. This is always zero for a distance joint.
|
Method | Description | |
---|---|---|
DistanceJoint ( ) : System | ||
initVelocityConstraints ( SolverData &data ) : void | ||
solvePositionConstraints ( SolverData &data ) : bool | ||
solveVelocityConstraints ( SolverData &data ) : void |
public DistanceJoint ( Body bodyA, Body bodyB, Vector2 anchorA, Vector2 anchorB, bool useWorldCoordinates = false ) : System | ||
bodyA | Body | The first body |
bodyB | Body | The second body |
anchorA | Vector2 | The first body anchor |
anchorB | Vector2 | The second body anchor |
useWorldCoordinates | bool | Set to true if you are using world coordinates as anchors. |
return | System |
public getReactionForce ( float invDt ) : Vector2 | ||
invDt | float | |
return | Vector2 |
public getReactionTorque ( float invDt ) : float | ||
invDt | float | |
return | float |