Rope joint. More...
#include <RopeJoint.hpp>
Public Member Functions | |
RopeJoint (const RopeJointConf &data) | |
Initializing constructor. More... | |
void | Accept (JointVisitor &visitor) const override |
Accepts a visitor. More... | |
void | Accept (JointVisitor &visitor) override |
Accepts a visitor. More... | |
Length2 | GetAnchorA () const override |
Get the anchor point on body-A in world coordinates. More... | |
Length2 | GetAnchorB () const override |
Get the anchor point on body-B in world coordinates. More... | |
Momentum2 | GetLinearReaction () const override |
Get the linear reaction on body-B at the joint anchor. More... | |
AngularMomentum | GetAngularReaction () const override |
Get the angular reaction on body-B. More... | |
Length2 | GetLocalAnchorA () const |
The local anchor point relative to body A's origin. More... | |
Length2 | GetLocalAnchorB () const |
The local anchor point relative to body B's origin. More... | |
void | SetMaxLength (Length length) |
Sets the maximum length of the rope. More... | |
Length | GetMaxLength () const |
Gets the maximum length of the rope. More... | |
LimitState | GetLimitState () const |
Gets the limit state. More... | |
Public Member Functions inherited from playrho::d2::Joint | |
virtual | ~Joint () noexcept=default |
Body * | GetBodyA () const noexcept |
Gets the first body attached to this joint. More... | |
Body * | GetBodyB () const noexcept |
Gets 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 |
Gets collide connected. More... | |
virtual bool | ShiftOrigin (const Length2) |
Shifts the origin for any points stored in world coordinates. More... | |
Related Functions | |
(Note that these are not member functions.) | |
RopeJointConf | GetRopeJointConf (const RopeJoint &joint) noexcept |
Gets the definition data for the given joint. More... | |
Related Functions inherited from playrho::d2::Joint | |
bool | IsEnabled (const Joint &j) noexcept |
Short-cut function to determine if both bodies are enabled. More... | |
void | SetAwake (Joint &j) noexcept |
Wakes up the joined bodies. More... | |
JointCounter | GetWorldIndex (const Joint *joint) |
Gets the world index of the given joint. More... | |
JointType | GetType (const Joint &joint) noexcept |
Gets the type of the given joint. More... | |
Additional Inherited Members | |
Public Types inherited from playrho::d2::Joint | |
enum | LimitState { e_inactiveLimit, e_atLowerLimit, e_atUpperLimit, e_equalLimits } |
Limit state. More... | |
Static Public Member Functions inherited from playrho::d2::Joint | |
static bool | IsOkay (const JointConf &def) noexcept |
Is the given definition okay. More... | |
Protected Member Functions inherited from playrho::d2::Joint | |
Joint (const JointConf &def) | |
Initializing constructor. More... | |
Detailed Description
Rope joint.
A rope joint enforces a maximum distance between two points on two bodies. It has no other effect.
- Warning
- If you attempt to change the maximum length during the simulation you will get some non-physical behavior. A model that would allow you to dynamically modify the length would have some sponginess, so it was decided not to implement it that way. See
DistanceJoint
if you want to dynamically control length.
Definition at line 44 of file RopeJoint.hpp.
Constructor & Destructor Documentation
◆ RopeJoint()
playrho::d2::RopeJoint::RopeJoint | ( | const RopeJointConf & | data | ) |
Initializing constructor.
- Attention
- To create or use the joint within a world instance, call that world instance's create joint method instead of calling this constructor directly.
- See also
- World::CreateJoint
Definition at line 42 of file RopeJoint.cpp.
Member Function Documentation
◆ Accept() [1/2]
|
overridevirtual |
Accepts a visitor.
This is the Accept method definition of a "visitor design pattern" for for doing joint subclass specific types of processing for a constant joint.
Implements playrho::d2::Joint.
Definition at line 50 of file RopeJoint.cpp.
◆ Accept() [2/2]
|
overridevirtual |
Accepts a visitor.
This is the Accept method definition of a "visitor design pattern" for for doing joint subclass specific types of processing.
Implements playrho::d2::Joint.
Definition at line 55 of file RopeJoint.cpp.
◆ GetAnchorA()
|
overridevirtual |
Get the anchor point on body-A in world coordinates.
Implements playrho::d2::Joint.
Definition at line 209 of file RopeJoint.cpp.
◆ GetAnchorB()
|
overridevirtual |
Get the anchor point on body-B in world coordinates.
Implements playrho::d2::Joint.
Definition at line 214 of file RopeJoint.cpp.
◆ GetLinearReaction()
|
overridevirtual |
Get the linear reaction on body-B at the joint anchor.
Implements playrho::d2::Joint.
Definition at line 219 of file RopeJoint.cpp.
◆ GetAngularReaction()
|
overridevirtual |
Get the angular reaction on body-B.
Implements playrho::d2::Joint.
Definition at line 224 of file RopeJoint.cpp.
◆ GetLocalAnchorA()
|
inline |
The local anchor point relative to body A's origin.
Definition at line 64 of file RopeJoint.hpp.
◆ GetLocalAnchorB()
|
inline |
The local anchor point relative to body B's origin.
Definition at line 67 of file RopeJoint.hpp.
◆ SetMaxLength()
|
inline |
Sets the maximum length of the rope.
Definition at line 70 of file RopeJoint.hpp.
◆ GetMaxLength()
Length playrho::d2::RopeJoint::GetMaxLength | ( | ) | const |
Gets the maximum length of the rope.
Definition at line 229 of file RopeJoint.cpp.
◆ GetLimitState()
Joint::LimitState playrho::d2::RopeJoint::GetLimitState | ( | ) | const |
Gets the limit state.
Definition at line 234 of file RopeJoint.cpp.
Friends And Related Function Documentation
◆ GetRopeJointConf()
|
related |
Gets the definition data for the given joint.
Definition at line 29 of file RopeJointConf.cpp.
The documentation for this class was generated from the following files:
- Dynamics/Joints/RopeJoint.hpp
- Dynamics/Joints/RopeJoint.cpp
- Dynamics/Joints/RopeJointConf.hpp