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
 Inheritedbody1 : b2Body
The first attached body.
b2JointDef
 Inheritedbody2 : 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 response speed.
b2DistanceJointDef
  length : Number
The equilibrium length between the anchor points.
b2DistanceJointDef
  localAnchor1 : b2Vec2
The local anchor point relative to body1's origin.
b2DistanceJointDef
  localAnchor2 : 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(b1:b2Body, b2:b2Body, anchor1:b2Vec2, anchor2: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 response speed.

lengthproperty 
public var length:Number

The equilibrium length between the anchor points.

localAnchor1property 
public var localAnchor1:b2Vec2

The local anchor point relative to body1's origin.

localAnchor2property 
public var localAnchor2:b2Vec2

The local anchor point relative to body2's origin.

Constructor detail
b2DistanceJointDef()constructor
public function b2DistanceJointDef()
Method detail
Initialize()method
public function Initialize(b1:b2Body, b2:b2Body, anchor1:b2Vec2, anchor2:b2Vec2):void

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

Parameters
b1:b2Body
 
b2:b2Body
 
anchor1:b2Vec2
 
anchor2:b2Vec2