#include <b2_pulley_joint.h>
Public Member Functions | |
void | Dump () override |
Dump joint to dmLog. More... | |
b2Vec2 | GetAnchorA () const override |
Get the anchor point on bodyA in world coordinates. More... | |
b2Vec2 | GetAnchorB () const override |
Get the anchor point on bodyB in world coordinates. More... | |
float | GetCurrentLengthA () const |
Get the current length of the segment attached to bodyA. More... | |
float | GetCurrentLengthB () const |
Get the current length of the segment attached to bodyB. More... | |
b2Vec2 | GetGroundAnchorA () const |
Get the first ground anchor. More... | |
b2Vec2 | GetGroundAnchorB () const |
Get the second ground anchor. More... | |
float | GetLengthA () const |
Get the current length of the segment attached to bodyA. More... | |
float | GetLengthB () const |
Get the current length of the segment attached to bodyB. More... | |
float | GetRatio () const |
Get the pulley ratio. More... | |
b2Vec2 | GetReactionForce (float inv_dt) const override |
Get the reaction force on bodyB at the joint anchor in Newtons. More... | |
float | GetReactionTorque (float inv_dt) const override |
Get the reaction torque on bodyB in N*m. More... | |
void | ShiftOrigin (const b2Vec2 &newOrigin) override |
Implement b2Joint::ShiftOrigin. More... | |
![]() | |
virtual void | Draw (b2Draw *draw) const |
Debug draw this joint. More... | |
b2Body * | GetBodyA () |
Get the first body attached to this joint. More... | |
b2Body * | GetBodyB () |
Get the second body attached to this joint. More... | |
bool | GetCollideConnected () const |
b2Joint * | GetNext () |
Get the next joint the world joint list. More... | |
const b2Joint * | GetNext () const |
b2JointType | GetType () const |
Get the type of the concrete joint. More... | |
b2JointUserData & | GetUserData () |
Get the user data pointer. More... | |
bool | IsEnabled () const |
Short-cut function to determine if either body is enabled. More... | |
Protected Member Functions | |
b2PulleyJoint (const b2PulleyJointDef *data) | |
void | InitVelocityConstraints (const b2SolverData &data) override |
bool | SolvePositionConstraints (const b2SolverData &data) override |
void | SolveVelocityConstraints (const b2SolverData &data) override |
![]() | |
b2Joint (const b2JointDef *def) | |
virtual | ~b2Joint () |
Protected Attributes | |
float | m_constant |
b2Vec2 | m_groundAnchorA |
b2Vec2 | m_groundAnchorB |
float | m_impulse |
int32 | m_indexA |
int32 | m_indexB |
float | m_invIA |
float | m_invIB |
float | m_invMassA |
float | m_invMassB |
float | m_lengthA |
float | m_lengthB |
b2Vec2 | m_localAnchorA |
b2Vec2 | m_localAnchorB |
b2Vec2 | m_localCenterA |
b2Vec2 | m_localCenterB |
float | m_mass |
b2Vec2 | m_rA |
float | m_ratio |
b2Vec2 | m_rB |
b2Vec2 | m_uA |
b2Vec2 | m_uB |
![]() | |
b2Body * | m_bodyA |
b2Body * | m_bodyB |
bool | m_collideConnected |
b2JointEdge | m_edgeA |
b2JointEdge | m_edgeB |
int32 | m_index |
bool | m_islandFlag |
b2Joint * | m_next |
b2Joint * | m_prev |
b2JointType | m_type |
b2JointUserData | m_userData |
Friends | |
class | b2Joint |
Additional Inherited Members | |
![]() | |
static b2Joint * | Create (const b2JointDef *def, b2BlockAllocator *allocator) |
static void | Destroy (b2Joint *joint, b2BlockAllocator *allocator) |
The pulley joint is connected to two bodies and two fixed ground points. The pulley supports a ratio such that: length1 + ratio * length2 <= 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.
Definition at line 84 of file b2_pulley_joint.h.
|
protected |
Definition at line 58 of file b2_pulley_joint.cpp.
|
overridevirtual |
Dump joint to dmLog.
Reimplemented from b2Joint.
Definition at line 329 of file b2_pulley_joint.cpp.
|
overridevirtual |
Get the anchor point on bodyA in world coordinates.
Implements b2Joint.
Definition at line 266 of file b2_pulley_joint.cpp.
|
overridevirtual |
Get the anchor point on bodyB in world coordinates.
Implements b2Joint.
Definition at line 271 of file b2_pulley_joint.cpp.
float b2PulleyJoint::GetCurrentLengthA | ( | ) | const |
Get the current length of the segment attached to bodyA.
Definition at line 313 of file b2_pulley_joint.cpp.
float b2PulleyJoint::GetCurrentLengthB | ( | ) | const |
Get the current length of the segment attached to bodyB.
Definition at line 321 of file b2_pulley_joint.cpp.
b2Vec2 b2PulleyJoint::GetGroundAnchorA | ( | ) | const |
Get the first ground anchor.
Definition at line 288 of file b2_pulley_joint.cpp.
b2Vec2 b2PulleyJoint::GetGroundAnchorB | ( | ) | const |
Get the second ground anchor.
Definition at line 293 of file b2_pulley_joint.cpp.
float b2PulleyJoint::GetLengthA | ( | ) | const |
Get the current length of the segment attached to bodyA.
Definition at line 298 of file b2_pulley_joint.cpp.
float b2PulleyJoint::GetLengthB | ( | ) | const |
Get the current length of the segment attached to bodyB.
Definition at line 303 of file b2_pulley_joint.cpp.
float b2PulleyJoint::GetRatio | ( | ) | const |
Get the pulley ratio.
Definition at line 308 of file b2_pulley_joint.cpp.
|
overridevirtual |
Get the reaction force on bodyB at the joint anchor in Newtons.
Implements b2Joint.
Definition at line 276 of file b2_pulley_joint.cpp.
|
overridevirtual |
Get the reaction torque on bodyB in N*m.
Implements b2Joint.
Definition at line 282 of file b2_pulley_joint.cpp.
|
overrideprotectedvirtual |
Implements b2Joint.
Definition at line 77 of file b2_pulley_joint.cpp.
Implement b2Joint::ShiftOrigin.
Reimplemented from b2Joint.
Definition at line 348 of file b2_pulley_joint.cpp.
|
overrideprotectedvirtual |
Implements b2Joint.
Definition at line 194 of file b2_pulley_joint.cpp.
|
overrideprotectedvirtual |
Implements b2Joint.
Definition at line 167 of file b2_pulley_joint.cpp.
|
friend |
Definition at line 122 of file b2_pulley_joint.h.
|
protected |
Definition at line 137 of file b2_pulley_joint.h.
|
protected |
Definition at line 129 of file b2_pulley_joint.h.
|
protected |
Definition at line 130 of file b2_pulley_joint.h.
|
protected |
Definition at line 139 of file b2_pulley_joint.h.
|
protected |
Definition at line 142 of file b2_pulley_joint.h.
|
protected |
Definition at line 143 of file b2_pulley_joint.h.
|
protected |
Definition at line 152 of file b2_pulley_joint.h.
|
protected |
Definition at line 153 of file b2_pulley_joint.h.
|
protected |
Definition at line 150 of file b2_pulley_joint.h.
|
protected |
Definition at line 151 of file b2_pulley_joint.h.
|
protected |
Definition at line 131 of file b2_pulley_joint.h.
|
protected |
Definition at line 132 of file b2_pulley_joint.h.
|
protected |
Definition at line 135 of file b2_pulley_joint.h.
|
protected |
Definition at line 136 of file b2_pulley_joint.h.
|
protected |
Definition at line 148 of file b2_pulley_joint.h.
|
protected |
Definition at line 149 of file b2_pulley_joint.h.
|
protected |
Definition at line 154 of file b2_pulley_joint.h.
|
protected |
Definition at line 146 of file b2_pulley_joint.h.
|
protected |
Definition at line 138 of file b2_pulley_joint.h.
|
protected |
Definition at line 147 of file b2_pulley_joint.h.
|
protected |
Definition at line 144 of file b2_pulley_joint.h.
|
protected |
Definition at line 145 of file b2_pulley_joint.h.