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< ForceGetMaxForce () const noexcept
 Gets the maximum friction force. More...
 
void SetMaxForce (NonNegative< Force > force)
 Sets the maximum friction force. More...
 
NonNegative< TorqueGetMaxTorque () 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
 
BodyGetBodyA () const noexcept
 Gets the first body attached to this joint. More...
 
BodyGetBodyB () 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...
 

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]

void playrho::d2::MotorJoint::Accept ( JointVisitor visitor) const
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.

See also
JointVisitor
https://en.wikipedia.org/wiki/Visitor_pattern

Implements playrho::d2::Joint.

Definition at line 57 of file MotorJoint.cpp.

◆ Accept() [2/2]

void playrho::d2::MotorJoint::Accept ( JointVisitor visitor)
overridevirtual

Accepts a visitor.

This is the Accept method definition of a "visitor design pattern" for for doing joint subclass specific types of processing.

See also
JointVisitor
https://en.wikipedia.org/wiki/Visitor_pattern

Implements playrho::d2::Joint.

Definition at line 62 of file MotorJoint.cpp.

◆ GetAnchorA()

Length2 playrho::d2::MotorJoint::GetAnchorA ( ) const
overridevirtual

Get the anchor point on body-A in world coordinates.

Implements playrho::d2::Joint.

Definition at line 227 of file MotorJoint.cpp.

◆ GetAnchorB()

Length2 playrho::d2::MotorJoint::GetAnchorB ( ) const
overridevirtual

Get the anchor point on body-B in world coordinates.

Implements playrho::d2::Joint.

Definition at line 232 of file MotorJoint.cpp.

◆ GetLinearReaction()

Momentum2 playrho::d2::MotorJoint::GetLinearReaction ( ) const
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()

AngularMomentum playrho::d2::MotorJoint::GetAngularReaction ( ) const
inlineoverridevirtual

Get the angular reaction on body-B.

Implements playrho::d2::Joint.

Definition at line 156 of file MotorJoint.hpp.

◆ GetLinearOffset()

Length2 playrho::d2::MotorJoint::GetLinearOffset ( ) const
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()

Angle playrho::d2::MotorJoint::GetAngularOffset ( ) const
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()

NonNegative< Force > playrho::d2::MotorJoint::GetMaxForce ( ) const
inlinenoexcept

Gets the maximum friction force.

Definition at line 121 of file MotorJoint.hpp.

◆ SetMaxForce()

void playrho::d2::MotorJoint::SetMaxForce ( NonNegative< Force force)
inline

Sets the maximum friction force.

Definition at line 126 of file MotorJoint.hpp.

◆ GetMaxTorque()

NonNegative< Torque > playrho::d2::MotorJoint::GetMaxTorque ( ) const
inlinenoexcept

Gets the maximum friction torque.

Definition at line 131 of file MotorJoint.hpp.

◆ SetMaxTorque()

void playrho::d2::MotorJoint::SetMaxTorque ( NonNegative< Torque torque)
inline

Sets the maximum friction torque.

Definition at line 136 of file MotorJoint.hpp.

◆ GetCorrectionFactor()

Real playrho::d2::MotorJoint::GetCorrectionFactor ( ) const
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()

Length2 playrho::d2::MotorJoint::GetLinearError ( ) const
inlinenoexcept

Gets the linear error.

Note
This is calculated by the InitVelocityConstraints method.

Definition at line 166 of file MotorJoint.hpp.

◆ GetAngularError()

Angle playrho::d2::MotorJoint::GetAngularError ( ) const
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()

MotorJointConf GetMotorJointConf ( const MotorJoint joint)
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: