playrho::d2::PulleyJointConf Struct Reference

Pulley joint definition. More...

#include <PulleyJointConf.hpp>

Public Types

using super = JointBuilder< PulleyJointConf >
 Super type. More...
 
- Public Types inherited from playrho::d2::JointBuilder< PulleyJointConf >
using value_type = PulleyJointConf
 Value type. More...
 
using reference = value_type &
 Reference type. More...
 

Public Member Functions

 PulleyJointConf () noexcept
 
 PulleyJointConf (NonNull< Body * > bodyA, NonNull< Body * > bodyB, const Length2 groundAnchorA, const Length2 groundAnchorB, const Length2 anchorA, const Length2 anchorB)
 Initialize the bodies, anchors, lengths, max lengths, and ratio using the world anchors. More...
 
PulleyJointConfUseRatio (Real v) noexcept
 Uses the given ratio value. More...
 
- Public Member Functions inherited from playrho::d2::JointBuilder< PulleyJointConf >
PLAYRHO_CONSTEXPR JointBuilder (JointType t) noexcept
 Initializing constructor. More...
 
PLAYRHO_CONSTEXPR reference UseBodyA (Body *b) noexcept
 Use value for body A setting. More...
 
PLAYRHO_CONSTEXPR reference UseBodyB (Body *b) noexcept
 Use value for body B setting. More...
 
PLAYRHO_CONSTEXPR reference UseCollideConnected (bool v) noexcept
 Use value for collide connected setting. More...
 
PLAYRHO_CONSTEXPR reference UseUserData (void *v) noexcept
 Use value for user data setting. More...
 
- Public Member Functions inherited from playrho::d2::JointConf
 JointConf ()=delete
 Deleted default constructor for abstract base class. More...
 
PLAYRHO_CONSTEXPR JointConf (JointType t) noexcept
 Initializing constructor. More...
 

Public Attributes

Length2 groundAnchorA = Length2{-1_m, +1_m}
 The first ground anchor in world coordinates. This point never moves. More...
 
Length2 groundAnchorB = Length2{+1_m, +1_m}
 The second ground anchor in world coordinates. This point never moves. More...
 
Length2 localAnchorA = Length2{-1_m, 0_m}
 The local anchor point relative to body A's origin. More...
 
Length2 localAnchorB = Length2{+1_m, 0_m}
 The local anchor point relative to body B's origin. More...
 
Length lengthA = 0_m
 The a reference length for the segment attached to body-A. More...
 
Length lengthB = 0_m
 The a reference length for the segment attached to body-B. More...
 
Real ratio = 1
 The pulley ratio, used to simulate a block-and-tackle. More...
 
- Public Attributes inherited from playrho::d2::JointConf
JointType type = JointType::Unknown
 Type of the joint is set automatically for concrete joint types. More...
 
BodybodyA = nullptr
 1st attached body. More...
 
BodybodyB = nullptr
 2nd attached body. More...
 
bool collideConnected = false
 Collide connected. More...
 
void * userData = nullptr
 User data. More...
 

Additional Inherited Members

Detailed Description

Pulley joint definition.

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

Examples
World.cpp.

Definition at line 36 of file PulleyJointConf.hpp.

Member Typedef Documentation

◆ super

Constructor & Destructor Documentation

◆ PulleyJointConf() [1/2]

playrho::d2::PulleyJointConf::PulleyJointConf ( )
inlinenoexcept

Definition at line 41 of file PulleyJointConf.hpp.

◆ PulleyJointConf() [2/2]

playrho::d2::PulleyJointConf::PulleyJointConf ( NonNull< Body * >  bodyA,
NonNull< Body * >  bodyB,
const Length2  groundAnchorA,
const Length2  groundAnchorB,
const Length2  anchorA,
const Length2  anchorB 
)

Initialize the bodies, anchors, lengths, max lengths, and ratio using the world anchors.

Definition at line 29 of file PulleyJointConf.cpp.

Member Function Documentation

◆ UseRatio()

PulleyJointConf & playrho::d2::PulleyJointConf::UseRatio ( Real  v)
inlinenoexcept

Uses the given ratio value.

Definition at line 76 of file PulleyJointConf.hpp.

Member Data Documentation

◆ groundAnchorA

Length2 playrho::d2::PulleyJointConf::groundAnchorA = Length2{-1_m, +1_m}

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

Definition at line 55 of file PulleyJointConf.hpp.

◆ groundAnchorB

Length2 playrho::d2::PulleyJointConf::groundAnchorB = Length2{+1_m, +1_m}

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

Definition at line 58 of file PulleyJointConf.hpp.

◆ localAnchorA

Length2 playrho::d2::PulleyJointConf::localAnchorA = Length2{-1_m, 0_m}

The local anchor point relative to body A's origin.

Definition at line 61 of file PulleyJointConf.hpp.

◆ localAnchorB

Length2 playrho::d2::PulleyJointConf::localAnchorB = Length2{+1_m, 0_m}

The local anchor point relative to body B's origin.

Definition at line 64 of file PulleyJointConf.hpp.

◆ lengthA

Length playrho::d2::PulleyJointConf::lengthA = 0_m

The a reference length for the segment attached to body-A.

Definition at line 67 of file PulleyJointConf.hpp.

◆ lengthB

Length playrho::d2::PulleyJointConf::lengthB = 0_m

The a reference length for the segment attached to body-B.

Definition at line 70 of file PulleyJointConf.hpp.

◆ ratio

Real playrho::d2::PulleyJointConf::ratio = 1

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

Definition at line 73 of file PulleyJointConf.hpp.


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