Public Member Functions | |
void | Initialize (b2Body *body1, b2Body *body2, const b2Vec2 &anchor1, const b2Vec2 &anchor2) |
Initialize the bodies, anchors, and length using the world anchors. | |
Public Attributes | |
b2Vec2 | localAnchor1 |
The local anchor point relative to body1's origin. | |
b2Vec2 | localAnchor2 |
The local anchor point relative to body2's origin. | |
float32 | length |
The equilibrium length between the anchor points. |
This requires defining an anchor point on both bodies and the non-zero length of the distance joint. The definition uses local anchor points so that the initial configuration can violate the constraint slightly. This helps when saving and loading a game.
void b2DistanceJointDef::Initialize | ( | b2Body * | body1, | |
b2Body * | body2, | |||
const b2Vec2 & | anchor1, | |||
const b2Vec2 & | anchor2 | |||
) |
Initialize the bodies, anchors, and length using the world anchors.