PlayRho  1.1.0
An Interactive Real-Time-Oriented C++ Physics Engine & Library
playrho::d2::Joint Class Reference

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

#include <Joint.hpp>

Collaboration diagram for playrho::d2::Joint:
[legend]

Classes

struct  Concept
 Internal configuration concept. More...
 
struct  Model
 Internal model configuration concept. More...
 

Public Types

using BodyConstraintsMap = std::vector< BodyConstraint >
 Type alias for body constraints mapping.
 

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 = DecayedTypeIfNotSelf<T>, typename = std::enable_if_t<std::is_copy_constructible<Tp>::value>>
 Joint (T &&arg)
 Initializing constructor. More...
 
Jointoperator= (const Joint &other)
 Copy assignment. More...
 
Jointoperator= (Joint &&other) noexcept
 Move assignment. More...
 
template<typename T , typename Tp = DecayedTypeIfNotSelf<T>, typename = std::enable_if_t<std::is_copy_constructible<Tp>::value>>
Jointoperator= (T &&other) noexcept
 Move assignment support for any valid underlying configuration. More...
 
void swap (Joint &other) noexcept
 Swap function.
 
bool has_value () const noexcept
 Checks whether this instance contains a value.
 

Private Types

template<typename Type , typename DecayedType = std::decay_t<Type>>
using DecayedTypeIfNotSelf = std::enable_if_t<!std::is_same_v< DecayedType, Joint >, DecayedType >
 Decayed type if not same as this class. More...
 

Private Attributes

std::unique_ptr< Conceptm_self
 Self pointer.
 

Friends

TypeID GetType (const Joint &object) noexcept
 Gets the identifier of the type of data this can be casted to.
 
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...
 
bool operator== (const Joint &lhs, const Joint &rhs) noexcept
 Equality operator for joint comparisons.
 
bool operator!= (const Joint &lhs, const Joint &rhs) noexcept
 Inequality operator for joint comparisons.
 
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...
 
bool ShiftOrigin (Joint &object, Length2 value) noexcept
 Shifts the origin for any points stored in world coordinates. More...
 
void InitVelocity (Joint &object, std::vector< BodyConstraint > &bodies, const playrho::StepConf &step, const ConstraintSolverConf &conf)
 Initializes velocity constraint data based on the given solver data. More...
 
bool SolveVelocity (Joint &object, std::vector< BodyConstraint > &bodies, const playrho::StepConf &step)
 Solves velocity constraint. More...
 
bool SolvePosition (const Joint &object, std::vector< BodyConstraint > &bodies, const ConstraintSolverConf &conf)
 Solves the position constraint. More...
 

Related Functions

(Note that these are not member functions.)

DistanceJointConf GetDistanceJointConf (const Joint &joint) noexcept
 Gets the definition data for the given joint.
 
FrictionJointConf GetFrictionJointConf (const Joint &joint) noexcept
 Gets the definition data for the given joint.
 
GearJointConf GetGearJointConf (const Joint &joint) noexcept
 Gets the definition data for the given joint.
 
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...
 
Length2 GetLocalAnchorA (const Joint &object)
 Get the anchor point on body-A in local coordinates.
 
Length2 GetLocalAnchorB (const Joint &object)
 Get the anchor point on body-B in local coordinates.
 
Momentum2 GetLinearReaction (const Joint &object)
 Get the linear reaction on body-B at the joint anchor.
 
AngularMomentum GetAngularReaction (const Joint &object)
 Get the angular reaction on body-B.
 
Angle GetReferenceAngle (const Joint &object)
 Gets the reference angle of the joint if it has one. More...
 
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...
 
AngularVelocity GetMotorSpeed (const Joint &object)
 Gets the given joint's motor speed 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...
 
Force GetMaxForce (const Joint &object)
 Gets the given joint's max force if its type supports that. More...
 
Torque GetMaxTorque (const Joint &object)
 Gets the given joint's max torque 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...
 
void SetMaxMotorForce (Joint &object, Force value)
 Sets 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...
 
void SetMaxMotorTorque (Joint &object, Torque value)
 Sets the given joint's max motor torque if its type supports that. More...
 
RotInertia GetAngularMass (const Joint &object)
 Gets the given joint's angular mass. More...
 
Real GetRatio (const Joint &object)
 Gets the given joint's ratio property if it has one. More...
 
Real GetDampingRatio (const Joint &object)
 Gets the given joint's damping ratio property if it has one. More...
 
Frequency GetFrequency (const Joint &object)
 Gets the frequency of the joint if it has this property. More...
 
void SetFrequency (Joint &object, Frequency value)
 Sets the frequency of the joint if it has this property. More...
 
AngularMomentum GetAngularMotorImpulse (const Joint &object)
 Gets the angular motor impulse of the joint if it has this property. More...
 
Length2 GetTarget (const Joint &object)
 Gets the given joint's target property if it has one. More...
 
void SetTarget (Joint &object, Length2 value)
 Sets the given joint's target property if it has one. More...
 
Length GetLinearLowerLimit (const Joint &object)
 Gets the lower linear joint limit. More...
 
Length GetLinearUpperLimit (const Joint &object)
 Gets the upper linear joint limit. More...
 
void SetLinearLimits (Joint &object, Length lower, Length upper)
 Sets the joint limits. More...
 
Angle GetAngularLowerLimit (const Joint &object)
 Gets the lower joint limit. More...
 
Angle GetAngularUpperLimit (const Joint &object)
 Gets the upper joint limit. More...
 
void SetAngularLimits (Joint &object, Angle lower, Angle upper)
 Sets the joint limits. More...
 
bool IsLimitEnabled (const Joint &object)
 Gets the specified joint's limit property if it supports one. More...
 
void EnableLimit (Joint &object, bool value)
 Enables 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 EnableMotor (Joint &object, bool value)
 Enables the specified joint's motor property if it supports one. More...
 
Length2 GetLinearOffset (const Joint &object)
 Gets the linear offset property of the specified joint if its type has one. More...
 
void SetLinearOffset (Joint &object, Length2 value)
 Sets the linear offset property of the specified joint if its type has one. More...
 
Angle GetAngularOffset (const Joint &object)
 Gets the angular offset property of the specified joint if its type has one. More...
 
void SetAngularOffset (Joint &object, Angle value)
 Sets the angular offset property of the specified joint if its type has one. More...
 
LimitState GetLimitState (const Joint &object)
 
Length2 GetGroundAnchorA (const Joint &object)
 
Length2 GetGroundAnchorB (const Joint &object)
 
Momentum GetLinearMotorImpulse (const Joint &object)
 
Length GetLength (const Joint &object)
 Gets the length property of the specified joint if its type has one. More...
 
Torque GetMotorTorque (const Joint &joint, Frequency inv_dt)
 Gets the current motor torque for the given joint given the inverse time step. More...
 
MotorJointConf GetMotorJointConf (const Joint &joint) noexcept
 Gets the definition data for the given joint.
 
PrismaticJointConf GetPrismaticJointConf (const Joint &joint)
 Gets the definition data for the given joint.
 
PulleyJointConf GetPulleyJointConf (const Joint &joint)
 Gets the definition data for the given joint.
 
RevoluteJointConf GetRevoluteJointConf (const Joint &joint)
 Gets the definition data for the given joint.
 
RopeJointConf GetRopeJointConf (const Joint &joint) noexcept
 Gets the definition data for the given joint.
 
TargetJointConf GetTargetJointConf (const Joint &joint)
 Gets the definition data for the given joint.
 
WeldJointConf GetWeldJointConf (const Joint &joint)
 Gets the definition data for the given joint.
 
WheelJointConf GetWheelJointConf (const Joint &joint)
 Gets the definition data for the given joint.
 

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, std::vector<BodyConstraint>& bodies, const StepConf& step, const ConstraintSolverConf& conf);
  • bool SolveVelocity(T& object, std::vector<BodyConstraint>& bodies, const StepConf& step);
  • bool SolvePosition(const T& object, std::vector<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
Examples
DistanceJoint.cpp, FrictionJoint.cpp, Joint.cpp, MotorJoint.cpp, PrismaticJoint.cpp, PulleyJoint.cpp, RevoluteJoint.cpp, RopeJoint.cpp, TargetJoint.cpp, WeldJoint.cpp, WheelJoint.cpp, and World.cpp.

Member Typedef Documentation

◆ DecayedTypeIfNotSelf

template<typename Type , typename DecayedType = std::decay_t<Type>>
using playrho::d2::Joint::DecayedTypeIfNotSelf = std::enable_if_t<!std::is_same_v<DecayedType, Joint>, DecayedType>
private

Decayed type if not same as this class.

Note
This is done separately from other checks to ensure order of compiler's SFINAE processing and to ensure elimination of self class before attempting to process other checks like is_copy_constructible. This prevents a compiler error that started showing up in gcc-9.

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 = DecayedTypeIfNotSelf<T>, typename = std::enable_if_t<std::is_copy_constructible<Tp>::value>>
playrho::d2::Joint::Joint ( T &&  arg)
inlineexplicit

Initializing constructor.

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);
Postcondition
has_value() returns true.
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 = DecayedTypeIfNotSelf<T>, typename = std::enable_if_t<std::is_copy_constructible<Tp>::value>>
Joint& playrho::d2::Joint::operator= ( T &&  other)
inlinenoexcept

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.

Referenced by playrho::d2::GetMotorTorque().

◆ 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.

◆ 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.

Referenced by playrho::d2::Joint::Model< T >::GetCollideConnected_().

◆ 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.

◆ 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.

◆ 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.

◆ 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.

◆ 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.

◆ 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.

◆ 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.

◆ 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.
Examples
World.cpp.

◆ InitVelocity

void InitVelocity ( Joint object,
std::vector< 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.

Referenced by playrho::d2::Joint::Model< T >::InitVelocity_().

◆ 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,
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,
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.
Examples
World.cpp.

◆ ShiftOrigin

bool ShiftOrigin ( Joint object,
Length2  value 
)
friend

Shifts the origin for any points stored in world coordinates.

Returns
true if shift done, false otherwise.

Referenced by playrho::d2::Joint::Model< T >::ShiftOrigin_().

◆ SolvePosition

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

Solves the position constraint.

Returns
true if the position errors are within tolerance.

Referenced by playrho::d2::Joint::Model< T >::SolvePosition_().

◆ SolveVelocity

bool SolveVelocity ( Joint object,
std::vector< 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.

Referenced by playrho::d2::Joint::Model< T >::SolveVelocity_().

◆ 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:
playrho::d2::Joint::Joint
Joint() noexcept=default
Default constructor.