|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jbox2d.dynamics.joints.Joint
org.jbox2d.dynamics.joints.GearJoint
public class GearJoint
A gear joint is used to connect two joints together. Either joint
can be a revolute or prismatic joint. You specify a gear ratio
to bind the motions together:
coordinate1 + ratio * coordinate2 = constant
The ratio can be negative or positive. If one joint is a revolute joint
and the other joint is a prismatic joint, then the ratio will have units
of length or units of 1/length.
Warning: The revolute and prismatic joints must be attached to
fixed bodies (which must be body1 on those joints).
Fields inherited from class org.jbox2d.dynamics.joints.Joint |
---|
m_body1, m_body2, m_collideConnected, m_islandFlag, m_next, m_node1, m_node2, m_prev, m_type, m_userData |
Constructor Summary | |
---|---|
GearJoint(GearJointDef def)
|
Method Summary | |
---|---|
Vec2 |
getAnchor1()
Get the anchor point on body1 in world coordinates. |
Vec2 |
getAnchor2()
Get the anchor point on body2 in world coordinates. |
float |
getRatio()
|
Vec2 |
getReactionForce()
Get the reaction force on body2 at the joint anchor. |
float |
getReactionTorque()
Get the reaction torque on body2. |
void |
initVelocityConstraints(TimeStep step)
|
boolean |
solvePositionConstraints()
This returns true if the position errors are within tolerance. |
void |
solveVelocityConstraints(TimeStep step)
|
Methods inherited from class org.jbox2d.dynamics.joints.Joint |
---|
create, destroy, destructor, getBody1, getBody2, getNext, getType, getUserData, initPositionConstraints |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public Body m_ground1
public Body m_ground2
public RevoluteJoint m_revolute1
public PrismaticJoint m_prismatic1
public RevoluteJoint m_revolute2
public PrismaticJoint m_prismatic2
public Vec2 m_groundAnchor1
public Vec2 m_groundAnchor2
public Vec2 m_localAnchor1
public Vec2 m_localAnchor2
public Jacobian m_J
public float m_constant
public float m_ratio
Constructor Detail |
---|
public GearJoint(GearJointDef def)
Method Detail |
---|
public void initVelocityConstraints(TimeStep step)
initVelocityConstraints
in class Joint
public void solveVelocityConstraints(TimeStep step)
solveVelocityConstraints
in class Joint
public boolean solvePositionConstraints()
Joint
solvePositionConstraints
in class Joint
public Vec2 getAnchor1()
Joint
getAnchor1
in class Joint
public Vec2 getAnchor2()
Joint
getAnchor2
in class Joint
public Vec2 getReactionForce()
Joint
getReactionForce
in class Joint
public float getReactionTorque()
Joint
getReactionTorque
in class Joint
public float getRatio()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |