C# Class Project290.Physics.Dynamics.Joints.DistanceJoint

A distance joint rains two points on two bodies to remain at a fixed distance from each other. You can view this as a massless, rigid rod.
Inheritance: Joint
Show file Open project: scastle/Solitude Class Usage Examples

Public Properties

Property Type Description
LocalAnchorA Vector2
LocalAnchorB Vector2

Public Methods

Method Description
DistanceJoint ( Body bodyA, Body bodyB, Vector2 localAnchorA, Vector2 localAnchorB ) : 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 inv_dt ) : Vector2
GetReactionTorque ( float inv_dt ) : float

Private Methods

Method Description
InitVelocityConstraints ( TimeStep &step ) : void
SolvePositionConstraints ( ) : bool
SolveVelocityConstraints ( TimeStep &step ) : void

Method Details

DistanceJoint() public method

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.
public DistanceJoint ( Body bodyA, Body bodyB, Vector2 localAnchorA, Vector2 localAnchorB ) : System
bodyA Body The first body
bodyB Body The second body
localAnchorA Vector2 The first body anchor
localAnchorB Vector2 The second body anchor
return System

GetReactionForce() public method

public GetReactionForce ( float inv_dt ) : Vector2
inv_dt float
return Vector2

GetReactionTorque() public method

public GetReactionTorque ( float inv_dt ) : float
inv_dt float
return float

Property Details

LocalAnchorA public property

The local anchor point relative to bodyA's origin.
public Vector2 LocalAnchorA
return Vector2

LocalAnchorB public property

The local anchor point relative to bodyB's origin.
public Vector2 LocalAnchorB
return Vector2