|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.badlogic.gdx.physics.box2d.Joint com.badlogic.gdx.physics.box2d.joints.RevoluteJoint
public class RevoluteJoint
A revolute joint constrains two bodies to share a common point while they are free to rotate about the point. The relative rotation about the shared point is the joint angle. You can limit the relative rotation with a joint limit that specifies a lower and upper angle. You can use a motor to drive the relative rotation about the shared point. A maximum motor torque is provided so that infinite forces are not generated.
Constructor Summary | |
---|---|
RevoluteJoint(World world,
long addr)
|
Method Summary | |
---|---|
void |
enableLimit(boolean flag)
Enable/disable the joint limit. |
void |
enableMotor(boolean flag)
Enable/disable the joint motor. |
float |
getJointAngle()
Get the current joint angle in radians. |
float |
getJointSpeed()
Get the current joint angle speed in radians per second. |
Vector2 |
getLocalAnchorA()
|
Vector2 |
getLocalAnchorB()
|
float |
getLowerLimit()
Get the lower joint limit in radians. |
float |
getMaxMotorTorque()
|
float |
getMotorSpeed()
Get the motor speed in radians per second. |
float |
getMotorTorque(float invDt)
Get the current motor torque, usually in N-m. |
float |
getReferenceAngle()
Get the current motor torque, usually in N-m. |
float |
getUpperLimit()
Get the upper joint limit in radians. |
boolean |
isLimitEnabled()
Is the joint limit enabled? |
boolean |
isMotorEnabled()
Is the joint motor enabled? |
void |
setLimits(float lower,
float upper)
Set the joint limits in radians. |
void |
setMaxMotorTorque(float torque)
Set the maximum motor torque, usually in N-m. |
void |
setMotorSpeed(float speed)
Set the motor speed in radians per second. |
Methods inherited from class com.badlogic.gdx.physics.box2d.Joint |
---|
getAnchorA, getAnchorB, getBodyA, getBodyB, getReactionForce, getReactionTorque, getType, getUserData, isActive, setUserData |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public RevoluteJoint(World world, long addr)
Method Detail |
---|
public float getJointAngle()
public float getJointSpeed()
public boolean isLimitEnabled()
public void enableLimit(boolean flag)
public float getLowerLimit()
public float getUpperLimit()
public void setLimits(float lower, float upper)
upper
- public boolean isMotorEnabled()
public void enableMotor(boolean flag)
public void setMotorSpeed(float speed)
public float getMotorSpeed()
public void setMaxMotorTorque(float torque)
public float getMotorTorque(float invDt)
public Vector2 getLocalAnchorA()
public Vector2 getLocalAnchorB()
public float getReferenceAngle()
public float getMaxMotorTorque()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |