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

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

public class PulleyJointDef
extends JointDef

Pulley joint definition. This requires two ground anchors, two dynamic body anchor points, max lengths for each side, and a pulley ratio.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.badlogic.gdx.physics.box2d.JointDef
JointDef.JointType
 
Field Summary
 Vector2 groundAnchorA
          The first ground anchor in world coordinates.
 Vector2 groundAnchorB
          The second ground anchor in world coordinates.
 float lengthA
          The a reference length for the segment attached to bodyA.
 float lengthB
          The a reference length for the segment attached to bodyB.
 Vector2 localAnchorA
          The local anchor point relative to bodyA's origin.
 Vector2 localAnchorB
          The local anchor point relative to bodyB's origin.
 float ratio
          The pulley ratio, used to simulate a block-and-tackle.
 
Fields inherited from class com.badlogic.gdx.physics.box2d.JointDef
bodyA, bodyB, collideConnected, type
 
Constructor Summary
PulleyJointDef()
           
 
Method Summary
 void initialize(Body bodyA, Body bodyB, Vector2 groundAnchorA, Vector2 groundAnchorB, Vector2 anchorA, Vector2 anchorB, float ratio)
          Initialize the bodies, anchors, lengths, max lengths, and ratio using the world anchors.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

groundAnchorA

public final Vector2 groundAnchorA
The first ground anchor in world coordinates. This point never moves.


groundAnchorB

public final Vector2 groundAnchorB
The second ground anchor in world coordinates. This point never moves.


localAnchorA

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


localAnchorB

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


lengthA

public float lengthA
The a reference length for the segment attached to bodyA.


lengthB

public float lengthB
The a reference length for the segment attached to bodyB.


ratio

public float ratio
The pulley ratio, used to simulate a block-and-tackle.

Constructor Detail

PulleyJointDef

public PulleyJointDef()
Method Detail

initialize

public void initialize(Body bodyA,
                       Body bodyB,
                       Vector2 groundAnchorA,
                       Vector2 groundAnchorB,
                       Vector2 anchorA,
                       Vector2 anchorB,
                       float ratio)
Initialize the bodies, anchors, lengths, max lengths, and ratio using the world anchors.



Copyright © 2013. All Rights Reserved.