PlayRho  2.0.0
An interactive physics engine & library.
playrho::d2::detail Namespace Reference

Classes

struct  IsValidJointType
 An "is valid joint type" trait. More...
 
struct  IsValidJointType< T, std::void_t< decltype(GetBodyA(std::declval< T >())), decltype(GetBodyB(std::declval< T >())), decltype(GetCollideConnected(std::declval< T >())), decltype(ShiftOrigin(std::declval< T & >(), std::declval< Length2 >())), decltype(InitVelocity(std::declval< T & >(), std::declval< const Span< BodyConstraint > & >(), std::declval< StepConf >(), std::declval< ConstraintSolverConf >())), decltype(SolveVelocity(std::declval< T & >(), std::declval< const Span< BodyConstraint > & >(), std::declval< StepConf >())), decltype(SolvePosition(std::declval< T >(), std::declval< const Span< BodyConstraint > & >(), std::declval< ConstraintSolverConf >())), decltype(std::declval< T >()==std::declval< T >()), decltype(Joint{std::declval< T >()})> >
 An "is valid joint type" trait. More...
 
struct  IsValidShapeType
 An "is valid shape type" trait. More...
 
struct  IsValidShapeType< T, std::void_t< decltype(GetChildCount(std::declval< T >())), decltype(GetChild(std::declval< T >(), std::declval< ChildCounter >())), decltype(GetMassData(std::declval< T >())), decltype(GetVertexRadius(std::declval< T >(), std::declval< ChildCounter >())), decltype(GetDensity(std::declval< T >())), decltype(GetFriction(std::declval< T >())), decltype(GetRestitution(std::declval< T >())), decltype(std::declval< T >()==std::declval< T >()), decltype(std::declval< DecayedTypeIfNotSame< T, Shape >>()), decltype(std::is_constructible_v< DecayedTypeIfNotSame< T, Shape >, T >)> >
 An "is valid shape type" trait. More...
 
struct  JointConcept
 Internal joint concept interface. More...
 
struct  JointModel
 Internal joint model type. More...
 
struct  ShapeConcept
 Internal shape concept interface. More...
 
struct  ShapeModel
 Internal model configuration concept. More...
 
struct  WorldConcept
 World-concept internal pure virtual base interface class. More...
 
struct  WorldModel
 Interface between type class template instantiated for and the WorldConcept class. More...
 

Typedefs

template<class T >
using RotateReturnType = decltype(Rotate(std::declval< T & >(), std::declval< Angle >()))
 Return type for a Rotate function taking an arbitrary type and a value. More...
 
template<class T >
using ScaleReturnType = decltype(Scale(std::declval< T & >(), std::declval< Vec2 >()))
 Return type for a Scale function taking an arbitrary type and a value. More...
 
template<class T >
using SetDensityReturnType = decltype(SetDensity(std::declval< T & >(), std::declval< NonNegative< AreaDensity > >()))
 Return type for a SetDensity function taking an arbitrary type and a value. More...
 
template<class T >
using SetFilterReturnType = decltype(SetFilter(std::declval< T & >(), std::declval< Filter >()))
 Return type for a SetFilter function taking an arbitrary type and a value. More...
 
template<class T >
using SetFrictionReturnType = decltype(SetFriction(std::declval< T & >(), std::declval< Real >()))
 Return type for a SetFriction function taking an arbitrary type and a value. More...
 
template<class T >
using SetRestitutionReturnType = decltype(SetRestitution(std::declval< T & >(), std::declval< Real >()))
 Return type for a SetRestitution function taking an arbitrary type and a value. More...
 
template<class T >
using SetSensorReturnType = decltype(SetSensor(std::declval< T & >(), std::declval< bool >()))
 Return type for a SetSensor function taking an arbitrary type and a value. More...
 
template<class T >
using TranslateReturnType = decltype(Translate(std::declval< T & >(), std::declval< Length2 >()))
 Return type for a Translate function taking an arbitrary type and a value. More...
 

Functions

template<class T >
auto Rotate (T &, const UnitVec &value) -> std::enable_if_t< IsValidShapeTypeV< T > &&!HasRotateV< T >, void >
 Fallback rotate function that throws unless the given value has no effect.
 
template<class T >
auto Scale (T &, const Vec2 &value) -> std::enable_if_t< IsValidShapeTypeV< T > &&!HasScaleV< T >, void >
 Fallback scale function that throws unless the given value has no effect.
 
template<class T >
auto SetDensity (T &o, NonNegative< AreaDensity > value) -> std::enable_if_t< IsValidShapeTypeV< T > &&!HasSetDensityV< T >, void >
 Fallback density setter that throws unless given the same value as current.
 
template<class T >
auto SetFilter (T &o, Filter value) -> std::enable_if_t< IsValidShapeTypeV< T > &&!HasSetFilterV< T >, void >
 Fallback filter setter that throws unless given the same value as current.
 
template<class T >
auto SetFriction (T &o, NonNegative< Real > value) -> std::enable_if_t< IsValidShapeTypeV< T > &&!HasSetFrictionV< T >, void >
 Fallback friction setter that throws unless given the same value as current.
 
template<class T >
auto SetRestitution (T &o, Real value) -> std::enable_if_t< IsValidShapeTypeV< T > &&!HasSetRestitutionV< T >, void >
 Fallback restitution setter that throws unless given the same value as current.
 
template<class T >
auto SetSensor (T &o, bool value) -> std::enable_if_t< IsValidShapeTypeV< T > &&!HasSetSensorV< T >, void >
 Fallback sensor setter that throws unless given the same value as current.
 
template<class T >
auto Translate (T &, const Length2 &value) -> std::enable_if_t< IsValidShapeTypeV< T > &&!HasTranslateV< T >, void >
 Fallback translate function that throws unless the given value has no effect.
 

Variables

template<class T >
constexpr bool HasRotateV = playrho::detail::is_detected_v<RotateReturnType, T>
 Helper variable template on whether Rotate(T&, Angle) is found.
 
template<class T >
constexpr bool HasScaleV = playrho::detail::is_detected_v<ScaleReturnType, T>
 Helper variable template on whether Scale(T&, Vec2) is found.
 
template<class T >
constexpr bool HasSetDensityV = playrho::detail::is_detected_v<SetDensityReturnType, T>
 Helper variable template on whether SetDensity(T&, NonNegative<AreaDensity>) is found.
 
template<class T >
constexpr bool HasSetFilterV = playrho::detail::is_detected_v<SetFilterReturnType, T>
 Helper variable template on whether SetFilter(T&, Filter) is found.
 
template<class T >
constexpr bool HasSetFrictionV = playrho::detail::is_detected_v<SetFrictionReturnType, T>
 Helper variable template on whether SetFriction(T&, Real) is found.
 
template<class T >
constexpr bool HasSetRestitutionV = playrho::detail::is_detected_v<SetRestitutionReturnType, T>
 Helper variable template on whether SetRestitution(T&, Real) is found.
 
template<class T >
constexpr bool HasSetSensorV = playrho::detail::is_detected_v<SetSensorReturnType, T>
 Helper variable template on whether SetSensor(T&, bool) is found.
 
template<class T >
constexpr bool HasTranslateV = playrho::detail::is_detected_v<TranslateReturnType, T>
 Helper variable template on whether Translate(T&, Length2) is found.
 
template<class T >
constexpr bool IsValidShapeTypeV = IsValidShapeType<T>::value
 Boolean value for whether the specified type is a valid shape type. More...
 

Detailed Description

Name space for internal/detail 2-dimensionally related PlayRho names.

Typedef Documentation

◆ RotateReturnType

template<class T >
using playrho::d2::detail::RotateReturnType = typedef decltype(Rotate(std::declval<T&>(), std::declval<Angle>()))

Return type for a Rotate function taking an arbitrary type and a value.

Template Parameters
Ttype to find function return type for.

◆ ScaleReturnType

template<class T >
using playrho::d2::detail::ScaleReturnType = typedef decltype(Scale(std::declval<T&>(), std::declval<Vec2>()))

Return type for a Scale function taking an arbitrary type and a value.

Template Parameters
Ttype to find function return type for.

◆ SetDensityReturnType

template<class T >
using playrho::d2::detail::SetDensityReturnType = typedef decltype(SetDensity(std::declval<T&>(), std::declval<NonNegative<AreaDensity> >()))

Return type for a SetDensity function taking an arbitrary type and a value.

Template Parameters
Ttype to find function return type for.

◆ SetFilterReturnType

template<class T >
using playrho::d2::detail::SetFilterReturnType = typedef decltype(SetFilter(std::declval<T&>(), std::declval<Filter>()))

Return type for a SetFilter function taking an arbitrary type and a value.

Template Parameters
Ttype to find function return type for.

◆ SetFrictionReturnType

template<class T >
using playrho::d2::detail::SetFrictionReturnType = typedef decltype(SetFriction(std::declval<T&>(), std::declval<Real>()))

Return type for a SetFriction function taking an arbitrary type and a value.

Template Parameters
Ttype to find function return type for.

◆ SetRestitutionReturnType

template<class T >
using playrho::d2::detail::SetRestitutionReturnType = typedef decltype(SetRestitution(std::declval<T&>(), std::declval<Real>()))

Return type for a SetRestitution function taking an arbitrary type and a value.

Template Parameters
Ttype to find function return type for.

◆ SetSensorReturnType

template<class T >
using playrho::d2::detail::SetSensorReturnType = typedef decltype(SetSensor(std::declval<T&>(), std::declval<bool>()))

Return type for a SetSensor function taking an arbitrary type and a value.

Template Parameters
Ttype to find function return type for.

◆ TranslateReturnType

template<class T >
using playrho::d2::detail::TranslateReturnType = typedef decltype(Translate(std::declval<T&>(), std::declval<Length2>()))

Return type for a Translate function taking an arbitrary type and a value.

Template Parameters
Ttype to find function return type for.

Variable Documentation

◆ IsValidShapeTypeV

template<class T >
constexpr bool playrho::d2::detail::IsValidShapeTypeV = IsValidShapeType<T>::value
constexpr

Boolean value for whether the specified type is a valid shape type.

See also
Shape.
Examples
Compositor.cpp.