org.jbox2d.dynamics.joints
Class DistanceJointDef
java.lang.Object
org.jbox2d.dynamics.joints.JointDef
org.jbox2d.dynamics.joints.DistanceJointDef
public class DistanceJointDef
- extends JointDef
Definition for a distance joint. A distance joint
keeps two points on two bodies at a constant distance
from each other.
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 |
localAnchor1
public Vec2 localAnchor1
- The local anchor point relative to body1's origin.
localAnchor2
public Vec2 localAnchor2
- The local anchor point relative to body2's origin.
length
public float length
- The equilibrium length between the anchor points.
frequencyHz
public float frequencyHz
dampingRatio
public float dampingRatio
DistanceJointDef
public DistanceJointDef()
initialize
public void initialize(Body b1,
Body b2,
Vec2 anchor1,
Vec2 anchor2)
- Initialize the bodies, anchors, and length using the world
anchors.
- Parameters:
b1
- First bodyb2
- Second bodyanchor1
- World anchor on first bodyanchor2
- World anchor on second body