Base joint class. More...
#include <Joint.hpp>
Public Types | |
enum | LimitState { e_inactiveLimit, e_atLowerLimit, e_atUpperLimit, e_equalLimits } |
Limit state. More... | |
Public Member Functions | |
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... | |
virtual Length2 | GetAnchorA () const =0 |
Get the anchor point on body-A in world coordinates. More... | |
virtual Length2 | GetAnchorB () const =0 |
Get the anchor point on body-B in world coordinates. More... | |
virtual Momentum2 | GetLinearReaction () const =0 |
Get the linear reaction on body-B at the joint anchor. More... | |
virtual AngularMomentum | GetAngularReaction () const =0 |
Get the angular reaction on body-B. More... | |
virtual void | Accept (JointVisitor &visitor) const =0 |
Accepts a visitor. More... | |
virtual void | Accept (JointVisitor &visitor)=0 |
Accepts a visitor. 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... | |
Static Public Member Functions | |
static bool | IsOkay (const JointConf &def) noexcept |
Is the given definition okay. More... | |
Protected Member Functions | |
Joint (const JointConf &def) | |
Initializing constructor. More... | |
Friends | |
class | JointAtty |
Related Functions | |
(Note that these are not member functions.) | |
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... | |
Detailed Description
Base joint class.
Joints are constraints that are used to constrain one or more bodies in various fashions. Some joints also feature limits and motors.
- See also
- World
- Examples
- World.cpp.
Member Enumeration Documentation
◆ LimitState
Limit state.
- Note
- Only used by joints that implement some notion of a limited range.
Constructor & Destructor Documentation
◆ ~Joint()
|
virtualdefaultnoexcept |
◆ Joint()
|
explicitprotected |
Member Function Documentation
◆ IsOkay()
|
staticnoexcept |
◆ GetBodyA()
|
inlinenoexcept |
◆ GetBodyB()
|
inlinenoexcept |
◆ GetAnchorA()
|
pure virtual |
Get the anchor point on body-A in world coordinates.
Implemented in playrho::d2::GearJoint, playrho::d2::RevoluteJoint, playrho::d2::PrismaticJoint, playrho::d2::PulleyJoint, playrho::d2::RopeJoint, playrho::d2::TargetJoint, playrho::d2::WheelJoint, playrho::d2::DistanceJoint, playrho::d2::FrictionJoint, playrho::d2::MotorJoint, and playrho::d2::WeldJoint.
◆ GetAnchorB()
|
pure virtual |
Get the anchor point on body-B in world coordinates.
Implemented in playrho::d2::GearJoint, playrho::d2::RevoluteJoint, playrho::d2::PrismaticJoint, playrho::d2::PulleyJoint, playrho::d2::RopeJoint, playrho::d2::TargetJoint, playrho::d2::WheelJoint, playrho::d2::DistanceJoint, playrho::d2::FrictionJoint, playrho::d2::MotorJoint, and playrho::d2::WeldJoint.
◆ GetLinearReaction()
|
pure virtual |
Get the linear reaction on body-B at the joint anchor.
Implemented in playrho::d2::RevoluteJoint, playrho::d2::GearJoint, playrho::d2::PrismaticJoint, playrho::d2::PulleyJoint, playrho::d2::RopeJoint, playrho::d2::TargetJoint, playrho::d2::WheelJoint, playrho::d2::DistanceJoint, playrho::d2::FrictionJoint, playrho::d2::MotorJoint, and playrho::d2::WeldJoint.
◆ GetAngularReaction()
|
pure virtual |
Get the angular reaction on body-B.
Implemented in playrho::d2::RevoluteJoint, playrho::d2::GearJoint, playrho::d2::PrismaticJoint, playrho::d2::PulleyJoint, playrho::d2::RopeJoint, playrho::d2::TargetJoint, playrho::d2::WheelJoint, playrho::d2::DistanceJoint, playrho::d2::FrictionJoint, playrho::d2::MotorJoint, and playrho::d2::WeldJoint.
◆ Accept() [1/2]
|
pure virtual |
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.
Implemented in playrho::d2::GearJoint, playrho::d2::RevoluteJoint, playrho::d2::PulleyJoint, playrho::d2::PrismaticJoint, playrho::d2::TargetJoint, playrho::d2::RopeJoint, playrho::d2::DistanceJoint, playrho::d2::WheelJoint, playrho::d2::FrictionJoint, playrho::d2::MotorJoint, and playrho::d2::WeldJoint.
◆ Accept() [2/2]
|
pure virtual |
Accepts a visitor.
This is the Accept method definition of a "visitor design pattern" for for doing joint subclass specific types of processing.
Implemented in playrho::d2::GearJoint, playrho::d2::RevoluteJoint, playrho::d2::PulleyJoint, playrho::d2::PrismaticJoint, playrho::d2::TargetJoint, playrho::d2::RopeJoint, playrho::d2::DistanceJoint, playrho::d2::WheelJoint, playrho::d2::FrictionJoint, playrho::d2::MotorJoint, and playrho::d2::WeldJoint.
◆ GetUserData()
|
inlinenoexcept |
◆ SetUserData()
|
inlinenoexcept |
◆ GetCollideConnected()
|
inlinenoexcept |
◆ ShiftOrigin()
|
inlinevirtual |
Shifts the origin for any points stored in world coordinates.
- Returns
true
if shift done,false
otherwise.
Reimplemented in playrho::d2::PulleyJoint, and playrho::d2::TargetJoint.
Friends And Related Function Documentation
◆ JointAtty
◆ IsEnabled()
|
related |
◆ SetAwake()
|
related |
◆ GetWorldIndex()
|
related |
◆ GetType()
The documentation for this class was generated from the following files:
- Dynamics/Joints/Joint.hpp
- Dynamics/Joints/Joint.cpp
- Dynamics/Joints/JointType.hpp