Property | Type | Description | |
---|---|---|---|
LocalAnchorA | Vector2 | ||
LocalAnchorB | Vector2 |
Method | Description | |
---|---|---|
GetReactionForce ( float inv_dt ) : Vector2 | ||
GetReactionTorque ( float inv_dt ) : float | ||
RevoluteJoint ( Body bodyA, Body bodyB, Vector2 localAnchorA, Vector2 localAnchorB ) : System |
Initialize the bodies and local anchor. This requires defining an anchor point where the bodies are joined. The definition uses local anchor points so that the initial configuration can violate the constraint slightly. You also need to specify the initial relative angle for joint limits. This helps when saving and loading a game. The local anchor points are measured from the body's origin rather than the center of mass because: 1. you might not know where the center of mass will be. 2. if you add/remove shapes from a body and recompute the mass, the joints will be broken.
|
Method | Description | |
---|---|---|
InitVelocityConstraints ( TimeStep &step ) : void | ||
SolvePositionConstraints ( ) : bool | ||
SolveVelocityConstraints ( TimeStep &step ) : void |
public GetReactionForce ( float inv_dt ) : Vector2 | ||
inv_dt | float | |
return | Vector2 |
public GetReactionTorque ( float inv_dt ) : float | ||
inv_dt | float | |
return | float |
public RevoluteJoint ( 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 anchor. |
return | System |