PlayRho  2.0.0
An interactive physics engine & library.
playrho::d2::Joint Class Reference

A joint-like constraint on one or more bodies. More...

#include <playrho/d2/Joint.hpp>

Public Member Functions

 Joint () noexcept=default
 Default constructor. More...
 
 Joint (const Joint &other)
 Copy constructor. More...
 
 Joint (Joint &&other) noexcept
 Move constructor. More...
 
template<typename T , typename Tp = DecayedTypeIfNotSame<T, Joint>, typename = std::enable_if_t<std::is_constructible_v<Tp, T>>>
 Joint (T &&arg)
 Initializing constructor. More...
 
bool has_value () const noexcept
 Checks whether this instance contains a value.
 
Jointoperator= (const Joint &other)
 Copy assignment. More...
 
Jointoperator= (Joint &&other) noexcept
 Move assignment. More...
 
template<typename T , typename Tp = DecayedTypeIfNotSame<T, Joint>, typename = std::enable_if_t<std::is_constructible_v<Tp, T>>>
Jointoperator= (T &&arg)
 Move assignment support for any valid underlying configuration. More...
 
void swap (Joint &other) noexcept
 Swap function.
 

Friends

BodyID GetBodyA (const Joint &object) noexcept
 Gets the first body attached to this joint.
 
BodyID GetBodyB (const Joint &object) noexcept
 Gets the second body attached to this joint.
 
bool GetCollideConnected (const Joint &object) noexcept
 Gets collide connected. More...
 
TypeID GetType (const Joint &object) noexcept
 Gets the identifier of the type of data this can be casted to.
 
void InitVelocity (Joint &object, const Span< BodyConstraint > &bodies, const playrho::StepConf &step, const ConstraintSolverConf &conf)
 Initializes velocity constraint data based on the given solver data. More...
 
bool operator!= (const Joint &lhs, const Joint &rhs) noexcept
 Inequality operator for joint comparisons.
 
bool operator== (const Joint &lhs, const Joint &rhs) noexcept
 Equality operator for joint comparisons.
 
bool ShiftOrigin (Joint &object, const Length2 &value) noexcept
 Shifts the origin for any points stored in world coordinates. More...
 
bool SolvePosition (const Joint &object, const Span< BodyConstraint > &bodies, const ConstraintSolverConf &conf)
 Solves the position constraint. More...
 
bool SolveVelocity (Joint &object, const Span< BodyConstraint > &bodies, const playrho::StepConf &step)
 Solves velocity constraint. More...
 
template<typename T >
std::add_pointer_t< std::add_const_t< T > > TypeCast (const Joint *value) noexcept
 Converts the given joint into its current configuration value. More...
 
template<typename T >
std::add_pointer_t< T > TypeCast (Joint *value) noexcept
 Converts the given joint into its current configuration value. More...
 

Related Functions

(Note that these are not member functions.)

void EnableLimit (Joint &object, bool value)
 Enables the specified joint's limit property if it supports one. More...
 
void EnableMotor (Joint &object, bool value)
 Enables the specified joint's motor property if it supports one. More...
 
Angle GetAngularLowerLimit (const Joint &object)
 
RotInertia GetAngularMass (const Joint &object)
 Gets the given joint's angular mass. More...
 
AngularMomentum GetAngularMotorImpulse (const Joint &object)
 Gets the angular motor impulse of the joint if it has this property. More...
 
Angle GetAngularOffset (const Joint &object)
 Gets the angular offset property of the specified joint if its type has one. More...
 
AngularMomentum GetAngularReaction (const Joint &object)
 
Angle GetAngularUpperLimit (const Joint &object)
 Gets the upper joint limit. More...
 
Real GetDampingRatio (const Joint &object)
 Gets the given joint's damping ratio property if it has one. More...
 
DistanceJointConf GetDistanceJointConf (const Joint &joint)
 Gets the definition data for the given joint. More...
 
Frequency GetFrequency (const Joint &object)
 Gets the frequency of the joint if it has this property. More...
 
FrictionJointConf GetFrictionJointConf (const Joint &joint)
 Gets the definition data for the given joint. More...
 
GearJointConf GetGearJointConf (const Joint &joint)
 Gets the definition data for the given joint. More...
 
Length2 GetGroundAnchorA (const Joint &object)
 
Length2 GetGroundAnchorB (const Joint &object)
 
Length GetLength (const Joint &object)
 Gets the length property of the specified joint if its type has one. More...
 
LimitState GetLimitState (const Joint &object)
 
Length GetLinearLowerLimit (const Joint &object)
 
Momentum GetLinearMotorImpulse (const Joint &object)
 
Length2 GetLinearOffset (const Joint &object)
 Gets the linear offset property of the specified joint if its type has one. More...
 
Momentum2 GetLinearReaction (const Joint &object)
 
Length GetLinearUpperLimit (const Joint &object)
 
Length2 GetLocalAnchorA (const Joint &object)
 
Length2 GetLocalAnchorB (const Joint &object)
 
UnitVec GetLocalXAxisA (const Joint &object)
 Gets the given joint's local X axis A if its type supports that. More...
 
UnitVec GetLocalYAxisA (const Joint &object)
 Gets the given joint's local Y axis A if its type supports that. More...
 
Force GetMaxForce (const Joint &object)
 Gets the given joint's max force if its type supports that. More...
 
Force GetMaxMotorForce (const Joint &object)
 Gets the given joint's max motor force if its type supports that. More...
 
Torque GetMaxMotorTorque (const Joint &object)
 Gets the given joint's max motor torque if its type supports that. More...
 
Torque GetMaxTorque (const Joint &object)
 Gets the given joint's max torque if its type supports that. More...
 
MotorJointConf GetMotorJointConf (const Joint &joint)
 Gets the definition data for the given joint. More...
 
AngularVelocity GetMotorSpeed (const Joint &object)
 Gets the given joint's motor speed if its type supports that. More...
 
Torque GetMotorTorque (const Joint &joint, Frequency inv_dt)
 Gets the current motor torque for the given joint given the inverse time step. More...
 
PrismaticJointConf GetPrismaticJointConf (const Joint &joint)
 Gets the definition data for the given joint. More...
 
PulleyJointConf GetPulleyJointConf (const Joint &joint)
 Gets the definition data for the given joint. More...
 
Real GetRatio (const Joint &object)
 Gets the given joint's ratio property if it has one. More...
 
Angle GetReferenceAngle (const Joint &object)
 Gets the reference angle of the joint if it has one. More...
 
RevoluteJointConf GetRevoluteJointConf (const Joint &joint)
 Gets the definition data for the given joint. More...
 
RopeJointConf GetRopeJointConf (const Joint &joint)
 Gets the definition data for the given joint. More...
 
Length2 GetTarget (const Joint &object)
 Gets the given joint's target property if it has one. More...
 
TargetJointConf GetTargetJointConf (const Joint &joint)
 Gets the definition data for the given joint. More...
 
WeldJointConf GetWeldJointConf (const Joint &joint)
 Gets the definition data for the given joint. More...
 
WheelJointConf GetWheelJointConf (const Joint &joint)
 Gets the definition data for the given joint. More...
 
auto IsDestroyed (const Joint &object) noexcept -> bool
 Gets whether the given entity is in the is-destroyed state.
 
bool IsLimitEnabled (const Joint &object)
 Gets the specified joint's limit property if it supports one. More...
 
bool IsMotorEnabled (const Joint &object)
 Gets the specified joint's motor property value if it supports one. More...
 
void SetAngularLimits (Joint &object, Angle lower, Angle upper)
 Sets the joint limits. More...
 
void SetAngularOffset (Joint &object, Angle value)
 Sets the angular offset property of the specified joint if its type has one. More...
 
void SetFrequency (Joint &object, Frequency value)
 Sets the frequency of the joint if it has this property. More...
 
void SetLinearLimits (Joint &object, Length lower, Length upper)
 
void SetLinearOffset (Joint &object, const Length2 &value)
 Sets the linear offset property of the specified joint if its type has one. More...
 
void SetMaxMotorForce (Joint &object, Force value)
 Sets the given joint's max motor force if its type supports that. More...
 
void SetMaxMotorTorque (Joint &object, Torque value)
 Sets the given joint's max motor torque if its type supports that. More...
 
void SetMotorSpeed (Joint &object, AngularVelocity value)
 Sets the given joint's motor speed if its type supports that. More...
 
void SetTarget (Joint &object, const Length2 &value)
 Sets the given joint's target property if it has one. More...
 
template<typename T >
TypeCast (const Joint &value)
 Converts the given joint into its current configuration value. More...
 
template<typename T >
TypeCast (Joint &&value)
 Converts the given joint into its current configuration value. More...
 
template<typename T >
TypeCast (Joint &value)
 Converts the given joint into its current configuration value. More...
 

Detailed Description

A joint-like constraint on one or more bodies.

This is a concrete manifestation of the joint concept. Joints are constraints that are used to constrain one or more bodies in various fashions. Some joints also feature limits and motors.

Note
This class's design provides a "polymorphic value type" offering polymorphism without public inheritance. This is based on a technique that's described by Sean Parent in his January 2017 Norwegian Developers Conference London talk "Better Code: Runtime Polymorphism".
A joint can be constructed from or have its value set to any value whose type T has at least the following function definitions available for it:
  • bool operator==(const T& lhs, const T& rhs) noexcept;
  • BodyID GetBodyA(const T& object) noexcept;
  • BodyID GetBodyB(const T& object) noexcept;
  • bool GetCollideConnected(const T& object) noexcept;
  • bool ShiftOrigin(T& object, Length2 value) noexcept;
  • void InitVelocity(T& object, const Span<BodyConstraint>& bodies, const StepConf& step, const ConstraintSolverConf& conf);
  • bool SolveVelocity(T& object, const Span<BodyConstraint>& bodies, const StepConf& step);
  • bool SolvePosition(const T& object, const Span<BodyConstraint>& bodies, const ConstraintSolverConf& conf);
See also
Joint Classes, Physical Entities.
https://youtu.be/QGcVXgEVMJg
https://en.wikibooks.org/wiki/More_C%2B%2B_Idioms/Polymorphic_Value_Types

Constructor & Destructor Documentation

◆ Joint() [1/4]

playrho::d2::Joint::Joint ( )
defaultnoexcept

Default constructor.

Constructs a joint that contains no value.

Postcondition
has_value() returns false.
GetType(const Joint&) returns GetTypeID<void>().

Referenced by operator=().

◆ Joint() [2/4]

playrho::d2::Joint::Joint ( const Joint other)
inline

Copy constructor.

This constructor copies all the details of other.

◆ Joint() [3/4]

playrho::d2::Joint::Joint ( Joint &&  other)
inlinenoexcept

Move constructor.

This constructor moves all the details of other into *this and leaves other in the default constructed state.

◆ Joint() [4/4]

template<typename T , typename Tp = DecayedTypeIfNotSame<T, Joint>, typename = std::enable_if_t<std::is_constructible_v<Tp, T>>>
playrho::d2::Joint::Joint ( T &&  arg)
inlineexplicit

Initializing constructor.

Parameters
argValue to construct a joint instance for.
Note
See the class notes section for an explanation of requirements on a type T for its values to be valid candidates for this function.
This constructor is marked explicit to prevent implicit conversions and to provide preferable error messages from the compiler with less to-do when a type doesn't support one or more of the required functions. For instance, if there exists no function GetBodyA(const T&) for the type T, then clang issues the error: No matching function for call to 'GetBodyA'.
If this constructor was not marked explicit and nothing else is done, then GetBodyA(const Joint&) becomes eligible to satisfy that requirement (because of implicit conversion from T to Joint). This results in an exhaustive loop which is decidely less desirable than a compile time error.
If this constructor is not marked explicit and const rvalue reference taking versions of the required functions are deleted with definitions like BodyID GetBodyA(const Joint&&) noexcept = delete, then clang issues an error of: Call to deleted function 'GetBodyA'. The idea for these deleted functions came from the article Controlling overload resolution #1: Preventing implicit conversions. While this would be preferable to discovering the issue at runtime, that's not as preferable as the error clang generates when this constructor is marked explicit since this message points to the deleted function as the problem rather than directly to there being "no matching function".
While allowing implicit conversion would be preferable from a syntactic perspective and its similarity to the behavior of std::any, dealing with overload resolution of the required functions is less appealing than marking this constuctor explicit as explained above.
This constructor allows code like the following to work:
auto def = WheelJointConf{};
auto joint = Joint{def}; Joint{WheelJointConf{}};
void f(Joint j);
f(joint); f(Joint{def}); // but not f(def);
Joint() noexcept=default
Default constructor.
Postcondition
has_value() returns true.
Exceptions
std::bad_allocif there's a failure allocating storage.
See also
https://foonathan.net/2015/10/overload-resolution-1/

Member Function Documentation

◆ operator=() [1/3]

Joint& playrho::d2::Joint::operator= ( const Joint other)
inline

Copy assignment.

This operator copies all the details of other into *this.

◆ operator=() [2/3]

Joint& playrho::d2::Joint::operator= ( Joint &&  other)
inlinenoexcept

Move assignment.

This operator moves all the details of other into *this and leaves other in the default constructed state.

◆ operator=() [3/3]

template<typename T , typename Tp = DecayedTypeIfNotSame<T, Joint>, typename = std::enable_if_t<std::is_constructible_v<Tp, T>>>
Joint& playrho::d2::Joint::operator= ( T &&  arg)
inline

Move assignment support for any valid underlying configuration.

Note
See the class notes section for an explanation of requirements on a type T for its values to be valid candidates for this function.
Postcondition
has_value() returns true.

Friends And Related Function Documentation

◆ EnableLimit()

void EnableLimit ( Joint object,
bool  value 
)
related

Enables the specified joint's limit property if it supports one.

Exceptions
std::invalid_argumentIf not supported for the given joint's type.

◆ EnableMotor()

void EnableMotor ( Joint object,
bool  value 
)
related

Enables the specified joint's motor property if it supports one.

Exceptions
std::invalid_argumentIf not supported for the given joint's type.

◆ GetAngularLowerLimit()

Angle GetAngularLowerLimit ( const Joint object)
related

Gets the lower joint limit.

Exceptions
std::invalid_argumentIf not supported for the given joint's type.

◆ GetAngularMass()

RotInertia GetAngularMass ( const Joint object)
related

Gets the given joint's angular mass.

Exceptions
std::invalid_argumentIf not supported for the given joint's type.

◆ GetAngularMotorImpulse()

AngularMomentum GetAngularMotorImpulse ( const Joint object)
related

Gets the angular motor impulse of the joint if it has this property.

Exceptions
std::invalid_argumentIf not supported for the given joint's type.

◆ GetAngularOffset()

Angle GetAngularOffset ( const Joint object)
related

Gets the angular offset property of the specified joint if its type has one.

Exceptions
std::invalid_argumentIf not supported for the given joint's type.

◆ GetAngularReaction()

AngularMomentum GetAngularReaction ( const Joint object)
related

Get the angular reaction on body-B.

◆ GetAngularUpperLimit()

Angle GetAngularUpperLimit ( const Joint object)
related

Gets the upper joint limit.

Exceptions
std::invalid_argumentIf not supported for the given joint's type.

◆ GetCollideConnected

bool GetCollideConnected ( const Joint object)
friend

Gets collide connected.

Note
Modifying the collide connect flag won't work correctly because the flag is only checked when fixture AABBs begin to overlap.

◆ GetDampingRatio()

Real GetDampingRatio ( const Joint object)
related

Gets the given joint's damping ratio property if it has one.

Exceptions
std::invalid_argumentIf not supported for the given joint's type.

◆ GetDistanceJointConf()

DistanceJointConf GetDistanceJointConf ( const Joint joint)
related

Gets the definition data for the given joint.

Parameters
jointThe joint to get the configuration for.
Exceptions
std::bad_castIf the given joint's type is inappropriate for getting this value.

◆ GetFrequency()

Frequency GetFrequency ( const Joint object)
related

Gets the frequency of the joint if it has this property.

Exceptions
std::invalid_argumentIf not supported for the given joint's type.

◆ GetFrictionJointConf()

FrictionJointConf GetFrictionJointConf ( const Joint joint)
related

Gets the definition data for the given joint.

Exceptions
std::bad_castIf the given joint's type is inappropriate for getting this value.

◆ GetGearJointConf()

GearJointConf GetGearJointConf ( const Joint joint)
related

Gets the definition data for the given joint.

Exceptions
std::bad_castIf the given joint's type is inappropriate for getting this value.

◆ GetGroundAnchorA()

Length2 GetGroundAnchorA ( const Joint object)
related
Exceptions
std::invalid_argumentIf not supported for the given joint's type.

◆ GetGroundAnchorB()

Length2 GetGroundAnchorB ( const Joint object)
related
Exceptions
std::invalid_argumentIf not supported for the given joint's type.

◆ GetLength()

Length GetLength ( const Joint object)
related

Gets the length property of the specified joint if its type has one.

Exceptions
std::invalid_argumentIf not supported for the given joint's type.

◆ GetLimitState()

LimitState GetLimitState ( const Joint object)
related
Exceptions
std::invalid_argumentIf not supported for the given joint's type.

◆ GetLinearLowerLimit()

Length GetLinearLowerLimit ( const Joint object)
related

Gets the lower linear joint limit.

Exceptions
std::invalid_argumentIf not supported for the given joint's type.

◆ GetLinearMotorImpulse()

Momentum GetLinearMotorImpulse ( const Joint object)
related
Exceptions
std::invalid_argumentIf not supported for the given joint's type.

◆ GetLinearOffset()

Length2 GetLinearOffset ( const Joint object)
related

Gets the linear offset property of the specified joint if its type has one.

Exceptions
std::invalid_argumentIf not supported for the given joint's type.

◆ GetLinearReaction()

Momentum2 GetLinearReaction ( const Joint object)
related

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

◆ GetLinearUpperLimit()

Length GetLinearUpperLimit ( const Joint object)
related

Gets the upper linear joint limit.

Exceptions
std::invalid_argumentIf not supported for the given joint's type.

◆ GetLocalAnchorA()

Length2 GetLocalAnchorA ( const Joint object)
related

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

◆ GetLocalAnchorB()

Length2 GetLocalAnchorB ( const Joint object)
related

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

◆ GetLocalXAxisA()

UnitVec GetLocalXAxisA ( const Joint object)
related

Gets the given joint's local X axis A if its type supports that.

Exceptions
std::invalid_argumentIf not supported for the given joint's type.

◆ GetLocalYAxisA()

UnitVec GetLocalYAxisA ( const Joint object)
related

Gets the given joint's local Y axis A if its type supports that.

Exceptions
std::invalid_argumentIf not supported for the given joint's type.

◆ GetMaxForce()

Force GetMaxForce ( const Joint object)
related

Gets the given joint's max force if its type supports that.

Exceptions
std::invalid_argumentIf not supported for the given joint's type.

◆ GetMaxMotorForce()

Force GetMaxMotorForce ( const Joint object)
related

Gets the given joint's max motor force if its type supports that.

Exceptions
std::invalid_argumentIf not supported for the given joint's type.

◆ GetMaxMotorTorque()

Torque GetMaxMotorTorque ( const Joint object)
related

Gets the given joint's max motor torque if its type supports that.

Exceptions
std::invalid_argumentIf not supported for the given joint's type.

◆ GetMaxTorque()

Torque GetMaxTorque ( const Joint object)
related

Gets the given joint's max torque if its type supports that.

Exceptions
std::invalid_argumentIf not supported for the given joint's type.

◆ GetMotorJointConf()

MotorJointConf GetMotorJointConf ( const Joint joint)
related

Gets the definition data for the given joint.

Exceptions
std::bad_castIf the given joint's type is inappropriate for getting this value.

◆ GetMotorSpeed()

AngularVelocity GetMotorSpeed ( const Joint object)
related

Gets the given joint's motor speed if its type supports that.

Exceptions
std::invalid_argumentIf not supported for the given joint's type.

◆ GetMotorTorque()

Torque GetMotorTorque ( const Joint joint,
Frequency  inv_dt 
)
related

Gets the current motor torque for the given joint given the inverse time step.

Exceptions
std::invalid_argumentIf not supported for the given joint's type.

◆ GetPrismaticJointConf()

PrismaticJointConf GetPrismaticJointConf ( const Joint joint)
related

Gets the definition data for the given joint.

Exceptions
std::bad_castIf the given joint's type is inappropriate for getting this value.

◆ GetPulleyJointConf()

PulleyJointConf GetPulleyJointConf ( const Joint joint)
related

Gets the definition data for the given joint.

Exceptions
std::bad_castIf the given joint's type is inappropriate for getting this value.

◆ GetRatio()

Real GetRatio ( const Joint object)
related

Gets the given joint's ratio property if it has one.

Exceptions
std::invalid_argumentIf not supported for the given joint's type.

◆ GetReferenceAngle()

Angle GetReferenceAngle ( const Joint object)
related

Gets the reference angle of the joint if it has one.

Exceptions
std::invalid_argumentIf not supported for the given joint's type.

◆ GetRevoluteJointConf()

RevoluteJointConf GetRevoluteJointConf ( const Joint joint)
related

Gets the definition data for the given joint.

Exceptions
std::bad_castIf the given joint's type is inappropriate for getting this value.

◆ GetRopeJointConf()

RopeJointConf GetRopeJointConf ( const Joint joint)
related

Gets the definition data for the given joint.

Exceptions
std::bad_castIf the given joint's type is inappropriate for getting this value.

◆ GetTarget()

Length2 GetTarget ( const Joint object)
related

Gets the given joint's target property if it has one.

Exceptions
std::invalid_argumentIf not supported for the given joint's type.

◆ GetTargetJointConf()

TargetJointConf GetTargetJointConf ( const Joint joint)
related

Gets the definition data for the given joint.

Exceptions
std::bad_castIf the given joint's type is inappropriate for getting this value.

◆ GetWeldJointConf()

WeldJointConf GetWeldJointConf ( const Joint joint)
related

Gets the definition data for the given joint.

Exceptions
std::bad_castIf the given joint's type is inappropriate for getting this value.

◆ GetWheelJointConf()

WheelJointConf GetWheelJointConf ( const Joint joint)
related

Gets the definition data for the given joint.

Exceptions
std::bad_castIf the given joint's type is inappropriate for getting this value.

◆ InitVelocity

void InitVelocity ( Joint object,
const Span< BodyConstraint > &  bodies,
const playrho::StepConf step,
const ConstraintSolverConf conf 
)
friend

Initializes velocity constraint data based on the given solver data.

Note
This MUST be called prior to calling SolveVelocity.
See also
SolveVelocity.

◆ IsLimitEnabled()

bool IsLimitEnabled ( const Joint object)
related

Gets the specified joint's limit property if it supports one.

Exceptions
std::invalid_argumentIf not supported for the given joint's type.

◆ IsMotorEnabled()

bool IsMotorEnabled ( const Joint object)
related

Gets the specified joint's motor property value if it supports one.

Exceptions
std::invalid_argumentIf not supported for the given joint's type.

◆ SetAngularLimits()

void SetAngularLimits ( Joint object,
Angle  lower,
Angle  upper 
)
related

Sets the joint limits.

Exceptions
std::invalid_argumentIf not supported for the given joint's type.

◆ SetAngularOffset()

void SetAngularOffset ( Joint object,
Angle  value 
)
related

Sets the angular offset property of the specified joint if its type has one.

Exceptions
std::invalid_argumentIf not supported for the given joint's type.

◆ SetFrequency()

void SetFrequency ( Joint object,
Frequency  value 
)
related

Sets the frequency of the joint if it has this property.

Exceptions
std::invalid_argumentIf not supported for the given joint's type.

◆ SetLinearLimits()

void SetLinearLimits ( Joint object,
Length  lower,
Length  upper 
)
related

Sets the joint limits.

Exceptions
std::invalid_argumentIf not supported for the given joint's type.

◆ SetLinearOffset()

void SetLinearOffset ( Joint object,
const Length2 value 
)
related

Sets the linear offset property of the specified joint if its type has one.

Exceptions
std::invalid_argumentIf not supported for the given joint's type.

◆ SetMaxMotorForce()

void SetMaxMotorForce ( Joint object,
Force  value 
)
related

Sets the given joint's max motor force if its type supports that.

Exceptions
std::invalid_argumentIf not supported for the given joint's type.

◆ SetMaxMotorTorque()

void SetMaxMotorTorque ( Joint object,
Torque  value 
)
related

Sets the given joint's max motor torque if its type supports that.

Exceptions
std::invalid_argumentIf not supported for the given joint's type.

◆ SetMotorSpeed()

void SetMotorSpeed ( Joint object,
AngularVelocity  value 
)
related

Sets the given joint's motor speed if its type supports that.

Exceptions
std::invalid_argumentIf not supported for the given joint's type.

◆ SetTarget()

void SetTarget ( Joint object,
const Length2 value 
)
related

Sets the given joint's target property if it has one.

Exceptions
std::invalid_argumentIf not supported for the given joint's type.

◆ ShiftOrigin

bool ShiftOrigin ( Joint object,
const Length2 value 
)
friend

Shifts the origin for any points stored in world coordinates.

Returns
true if shift done, false otherwise.

◆ SolvePosition

bool SolvePosition ( const Joint object,
const Span< BodyConstraint > &  bodies,
const ConstraintSolverConf conf 
)
friend

Solves the position constraint.

Returns
true if the position errors are within tolerance.

◆ SolveVelocity

bool SolveVelocity ( Joint object,
const Span< BodyConstraint > &  bodies,
const playrho::StepConf step 
)
friend

Solves velocity constraint.

Precondition
InitVelocity has been called.
See also
InitVelocity.
Returns
true if velocity is "solved", false otherwise.

◆ TypeCast() [1/5]

template<typename T >
T TypeCast ( const Joint value)
related

Converts the given joint into its current configuration value.

Note
The design for this was based off the design of the C++17 std::any class and its associated std::any_cast function. The code for this is based off of the std::any implementation from the LLVM Project.
Exceptions
std::bad_castIf the given template parameter type isn't the type of this joint's configuration value.
See also
https://llvm.org/

◆ TypeCast [2/5]

template<typename T >
std::add_pointer_t<std::add_const_t<T> > TypeCast ( const Joint value)
friend

Converts the given joint into its current configuration value.

Note
The design for this was based off the design of the C++17 std::any class and its associated std::any_cast function. The code for this is based off of the std::any code from the LLVM Project.
See also
https://llvm.org/

◆ TypeCast() [3/5]

template<typename T >
T TypeCast ( Joint &&  value)
related

Converts the given joint into its current configuration value.

Note
The design for this was based off the design of the C++17 std::any class and its associated std::any_cast function. The code for this is based off of the std::any implementation from the LLVM Project.
See also
https://llvm.org/

◆ TypeCast() [4/5]

template<typename T >
T TypeCast ( Joint value)
related

Converts the given joint into its current configuration value.

Note
The design for this was based off the design of the C++17 std::any class and its associated std::any_cast function. The code for this is based off of the std::any implementation from the LLVM Project.
See also
https://llvm.org/

◆ TypeCast [5/5]

template<typename T >
std::add_pointer_t<T> TypeCast ( Joint value)
friend

Converts the given joint into its current configuration value.

Note
The design for this was based off the design of the C++17 std::any class and its associated std::any_cast function. The code for this is based off of the std::any implementation from the LLVM Project.
See also
https://llvm.org/

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