Class b2DistanceJointDef

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.

Hierarchy

Index

Constructor methods

Properties

Methods

Constructor methods

constructor(): b2DistanceJointDef

Constructor.

Returns

b2DistanceJointDef

Properties

public bodyA: b2Body

The first attached body.

public bodyB: b2Body

The second attached body.

public collideConnected: boolean

Set this flag to true if the attached bodies should collide.

public dampingRatio: number

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

public frequencyHz: number

The mass-spring-damper frequency in Hertz.

public length: number

The natural length between the anchor points.

public localAnchorA: b2Vec2

The local anchor point relative to body1's origin.

public localAnchorB: b2Vec2

The local anchor point relative to body2's origin.

public type: number

The joint type is set automatically for concrete joint types.

public userData: any

Use this to attach application specific data to your joints.

Methods

public Initialize(bA: b2Body, bB: b2Body, anchorA: b2Vec2, anchorB: b2Vec2)

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

Parameters