Prismatic Joint. More...

#include <PrismaticJoint.hpp>

Public Member Functions

 PrismaticJoint (const PrismaticJointConf &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 GetLocalAnchorA () const
 Gets the local anchor point relative to body A's origin. More...
 
Length2 GetLocalAnchorB () const
 Gets the local anchor point relative to body B's origin. More...
 
UnitVec GetLocalAxisA () const
 Gets local joint axis relative to body-A. More...
 
Angle GetReferenceAngle () const
 Gets the reference angle. More...
 
bool IsLimitEnabled () const noexcept
 Is the joint limit enabled? More...
 
void EnableLimit (bool flag) noexcept
 Enable/disable the joint limit. More...
 
Length GetLowerLimit () const noexcept
 Gets the lower joint limit. More...
 
Length GetUpperLimit () const noexcept
 Gets the upper joint limit. More...
 
void SetLimits (Length lower, Length upper) noexcept
 Sets the joint limits. More...
 
bool IsMotorEnabled () const noexcept
 Is the joint motor enabled? More...
 
void EnableMotor (bool flag) noexcept
 Enable/disable the joint motor. More...
 
void SetMotorSpeed (AngularVelocity speed) noexcept
 Sets the motor speed. More...
 
AngularVelocity GetMotorSpeed () const noexcept
 Gets the motor speed. More...
 
void SetMaxMotorForce (Force force) noexcept
 Sets the maximum motor force. More...
 
Force GetMaxMotorForce () const noexcept
 Gets the maximum motor force. More...
 
Momentum GetMotorImpulse () const noexcept
 Gets the current motor impulse. More...
 
LimitState GetLimitState () const noexcept
 Gets the current limit state. 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.)

Length GetJointTranslation (const PrismaticJoint &joint) noexcept
 Get the current joint translation. More...
 
LinearVelocity GetLinearVelocity (const PrismaticJoint &joint) noexcept
 Get the current joint translation speed. More...
 
Force GetMotorForce (const PrismaticJoint &joint, Frequency inv_dt) noexcept
 Gets the current motor force for the given joint, given the inverse time step. More...
 
PrismaticJointConf GetPrismaticJointConf (const PrismaticJoint &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

Prismatic Joint.

This joint provides one degree of freedom: translation along an axis fixed in body-A. Relative rotation is prevented.

Note
You can use a joint limit to restrict the range of motion and a joint motor to drive the motion or to model joint friction.
See also
https://en.wikipedia.org/wiki/Prismatic_joint

Definition at line 46 of file PrismaticJoint.hpp.

Constructor & Destructor Documentation

◆ PrismaticJoint()

playrho::d2::PrismaticJoint::PrismaticJoint ( const PrismaticJointConf 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 100 of file PrismaticJoint.cpp.

Member Function Documentation

◆ Accept() [1/2]

void playrho::d2::PrismaticJoint::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 117 of file PrismaticJoint.cpp.

◆ Accept() [2/2]

void playrho::d2::PrismaticJoint::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 122 of file PrismaticJoint.cpp.

◆ GetAnchorA()

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

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

Implements playrho::d2::Joint.

Definition at line 524 of file PrismaticJoint.cpp.

◆ GetAnchorB()

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

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

Implements playrho::d2::Joint.

Definition at line 529 of file PrismaticJoint.cpp.

◆ GetLinearReaction()

Momentum2 playrho::d2::PrismaticJoint::GetLinearReaction ( ) const
overridevirtual

Get the linear reaction on body-B at the joint anchor.

Implements playrho::d2::Joint.

Definition at line 534 of file PrismaticJoint.cpp.

◆ GetAngularReaction()

AngularMomentum playrho::d2::PrismaticJoint::GetAngularReaction ( ) const
overridevirtual

Get the angular reaction on body-B.

Implements playrho::d2::Joint.

Definition at line 541 of file PrismaticJoint.cpp.

◆ GetLocalAnchorA()

Length2 playrho::d2::PrismaticJoint::GetLocalAnchorA ( ) const
inline

Gets the local anchor point relative to body A's origin.

Definition at line 66 of file PrismaticJoint.hpp.

◆ GetLocalAnchorB()

Length2 playrho::d2::PrismaticJoint::GetLocalAnchorB ( ) const
inline

Gets the local anchor point relative to body B's origin.

Definition at line 69 of file PrismaticJoint.hpp.

◆ GetLocalAxisA()

UnitVec playrho::d2::PrismaticJoint::GetLocalAxisA ( ) const
inline

Gets local joint axis relative to body-A.

Definition at line 72 of file PrismaticJoint.hpp.

◆ GetReferenceAngle()

Angle playrho::d2::PrismaticJoint::GetReferenceAngle ( ) const
inline

Gets the reference angle.

Definition at line 75 of file PrismaticJoint.hpp.

◆ IsLimitEnabled()

bool playrho::d2::PrismaticJoint::IsLimitEnabled ( ) const
inlinenoexcept

Is the joint limit enabled?

Definition at line 162 of file PrismaticJoint.hpp.

◆ EnableLimit()

void playrho::d2::PrismaticJoint::EnableLimit ( bool  flag)
noexcept

Enable/disable the joint limit.

Definition at line 546 of file PrismaticJoint.cpp.

◆ GetLowerLimit()

Length playrho::d2::PrismaticJoint::GetLowerLimit ( ) const
inlinenoexcept

Gets the lower joint limit.

Definition at line 152 of file PrismaticJoint.hpp.

◆ GetUpperLimit()

Length playrho::d2::PrismaticJoint::GetUpperLimit ( ) const
inlinenoexcept

Gets the upper joint limit.

Definition at line 157 of file PrismaticJoint.hpp.

◆ SetLimits()

void playrho::d2::PrismaticJoint::SetLimits ( Length  lower,
Length  upper 
)
noexcept

Sets the joint limits.

Definition at line 558 of file PrismaticJoint.cpp.

◆ IsMotorEnabled()

bool playrho::d2::PrismaticJoint::IsMotorEnabled ( ) const
inlinenoexcept

Is the joint motor enabled?

Definition at line 167 of file PrismaticJoint.hpp.

◆ EnableMotor()

void playrho::d2::PrismaticJoint::EnableMotor ( bool  flag)
noexcept

Enable/disable the joint motor.

Definition at line 572 of file PrismaticJoint.cpp.

◆ SetMotorSpeed()

void playrho::d2::PrismaticJoint::SetMotorSpeed ( AngularVelocity  speed)
noexcept

Sets the motor speed.

Definition at line 584 of file PrismaticJoint.cpp.

◆ GetMotorSpeed()

AngularVelocity playrho::d2::PrismaticJoint::GetMotorSpeed ( ) const
inlinenoexcept

Gets the motor speed.

Definition at line 172 of file PrismaticJoint.hpp.

◆ SetMaxMotorForce()

void playrho::d2::PrismaticJoint::SetMaxMotorForce ( Force  force)
noexcept

Sets the maximum motor force.

Definition at line 596 of file PrismaticJoint.cpp.

◆ GetMaxMotorForce()

Force playrho::d2::PrismaticJoint::GetMaxMotorForce ( ) const
inlinenoexcept

Gets the maximum motor force.

Definition at line 108 of file PrismaticJoint.hpp.

◆ GetMotorImpulse()

Momentum playrho::d2::PrismaticJoint::GetMotorImpulse ( ) const
inlinenoexcept

Gets the current motor impulse.

Definition at line 111 of file PrismaticJoint.hpp.

◆ GetLimitState()

Joint::LimitState playrho::d2::PrismaticJoint::GetLimitState ( ) const
inlinenoexcept

Gets the current limit state.

Note
This will be e_inactiveLimit unless the joint limit has been enabled.

Definition at line 177 of file PrismaticJoint.hpp.

Friends And Related Function Documentation

◆ GetJointTranslation()

Length GetJointTranslation ( const PrismaticJoint joint)
related

Get the current joint translation.

Definition at line 608 of file PrismaticJoint.cpp.

◆ GetLinearVelocity()

LinearVelocity GetLinearVelocity ( const PrismaticJoint joint)
related

Get the current joint translation speed.

Definition at line 615 of file PrismaticJoint.cpp.

◆ GetMotorForce()

Force GetMotorForce ( const PrismaticJoint joint,
Frequency  inv_dt 
)
related

Gets the current motor force for the given joint, given the inverse time step.

Definition at line 192 of file PrismaticJoint.hpp.

◆ GetPrismaticJointConf()

PrismaticJointConf GetPrismaticJointConf ( const PrismaticJoint joint)
related

Gets the definition data for the given joint.

Definition at line 40 of file PrismaticJointConf.cpp.


The documentation for this class was generated from the following files: