API Documentation for:
Show:

b2DistanceJointDef Class

Extends b2Joint
Defined in: b2DistanceJointDef:17
Module: Joints

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.

Constructor

b2DistanceJointDef

()

Methods

initialize

(
  • bodyA
  • bodyB
  • anchor1
  • anchor2
)
Void public

Defined in initialize:142

Parameters:

  • bodyA B2Body
  • bodyB B2Body
  • anchor1 B2Vec2
  • anchor2 B2Vec2

Returns:

Void:

Properties

dampingRatio

Float public

Defined in dampingRatio:103

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

Default: 0.0

frequencyHz

Float public

Defined in frequencyHz:92

The mass-spring-damper frequency in Hertz. A value of 0 disables softness.

Default: 0.0

length

Float public

Defined in length:82

The natural length between the anchor points.

Default: 1.0

localAnchorA

B2Vec2 public

Defined in localAnchorA:54

The local anchor point relative to bodyA's origin.

localAnchorB

B2Vec2 public

Defined in localAnchorB:63

The local anchor point relative to bodyB's origin.

type

Int public

Defined in type:74

Default: b2Joint.e_distanceJoint