| Package | Box2D.Dynamics.Joints |
| Class | public class b2DistanceJointDef |
| Inheritance | b2DistanceJointDef b2JointDef |
| Source | b2DistanceJointDef.as |
Warning: Do not use a zero or short length.
See also
| Property | Defined by | ||
|---|---|---|---|
![]() | body1 : b2Body
The first attached body.
| b2JointDef | |
![]() | body2 : b2Body
The second attached body.
| b2JointDef | |
![]() | collideConnected : 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 | ||
![]() | type : int
The joint type is set automatically for concrete joint types.
| b2JointDef | |
![]() | userData : *
Use this to attach application specific data to your joints.
| b2JointDef | |
| Method | Defined by | ||
|---|---|---|---|
| b2DistanceJointDef | |||
|
Initialize the bodies, anchors, and length using the world
anchors.
| b2DistanceJointDef | ||
| dampingRatio | property |
public var dampingRatio:NumberThe damping ratio. 0 = no damping, 1 = critical damping.
| frequencyHz | property |
public var frequencyHz:NumberThe response speed.
| length | property |
public var length:NumberThe equilibrium length between the anchor points.
| localAnchor1 | property |
public var localAnchor1:b2Vec2The local anchor point relative to body1's origin.
| localAnchor2 | property |
public var localAnchor2:b2Vec2The local anchor point relative to body2's origin.
| b2DistanceJointDef | () | constructor |
public function b2DistanceJointDef()
| Initialize | () | method |
public function Initialize(b1:b2Body, b2:b2Body, anchor1:b2Vec2, anchor2:b2Vec2):voidInitialize the bodies, anchors, and length using the world anchors.
Parametersb1:b2Body |
|
b2:b2Body |
|
anchor1:b2Vec2 |
|
anchor2:b2Vec2 |