Box2D
3.0.0
A Real-Time-Oriented 2-D Physics Engine
|
Pulley joint definition. This requires two ground anchors, two dynamic body anchor points, and a pulley ratio. More...
#include <PulleyJoint.hpp>
Public Member Functions | |
PulleyJointDef () noexcept | |
void | Initialize (Body *bodyA, Body *bodyB, const Length2D groundAnchorA, const Length2D groundAnchorB, const Length2D anchorA, const Length2D anchorB, RealNum ratio) |
Initialize the bodies, anchors, lengths, max lengths, and ratio using the world anchors. More... | |
![]() | |
JointDef ()=delete | |
Deleted default constructor for abstract base class. More... | |
constexpr | JointDef (JointType t) noexcept |
constexpr | JointDef (JointType t, Body *bA, Body *bB, bool cc=false, void *u=nullptr) noexcept |
Public Attributes | |
Length2D | groundAnchorA = Vec2{-1, 1} * Meter |
The first ground anchor in world coordinates. This point never moves. More... | |
Length2D | groundAnchorB = Vec2{1, 1} * Meter |
The second ground anchor in world coordinates. This point never moves. More... | |
Length2D | localAnchorA = Vec2{-1, 0} * Meter |
The local anchor point relative to bodyA's origin. More... | |
Length2D | localAnchorB = Vec2{1, 0} * Meter |
The local anchor point relative to bodyB's origin. More... | |
Length | lengthA = Length{0} |
The a reference length for the segment attached to bodyA. More... | |
Length | lengthB = Length{0} |
The a reference length for the segment attached to bodyB. More... | |
RealNum | ratio = 1 |
The pulley ratio, used to simulate a block-and-tackle. More... | |
![]() | |
const JointType | type |
The joint type is set automatically for concrete joint types. More... | |
Body * | bodyA = nullptr |
The first attached body. More... | |
Body * | bodyB = nullptr |
The second attached body. More... | |
bool | collideConnected = false |
Set this flag to true if the attached bodies should collide. More... | |
void * | userData = nullptr |
Use this to attach application specific data to your joints. More... | |
Pulley joint definition. This requires two ground anchors, two dynamic body anchor points, and a pulley ratio.
|
inlinenoexcept |
void PulleyJointDef::Initialize | ( | Body * | bodyA, |
Body * | bodyB, | ||
const Length2D | groundAnchorA, | ||
const Length2D | groundAnchorB, | ||
const Length2D | anchorA, | ||
const Length2D | anchorB, | ||
RealNum | ratio | ||
) |
Initialize the bodies, anchors, lengths, max lengths, and ratio using the world anchors.
The first ground anchor in world coordinates. This point never moves.
The second ground anchor in world coordinates. This point never moves.
The a reference length for the segment attached to bodyA.
The a reference length for the segment attached to bodyB.
The local anchor point relative to bodyA's origin.
The local anchor point relative to bodyB's origin.
RealNum box2d::PulleyJointDef::ratio = 1 |
The pulley ratio, used to simulate a block-and-tackle.