com.badlogic.gdx.physics.box2d.joints
Class DistanceJointDef

java.lang.Object
  extended by com.badlogic.gdx.physics.box2d.JointDef
      extended by com.badlogic.gdx.physics.box2d.joints.DistanceJointDef

public class DistanceJointDef
extends JointDef

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.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.badlogic.gdx.physics.box2d.JointDef
JointDef.JointType
 
Field Summary
 float dampingRatio
          The damping ratio.
 float frequencyHz
          The mass-spring-damper frequency in Hertz.
 float length
          The natural length between the anchor points.
 Vector2 localAnchorA
          The local anchor point relative to body1's origin.
 Vector2 localAnchorB
          The local anchor point relative to body2's origin.
 
Fields inherited from class com.badlogic.gdx.physics.box2d.JointDef
bodyA, bodyB, collideConnected, type
 
Constructor Summary
DistanceJointDef()
           
 
Method Summary
 void initialize(Body bodyA, Body bodyB, Vector2 anchorA, Vector2 anchorB)
          Initialize the bodies, anchors, and length using the world anchors.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

localAnchorA

public final Vector2 localAnchorA
The local anchor point relative to body1's origin.


localAnchorB

public final Vector2 localAnchorB
The local anchor point relative to body2's origin.


length

public float length
The natural length between the anchor points.


frequencyHz

public float frequencyHz
The mass-spring-damper frequency in Hertz.


dampingRatio

public float dampingRatio
The damping ratio. 0 = no damping, 1 = critical damping.

Constructor Detail

DistanceJointDef

public DistanceJointDef()
Method Detail

initialize

public void initialize(Body bodyA,
                       Body bodyB,
                       Vector2 anchorA,
                       Vector2 anchorB)
Initialize the bodies, anchors, and length using the world anchors.



Copyright © 2013. All Rights Reserved.