API Documentation for:
Show:

b2RopeJoint Class

Extends b2Joint
Defined in: b2RopeJoint:19
Module: Joints

A rope joint enforces a maximum distance between two points on two bodies. It has no other effect.

Warning: if you attempt to change the maximum length during the simulation you will get some non-physical behavior. A model that would allow you to dynamically modify the length would have some sponginess, so I chose not to implement it that way. See b2DistanceJoint if you want to dynamically control length.

Constructor

b2RopeJoint

(
  • ropeJointDef
)

Defined in b2RopeJoint:19

Parameters:

  • ropeJointDef B2RopeJointDef

Example:

Limit: C = norm(pB - pA) - L u = (pB - pA) / norm(pB - pA) Cdot = dot(u, vB + cross(wB, rB) - vA - cross(wA, rA)) J = [-u -cross(rA, u) u cross(rB, u)] K = J invM JT = invMassA + invIA cross(rA, u)^2 + invMassB + invIB cross(rB, u)^2

Methods

getAnchorA

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

Defined in getAnchorA:327

Parameters:

  • [out=b2Vec2] B2Vec2 | Object= optional

    reusable object

Returns:

B2Vec2 | Object:

out

getAnchorB

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

Defined in getAnchorB:338

Parameters:

  • [out=b2Vec2] B2Vec2 | Object= optional

    reusable object

Returns:

B2Vec2 | Object:

out

getLimitState

() Int public

Defined in getLimitState:426

Returns:

Int:

getLocalAnchorA

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

Defined in getLocalAnchorA:377

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:390

The local anchor point relative to bodyB's origin.

Parameters:

  • [out=b2Vec2] B2Vec2 | Object= optional

    reusable object

Returns:

B2Vec2 | Object:

out

getMaxLength

() Float public

Defined in getMaxLength:415

Get the maximum length of the rope.

Returns:

Float:

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:

setMaxLength

(
  • length
)
Void public

Defined in setMaxLength:403

Set the maximum length of the rope.

Parameters:

  • length Float

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:181

Default: (0,0)

m_frequencyHz

Float public

Defined in m_frequencyHz:172

Default: {b2ropeDef.frequencyHz} 0.0

m_gamma

Float public

Defined in m_gamma:190

Default: (0,0)

m_impulse

Float public

Defined in m_impulse:199

Default: 0.0

m_indexA

Int public

Defined in m_indexA:244

Default: 0

m_indexB

Int public

Defined in m_indexB:253

Default: 0

m_invMassB

Int public

Defined in m_invMassB:271

Default: 0.0

m_invMassB

Int public

Defined in m_invMassB:280

Default: 0

m_lalcA

B2Vec2 public

Defined in m_lalcA:144

m_lalcB

B2Vec2 public

Defined in m_lalcB:151

m_length

Float public

Defined in m_length:217

Default: {b2ropeDef.length} 1.0

m_localAnchorA

B2Vec2 public

Defined in m_localAnchorA:66

Default: {b2ropeDef.localAnchorB} (0,0)

m_localAnchorB

B2Vec2 public

Defined in m_localAnchorB:75

Default: {b2ropeDef.localAnchorB} (0,0)

m_localCenterA

B2Vec2 public

Defined in m_localCenterA:84

m_localCenterB

B2Vec2 public

Defined in m_localCenterB:92

m_mass

Float protected

Defined in m_mass:226

Default: 0.0

m_maxLength

Float public

Defined in m_maxLength:163

Default: {b2ropeDef.maxLength} 0.0

m_maxLength

Float public

Defined in m_maxLength:235

Default: 0.0

m_qA

B2Rot public

Defined in m_qA:123

m_qA

B2Rot public

Defined in m_qA:130

m_qB

B2Rot public

Defined in m_qB:137

m_rA

B2Vec2 public

Defined in m_rA:108

m_rB

B2Vec2 public

Defined in m_rB:116

m_state

Int public

Defined in m_state:262

Default: b2Joint.e_inactiveLimit

m_state

Float protected

Defined in m_state:208

Default: b2Joint.e_inactiveLimit

m_u

B2Vec2 public

Defined in m_u:100