PackageBox2D.Dynamics.Joints
Classpublic class b2DistanceJointDef
Inheritanceb2DistanceJointDef Inheritance b2JointDef
Sourceb2DistanceJointDef.as

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.

Warning: Do not use a zero or short length.

See also

b2DistanceJoint


Public Properties
 PropertyDefined by
 InheritedbodyA : b2Body
The first attached body.
b2JointDef
 InheritedbodyB : b2Body
The second attached body.
b2JointDef
 InheritedcollideConnected : Boolean
Set this flag to true if the attached bodies should collide.
b2JointDef
  dampingRatio : Number
The damping ratio.
b2DistanceJointDef
  frequencyHz : Number
The mass-spring-damper frequency in Hertz.
b2DistanceJointDef
  length : Number
The natural length between the anchor points.
b2DistanceJointDef
  localAnchorA : b2Vec2
The local anchor point relative to body1's origin.
b2DistanceJointDef
  localAnchorB : b2Vec2
The local anchor point relative to body2's origin.
b2DistanceJointDef
 Inheritedtype : int
The joint type is set automatically for concrete joint types.
b2JointDef
 InheriteduserData : *
Use this to attach application specific data to your joints.
b2JointDef
Public Methods
 MethodDefined by
  
b2DistanceJointDef
  
Initialize(bA:b2Body, bB:b2Body, anchorA:b2Vec2, anchorB:b2Vec2):void
Initialize the bodies, anchors, and length using the world anchors.
b2DistanceJointDef
Property detail
dampingRatioproperty
public var dampingRatio:Number

The damping ratio. 0 = no damping, 1 = critical damping.

frequencyHzproperty 
public var frequencyHz:Number

The mass-spring-damper frequency in Hertz.

lengthproperty 
public var length:Number

The natural length between the anchor points.

localAnchorAproperty 
public var localAnchorA:b2Vec2

The local anchor point relative to body1's origin.

localAnchorBproperty 
public var localAnchorB:b2Vec2

The local anchor point relative to body2's origin.

Constructor detail
b2DistanceJointDef()constructor
public function b2DistanceJointDef()
Method detail
Initialize()method
public function Initialize(bA:b2Body, bB:b2Body, anchorA:b2Vec2, anchorB:b2Vec2):void

Initialize the bodies, anchors, and length using the world anchors.

Parameters
bA:b2Body
 
bB:b2Body
 
anchorA:b2Vec2
 
anchorB:b2Vec2