b2PulleyJoint Class
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
Parameters:
-
pulleyJointDef
B2PulleyJointDef
Item Index
Methods
- getAnchorB
- getAnchorB
- getCurrentLengthA
- getCurrentLengthB
- getGroundAnchorA
- getGroundAnchorB
- getLengthA
- getLengthB
- getRatio
- getReactionForce
- getReactionTorque
- initVelocityConstraints
- shiftOrigin
- solvePositionConstraints
- solveVelocityConstraints
- create static
- destroy static
- getAnchorA
- getAnchorB
- getBodyA
- getBodyB
- getCollideConnected
- getNext
- getReactionForce
- getReactionTorque
- getType
- getUserData
- initVelocityConstraints
- isActive
- setUserData
- shiftOrigin
- solveVelocityConstraints
- solveVelocityConstraints
Properties
- m_constant
- m_groundAnchorA
- m_groundAnchorB
- m_impulse
- m_indexA
- m_indexB
- m_indexB
- m_indexB
- m_indexB
- m_indexB
- m_lalcA
- m_lalcB
- m_lengthA
- m_lengthB
- m_localAnchorA
- m_localAnchorB
- m_localCenterA
- m_localCenterB
- m_mass
- m_qA
- m_qB
- m_rA
- m_ratio
- m_rB
- m_uA
- m_uB
- m_bodyA
- m_bodyB
- m_collideConnected
- m_edgeA
- m_edgeB
- m_index
- m_islandFlag
- m_next
- m_prev
- m_type
- m_userData
- ParentClass
Methods
getAnchorB
-
[out=b2Vec2]
Parameters:
-
[out=b2Vec2]
B2Vec2 | Object= optionalreusable object
Returns:
out
getAnchorB
-
[out=b2Vec2]
Parameters:
-
[out=b2Vec2]
B2Vec2 | Object= optionalreusable object
Returns:
out
getCurrentLengthA
()
Float
public
Get the current length of the segment attached to bodyA.
Returns:
getCurrentLengthB
()
Float
public
Get the current length of the segment attached to bodyB.
Returns:
getGroundAnchorA
-
[out=b2Vec2]
Parameters:
-
[out=b2Vec2]
B2Vec2 | Object= optionalreusable object
Returns:
out
getGroundAnchorB
-
[out=b2Vec2]
Parameters:
-
[out=b2Vec2]
B2Vec2 | Object= optionalreusable object
Returns:
out
getLengthA
()
Float
public
Get the current length of the segment attached to bodyA.
Returns:
getLengthB
()
Float
public
Get the current length of the segment attached to bodyB.
Returns:
getRatio
()
Float
public
Get the pulley ratio.
Returns:
getReactionForce
-
invDeltaTime
-
[out=b2Vec2]
Get the reaction force given the inverse time step. Unit is N.
Parameters:
-
invDeltaTime
Float -
[out=b2Vec2]
B2Vec2 | Object= optionalreusable object
Returns:
out
getReactionTorque
-
invDeltaTime
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:
initVelocityConstraints
-
data
Parameters:
-
data
B2SolverData
Returns:
shiftOrigin
-
newOrigin
Parameters:
-
newOrigin
B2Vec2
Returns:
solvePositionConstraints
-
data
Parameters:
-
data
B2SolverData
Returns:
solveVelocityConstraints
-
data
Parameters:
-
data
B2SolverData
Returns:
Properties
m_constant
Float
public
m_groundAnchorA
B2Vec2
public
m_groundAnchorB
B2Vec2
public
m_impulse
Float
public
Default: 0.0
m_indexA
Int
public
Default: 0
m_indexB
Float
public
Default: 0.0
m_indexB
Int
public
Default: 0
m_indexB
Float
public
Default: 0.0
m_indexB
Float
public
Default: 0.0
m_indexB
Float
public
Default: 0.0
m_lalcA
B2Rot
public
m_lalcB
B2Rot
public
m_lengthA
Float
public
m_lengthB
Float
public
m_localAnchorA
B2Vec2
public
m_localAnchorB
B2Vec2
public
m_localCenterA
B2Vec2
public
m_localCenterB
B2Vec2
public
m_mass
Float
public
Default: 0.0