Distance joint definition. More...
#include <DistanceJointConf.hpp>
Public Types | |
using | super = JointBuilder< DistanceJointConf > |
Super type. More... | |
Public Types inherited from playrho::d2::JointBuilder< DistanceJointConf > | |
using | value_type = DistanceJointConf |
Value type. More... | |
using | reference = value_type & |
Reference type. More... | |
Public Member Functions | |
PLAYRHO_CONSTEXPR | DistanceJointConf () noexcept |
DistanceJointConf (const DistanceJointConf ©)=default | |
Copy constructor. More... | |
DistanceJointConf (NonNull< Body * > bodyA, NonNull< Body * > bodyB, Length2 anchorA=Length2{}, Length2 anchorB=Length2{}) noexcept | |
Initializing constructor. More... | |
PLAYRHO_CONSTEXPR DistanceJointConf & | UseLength (Length v) noexcept |
Uses the given length. More... | |
PLAYRHO_CONSTEXPR DistanceJointConf & | UseFrequency (NonNegative< Frequency > v) noexcept |
Uses the given frequency. More... | |
PLAYRHO_CONSTEXPR DistanceJointConf & | UseDampingRatio (Real v) noexcept |
Uses the given damping ratio. More... | |
Public Member Functions inherited from playrho::d2::JointBuilder< DistanceJointConf > | |
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 | localAnchorA = Length2{} |
Local anchor point relative to body A's origin. More... | |
Length2 | localAnchorB = Length2{} |
Local anchor point relative to body B's origin. More... | |
Length | length = 1_m |
Natural length between the anchor points. More... | |
NonNegative< Frequency > | frequency = NonNegative<Frequency>{0_Hz} |
Mass-spring-damper frequency. More... | |
Real | dampingRatio = 0 |
Damping ratio. More... | |
Public Attributes inherited from playrho::d2::JointConf | |
JointType | type = JointType::Unknown |
Type of the joint is set automatically for concrete joint types. More... | |
Body * | bodyA = nullptr |
1st attached body. More... | |
Body * | bodyB = nullptr |
2nd attached body. More... | |
bool | collideConnected = false |
Collide connected. More... | |
void * | userData = nullptr |
User data. More... | |
Additional Inherited Members | |
Related Functions inherited from playrho::d2::JointConf | |
void | Set (JointConf &def, const Joint &joint) noexcept |
Sets the joint definition data for the given joint. More... | |
Detailed Description
Distance joint definition.
This requires defining an anchor point on both bodies and the non-zero length of the distance joint. The definition uses local anchor points so that the initial configuration can violate the constraint slightly. This helps when
- Warning
- Do not use a zero or short length.
- Examples
- World.cpp.
Definition at line 41 of file DistanceJointConf.hpp.
Member Typedef Documentation
◆ super
Super type.
Definition at line 45 of file DistanceJointConf.hpp.
Constructor & Destructor Documentation
◆ DistanceJointConf() [1/3]
|
inlinenoexcept |
Definition at line 47 of file DistanceJointConf.hpp.
◆ DistanceJointConf() [2/3]
|
default |
Copy constructor.
◆ DistanceJointConf() [3/3]
|
noexcept |
Initializing constructor.
Initialize the bodies, anchors, and length using the world anchors.
Definition at line 29 of file DistanceJointConf.cpp.
Member Function Documentation
◆ UseLength()
|
inlinenoexcept |
Uses the given length.
Definition at line 85 of file DistanceJointConf.hpp.
◆ UseFrequency()
|
inlinenoexcept |
Uses the given frequency.
Definition at line 91 of file DistanceJointConf.hpp.
◆ UseDampingRatio()
|
inlinenoexcept |
Uses the given damping ratio.
Definition at line 97 of file DistanceJointConf.hpp.
Member Data Documentation
◆ localAnchorA
Local anchor point relative to body A's origin.
Definition at line 68 of file DistanceJointConf.hpp.
◆ localAnchorB
Local anchor point relative to body B's origin.
Definition at line 71 of file DistanceJointConf.hpp.
◆ length
Length playrho::d2::DistanceJointConf::length = 1_m |
Natural length between the anchor points.
Definition at line 74 of file DistanceJointConf.hpp.
◆ frequency
NonNegative<Frequency> playrho::d2::DistanceJointConf::frequency = NonNegative<Frequency>{0_Hz} |
Mass-spring-damper frequency.
- Note
- 0 disables softness.
Definition at line 78 of file DistanceJointConf.hpp.
◆ dampingRatio
Real playrho::d2::DistanceJointConf::dampingRatio = 0 |
Damping ratio.
- Note
- 0 = no damping, 1 = critical damping.
Definition at line 82 of file DistanceJointConf.hpp.
The documentation for this struct was generated from the following files:
- Dynamics/Joints/DistanceJointConf.hpp
- Dynamics/Joints/DistanceJointConf.cpp