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

Pulley joint definition. This requires two ground anchors, two dynamic body anchor points, and a pulley ratio. More...

#include <PulleyJoint.hpp>

Inheritance diagram for box2d::PulleyJointDef:
box2d::JointDef

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...
 
- Public Member Functions inherited from box2d::JointDef
 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...
 
- Public Attributes inherited from box2d::JointDef
const JointType type
 The joint type is set automatically for concrete joint types. More...
 
BodybodyA = nullptr
 The first attached body. More...
 
BodybodyB = 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...
 

Detailed Description

Pulley joint definition. This requires two ground anchors, two dynamic body anchor points, and a pulley ratio.

Constructor & Destructor Documentation

◆ PulleyJointDef()

box2d::PulleyJointDef::PulleyJointDef ( )
inlinenoexcept

Member Function Documentation

◆ Initialize()

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.

Member Data Documentation

◆ groundAnchorA

Length2D box2d::PulleyJointDef::groundAnchorA = Vec2{-1, 1} * Meter

The first ground anchor in world coordinates. This point never moves.

◆ groundAnchorB

Length2D box2d::PulleyJointDef::groundAnchorB = Vec2{1, 1} * Meter

The second ground anchor in world coordinates. This point never moves.

◆ lengthA

Length box2d::PulleyJointDef::lengthA = Length{0}

The a reference length for the segment attached to bodyA.

◆ lengthB

Length box2d::PulleyJointDef::lengthB = Length{0}

The a reference length for the segment attached to bodyB.

◆ localAnchorA

Length2D box2d::PulleyJointDef::localAnchorA = Vec2{-1, 0} * Meter

The local anchor point relative to bodyA's origin.

◆ localAnchorB

Length2D box2d::PulleyJointDef::localAnchorB = Vec2{1, 0} * Meter

The local anchor point relative to bodyB's origin.

◆ ratio

RealNum box2d::PulleyJointDef::ratio = 1

The pulley ratio, used to simulate a block-and-tackle.


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