|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jbox2d.dynamics.joints.JointDef
org.jbox2d.dynamics.joints.DistanceJointDef
public class DistanceJointDef
Distance joint definition. This requires defining an anchor point on both bodies and the non-zero length of the distance joint. The definition uses local anchor points so that the initial configuration can violate the constraint slightly. This helps when saving and loading a game.
| Field Summary | |
|---|---|
float |
dampingRatio
The damping ratio. |
float |
frequencyHz
The mass-spring-damper frequency in Hertz. |
float |
length
The equilibrium length between the anchor points. |
Vec2 |
localAnchorA
The local anchor point relative to body1's origin. |
Vec2 |
localAnchorB
The local anchor point relative to body2's origin. |
| Fields inherited from class org.jbox2d.dynamics.joints.JointDef |
|---|
bodyA, bodyB, collideConnected, type, userData |
| Constructor Summary | |
|---|---|
DistanceJointDef()
|
|
| Method Summary | |
|---|---|
void |
initialize(Body b1,
Body b2,
Vec2 anchor1,
Vec2 anchor2)
Initialize the bodies, anchors, and length using the world anchors. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public final Vec2 localAnchorA
public final Vec2 localAnchorB
public float length
public float frequencyHz
public float dampingRatio
| Constructor Detail |
|---|
public DistanceJointDef()
| Method Detail |
|---|
public void initialize(Body b1,
Body b2,
Vec2 anchor1,
Vec2 anchor2)
b1 - First bodyb2 - Second bodyanchor1 - World anchor on first bodyanchor2 - World anchor on second body
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||