|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.badlogic.gdx.physics.box2d.JointDef com.badlogic.gdx.physics.box2d.joints.RevoluteJointDef
public class RevoluteJointDef
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: 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.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.badlogic.gdx.physics.box2d.JointDef |
---|
JointDef.JointType |
Field Summary | |
---|---|
boolean |
enableLimit
A flag to enable joint limits. |
boolean |
enableMotor
A flag to enable the joint motor. |
Vector2 |
localAnchorA
The local anchor point relative to body1's origin. |
Vector2 |
localAnchorB
The local anchor point relative to body2's origin. |
float |
lowerAngle
The lower angle for the joint limit (radians). |
float |
maxMotorTorque
The maximum motor torque used to achieve the desired motor speed. |
float |
motorSpeed
The desired motor speed. |
float |
referenceAngle
The body2 angle minus body1 angle in the reference state (radians). |
float |
upperAngle
The upper angle for the joint limit (radians). |
Fields inherited from class com.badlogic.gdx.physics.box2d.JointDef |
---|
bodyA, bodyB, collideConnected, type |
Constructor Summary | |
---|---|
RevoluteJointDef()
|
Method Summary | |
---|---|
void |
initialize(Body bodyA,
Body bodyB,
Vector2 anchor)
Initialize the bodies, anchors, and reference angle using a world anchor point. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public final Vector2 localAnchorA
public final Vector2 localAnchorB
public float referenceAngle
public boolean enableLimit
public float lowerAngle
public float upperAngle
public boolean enableMotor
public float motorSpeed
public float maxMotorTorque
Constructor Detail |
---|
public RevoluteJointDef()
Method Detail |
---|
public void initialize(Body bodyA, Body bodyB, Vector2 anchor)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |