Friction joint. More...

#include <FrictionJoint.hpp>

Public Member Functions

 FrictionJoint (const FrictionJointConf &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
 The local anchor point relative to body A's origin. More...
 
Length2 GetLocalAnchorB () const
 The local anchor point relative to body B's origin. More...
 
void SetMaxForce (NonNegative< Force > force)
 Set the maximum friction force in N. More...
 
NonNegative< ForceGetMaxForce () const
 Get the maximum friction force in N. More...
 
void SetMaxTorque (NonNegative< Torque > torque)
 Set the maximum friction torque in N*m. More...
 
NonNegative< TorqueGetMaxTorque () const
 Get the maximum friction torque in N*m. 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.)

FrictionJointConf GetFrictionJointConf (const FrictionJoint &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

Friction joint.

This is used for top-down friction. It provides 2-D translational friction and angular friction.

Definition at line 39 of file FrictionJoint.hpp.

Constructor & Destructor Documentation

◆ FrictionJoint()

playrho::d2::FrictionJoint::FrictionJoint ( const FrictionJointConf 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 45 of file FrictionJoint.cpp.

Member Function Documentation

◆ Accept() [1/2]

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

◆ Accept() [2/2]

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

◆ GetAnchorA()

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

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

Implements playrho::d2::Joint.

Definition at line 219 of file FrictionJoint.cpp.

◆ GetAnchorB()

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

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

Implements playrho::d2::Joint.

Definition at line 224 of file FrictionJoint.cpp.

◆ GetLinearReaction()

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

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

Implements playrho::d2::Joint.

Definition at line 229 of file FrictionJoint.cpp.

◆ GetAngularReaction()

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

Get the angular reaction on body-B.

Implements playrho::d2::Joint.

Definition at line 234 of file FrictionJoint.cpp.

◆ GetLocalAnchorA()

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

The local anchor point relative to body A's origin.

Definition at line 59 of file FrictionJoint.hpp.

◆ GetLocalAnchorB()

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

The local anchor point relative to body B's origin.

Definition at line 62 of file FrictionJoint.hpp.

◆ SetMaxForce()

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

Set the maximum friction force in N.

Definition at line 100 of file FrictionJoint.hpp.

◆ GetMaxForce()

NonNegative< Force > playrho::d2::FrictionJoint::GetMaxForce ( ) const
inline

Get the maximum friction force in N.

Definition at line 105 of file FrictionJoint.hpp.

◆ SetMaxTorque()

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

Set the maximum friction torque in N*m.

Definition at line 110 of file FrictionJoint.hpp.

◆ GetMaxTorque()

NonNegative< Torque > playrho::d2::FrictionJoint::GetMaxTorque ( ) const
inline

Get the maximum friction torque in N*m.

Definition at line 115 of file FrictionJoint.hpp.

Friends And Related Function Documentation

◆ GetFrictionJointConf()

FrictionJointConf GetFrictionJointConf ( const FrictionJoint joint)
related

Gets the definition data for the given joint.

Definition at line 36 of file FrictionJointConf.cpp.


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