Options
All
  • Public
  • Public/Protected
  • All
Menu

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

Constructors

constructor

Properties

bodyA

bodyA: b2Body

The first attached body.

bodyB

bodyB: b2Body

The second attached body.

collideConnected

collideConnected: boolean

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

dampingRatio

dampingRatio: number

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

frequencyHz

frequencyHz: number

The mass-spring-damper frequency in Hertz.

length

length: number

The natural length between the anchor points.

localAnchorA

localAnchorA: b2Vec2

The local anchor point relative to body1's origin.

localAnchorB

localAnchorB: b2Vec2

The local anchor point relative to body2's origin.

type

type: number

The joint type is set automatically for concrete joint types.

userData

userData: any

Use this to attach application specific data to your joints.

Methods

Initialize

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

    Parameters

    Returns void

Generated using TypeDoc