API Documentation for:
Show:

b2DistanceJoint Class

Extends b2Joint
Defined in: b2DistanceJoint:17
Module: Joints

A distance joint constrains two points on two bodies to remain at a fixed distance from each other. You can view this as a massless, rigid rod.

Constructor

b2DistanceJoint

(
  • distanceJointDef
)

Defined in b2DistanceJoint:17

Parameters:

  • distanceJointDef B2DistanceJointDef

Methods

getAnchorA

(
  • [out=b2Vec2]
)
B2Vec2 | Object public

Defined in getAnchorA:288

Parameters:

  • [out=b2Vec2] B2Vec2 | Object= optional

    reusable object

Returns:

B2Vec2 | Object:

out

getAnchorB

(
  • [out=b2Vec2]
)
B2Vec2 | Object public

Defined in getAnchorB:299

Parameters:

  • [out=b2Vec2] B2Vec2 | Object= optional

    reusable object

Returns:

B2Vec2 | Object:

out

getDampingRatio

() Float public

Defined in getDampingRatio:407

Get damping ratio.

Returns:

Float:

getFrequency

() Float public

Defined in getFrequency:383

Get frequency in Hz.

Returns:

Float:

getLength

() Float public

Defined in getLength:364

Returns:

Float:

getLocalAnchorA

(
  • [out=b2Vec2]
)
B2Vec2 | Object public

Defined in getLocalAnchorA:310

The local anchor point relative to bodyA's origin.

Parameters:

  • [out=b2Vec2] B2Vec2 | Object= optional

    reusable object

Returns:

B2Vec2 | Object:

out

getLocalAnchorB

(
  • [out=b2Vec2]
)
B2Vec2 | Object public

Defined in getLocalAnchorB:323

The local anchor point relative to bodyA's origin.

Parameters:

  • [out=b2Vec2] B2Vec2 | Object= optional

    reusable object

Returns:

B2Vec2 | Object:

out

getReactionForce

(
  • invDeltaTime
  • [out=b2Vec2]
)
B2Vec2 | Object public

Get the reaction force given the inverse time step. Unit is N.

Parameters:

  • invDeltaTime Float
  • [out=b2Vec2] B2Vec2 | Object= optional

    reusable object

Returns:

B2Vec2 | Object:

out

getReactionTorque

(
  • invDeltaTime
)
Float public

Get the reaction torque given the inverse time step. Unit is N*m. This is always zero for a distance joint.

Parameters:

  • invDeltaTime Float

Returns:

Float:

initVelocityConstraints

(
  • data
)
Void public

Parameters:

  • data B2SolverData

Returns:

Void:

setDampingRatio

() Float public

Defined in setDampingRatio:418

Set damping ratio.

Returns:

Float:

setFrequency

(
  • hz
)
Void public

Defined in setFrequency:394

Set frequency in Hz.

Parameters:

  • hz Float

Returns:

Void:

setLength

() Void public

Defined in setLength:373

Returns:

Void:

solvePositionConstraints

(
  • data
)
Void public

Parameters:

  • data B2SolverData

Returns:

Void:

solveVelocityConstraints

(
  • data
)
Void public

Parameters:

  • data B2SolverData

Returns:

Void:

Properties

m_bias

Float public

Defined in m_bias:183

Default: 0.0

m_dampingRatio

Float public

Defined in m_dampingRatio:157

m_frequencyHz

Float public

Defined in m_frequencyHz:149

m_gamma

Number public

Defined in m_gamma:174

Default: 0.0

m_impulse

Number public

Defined in m_impulse:165

Default: 0.0

m_indexA

Float public

Defined in m_indexA:192

Default: 0.0

m_indexB

Float public

Defined in m_indexB:201

Default: 0.0

m_invIA

Float public

Defined in m_invIA:226

Default: 0.0

m_invIB

Float public

Defined in m_invIB:234

Default: 0.0

m_invMassA

Float public

Defined in m_invMassA:210

Default: 0.0

m_invMassB

Float public

Defined in m_invMassB:218

Default: 0.0

m_lalcA

B2Vec2 public

Defined in m_lalcA:119

m_lalcB

B2Vec2 public

Defined in m_lalcB:127

m_length

Float public

Defined in m_length:141

m_localAnchorA

B2Vec2 public

Defined in m_localAnchorA:65

m_localAnchorB

B2Vec2 public

Defined in m_localAnchorB:72

m_localCenterA

B2Vec2 public

Defined in m_localCenterA:51

m_localCenterB

B2Vec2 public

Defined in m_localCenterB:58

m_mass

Float public

Defined in m_mass:242

Default: 0.0

m_qA

B2Rot public

Defined in m_qA:103

m_qB

B2Rot public

Defined in m_qB:111

m_rA

B2Vec2 public

Defined in m_rA:87

m_rB

B2Vec2 public

Defined in m_rB:95

m_u

B2Vec2 public

Defined in m_u:79