Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
b2PulleyJoint Class Reference

#include <b2_pulley_joint.h>

Inheritance diagram for b2PulleyJoint:
Inheritance graph
[legend]

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...
 
- Public Member Functions inherited from b2Joint
virtual void Draw (b2Draw *draw) const
 Debug draw this joint. More...
 
b2BodyGetBodyA ()
 Get the first body attached to this joint. More...
 
b2BodyGetBodyB ()
 Get the second body attached to this joint. More...
 
bool GetCollideConnected () const
 
b2JointGetNext ()
 Get the next joint the world joint list. More...
 
const b2JointGetNext () const
 
b2JointType GetType () const
 Get the type of the concrete joint. More...
 
b2JointUserDataGetUserData ()
 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
 
- Protected Member Functions inherited from b2Joint
 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
 
- Protected Attributes inherited from b2Joint
b2Bodym_bodyA
 
b2Bodym_bodyB
 
bool m_collideConnected
 
b2JointEdge m_edgeA
 
b2JointEdge m_edgeB
 
int32 m_index
 
bool m_islandFlag
 
b2Jointm_next
 
b2Jointm_prev
 
b2JointType m_type
 
b2JointUserData m_userData
 

Friends

class b2Joint
 

Additional Inherited Members

- Static Protected Member Functions inherited from b2Joint
static b2JointCreate (const b2JointDef *def, b2BlockAllocator *allocator)
 
static void Destroy (b2Joint *joint, b2BlockAllocator *allocator)
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ b2PulleyJoint()

b2PulleyJoint::b2PulleyJoint ( const b2PulleyJointDef data)
protected

Definition at line 58 of file b2_pulley_joint.cpp.

Member Function Documentation

◆ Dump()

void b2PulleyJoint::Dump ( )
overridevirtual

Dump joint to dmLog.

Reimplemented from b2Joint.

Definition at line 329 of file b2_pulley_joint.cpp.

◆ GetAnchorA()

b2Vec2 b2PulleyJoint::GetAnchorA ( ) const
overridevirtual

Get the anchor point on bodyA in world coordinates.

Implements b2Joint.

Definition at line 266 of file b2_pulley_joint.cpp.

◆ GetAnchorB()

b2Vec2 b2PulleyJoint::GetAnchorB ( ) const
overridevirtual

Get the anchor point on bodyB in world coordinates.

Implements b2Joint.

Definition at line 271 of file b2_pulley_joint.cpp.

◆ GetCurrentLengthA()

float b2PulleyJoint::GetCurrentLengthA ( ) const

Get the current length of the segment attached to bodyA.

Definition at line 313 of file b2_pulley_joint.cpp.

◆ GetCurrentLengthB()

float b2PulleyJoint::GetCurrentLengthB ( ) const

Get the current length of the segment attached to bodyB.

Definition at line 321 of file b2_pulley_joint.cpp.

◆ GetGroundAnchorA()

b2Vec2 b2PulleyJoint::GetGroundAnchorA ( ) const

Get the first ground anchor.

Definition at line 288 of file b2_pulley_joint.cpp.

◆ GetGroundAnchorB()

b2Vec2 b2PulleyJoint::GetGroundAnchorB ( ) const

Get the second ground anchor.

Definition at line 293 of file b2_pulley_joint.cpp.

◆ GetLengthA()

float b2PulleyJoint::GetLengthA ( ) const

Get the current length of the segment attached to bodyA.

Definition at line 298 of file b2_pulley_joint.cpp.

◆ GetLengthB()

float b2PulleyJoint::GetLengthB ( ) const

Get the current length of the segment attached to bodyB.

Definition at line 303 of file b2_pulley_joint.cpp.

◆ GetRatio()

float b2PulleyJoint::GetRatio ( ) const

Get the pulley ratio.

Definition at line 308 of file b2_pulley_joint.cpp.

◆ GetReactionForce()

b2Vec2 b2PulleyJoint::GetReactionForce ( float  inv_dt) const
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.

◆ GetReactionTorque()

float b2PulleyJoint::GetReactionTorque ( float  inv_dt) const
overridevirtual

Get the reaction torque on bodyB in N*m.

Implements b2Joint.

Definition at line 282 of file b2_pulley_joint.cpp.

◆ InitVelocityConstraints()

void b2PulleyJoint::InitVelocityConstraints ( const b2SolverData data)
overrideprotectedvirtual

Implements b2Joint.

Definition at line 77 of file b2_pulley_joint.cpp.

◆ ShiftOrigin()

void b2PulleyJoint::ShiftOrigin ( const b2Vec2 newOrigin)
overridevirtual

Implement b2Joint::ShiftOrigin.

Reimplemented from b2Joint.

Definition at line 348 of file b2_pulley_joint.cpp.

◆ SolvePositionConstraints()

bool b2PulleyJoint::SolvePositionConstraints ( const b2SolverData data)
overrideprotectedvirtual

Implements b2Joint.

Definition at line 194 of file b2_pulley_joint.cpp.

◆ SolveVelocityConstraints()

void b2PulleyJoint::SolveVelocityConstraints ( const b2SolverData data)
overrideprotectedvirtual

Implements b2Joint.

Definition at line 167 of file b2_pulley_joint.cpp.

Friends And Related Function Documentation

◆ b2Joint

friend class b2Joint
friend

Definition at line 122 of file b2_pulley_joint.h.

Member Data Documentation

◆ m_constant

float b2PulleyJoint::m_constant
protected

Definition at line 137 of file b2_pulley_joint.h.

◆ m_groundAnchorA

b2Vec2 b2PulleyJoint::m_groundAnchorA
protected

Definition at line 129 of file b2_pulley_joint.h.

◆ m_groundAnchorB

b2Vec2 b2PulleyJoint::m_groundAnchorB
protected

Definition at line 130 of file b2_pulley_joint.h.

◆ m_impulse

float b2PulleyJoint::m_impulse
protected

Definition at line 139 of file b2_pulley_joint.h.

◆ m_indexA

int32 b2PulleyJoint::m_indexA
protected

Definition at line 142 of file b2_pulley_joint.h.

◆ m_indexB

int32 b2PulleyJoint::m_indexB
protected

Definition at line 143 of file b2_pulley_joint.h.

◆ m_invIA

float b2PulleyJoint::m_invIA
protected

Definition at line 152 of file b2_pulley_joint.h.

◆ m_invIB

float b2PulleyJoint::m_invIB
protected

Definition at line 153 of file b2_pulley_joint.h.

◆ m_invMassA

float b2PulleyJoint::m_invMassA
protected

Definition at line 150 of file b2_pulley_joint.h.

◆ m_invMassB

float b2PulleyJoint::m_invMassB
protected

Definition at line 151 of file b2_pulley_joint.h.

◆ m_lengthA

float b2PulleyJoint::m_lengthA
protected

Definition at line 131 of file b2_pulley_joint.h.

◆ m_lengthB

float b2PulleyJoint::m_lengthB
protected

Definition at line 132 of file b2_pulley_joint.h.

◆ m_localAnchorA

b2Vec2 b2PulleyJoint::m_localAnchorA
protected

Definition at line 135 of file b2_pulley_joint.h.

◆ m_localAnchorB

b2Vec2 b2PulleyJoint::m_localAnchorB
protected

Definition at line 136 of file b2_pulley_joint.h.

◆ m_localCenterA

b2Vec2 b2PulleyJoint::m_localCenterA
protected

Definition at line 148 of file b2_pulley_joint.h.

◆ m_localCenterB

b2Vec2 b2PulleyJoint::m_localCenterB
protected

Definition at line 149 of file b2_pulley_joint.h.

◆ m_mass

float b2PulleyJoint::m_mass
protected

Definition at line 154 of file b2_pulley_joint.h.

◆ m_rA

b2Vec2 b2PulleyJoint::m_rA
protected

Definition at line 146 of file b2_pulley_joint.h.

◆ m_ratio

float b2PulleyJoint::m_ratio
protected

Definition at line 138 of file b2_pulley_joint.h.

◆ m_rB

b2Vec2 b2PulleyJoint::m_rB
protected

Definition at line 147 of file b2_pulley_joint.h.

◆ m_uA

b2Vec2 b2PulleyJoint::m_uA
protected

Definition at line 144 of file b2_pulley_joint.h.

◆ m_uB

b2Vec2 b2PulleyJoint::m_uB
protected

Definition at line 145 of file b2_pulley_joint.h.


The documentation for this class was generated from the following files:


mvsim
Author(s):
autogenerated on Tue Jul 4 2023 03:08:22