b2RevoluteJointDef Class
Revolute joint definition. 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:
- you might not know where the center of mass will be.
- if you add/remove shapes from a body and recompute the mass, the joints will be broken.
Constructor
b2RevoluteJointDef
()
Item Index
Methods
Methods
initialize
-
bodyA
-
bodyB
-
anchor
Parameters:
-
bodyA
B2Body -
bodyB
B2Body -
anchor
B2Vec2
Returns:
Properties
localAnchorA
B2Vec2
public
The local anchor point relative to bodyA's origin.
localAnchorB
B2Vec2
public
The local anchor point relative to bodyB's origin.
lowerAngle
Float
public
The lower angle for the joint limit (radians).
Default: 0.0
maxMotorTorque
Float
public
The maximum motor torque used to achieve the desired motor speed. Usually in N-m.
Default: 0.0
motorSpeed
Float
public
The desired motor speed. Usually in radians per second.
Default: 0.0
referenceAngle
Float
public
The bodyB angle minus bodyA angle in the reference state (radians).
Default: 0.0
type
Int
public
upperAngle
Float
public
The upper angle for the joint limit (radians).
Default: 0.0