#include <TargetJoint.hpp>
Public Member Functions | |
TargetJoint (const TargetJointConf &def) | |
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... | |
bool | ShiftOrigin (const Length2 newOrigin) override |
Shifts the origin for any points stored in world coordinates. More... | |
Length2 | GetLocalAnchorB () const noexcept |
Gets the local anchor B. More... | |
void | SetTarget (const Length2 target) noexcept |
Sets the target point. More... | |
Length2 | GetTarget () const noexcept |
Gets the target point. More... | |
void | SetMaxForce (NonNegative< Force > force) noexcept |
Sets the maximum force. More... | |
NonNegative< Force > | GetMaxForce () const noexcept |
Gets the maximum force. More... | |
void | SetFrequency (NonNegative< Frequency > hz) noexcept |
Sets the frequency. More... | |
NonNegative< Frequency > | GetFrequency () const noexcept |
Gets the frequency. More... | |
void | SetDampingRatio (NonNegative< Real > ratio) noexcept |
Sets the damping ratio. More... | |
NonNegative< Real > | GetDampingRatio () const noexcept |
Gets the damping ratio. 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... | |
Static Public Member Functions | |
static bool | IsOkay (const TargetJointConf &def) noexcept |
Is the given definition okay. More... | |
Static Public Member Functions inherited from playrho::d2::Joint | |
static bool | IsOkay (const JointConf &def) noexcept |
Is the given definition okay. More... | |
Related Functions | |
(Note that these are not member functions.) | |
TargetJointConf | GetTargetJointConf (const TargetJoint &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... | |
Protected Member Functions inherited from playrho::d2::Joint | |
Joint (const JointConf &def) | |
Initializing constructor. More... | |
Detailed Description
Target Joint.
A target joint is used to make a point on a body track a specified world point. This a soft constraint with a maximum force. This allows the constraint to stretch and without applying huge forces.
- Note
- This structure is 120-bytes large (using a 4-byte Real on at least one 64-bit architecture/build).
- Examples
- World.cpp.
Definition at line 42 of file TargetJoint.hpp.
Constructor & Destructor Documentation
◆ TargetJoint()
playrho::d2::TargetJoint::TargetJoint | ( | const TargetJointConf & | def | ) |
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 53 of file TargetJoint.cpp.
Member Function Documentation
◆ IsOkay()
|
staticnoexcept |
Is the given definition okay.
Definition at line 40 of file TargetJoint.cpp.
◆ 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 67 of file TargetJoint.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 72 of file TargetJoint.cpp.
◆ GetAnchorA()
|
overridevirtual |
Get the anchor point on body-A in world coordinates.
Implements playrho::d2::Joint.
Definition at line 206 of file TargetJoint.cpp.
◆ GetAnchorB()
|
overridevirtual |
Get the anchor point on body-B in world coordinates.
Implements playrho::d2::Joint.
Definition at line 211 of file TargetJoint.cpp.
◆ GetLinearReaction()
|
overridevirtual |
Get the linear reaction on body-B at the joint anchor.
Implements playrho::d2::Joint.
Definition at line 216 of file TargetJoint.cpp.
◆ GetAngularReaction()
|
overridevirtual |
Get the angular reaction on body-B.
Implements playrho::d2::Joint.
Definition at line 221 of file TargetJoint.cpp.
◆ ShiftOrigin()
|
overridevirtual |
Shifts the origin for any points stored in world coordinates.
- Returns
true
if shift done,false
otherwise.
Reimplemented from playrho::d2::Joint.
Definition at line 226 of file TargetJoint.cpp.
◆ GetLocalAnchorB()
|
inlinenoexcept |
Gets the local anchor B.
Definition at line 115 of file TargetJoint.hpp.
◆ SetTarget()
|
noexcept |
Sets the target point.
Definition at line 77 of file TargetJoint.cpp.
◆ GetTarget()
|
inlinenoexcept |
Gets the target point.
Definition at line 120 of file TargetJoint.hpp.
◆ SetMaxForce()
|
inlinenoexcept |
Sets the maximum force.
Definition at line 125 of file TargetJoint.hpp.
◆ GetMaxForce()
|
inlinenoexcept |
Gets the maximum force.
Definition at line 130 of file TargetJoint.hpp.
◆ SetFrequency()
|
inlinenoexcept |
Sets the frequency.
Definition at line 135 of file TargetJoint.hpp.
◆ GetFrequency()
|
inlinenoexcept |
Gets the frequency.
Definition at line 140 of file TargetJoint.hpp.
◆ SetDampingRatio()
|
inlinenoexcept |
Sets the damping ratio.
Definition at line 145 of file TargetJoint.hpp.
◆ GetDampingRatio()
|
inlinenoexcept |
Gets the damping ratio.
Definition at line 150 of file TargetJoint.hpp.
Friends And Related Function Documentation
◆ GetTargetJointConf()
|
related |
Gets the definition data for the given joint.
Definition at line 28 of file TargetJointConf.cpp.
The documentation for this class was generated from the following files:
- Dynamics/Joints/TargetJoint.hpp
- Dynamics/Joints/TargetJoint.cpp
- Dynamics/Joints/TargetJointConf.hpp