Class DistanceJointDef
java.lang.Object
org.jbox2d.dynamics.joints.JointDef
org.jbox2d.dynamics.joints.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
FieldsModifier and TypeFieldDescriptionfloatThe damping ratio. 0 = no damping, 1 = critical damping.floatThe mass-spring-damper frequency in Hertz.floatThe equilibrium length between the anchor points.final Vec2The local anchor point relative to body1's origin.final Vec2The local anchor point relative to body2's origin. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidinitialize(Body b1, Body b2, Vec2 anchor1, Vec2 anchor2) Initialize the bodies, anchors, and length using the world anchors.
-
Field Details
-
localAnchorA
The local anchor point relative to body1's origin. -
localAnchorB
The local anchor point relative to body2's origin. -
length
public float lengthThe equilibrium length between the anchor points. -
frequencyHz
public float frequencyHzThe mass-spring-damper frequency in Hertz. -
dampingRatio
public float dampingRatioThe damping ratio. 0 = no damping, 1 = critical damping.
-
-
Constructor Details
-
DistanceJointDef
public DistanceJointDef()
-
-
Method Details
-
initialize
-