Motor joint. More...
#include <MotorJoint.hpp>
Public Member Functions | |
MotorJoint (const MotorJointConf &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... | |
Length2 | GetLinearOffset () const noexcept |
Gets the target linear offset, in frame A. More... | |
void | SetLinearOffset (const Length2 linearOffset) |
Sets the target linear offset, in frame A. More... | |
Angle | GetAngularOffset () const noexcept |
Gets the target angular offset. More... | |
void | SetAngularOffset (Angle angularOffset) |
Sets the target angular offset. More... | |
NonNegative< Force > | GetMaxForce () const noexcept |
Gets the maximum friction force. More... | |
void | SetMaxForce (NonNegative< Force > force) |
Sets the maximum friction force. More... | |
NonNegative< Torque > | GetMaxTorque () const noexcept |
Gets the maximum friction torque. More... | |
void | SetMaxTorque (NonNegative< Torque > torque) |
Sets the maximum friction torque. More... | |
Real | GetCorrectionFactor () const noexcept |
Gets the position correction factor in the range [0,1]. More... | |
void | SetCorrectionFactor (Real factor) |
Sets the position correction factor in the range [0,1]. More... | |
Length2 | GetLinearError () const noexcept |
Gets the linear error. More... | |
Angle | GetAngularError () const noexcept |
Gets the angular error. 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.) | |
MotorJointConf | GetMotorJointConf (const MotorJoint &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
Motor joint.
A motor joint is used to control the relative motion between two bodies. A typical usage is to control the movement of a dynamic body with respect to the ground.
Definition at line 38 of file MotorJoint.hpp.
Constructor & Destructor Documentation
◆ MotorJoint()
playrho::d2::MotorJoint::MotorJoint | ( | const MotorJointConf & | 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 46 of file MotorJoint.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 57 of file MotorJoint.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 62 of file MotorJoint.cpp.
◆ GetAnchorA()
|
overridevirtual |
Get the anchor point on body-A in world coordinates.
Implements playrho::d2::Joint.
Definition at line 227 of file MotorJoint.cpp.
◆ GetAnchorB()
|
overridevirtual |
Get the anchor point on body-B in world coordinates.
Implements playrho::d2::Joint.
Definition at line 232 of file MotorJoint.cpp.
◆ GetLinearReaction()
|
inlineoverridevirtual |
Get the linear reaction on body-B at the joint anchor.
Implements playrho::d2::Joint.
Definition at line 151 of file MotorJoint.hpp.
◆ GetAngularReaction()
|
inlineoverridevirtual |
Get the angular reaction on body-B.
Implements playrho::d2::Joint.
Definition at line 156 of file MotorJoint.hpp.
◆ GetLinearOffset()
|
inlinenoexcept |
Gets the target linear offset, in frame A.
Definition at line 141 of file MotorJoint.hpp.
◆ SetLinearOffset()
void playrho::d2::MotorJoint::SetLinearOffset | ( | const Length2 | linearOffset | ) |
Sets the target linear offset, in frame A.
Definition at line 243 of file MotorJoint.cpp.
◆ GetAngularOffset()
|
inlinenoexcept |
Gets the target angular offset.
Definition at line 146 of file MotorJoint.hpp.
◆ SetAngularOffset()
void playrho::d2::MotorJoint::SetAngularOffset | ( | Angle | angularOffset | ) |
Sets the target angular offset.
Definition at line 253 of file MotorJoint.cpp.
◆ GetMaxForce()
|
inlinenoexcept |
Gets the maximum friction force.
Definition at line 121 of file MotorJoint.hpp.
◆ SetMaxForce()
|
inline |
Sets the maximum friction force.
Definition at line 126 of file MotorJoint.hpp.
◆ GetMaxTorque()
|
inlinenoexcept |
Gets the maximum friction torque.
Definition at line 131 of file MotorJoint.hpp.
◆ SetMaxTorque()
|
inline |
Sets the maximum friction torque.
Definition at line 136 of file MotorJoint.hpp.
◆ GetCorrectionFactor()
|
inlinenoexcept |
Gets the position correction factor in the range [0,1].
Definition at line 161 of file MotorJoint.hpp.
◆ SetCorrectionFactor()
void playrho::d2::MotorJoint::SetCorrectionFactor | ( | Real | factor | ) |
Sets the position correction factor in the range [0,1].
Definition at line 237 of file MotorJoint.cpp.
◆ GetLinearError()
|
inlinenoexcept |
Gets the linear error.
- Note
- This is calculated by the
InitVelocityConstraints
method.
Definition at line 166 of file MotorJoint.hpp.
◆ GetAngularError()
|
inlinenoexcept |
Gets the angular error.
- Note
- This is calculated by the
InitVelocityConstraints
method.
Definition at line 171 of file MotorJoint.hpp.
Friends And Related Function Documentation
◆ GetMotorJointConf()
|
related |
Gets the definition data for the given joint.
Definition at line 37 of file MotorJointConf.cpp.
The documentation for this class was generated from the following files:
- Dynamics/Joints/MotorJoint.hpp
- Dynamics/Joints/MotorJoint.cpp
- Dynamics/Joints/MotorJointConf.hpp