Box2D  3.0.0
A Real-Time-Oriented 2-D Physics Engine
Public Member Functions | List of all members
box2d::PulleyJoint Class Reference

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. More...

#include <PulleyJoint.hpp>

Inheritance diagram for box2d::PulleyJoint:
box2d::Joint

Public Member Functions

 PulleyJoint (const PulleyJointDef &data)
 
Length2D GetLocalAnchorA () const noexcept
 
Length2D GetLocalAnchorB () const noexcept
 
Length2D GetAnchorA () const override
 Get the anchor point on bodyA in world coordinates. More...
 
Length2D GetAnchorB () const override
 Get the anchor point on bodyB in world coordinates. More...
 
Force2D GetReactionForce (Frequency inv_dt) const override
 Get the reaction force on bodyB at the joint anchor in Newtons. More...
 
Torque GetReactionTorque (Frequency inv_dt) const override
 Get the reaction torque on bodyB in N*m. More...
 
Length2D GetGroundAnchorA () const noexcept
 Get the first ground anchor. More...
 
Length2D GetGroundAnchorB () const noexcept
 Get the second ground anchor. More...
 
Length GetLengthA () const noexcept
 Get the current length of the segment attached to bodyA. More...
 
Length GetLengthB () const noexcept
 Get the current length of the segment attached to bodyB. More...
 
RealNum GetRatio () const noexcept
 Get the pulley ratio. More...
 
void ShiftOrigin (const Length2D newOrigin) override
 Implement Joint::ShiftOrigin. More...
 
- Public Member Functions inherited from box2d::Joint
JointType GetType () const noexcept
 Get the type of the concrete joint. More...
 
BodyGetBodyA () noexcept
 Get the first body attached to this joint. More...
 
BodyGetBodyB () noexcept
 Get the second body attached to this joint. More...
 
const BodyGetBodyA () const noexcept
 Get the first body attached to this joint. More...
 
const BodyGetBodyB () const noexcept
 Get the second body attached to this joint. More...
 
void * GetUserData () const noexcept
 Get the user data pointer. More...
 
void SetUserData (void *data) noexcept
 Set the user data pointer. More...
 
bool GetCollideConnected () const noexcept
 Get collide connected. Note: modifying the collide connect flag won't work correctly because the flag is only checked when fixture AABBs begin to overlap. More...
 

Additional Inherited Members

- Public Types inherited from box2d::Joint
enum  LimitState { e_inactiveLimit, e_atLowerLimit, e_atUpperLimit, e_equalLimits }
 
using index_t = size_t
 
- Static Public Member Functions inherited from box2d::Joint
static bool IsOkay (const JointDef &def) noexcept
 
- Protected Member Functions inherited from box2d::Joint
 Joint (const JointDef &def)
 
virtual ~Joint () noexcept
 
void SetBodyA (Body *value) noexcept
 
void SetBodyB (Body *value) noexcept
 

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.

Constructor & Destructor Documentation

◆ PulleyJoint()

PulleyJoint::PulleyJoint ( const PulleyJointDef data)

Member Function Documentation

◆ GetAnchorA()

Length2D PulleyJoint::GetAnchorA ( ) const
overridevirtual

Get the anchor point on bodyA in world coordinates.

Implements box2d::Joint.

◆ GetAnchorB()

Length2D PulleyJoint::GetAnchorB ( ) const
overridevirtual

Get the anchor point on bodyB in world coordinates.

Implements box2d::Joint.

◆ GetGroundAnchorA()

Length2D box2d::PulleyJoint::GetGroundAnchorA ( ) const
inlinenoexcept

Get the first ground anchor.

◆ GetGroundAnchorB()

Length2D box2d::PulleyJoint::GetGroundAnchorB ( ) const
inlinenoexcept

Get the second ground anchor.

◆ GetLengthA()

Length box2d::PulleyJoint::GetLengthA ( ) const
inlinenoexcept

Get the current length of the segment attached to bodyA.

◆ GetLengthB()

Length box2d::PulleyJoint::GetLengthB ( ) const
inlinenoexcept

Get the current length of the segment attached to bodyB.

◆ GetLocalAnchorA()

Length2D box2d::PulleyJoint::GetLocalAnchorA ( ) const
inlinenoexcept

◆ GetLocalAnchorB()

Length2D box2d::PulleyJoint::GetLocalAnchorB ( ) const
inlinenoexcept

◆ GetRatio()

RealNum box2d::PulleyJoint::GetRatio ( ) const
inlinenoexcept

Get the pulley ratio.

◆ GetReactionForce()

Force2D PulleyJoint::GetReactionForce ( Frequency  inv_dt) const
overridevirtual

Get the reaction force on bodyB at the joint anchor in Newtons.

Implements box2d::Joint.

◆ GetReactionTorque()

Torque PulleyJoint::GetReactionTorque ( Frequency  inv_dt) const
overridevirtual

Get the reaction torque on bodyB in N*m.

Implements box2d::Joint.

◆ ShiftOrigin()

void PulleyJoint::ShiftOrigin ( const Length2D  newOrigin)
overridevirtual

Implement Joint::ShiftOrigin.

Reimplemented from box2d::Joint.


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