API Documentation for:
Show:

b2PulleyJoint Class

Extends b2Joint
Defined in: b2PulleyJoint:19
Module: Joints

The pulley joint is connected to two bodies and two fixed ground points. The pulley supports a ratio such that: lengthA + ratio * lengthB <= constant Yes, the force transmitted is scaled by the ratio.

Warning: the pulley joint can get a bit squirrelly by itself. They often work better when combined with prismatic joints. You should also cover the the anchor points with static shapes to prevent one side from going to zero length.

Constructor

b2PulleyJoint

(
  • pulleyJointDef
)

Defined in b2PulleyJoint:19

Parameters:

  • pulleyJointDef B2PulleyJointDef

Methods

getAnchorB

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

Defined in getAnchorB:328

Parameters:

  • [out=b2Vec2] B2Vec2 | Object= optional

    reusable object

Returns:

B2Vec2 | Object:

out

getAnchorB

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

Defined in getAnchorB:339

Parameters:

  • [out=b2Vec2] B2Vec2 | Object= optional

    reusable object

Returns:

B2Vec2 | Object:

out

getCurrentLengthA

() Float public

Get the current length of the segment attached to bodyA.

Returns:

Float:

getCurrentLengthB

() Float public

Get the current length of the segment attached to bodyB.

Returns:

Float:

getGroundAnchorA

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

Parameters:

  • [out=b2Vec2] B2Vec2 | Object= optional

    reusable object

Returns:

B2Vec2 | Object:

out

getGroundAnchorB

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

Parameters:

  • [out=b2Vec2] B2Vec2 | Object= optional

    reusable object

Returns:

B2Vec2 | Object:

out

getLengthA

() Float public

Defined in getLengthA:372

Get the current length of the segment attached to bodyA.

Returns:

Float:

getLengthB

() Float public

Defined in getLengthB:383

Get the current length of the segment attached to bodyB.

Returns:

Float:

getRatio

() Float public

Defined in getRatio:420

Get the pulley ratio.

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:

shiftOrigin

(
  • newOrigin
)
Void public

Defined in shiftOrigin:459

Parameters:

  • newOrigin B2Vec2

Returns:

Void:

solvePositionConstraints

(
  • data
)
Void public

Parameters:

  • data B2SolverData

Returns:

Void:

solveVelocityConstraints

(
  • data
)
Void public

Parameters:

  • data B2SolverData

Returns:

Void:

Properties

m_constant

Float public

Defined in m_constant:208

m_groundAnchorA

B2Vec2 public

Defined in m_groundAnchorA:59

m_groundAnchorB

B2Vec2 public

Defined in m_groundAnchorB:67

m_impulse

Float public

Defined in m_impulse:216

Default: 0.0

m_indexA

Int public

Defined in m_indexA:225

Default: 0

m_indexB

Float public

Defined in m_indexB:270

Default: 0.0

m_indexB

Int public

Defined in m_indexB:234

Default: 0

m_indexB

Float public

Defined in m_indexB:261

Default: 0.0

m_indexB

Float public

Defined in m_indexB:252

Default: 0.0

m_indexB

Float public

Defined in m_indexB:243

Default: 0.0

m_lalcA

B2Rot public

Defined in m_lalcA:155

m_lalcB

B2Rot public

Defined in m_lalcB:163

m_lengthA

Float public

Defined in m_lengthA:182

m_lengthB

Float public

Defined in m_lengthB:190

m_localAnchorA

B2Vec2 public

Defined in m_localAnchorA:75

m_localAnchorB

B2Vec2 public

Defined in m_localAnchorB:83

m_localCenterA

B2Vec2 public

Defined in m_localCenterA:123

m_localCenterB

B2Vec2 public

Defined in m_localCenterB:131

m_mass

Float public

Defined in m_mass:279

Default: 0.0

m_qA

B2Rot public

Defined in m_qA:139

m_qB

B2Rot public

Defined in m_qB:147

m_rA

B2Vec2 public

Defined in m_rA:107

m_ratio

Float public

Defined in m_ratio:200

m_rB

B2Vec2 public

Defined in m_rB:115

m_uA

B2Vec2 public

Defined in m_uA:91

m_uB

B2Vec2 public

Defined in m_uB:99