Box2D 2.4.1
A 2D physics engine for games
|
#include <b2_revolute_joint.h>
Public Member Functions | |
void | Initialize (b2Body *bodyA, b2Body *bodyB, const b2Vec2 &anchor) |
Public Attributes | |
b2Vec2 | localAnchorA |
The local anchor point relative to bodyA's origin. | |
b2Vec2 | localAnchorB |
The local anchor point relative to bodyB's origin. | |
float | referenceAngle |
The bodyB angle minus bodyA angle in the reference state (radians). | |
bool | enableLimit |
A flag to enable joint limits. | |
float | lowerAngle |
The lower angle for the joint limit (radians). | |
float | upperAngle |
The upper angle for the joint limit (radians). | |
bool | enableMotor |
A flag to enable the joint motor. | |
float | motorSpeed |
The desired motor speed. Usually in radians per second. | |
float | maxMotorTorque |
Public Attributes inherited from b2JointDef | |
b2JointType | type |
The joint type is set automatically for concrete joint types. | |
b2JointUserData | userData |
Use this to attach application specific data to your joints. | |
b2Body * | bodyA |
The first attached body. | |
b2Body * | bodyB |
The second attached body. | |
bool | collideConnected |
Set this flag to true if the attached bodies should collide. | |
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:
Initialize the bodies, anchors, and reference angle using a world anchor point.
float b2RevoluteJointDef::maxMotorTorque |
The maximum motor torque used to achieve the desired motor speed. Usually in N-m.