PlayRho  1.1.0
An Interactive Real-Time-Oriented C++ Physics Engine & Library
playrho Namespace Reference

Name space for all PlayRho related names. More...

Namespaces

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

Classes

class  AllocatedArray
 Allocated Array. More...
 
class  ArrayAllocator
 Array allocator. More...
 
class  ArrayList
 Array list. More...
 
class  BlockAllocator
 Block allocator. More...
 
struct  BlockDeallocator
 Block deallocator. More...
 
class  CheckedValue
 Checked value. More...
 
struct  ConstraintSolverConf
 Constraint solver configuration data. More...
 
struct  ContactFeature
 Contact Feature. More...
 
class  ContactKey
 Key value class for contacts. More...
 
struct  Filter
 A holder for contact filtering data. More...
 
struct  FiniteChecker
 Finite constrained value checker. More...
 
class  Fixed
 Template class for fixed-point numbers. More...
 
class  FlagGuard
 Flag guard type. More...
 
class  GrowableStack
 This is a growable LIFO stack with an initial capacity of N. If the stack size exceeds the initial capacity, the heap is used to increase the size of the stack. More...
 
struct  HasFunctor
 Has-functor trait template fallback class. More...
 
struct  HasFunctor< Type, Return(Args...)>
 Has-functor trait template class. More...
 
struct  HasType
 Has-type trait template class. More...
 
struct  HasType< T, std::tuple< T, Ts... > >
 Has-type trait true class. More...
 
struct  HasType< T, std::tuple< U, Ts... > >
 Has-type trait template super class. More...
 
struct  HasType< T, std::tuple<> >
 Has-type trait template class specialized for std::tuple classes. More...
 
class  Interval
 Interval template type. More...
 
class  InvalidArgument
 Invalid argument logic error. More...
 
struct  IsAddable
 Template for determining if the given types are addable. More...
 
struct  IsAddable< T1, T2, std::void_t< decltype(T1{}+T2{})> >
 Template specializing for addable types. More...
 
struct  IsArithmetic
 Template for determining if the given type is an "arithmetic" type. More...
 
struct  IsArithmetic< T, std::void_t< decltype(T{}+T{}), decltype(T{} - T{}), decltype(T{} *T{}), decltype(T{}/T{})> >
 Template specialization for valid/acceptable "arithmetic" types. More...
 
struct  IsDivisable
 Template for determining if the given types are divisable. More...
 
struct  IsDivisable< T1, T2, std::void_t< decltype(T1{}/T2{})> >
 Template specializing for divisable types. More...
 
struct  IsEqualityComparable
 Template for determining if the given type is an equality comparable type. More...
 
struct  IsEqualityComparable< T1, T2, std::void_t< decltype(T1{}==T2{})> >
 Template specialization for equality comparable types. More...
 
struct  IsInequalityComparable
 Template for determining if the given type is an inequality comparable type. More...
 
struct  IsInequalityComparable< T1, T2, std::void_t< decltype(T1{} !=T2{})> >
 Template specialization for inequality comparable types. More...
 
struct  IslandStats
 Island solver statistics. More...
 
struct  IsMatrix
 Trait class for checking if type is a matrix type. More...
 
struct  IsMatrix< Vector< Vector< T, N >, M > >
 Trait class specialization for checking if type is a matrix type. More...
 
struct  IsMultipliable
 Template for determining if the given types are multipliable. More...
 
struct  IsMultipliable< T1, T2, std::void_t< decltype(T1{} *T2{})> >
 Template specializing for multipliable types. More...
 
struct  IsSquareMatrix
 Trait class for checking if type is a square matrix type. More...
 
struct  IsSquareMatrix< Vector< Vector< T, M >, M > >
 Trait class specialization for checking if type is a square matrix type. More...
 
struct  IsVector
 Trait class for checking if type is a Vector type. More...
 
struct  IsVector< Vector< T, N > >
 Trait class specialization for checking if type is a Vector type.. More...
 
class  LengthError
 Length based logic error. More...
 
struct  LengthIndexPair
 A length associated with two vertex counter indices. More...
 
struct  LexicographicalGreater
 Function object for performing lexicographical greater-than comparisons of containers. More...
 
struct  LexicographicalGreaterEqual
 Function object for performing lexicographical greater-than or equal-to comparisons of containers. More...
 
struct  LexicographicalLess
 Function object for performing lexicographical less-than comparisons of containers. More...
 
struct  LexicographicalLessEqual
 Function object for performing lexicographical less-than or equal-to comparisons of containers. More...
 
struct  MovementConf
 Movement configuration. More...
 
struct  NegativeChecker
 Negative constrained value checker. More...
 
struct  NonNegativeChecker
 Non-negative constrained value checker. More...
 
struct  NonPositiveChecker
 Non-positive constrained value checker. More...
 
struct  NonZeroChecker
 Non-zero constrained value checker. More...
 
struct  NoOpChecker
 No-op value checker. More...
 
struct  PointStates
 Point states. More...
 
struct  PositiveChecker
 Positive constrained value checker. More...
 
struct  PreStepStats
 Pre-phase per-step statistics. More...
 
class  propagate_const
 Constant propagating template wrapper type. More...
 
class  Range
 Template range value class. More...
 
struct  RegStepStats
 Regular-phase per-step statistics. More...
 
class  SizedRange
 Template sized range value class. More...
 
class  Span
 A C++ encapsulation of an array and its size. More...
 
class  StackAllocator
 Stack allocator. More...
 
struct  StepConf
 Step configuration. More...
 
struct  StepStats
 Per-step statistics. More...
 
struct  ToiConf
 Time of impact configuration. More...
 
struct  TOIOutput
 Output data for time of impact. More...
 
struct  ToiStepStats
 TOI-phase per-step statistics. More...
 
struct  TypeInfo
 Type information. More...
 
struct  TypeInfo< d2::DistanceJointConf >
 Type info specialization for d2::DistanceJointConf. More...
 
struct  TypeInfo< d2::FrictionJointConf >
 Type info specialization for d2::FrictionJointConf. More...
 
struct  TypeInfo< d2::GearJointConf >
 Type info specialization for d2::GearJointConf. More...
 
struct  TypeInfo< d2::MotorJointConf >
 Type info specialization for d2::MotorJointConf. More...
 
struct  TypeInfo< d2::PrismaticJointConf >
 Type info specialization for d2::PrismaticJointConf. More...
 
struct  TypeInfo< d2::PulleyJointConf >
 Type info specialization for d2::PulleyJointConf. More...
 
struct  TypeInfo< d2::RevoluteJointConf >
 Type info specialization for d2::RevoluteJointConf. More...
 
struct  TypeInfo< d2::RopeJointConf >
 Type info specialization for d2::RopeJointConf. More...
 
struct  TypeInfo< d2::TargetJointConf >
 Type info specialization for d2::TargetJointConf. More...
 
struct  TypeInfo< d2::WeldJointConf >
 Type info specialization for d2::WeldJointConf. More...
 
struct  TypeInfo< d2::WheelJointConf >
 Type info specialization for d2::WheelJointConf. More...
 
struct  TypeInfo< double >
 Type info specialization for double. More...
 
struct  TypeInfo< Fixed32 >
 Type info specialization for Fixed32. More...
 
struct  TypeInfo< float >
 Type info specialization for float. More...
 
struct  TypeInfo< long double >
 Type info specialization for long double. More...
 
struct  underlying_type
 Underlying-type template class. More...
 
struct  underlying_type< detail::IndexingNamedType< T, Tag > >
 Underlying-type template class for detail::IndexingNamedType types. More...
 
struct  underlying_type< T, std::enable_if_t< std::is_enum_v< T > > >
 Underlying-type class specialization for enum types. More...
 
struct  UnitIntervalChecker
 Unit-interval constrained value checker. More...
 
struct  Vector
 Vector. More...
 
struct  Version
 Version numbering scheme. More...
 
struct  Wider
 Wider data type obtainer. More...
 
struct  Wider< double >
 Specialization of the Wider trait for double. More...
 
struct  Wider< float >
 Specialization of the Wider trait for float. More...
 
struct  Wider< std::int16_t >
 Specialization of the Wider trait for signed 16-bit integers. More...
 
struct  Wider< std::int32_t >
 Specialization of the Wider trait for signed 32-bit integers. More...
 
struct  Wider< std::int8_t >
 Specialization of the Wider trait for signed 8-bit integers. More...
 
struct  Wider< std::uint16_t >
 Specialization of the Wider trait for unsigned 16-bit integers. More...
 
struct  Wider< std::uint32_t >
 Specialization of the Wider trait for unsigned 32-bit integers. More...
 
struct  Wider< std::uint8_t >
 Specialization of the Wider trait for unsigned 8-bit integers. More...
 
class  WrongState
 Wrong state logic error. More...
 

Typedefs

using PairLength2 = std::pair< Length2, Length2 >
 Pair of Length2 values. More...
 
using IndexPair = std::pair< VertexCounter, VertexCounter >
 Index pair. More...
 
using IndexPair3 = std::array< IndexPair, MaxSimplexEdges >
 Array of three index-pair elements. More...
 
template<std::size_t N>
using VertexCounterArray = std::array< VertexCounter, N >
 Vertex counter array template alias.
 
using VertexCounter2 = VertexCounterArray< 2 >
 2-element vertex counter array.
 
template<typename T >
using DefaultCheckedValue = CheckedValue< T >
 Default checked value type. More...
 
template<typename T >
using Finite = CheckedValue< T, FiniteChecker< T > >
 Finite constrained value type.
 
using Fixed32 = Fixed< std::int32_t, 9 >
 32-bit fixed precision type. More...
 
template<class T >
using underlying_type_t = typename underlying_type< T >::type
 Underlying-type convenience alias.
 
template<typename T , std::size_t M, std::size_t N>
using Matrix = Vector< Vector< T, N >, M >
 Generic M by N matrix. More...
 
template<typename T >
using Matrix22 = Matrix< T, 2, 2 >
 2 by 2 matrix.
 
template<typename T >
using Matrix33 = Matrix< T, 3, 3 >
 3 by 3 matrix.
 
using Mat22 = Matrix22< Real >
 2 by 2 matrix of Real elements.
 
using Mass22 = Matrix22< Mass >
 2 by 2 matrix of Mass elements.
 
using InvMass22 = Matrix22< InvMass >
 2 by 2 matrix of InvMass elements.
 
using Mat33 = Matrix33< Real >
 3 by 3 matrix of Real elements.
 
template<typename T >
using Negative = CheckedValue< T, NegativeChecker< T > >
 Negative constrained value type.
 
template<typename T >
using NonNegative = CheckedValue< T, NonNegativeChecker< T > >
 Non-negative constrained value type.
 
template<typename T >
using NonPositive = CheckedValue< T, NonPositiveChecker< T > >
 Non-positive constrained value type.
 
template<typename T >
using NonZero = std::enable_if_t<!std::is_pointer< T >::value, CheckedValue< T, NonZeroChecker< T > >>
 Non-zero constrained value type.
 
template<typename T >
using NonNull = std::enable_if_t< std::is_pointer< T >::value, CheckedValue< T, NonZeroChecker< T > >>
 Non-null constrained value type.
 
template<typename T >
using Positive = CheckedValue< T, PositiveChecker< T > >
 Positive constrained value type.
 
using Real = float
 Real-number type. More...
 
using ChildCounter = std::remove_const< decltype(MaxChildCount)>::type
 Child counter type. More...
 
using TimestepIters = std::uint8_t
 Time step iterations type. More...
 
using VertexCounter = std::remove_const< decltype(MaxShapeVertices)>::type
 Vertex count type. More...
 
using FixtureCounter = std::remove_const< decltype(MaxFixtures)>::type
 Counter type for fixtures. More...
 
using BodyCounter = std::remove_const< decltype(MaxBodies)>::type
 Count type for bodies. More...
 
using ContactCounter = Wider< BodyCounter >::type
 Count type for contacts. More...
 
using JointCounter = std::remove_const< decltype(MaxJoints)>::type
 Counter type for joints. More...
 
template<class T >
using IsIterable = typename detail::IsIterableImpl< T >
 Determines whether the given type is an iterable type.
 
template<typename T , typename Tuple >
using TupleContainsType = typename HasType< T, Tuple >::type
 Tuple contains type alias. More...
 
template<typename Type , typename Return >
using HasNullaryFunctor = HasFunctor< Type, Return()>
 Has nullary functor type alias. More...
 
template<typename Type , typename Return , typename Arg >
using HasUnaryFunctor = HasFunctor< Type, Return(Arg)>
 Has unary functor type alias. More...
 
using TypeID = detail::IndexingNamedType< const char *const *, struct TypeIdentifier >
 Type identifier.
 
template<typename T >
using UnitInterval = CheckedValue< T, UnitIntervalChecker< T > >
 Unit interval constrained value type.
 
using Time = PLAYRHO_QUANTITY(boost::units::si::time)
 Time quantity. More...
 
using Frequency = PLAYRHO_QUANTITY(boost::units::si::frequency)
 Frequency quantity. More...
 
using Length = PLAYRHO_QUANTITY(boost::units::si::length)
 Length quantity. More...
 
using LinearVelocity = PLAYRHO_QUANTITY(boost::units::si::velocity)
 Linear velocity quantity. More...
 
using LinearAcceleration = PLAYRHO_QUANTITY(boost::units::si::acceleration)
 Linear acceleration quantity. More...
 
using Mass = PLAYRHO_QUANTITY(boost::units::si::mass)
 Mass quantity. More...
 
using InvMass = PLAYRHO_QUANTITY(playrho::units::si::inverse_mass)
 Inverse mass quantity. More...
 
using Area = PLAYRHO_QUANTITY(boost::units::si::area)
 Area quantity. More...
 
using AreaDensity = PLAYRHO_QUANTITY(boost::units::si::surface_density)
 Area (surface) density quantity. More...
 
using Angle = PLAYRHO_QUANTITY(boost::units::si::plane_angle)
 Angle quantity. More...
 
using AngularVelocity = PLAYRHO_QUANTITY(boost::units::si::angular_velocity)
 Angular velocity quantity. More...
 
using AngularAcceleration = PLAYRHO_QUANTITY(boost::units::si::angular_acceleration)
 Angular acceleration quantity. More...
 
using Force = PLAYRHO_QUANTITY(boost::units::si::force)
 Force quantity. More...
 
using Torque = PLAYRHO_QUANTITY(boost::units::si::torque)
 Torque quantity. More...
 
using SecondMomentOfArea = PLAYRHO_QUANTITY(playrho::units::si::second_moment_of_area)
 Second moment of area quantity. More...
 
using RotInertia = PLAYRHO_QUANTITY(boost::units::si::moment_of_inertia)
 Rotational inertia quantity. More...
 
using InvRotInertia = PLAYRHO_QUANTITY(playrho::units::si::inverse_moment_of_inertia)
 Inverse rotational inertia quantity. More...
 
using Momentum = PLAYRHO_QUANTITY(boost::units::si::momentum)
 Momentum quantity. More...
 
using AngularMomentum = PLAYRHO_QUANTITY(boost::units::si::angular_momentum)
 Angular momentum quantity. More...
 
template<typename T >
using Vector2 = Vector< T, 2 >
 Vector with 2-elements. More...
 
using Vec2 = Vector2< Real >
 Vector with 2 Real elements. More...
 
using Length2 = Vector2< Length >
 2-element vector of Length quantities. More...
 
using LinearVelocity2 = Vector2< LinearVelocity >
 2-element vector of linear velocity (LinearVelocity) quantities. More...
 
using LinearAcceleration2 = Vector2< LinearAcceleration >
 2-element vector of linear acceleration (LinearAcceleration) quantities. More...
 
using Force2 = Vector2< Force >
 2-element vector of Force quantities. More...
 
using Mass2 = Vector2< Mass >
 2-element vector of Mass quantities.
 
using InvMass2 = Vector2< InvMass >
 2-element vector of inverse mass (InvMass) quantities.
 
using Momentum2 = Vector2< Momentum >
 2-element vector of Momentum quantities. More...
 
template<typename T >
using Vector3 = Vector< T, 3 >
 Vector with 3-elements. More...
 
using Vec3 = Vector3< Real >
 A 3-dimensional column vector with 3 elements. More...
 
using Mass3 = Vector3< Mass >
 3-element vector of Mass quantities.
 
using InvMass3 = Vector3< InvMass >
 3-element vector of inverse mass (InvMass) quantities.
 
using BodyID = detail::IndexingNamedType< BodyCounter, struct BodyIdentifier >
 Identifier for bodies.
 
using ContactID = detail::IndexingNamedType< ContactCounter, struct ContactIdentifier >
 Contact identifier.
 
using FixtureID = detail::IndexingNamedType< FixtureCounter, struct FixtureIdentifier >
 Fixture identifier.
 
using JointID = detail::IndexingNamedType< JointCounter, struct JointIdentifier >
 Joint identifier.
 

Enumerations

enum  PointState { PointState::NullState, PointState::AddState, PointState::PersistState, PointState::RemoveState }
 Point state enumeration. More...
 
enum  RayCastOpcode { RayCastOpcode::Terminate, RayCastOpcode::IgnoreFixture, RayCastOpcode::ClipRay, RayCastOpcode::ResetRay }
 Ray cast opcode enumeration. More...
 
enum  BodyType { BodyType::Static = 0, BodyType::Kinematic, BodyType::Dynamic }
 Type of body. More...
 

Functions

template<>
constexpr d2::AABB GetInvalid () noexcept
 Gets an invalid AABB value. More...
 
constexpr ContactFeature GetVertexVertexContactFeature (ContactFeature::Index a, ContactFeature::Index b) noexcept
 Gets the vertex vertex contact feature for the given indices.
 
constexpr ContactFeature GetVertexFaceContactFeature (ContactFeature::Index a, ContactFeature::Index b) noexcept
 Gets the vertex face contact feature for the given indices.
 
constexpr ContactFeature GetFaceVertexContactFeature (ContactFeature::Index a, ContactFeature::Index b) noexcept
 Gets the face vertex contact feature for the given indices.
 
constexpr ContactFeature GetFaceFaceContactFeature (ContactFeature::Index a, ContactFeature::Index b) noexcept
 Gets the face face contact feature for the given indices.
 
constexpr ContactFeature Flip (ContactFeature val) noexcept
 Flips contact features information.
 
constexpr bool operator== (ContactFeature lhs, ContactFeature rhs) noexcept
 Determines if the given two contact features are equal.
 
constexpr bool operator!= (ContactFeature lhs, ContactFeature rhs) noexcept
 Determines if the given two contact features are not equal.
 
const char * GetName (ContactFeature::Type type) noexcept
 Gets the human readable name for the given contact feature type.
 
inline ::std::ostream & operator<< (::std::ostream &os, const ContactFeature &value)
 Stream output operator.
 
constexpr std::size_t GetNumValidIndices (IndexPair3 pairs) noexcept
 Gets the number of valid indices in the given collection of index pairs. More...
 
constexpr bool empty (IndexPair3 pairs) noexcept
 Checks whether the given collection of index pairs is empty.
 
constexpr auto size (IndexPair3 pairs) -> decltype(GetNumValidIndices(pairs))
 Gets the dynamic size of the given collection of index pairs. More...
 
constexpr auto max_size (IndexPair3 pairs) -> decltype(pairs.max_size())
 Gets the maximum size of the given container of index pairs. More...
 
template<std::size_t N>
VertexCounter GetFirstShapeVertexIdx (const detail::SeparationInfo< N > &info) noexcept
 Gets first shape vertex index.
 
template<VertexCounter M, std::size_t N>
VertexCounter GetSecondShapeVertexIdx (const detail::SeparationInfo< N > &info) noexcept
 Gets second shape vertex indices.
 
template<>
constexpr bool IsValid (const d2::Manifold &value) noexcept
 Gets whether the given manifold is valid.
 
const char * GetName (TOIOutput::State state) noexcept
 Gets a human readable name for the given output state.
 
ToiConf GetToiConf (const StepConf &conf) noexcept
 Gets the time of impact configuration for the given step configuration.
 
constexpr auto GetDefaultToiConf ()
 Gets the default time of impact configuration.
 
template<>
constexpr bool IsValid (const d2::Acceleration &value) noexcept
 Determines if the given value is valid.
 
template<typename T >
ArrayAllocator< T >::size_type used (const ArrayAllocator< T > &array) noexcept
 Gets the number of elements that are used in the specified structure. More...
 
template<typename T , std::size_t S>
ArrayList< T, S > & operator+= (ArrayList< T, S > &lhs, const typename ArrayList< T, S >::data_type &rhs)
 ArrayList append operator.
 
template<typename T , std::size_t S>
ArrayList< T, S > operator+ (ArrayList< T, S > lhs, const typename ArrayList< T, S >::data_type &rhs)
 ArrayList add operator.
 
template<typename T >
void Delete (const T *p, BlockAllocator &allocator)
 Deletes the given pointer by calling the pointed-to object's destructor and returning it to the given allocator.
 
bool operator== (const BlockAllocator &a, const BlockAllocator &b)
 BlockAllocator equality operator.
 
bool operator!= (const BlockAllocator &a, const BlockAllocator &b)
 BlockAllocator inequality operator.
 
template<typename ValueType , typename CheckerType >
auto operator<< (::std::ostream &os, const CheckedValue< ValueType, CheckerType > &value) -> decltype(os<< ValueType(value))
 Constrained value stream output operator for value types which support it. More...
 
template<typename LhsValueType , typename LhsCheckerType , typename RhsValueType , typename RhsCheckerType >
constexpr auto operator== (const CheckedValue< LhsValueType, LhsCheckerType > &lhs, const CheckedValue< RhsValueType, RhsCheckerType > &rhs) noexcept(noexcept(std::declval< LhsValueType >()==std::declval< RhsValueType >())) -> decltype(LhsValueType(lhs)==RhsValueType(rhs))
 Constrained value equality operator for value types which support it. More...
 
template<typename LhsValueType , typename LhsCheckerType , typename RhsValueType , typename RhsCheckerType >
constexpr auto operator!= (const CheckedValue< LhsValueType, LhsCheckerType > &lhs, const CheckedValue< RhsValueType, RhsCheckerType > &rhs) noexcept(noexcept(std::declval< LhsValueType >() !=std::declval< RhsValueType >())) -> decltype(LhsValueType(lhs) !=RhsValueType(rhs))
 Constrained value inequality operator for value types which support it. More...
 
template<typename LhsValueType , typename LhsCheckerType , typename RhsValueType , typename RhsCheckerType >
constexpr auto operator<= (const CheckedValue< LhsValueType, LhsCheckerType > &lhs, const CheckedValue< RhsValueType, RhsCheckerType > &rhs) -> decltype(LhsValueType(lhs)<=RhsValueType(rhs))
 Constrained value less-than or equal-to operator. More...
 
template<typename LhsValueType , typename LhsCheckerType , typename RhsValueType , typename RhsCheckerType >
constexpr auto operator>= (const CheckedValue< LhsValueType, LhsCheckerType > &lhs, const CheckedValue< RhsValueType, RhsCheckerType > &rhs) -> decltype(LhsValueType(lhs) >=RhsValueType(rhs))
 Constrained value greater-than or equal-to operator. More...
 
template<typename LhsValueType , typename LhsCheckerType , typename RhsValueType , typename RhsCheckerType >
constexpr auto operator< (const CheckedValue< LhsValueType, LhsCheckerType > &lhs, const CheckedValue< RhsValueType, RhsCheckerType > &rhs) -> decltype(LhsValueType(lhs)< RhsValueType(rhs))
 Constrained value less-than operator. More...
 
template<typename LhsValueType , typename LhsCheckerType , typename RhsValueType , typename RhsCheckerType >
constexpr auto operator> (const CheckedValue< LhsValueType, LhsCheckerType > &lhs, const CheckedValue< RhsValueType, RhsCheckerType > &rhs) -> decltype(LhsValueType(lhs) > RhsValueType(rhs))
 Constrained value greater-than operator. More...
 
template<typename LhsValueType , typename LhsCheckerType , typename RhsValueType , typename RhsCheckerType >
constexpr auto operator* (const CheckedValue< LhsValueType, LhsCheckerType > &lhs, const CheckedValue< RhsValueType, RhsCheckerType > &rhs) -> decltype(LhsValueType(lhs) *RhsValueType(rhs))
 Constrained value multiplication operator. More...
 
template<typename LhsValueType , typename LhsCheckerType , typename RhsValueType , typename RhsCheckerType >
constexpr auto operator/ (const CheckedValue< LhsValueType, LhsCheckerType > &lhs, const CheckedValue< RhsValueType, RhsCheckerType > &rhs) -> decltype(LhsValueType(lhs)/RhsValueType(rhs))
 Constrained value division operator. More...
 
template<typename LhsValueType , typename LhsCheckerType , typename RhsValueType , typename RhsCheckerType >
constexpr auto operator+ (const CheckedValue< LhsValueType, LhsCheckerType > &lhs, const CheckedValue< RhsValueType, RhsCheckerType > &rhs) -> decltype(LhsValueType(lhs)+RhsValueType(rhs))
 Constrained value addition operator. More...
 
template<typename LhsValueType , typename LhsCheckerType , typename RhsValueType , typename RhsCheckerType >
constexpr auto operator- (const CheckedValue< LhsValueType, LhsCheckerType > &lhs, const CheckedValue< RhsValueType, RhsCheckerType > &rhs) -> decltype(LhsValueType(lhs) - RhsValueType(rhs))
 Constrained value subtraction operator. More...
 
template<typename ValueType , typename CheckerType , typename Other >
constexpr auto operator== (const CheckedValue< ValueType, CheckerType > &lhs, const Other &rhs) -> decltype(ValueType(lhs)==rhs)
 Constrained value equality operator. More...
 
template<typename ValueType , typename CheckerType , typename Other >
constexpr auto operator== (const Other &lhs, const CheckedValue< ValueType, CheckerType > &rhs) -> decltype(lhs==ValueType(rhs))
 Constrained value equality operator. More...
 
template<typename ValueType , typename CheckerType , typename Other >
constexpr auto operator!= (const CheckedValue< ValueType, CheckerType > &lhs, const Other &rhs) -> decltype(ValueType(lhs) !=rhs)
 Constrained value inequality operator. More...
 
template<typename ValueType , typename CheckerType , typename Other >
constexpr auto operator!= (const Other &lhs, const CheckedValue< ValueType, CheckerType > &rhs) -> decltype(lhs !=ValueType(rhs))
 Constrained value inequality operator. More...
 
template<typename ValueType , typename CheckerType , typename Other >
constexpr auto operator<= (const CheckedValue< ValueType, CheckerType > &lhs, const Other &rhs) -> decltype(ValueType(lhs)<=rhs)
 Constrained value less-than or equal-to operator. More...
 
template<typename ValueType , typename CheckerType , typename Other >
constexpr auto operator<= (const Other &lhs, const CheckedValue< ValueType, CheckerType > &rhs) -> decltype(lhs<=ValueType(rhs))
 Constrained value less-than or equal-to operator. More...
 
template<typename ValueType , typename CheckerType , typename Other >
constexpr auto operator>= (const CheckedValue< ValueType, CheckerType > &lhs, const Other &rhs) -> decltype(ValueType(lhs) >=rhs)
 Constrained value greater-than or equal-to operator. More...
 
template<typename ValueType , typename CheckerType , typename Other >
constexpr auto operator>= (const Other &lhs, const CheckedValue< ValueType, CheckerType > &rhs) -> decltype(lhs >=ValueType(rhs))
 Constrained value greater-than or equal-to operator. More...
 
template<typename ValueType , typename CheckerType , typename Other >
constexpr auto operator< (const CheckedValue< ValueType, CheckerType > &lhs, const Other &rhs) -> decltype(ValueType(lhs)< rhs)
 Constrained value less-than operator. More...
 
template<typename ValueType , typename CheckerType , typename Other >
constexpr auto operator< (const Other &lhs, const CheckedValue< ValueType, CheckerType > &rhs) -> decltype(lhs< ValueType(rhs))
 Constrained value less-than operator. More...
 
template<typename ValueType , typename CheckerType , typename Other >
constexpr auto operator> (const CheckedValue< ValueType, CheckerType > &lhs, const Other &rhs) -> decltype(ValueType(lhs) > rhs)
 Constrained value greater-than operator. More...
 
template<typename ValueType , typename CheckerType , typename Other >
constexpr auto operator> (const Other &lhs, const CheckedValue< ValueType, CheckerType > &rhs) -> decltype(lhs > ValueType(rhs))
 Constrained value greater-than ooperator. More...
 
template<typename ValueType , typename CheckerType , typename Other >
constexpr auto operator* (const CheckedValue< ValueType, CheckerType > &lhs, const Other &rhs) -> std::enable_if_t<!IsMultipliable< CheckedValue< ValueType, CheckerType >, Other >::value, decltype(ValueType() *Other())>
 Constrained value multiplication operator. More...
 
template<typename ValueType , typename CheckerType , typename Other >
constexpr auto operator* (const Other &lhs, const CheckedValue< ValueType, CheckerType > &rhs) -> std::enable_if_t<!IsMultipliable< Other, CheckedValue< ValueType, CheckerType >>::value, decltype(Other() *ValueType())>
 Constrained value multiplication operator. More...
 
template<typename ValueType , typename CheckerType , typename Other >
constexpr auto operator/ (const CheckedValue< ValueType, CheckerType > &lhs, const Other &rhs) -> decltype(ValueType(lhs)/rhs)
 Constrained value division operator. More...
 
template<typename ValueType , typename CheckerType , typename Other >
constexpr auto operator/ (const Other &lhs, const CheckedValue< ValueType, CheckerType > &rhs) -> decltype(lhs/ValueType(rhs))
 Constrained value division operator. More...
 
template<typename ValueType , typename CheckerType , typename Other >
constexpr auto operator+ (const CheckedValue< ValueType, CheckerType > &lhs, const Other &rhs) -> decltype(ValueType(lhs)+rhs)
 Constrained value addition operator. More...
 
template<typename ValueType , typename CheckerType , typename Other >
constexpr auto operator+ (const Other &lhs, const CheckedValue< ValueType, CheckerType > &rhs) -> decltype(lhs+ValueType(rhs))
 Constrained value addition operator. More...
 
template<typename ValueType , typename CheckerType , typename Other >
constexpr auto operator- (const CheckedValue< ValueType, CheckerType > &lhs, const Other &rhs) -> decltype(ValueType(lhs) - rhs)
 Constrained value subtraction operator. More...
 
template<typename ValueType , typename CheckerType , typename Other >
constexpr auto operator- (const Other &lhs, const CheckedValue< ValueType, CheckerType > &rhs) -> decltype(lhs - ValueType(rhs))
 Constrained value subtraction operator. More...
 
void * Alloc (std::size_t size)
 Allocates memory. More...
 
void * Realloc (void *ptr, std::size_t size)
 Reallocates memory. More...
 
void Free (void *mem)
 Frees memory. More...
 
template<typename T >
T * AllocArray (std::size_t size)
 Allocates memory for an array. More...
 
template<typename T >
T * ReallocArray (T *ptr, std::size_t count)
 Reallocates memory for an array. More...
 
template<typename BT , unsigned int FB>
constexpr bool operator== (Fixed< BT, FB > lhs, Fixed< BT, FB > rhs) noexcept
 Equality operator.
 
template<typename BT , unsigned int FB>
constexpr bool operator!= (Fixed< BT, FB > lhs, Fixed< BT, FB > rhs) noexcept
 Inequality operator.
 
template<typename BT , unsigned int FB>
constexpr bool operator< (Fixed< BT, FB > lhs, Fixed< BT, FB > rhs) noexcept
 Less-than operator.
 
template<typename BT , unsigned int FB>
constexpr bool operator> (Fixed< BT, FB > lhs, Fixed< BT, FB > rhs) noexcept
 Greater-than operator.
 
template<typename BT , unsigned int FB>
constexpr bool operator<= (Fixed< BT, FB > lhs, Fixed< BT, FB > rhs) noexcept
 Less-than or equal-to operator.
 
template<typename BT , unsigned int FB>
constexpr bool operator>= (Fixed< BT, FB > lhs, Fixed< BT, FB > rhs) noexcept
 Greater-than or equal-to operator.
 
template<typename BT , unsigned int FB>
constexpr Fixed< BT, FB > operator+ (Fixed< BT, FB > lhs, Fixed< BT, FB > rhs) noexcept
 Addition operator.
 
template<typename BT , unsigned int FB>
constexpr Fixed< BT, FB > operator- (Fixed< BT, FB > lhs, Fixed< BT, FB > rhs) noexcept
 Subtraction operator.
 
template<typename BT , unsigned int FB>
constexpr Fixed< BT, FB > operator* (Fixed< BT, FB > lhs, Fixed< BT, FB > rhs) noexcept
 Multiplication operator.
 
template<typename BT , unsigned int FB>
constexpr Fixed< BT, FB > operator/ (Fixed< BT, FB > lhs, Fixed< BT, FB > rhs) noexcept
 Division operator.
 
template<typename BT , unsigned int FB>
constexpr Fixed< BT, FB > operator% (Fixed< BT, FB > lhs, Fixed< BT, FB > rhs) noexcept
 Modulo operator.
 
template<typename BT , unsigned int FB>
constexpr bool AlmostZero (Fixed< BT, FB > value)
 Gets whether a given value is almost zero. More...
 
template<typename BT , unsigned int FB>
constexpr bool AlmostEqual (Fixed< BT, FB > x, Fixed< BT, FB > y, int ulp=2)
 Determines whether the given two values are "almost equal".
 
template<typename BT , unsigned int FB>
inline ::std::ostream & operator<< (::std::ostream &os, const Fixed< BT, FB > &value)
 Output stream operator.
 
constexpr Fixed32 operator+ (Fixed32 lhs, Fixed32 rhs) noexcept
 Addition operator.
 
constexpr Fixed32 operator- (Fixed32 lhs, Fixed32 rhs) noexcept
 Subtraction operator.
 
constexpr Fixed32 operator* (Fixed32 lhs, Fixed32 rhs) noexcept
 Multiplication operator.
 
constexpr Fixed32 operator/ (Fixed32 lhs, Fixed32 rhs) noexcept
 Division operator.
 
constexpr Fixed32 operator% (Fixed32 lhs, Fixed32 rhs) noexcept
 Modulo operator.
 
constexpr bool operator== (Fixed32 lhs, Fixed32 rhs) noexcept
 Equality operator.
 
constexpr bool operator!= (Fixed32 lhs, Fixed32 rhs) noexcept
 Inequality operator.
 
constexpr bool operator<= (Fixed32 lhs, Fixed32 rhs) noexcept
 Less-than or equal-to operator.
 
constexpr bool operator>= (Fixed32 lhs, Fixed32 rhs) noexcept
 Greater-than or equal-to operator.
 
constexpr bool operator< (Fixed32 lhs, Fixed32 rhs) noexcept
 Less-than operator.
 
constexpr bool operator> (Fixed32 lhs, Fixed32 rhs) noexcept
 Greater-than operator.
 
template<typename BT , unsigned int FB, int N = 5>
constexpr Fixed< BT, FB > abs (Fixed< BT, FB > arg)
 Computes the absolute value. More...
 
template<typename BT , unsigned int FB>
constexpr Fixed< BT, FB > pow (Fixed< BT, FB > value, int n)
 Computes the value of the given number raised to the given power. More...
 
template<typename BT , unsigned int FB>
constexpr Fixed< BT, FB > trunc (Fixed< BT, FB > arg)
 Truncates the given value. More...
 
template<typename BT , unsigned int FB>
Fixed< BT, FB > nextafter (Fixed< BT, FB > from, Fixed< BT, FB > to) noexcept
 Next after function for Fixed types. More...
 
template<typename BT , unsigned int FB>
Fixed< BT, FB > fmod (Fixed< BT, FB > dividend, Fixed< BT, FB > divisor) noexcept
 Computes the remainder of the division of the given dividend by the given divisor. More...
 
template<typename BT , unsigned int FB>
auto sqrt (Fixed< BT, FB > arg)
 Square root's the given value. More...
 
template<typename BT , unsigned int FB>
bool isnormal (Fixed< BT, FB > arg)
 Gets whether the given value is normal - i.e. not 0 nor infinite. More...
 
template<typename BT , unsigned int FB>
Fixed< BT, FB > sin (Fixed< BT, FB > arg)
 Computes the sine of the argument for Fixed types. More...
 
template<typename BT , unsigned int FB>
Fixed< BT, FB > cos (Fixed< BT, FB > arg)
 Computes the cosine of the argument for Fixed types. More...
 
template<typename BT , unsigned int FB>
Fixed< BT, FB > atan (Fixed< BT, FB > arg)
 Computes the arc tangent. More...
 
template<typename BT , unsigned int FB>
Fixed< BT, FB > atan2 (Fixed< BT, FB > y, Fixed< BT, FB > x)
 Computes the multi-valued inverse tangent. More...
 
template<typename BT , unsigned int FB>
Fixed< BT, FB > log (Fixed< BT, FB > arg)
 Computes the natural logarithm of the given argument. More...
 
template<typename BT , unsigned int FB>
Fixed< BT, FB > exp (Fixed< BT, FB > arg)
 Computes the Euler number raised to the power of the given argument. More...
 
template<typename BT , unsigned int FB>
Fixed< BT, FB > pow (Fixed< BT, FB > base, Fixed< BT, FB > exponent)
 Computes the value of the base number raised to the power of the exponent. More...
 
template<typename BT , unsigned int FB>
Fixed< BT, FB > hypot (Fixed< BT, FB > x, Fixed< BT, FB > y)
 Computes the square root of the sum of the squares. More...
 
template<typename BT , unsigned int FB>
Fixed< BT, FB > round (Fixed< BT, FB > value) noexcept
 Rounds the given value. More...
 
template<typename BT , unsigned int FB>
bool signbit (Fixed< BT, FB > value) noexcept
 Determines whether the given value is negative. More...
 
template<typename BT , unsigned int FB>
constexpr bool isnan (Fixed< BT, FB > value) noexcept
 Gets whether the given value is not-a-number. More...
 
template<typename BT , unsigned int FB>
bool isfinite (Fixed< BT, FB > value) noexcept
 Gets whether the given value is finite. More...
 
template<typename T >
constexpr auto to_underlying (T value) noexcept -> underlying_type_t< T >
 Converts the given value to the value as the underlying type. More...
 
template<typename T >
constexpr T GetSize (const Interval< T > &v) noexcept
 Gets the size of the given interval. More...
 
template<typename T >
constexpr T GetCenter (const Interval< T > &v) noexcept
 Gets the center of the given interval. More...
 
template<typename T >
constexpr bool IsIntersecting (const Interval< T > &a, const Interval< T > &b) noexcept
 Checks whether two value ranges have any intersection/overlap at all.
 
template<typename T >
constexpr Interval< T > GetIntersection (Interval< T > a, const Interval< T > &b) noexcept
 Gets the intersecting interval of two given ranges.
 
template<typename T >
constexpr bool IsEntirelyBefore (const Interval< T > &a, const Interval< T > &b)
 Determines whether the first range is entirely before the second range.
 
template<typename T >
constexpr bool IsEntirelyAfter (const Interval< T > &a, const Interval< T > &b)
 Determines whether the first range is entirely after the second range.
 
template<typename T >
constexpr bool IsEntirelyEnclosing (const Interval< T > &a, const Interval< T > &b)
 Determines whether the first range entirely encloses the second.
 
template<typename T >
constexpr bool operator== (const Interval< T > &a, const Interval< T > &b) noexcept
 Equality operator. More...
 
template<typename T >
constexpr bool operator!= (const Interval< T > &a, const Interval< T > &b) noexcept
 Inequality operator. More...
 
template<typename T >
constexpr bool operator< (const Interval< T > &lhs, const Interval< T > &rhs) noexcept
 Less-than operator. More...
 
template<typename T >
constexpr bool operator<= (const Interval< T > &lhs, const Interval< T > &rhs) noexcept
 Less-than or equal-to operator. More...
 
template<typename T >
constexpr bool operator> (const Interval< T > &lhs, const Interval< T > &rhs) noexcept
 Greater-than operator. More...
 
template<typename T >
constexpr bool operator>= (const Interval< T > &lhs, const Interval< T > &rhs) noexcept
 Greater-than or equal-to operator. More...
 
template<typename T >
::std::ostream & operator<< (::std::ostream &os, const Interval< T > &value)
 Output stream operator.
 
Angle GetDelta (Angle a1, Angle a2) noexcept
 Gets the shortest angular distance to go from angle 1 to angle 2. More...
 
Length2 ComputeCentroid (const Span< const Length2 > &vertices)
 Computes the centroid of a counter-clockwise array of 3 or more vertices. More...
 
std::vector< Length2GetCircleVertices (Length radius, unsigned slices, Angle start=0_deg, Real turns=Real{1})
 Gets the vertices for a circle described by the given parameters.
 
NonNegative< AreaGetAreaOfCircle (Length radius)
 Gets the area of a circle.
 
NonNegative< AreaGetAreaOfPolygon (Span< const Length2 > vertices)
 Gets the area of a polygon. More...
 
SecondMomentOfArea GetPolarMoment (Span< const Length2 > vertices)
 Gets the polar moment of the area enclosed by the given vertices. More...
 
template<typename T >
constexpr auto & GetX (T &value)
 Gets the "X" element of the given value - i.e. the first element.
 
template<typename T >
constexpr auto & GetY (T &value)
 Gets the "Y" element of the given value - i.e. the second element.
 
template<typename T >
constexpr auto & GetZ (T &value)
 Gets the "Z" element of the given value - i.e. the third element.
 
template<typename T >
constexpr auto GetX (const T &value)
 Gets the "X" element of the given value - i.e. the first element.
 
template<typename T >
constexpr auto GetY (const T &value)
 Gets the "Y" element of the given value - i.e. the second element.
 
template<typename T >
constexpr auto GetZ (const T &value)
 Gets the "Z" element of the given value - i.e. the third element.
 
template<typename T >
constexpr std::enable_if_t< std::is_signed< T >::value, std::make_unsigned_t< T > > MakeUnsigned (const T &arg) noexcept
 Makes the given value into an unsigned value. More...
 
template<typename T >
constexpr auto StripUnit (const T &v) -> decltype(StripUnit(v.get()))
 Strips the unit from the given value.
 
template<typename T , typename U >
constexpr U Secant (T target, U a1, T s1, U a2, T s2) noexcept
 Secant method. More...
 
template<typename T >
constexpr T Bisect (T a1, T a2) noexcept
 Bisection method. More...
 
template<typename T >
constexpr bool IsOdd (T val) noexcept
 Is-odd. More...
 
template<class TYPE >
constexpr auto Square (TYPE t) noexcept
 Squares the given value.
 
template<typename T >
auto Atan2 (T y, T x)
 Computes the arc-tangent of the given y and x values. More...
 
template<typename T , typename = std::enable_if_t< IsIterable<T>::value && IsAddable<decltype(*begin(std::declval<T>()))>::value>
auto Average (const T &span)
 Computes the average of the given values.
 
template<typename T >
std::enable_if_t< IsArithmetic< T >::value, T > RoundOff (T value, unsigned precision=100000)
 Computes the rounded value of the given value.
 
Vec2 RoundOff (Vec2 value, std::uint32_t precision=100000)
 Computes the rounded value of the given value.
 
template<typename T , std::size_t N>
constexpr Vector< T, N > abs (const Vector< T, N > &v) noexcept
 Absolute value function for vectors.
 
d2::UnitVec abs (const d2::UnitVec &v) noexcept
 Gets the absolute value of the given value.
 
template<typename T >
constexpr std::enable_if_t< std::is_arithmetic< T >::value, bool > AlmostZero (T value)
 Gets whether a given value is almost zero. More...
 
template<typename T >
constexpr std::enable_if_t< std::is_floating_point< T >::value, bool > AlmostEqual (T x, T y, int ulp=2)
 Determines whether the given two values are "almost equal".
 
template<typename T >
auto ModuloViaFmod (T dividend, T divisor) noexcept
 Modulo operation using std::fmod. More...
 
template<typename T >
auto ModuloViaTrunc (T dividend, T divisor) noexcept
 Modulo operation using std::trunc. More...
 
Angle GetNormalized (Angle value) noexcept
 Gets the "normalized" value of the given angle. More...
 
template<class T >
Angle GetAngle (const Vector2< T > value)
 Gets the angle. More...
 
template<typename T >
constexpr auto GetMagnitudeSquared (T value) noexcept
 Gets the square of the magnitude of the given iterable value. More...
 
template<typename T >
auto GetMagnitude (T value)
 Gets the magnitude of the given value. More...
 
template<typename T1 , typename T2 >
constexpr auto Dot (const T1 a, const T2 b) noexcept
 Performs the dot product on two vectors (A and B). More...
 
template<class T1 , class T2 , std::enable_if_t< std::tuple_size< T1 >::value==2 &&std::tuple_size< T2 >::value==2, int > = 0>
constexpr auto Cross (T1 a, T2 b) noexcept
 Performs the 2-element analog of the cross product of two vectors. More...
 
template<typename T , typename U >
constexpr auto Solve (const Matrix22< U > mat, const Vector2< T > b) noexcept
 Solves A * x = b, where b is a column vector. More...
 
template<class IN_TYPE >
constexpr auto Invert (const Matrix22< IN_TYPE > value) noexcept
 Inverts the given value.
 
constexpr Vec3 Solve33 (const Mat33 &mat, const Vec3 b) noexcept
 Solves A * x = b, where b is a column vector. More...
 
template<typename T >
constexpr T Solve22 (const Mat33 &mat, const T b) noexcept
 Solves A * x = b, where b is a column vector. More...
 
constexpr Mat33 GetInverse22 (const Mat33 &value) noexcept
 Gets the inverse of the given matrix as a 2-by-2. More...
 
constexpr Mat33 GetSymInverse33 (const Mat33 &value) noexcept
 Gets the symmetric inverse of this matrix as a 3-by-3. More...
 
template<class T >
constexpr auto GetRevPerpendicular (const T vector) noexcept
 Gets a vector counter-clockwise (reverse-clockwise) perpendicular to the given vector. More...
 
template<class T >
constexpr auto GetFwdPerpendicular (const T vector) noexcept
 Gets a vector clockwise (forward-clockwise) perpendicular to the given vector. More...
 
template<std::size_t M, typename T1 , std::size_t N, typename T2 >
constexpr auto Transform (const Vector< T1, M > v, const Matrix< T2, M, N > &m) noexcept
 Multiplies an M-element vector by an M-by-N matrix. More...
 
constexpr Vec2 Transform (const Vec2 v, const Mat33 &A) noexcept
 Multiplies a vector by a matrix.
 
constexpr Vec2 InverseTransform (const Vec2 v, const Mat22 &A) noexcept
 Multiply a matrix transpose times a vector. If a rotation matrix is provided, then this transforms the vector from one frame to another (inverse transform).
 
constexpr Mat22 MulT (const Mat22 &A, const Mat22 &B) noexcept
 Computes A^T * B.
 
Mat22 abs (const Mat22 &A)
 Gets the absolute value of the given value.
 
template<typename T >
constexpr T NextPowerOfTwo (T x)
 Gets the next largest power of 2. More...
 
Real Normalize (Vec2 &vector)
 Converts the given vector into a unit vector and returns its original length.
 
template<typename T >
constexpr T GetModuloNext (T value, T count) noexcept
 Gets the modulo next value.
 
template<typename T >
constexpr T GetModuloPrev (T value, T count) noexcept
 Gets the modulo previous value.
 
constexpr Angle GetRevRotationalAngle (Angle a1, Angle a2) noexcept
 Gets the reverse (counter) clockwise rotational angle to go from angle 1 to angle 2. More...
 
template<typename T , std::size_t N>
constexpr std::enable_if_t<!IsVector< T >::value, Matrix< T, N, N > > GetIdentityMatrix ()
 Gets the identity matrix of the template type and size. More...
 
template<typename T >
constexpr std::enable_if_t< IsSquareMatrix< T >::value, T > GetIdentity ()
 Gets the identity matrix of the template type and size as given by the argument. More...
 
template<typename T , std::size_t N>
constexpr std::enable_if_t<!IsVector< T >::value, Vector< Vector< T, N >, 1 > > GetRowMatrix (Vector< T, N > arg)
 Gets the specified row of the given matrix as a row matrix.
 
template<typename T , std::size_t N>
constexpr std::enable_if_t<!IsVector< T >::value, Vector< Vector< T, 1 >, N > > GetColumnMatrix (Vector< T, N > arg)
 Gets the specified column of the given matrix as a column matrix.
 
template<typename T , std::size_t M, std::size_t N>
constexpr auto operator+ (const Matrix< T, M, N > &lhs, const Matrix< T, M, N > &rhs) noexcept
 Matrix addition operator for two same-type, same-sized matrices. More...
 
template<typename T , std::size_t M, std::size_t N>
constexpr auto operator- (const Matrix< T, M, N > &lhs, const Matrix< T, M, N > &rhs) noexcept
 Matrix subtraction operator for two same-type, same-sized matrices. More...
 
template<>
constexpr bool IsValid (const Mat22 &value) noexcept
 Determines if the given value is valid. More...
 
template<>
constexpr bool IsValid (const d2::Position &value) noexcept
 Determines if the given value is valid.
 
template<class T >
PROPAGATE_CONST_CONSTEXPR void swap (propagate_const< T > &pt, propagate_const< T > &pu) noexcept(noexcept(swap(std::declval< T & >(), std::declval< T & >())))
 Support for swap operation.
 
template<>
constexpr bool IsValid (const d2::Sweep &value) noexcept
 Determines if the given value is valid.
 
template<class... T>
void NOT_USED (T &&...)
 "Not used" annotator.
 
template<typename T >
constexpr bool IsValid (const T &value) noexcept
 Determines if the given value is valid. More...
 
template<>
constexpr bool IsValid (const std::size_t &value) noexcept
 Determines if the given value is valid.
 
template<typename T , typename U >
auto EraseFirst (T &container, const U &value) -> decltype(container.erase(find(begin(container), end(container), value)) !=end(container))
 Convenience template function for erasing first found value from container. More...
 
template<typename T , typename U >
auto EraseAll (T &container, const U &value) -> decltype(distance(container.erase(remove(begin(container), end(container), value), end(container)), end(container)))
 Convenience template function for erasing specified value from container. More...
 
template<>
constexpr bool IsValid (const d2::Transformation &value) noexcept
 Determines if the given value is valid.
 
template<>
constexpr bool IsValid (const TypeID &value) noexcept
 Determines if the given value is valid.
 
template<typename T >
constexpr TypeID GetTypeID ()
 Gets the type ID for the template parameter type.
 
template<typename T >
constexpr TypeID GetTypeID (T)
 Gets the type ID for the function parameter type.
 
constexpr const char * GetName (TypeID id) noexcept
 Gets the name associated with the given type ID.
 
template<typename T >
constexpr const char * GetTypeName () noexcept
 Gets the name associated with the given template parameter type.
 
constexpr Mass operator""_g (unsigned long long int v) noexcept
 SI unit symbol for a gram unit of Mass. More...
 
constexpr Mass operator""_g (long double v) noexcept
 SI unit symbol for a gram unit of Mass. More...
 
constexpr Mass operator""_kg (unsigned long long int v) noexcept
 SI unit symbol for a kilogram unit of Mass. More...
 
constexpr Mass operator""_kg (long double v) noexcept
 SI unit symbol for a kilogram unit of Mass. More...
 
constexpr Mass operator""_Pg (unsigned long long int v) noexcept
 SI unit symbol for a petagram unit of Mass. More...
 
constexpr Mass operator""_Pg (long double v) noexcept
 SI unit symbol for a petagram unit of Mass. More...
 
constexpr Mass operator""_Yg (unsigned long long int v) noexcept
 SI unit symbol for a yottagram unit of Mass. More...
 
constexpr Mass operator""_Yg (long double v) noexcept
 SI unit symbol for a yottagram unit of Mass. More...
 
constexpr Length operator""_m (unsigned long long int v) noexcept
 SI unit symbol for a meter of Length. More...
 
constexpr Length operator""_m (long double v) noexcept
 SI unit symbol for a meter of Length. More...
 
constexpr Length operator""_dm (unsigned long long int v) noexcept
 SI unit symbol for a decimeter of Length. More...
 
constexpr Length operator""_dm (long double v) noexcept
 SI unit symbol for a decimeter of Length. More...
 
constexpr Length operator""_cm (unsigned long long int v) noexcept
 SI unit symbol for a centimeter of Length. More...
 
constexpr Length operator""_cm (long double v) noexcept
 SI unit symbol for a centimeter of Length. More...
 
constexpr Length operator""_Gm (unsigned long long int v) noexcept
 SI unit symbol for a gigameter unit of Length. More...
 
constexpr Length operator""_Gm (long double v) noexcept
 SI unit symbol for a gigameter unit of Length. More...
 
constexpr Length operator""_Mm (unsigned long long int v) noexcept
 SI unit symbol for a megameter unit of Length. More...
 
constexpr Length operator""_Mm (long double v) noexcept
 SI unit symbol for a megameter unit of Length. More...
 
constexpr Length operator""_km (unsigned long long int v) noexcept
 SI symbol for a kilometer unit of Length. More...
 
constexpr Length operator""_km (long double v) noexcept
 SI symbol for a kilometer unit of Length. More...
 
constexpr Time operator""_s (unsigned long long int v) noexcept
 SI symbol for a second unit of Time. More...
 
constexpr Time operator""_s (long double v) noexcept
 SI symbol for a second unit of Time. More...
 
constexpr Time operator""_min (unsigned long long int v) noexcept
 SI symbol for a minute unit of Time. More...
 
constexpr Time operator""_min (long double v) noexcept
 SI symbol for a minute unit of Time. More...
 
constexpr Time operator""_h (unsigned long long int v) noexcept
 Symbol for an hour unit of Time. More...
 
constexpr Time operator""_h (long double v) noexcept
 Symbol for an hour unit of Time. More...
 
constexpr Time operator""_d (unsigned long long int v) noexcept
 Symbol for a day unit of Time. More...
 
constexpr Time operator""_d (long double v) noexcept
 Symbol for a day unit of Time. More...
 
constexpr Angle operator""_rad (unsigned long long int v) noexcept
 SI symbol for a radian unit of Angle. More...
 
constexpr Angle operator""_rad (long double v) noexcept
 SI symbol for a radian unit of Angle. More...
 
constexpr Angle operator""_deg (unsigned long long int v) noexcept
 Abbreviation for a degree unit of Angle. More...
 
constexpr Angle operator""_deg (long double v) noexcept
 Abbreviation for a degree unit of Angle. More...
 
constexpr Force operator""_N (unsigned long long int v) noexcept
 SI symbol for a newton unit of Force. More...
 
constexpr Force operator""_N (long double v) noexcept
 SI symbol for a newton unit of Force. More...
 
constexpr Area operator""_m2 (unsigned long long int v) noexcept
 Abbreviation for meter squared unit of Area. More...
 
constexpr Area operator""_m2 (long double v) noexcept
 Abbreviation for meter squared unit of Area. More...
 
constexpr LinearVelocity operator""_mps (unsigned long long int v) noexcept
 Abbreviation for meter per second. More...
 
constexpr LinearVelocity operator""_mps (long double v) noexcept
 Abbreviation for meter per second. More...
 
constexpr LinearVelocity operator""_kps (unsigned long long int v) noexcept
 Abbreviation for kilometer per second. More...
 
constexpr LinearVelocity operator""_kps (long double v) noexcept
 Abbreviation for kilometer per second. More...
 
constexpr LinearAcceleration operator""_mps2 (unsigned long long int v) noexcept
 Abbreviation for meter per second squared. More...
 
constexpr LinearAcceleration operator""_mps2 (long double v) noexcept
 Abbreviation for meter per second squared. More...
 
constexpr Frequency operator""_Hz (unsigned long long int v) noexcept
 SI symbol for a hertz unit of Frequency. More...
 
constexpr Frequency operator""_Hz (long double v) noexcept
 SI symbol for a hertz unit of Frequency. More...
 
constexpr Torque operator""_Nm (unsigned long long int v) noexcept
 Abbreviation for newton-meter unit of torque. More...
 
constexpr Torque operator""_Nm (long double v) noexcept
 Abbreviation for newton-meter unit of torque. More...
 
constexpr Momentum operator""_Ns (unsigned long long int v) noexcept
 SI symbol for a newton second of impulse. More...
 
constexpr Momentum operator""_Ns (long double v) noexcept
 SI symbol for a newton second of impulse. More...
 
constexpr AreaDensity operator""_kgpm2 (unsigned long long int v) noexcept
 Abbreviation for kilogram per square meter.
 
constexpr AreaDensity operator""_kgpm2 (long double v) noexcept
 Abbreviation for kilogram per square meter.
 
constexpr AngularVelocity operator""_rpm (unsigned long long int v) noexcept
 Abbreviation for revolutions per minute. More...
 
constexpr AngularVelocity operator""_rpm (long double v) noexcept
 Abbreviation for revolutions per minute. More...
 
constexpr Real StripUnit (const Real value)
 Strips the units off of the given value.
 
template<>
constexpr bool IsValid (const d2::UnitVec &value) noexcept
 Determines if the given value is valid.
 
template<typename T , std::size_t N>
constexpr bool operator== (const Vector< T, N > &lhs, const Vector< T, N > &rhs) noexcept
 Equality operator.
 
template<typename T , std::size_t N>
constexpr bool operator!= (const Vector< T, N > &lhs, const Vector< T, N > &rhs) noexcept
 Inequality operator.
 
template<typename T , std::size_t N>
constexpr std::enable_if_t< std::is_same< T, decltype(+T{})>::value, Vector< T, N > > operator+ (Vector< T, N > v) noexcept
 Unary plus operator.
 
template<typename T , std::size_t N>
constexpr std::enable_if_t< std::is_same< T, decltype(-T{})>::value, Vector< T, N > > operator- (Vector< T, N > v) noexcept
 Unary negation operator.
 
template<typename T , std::size_t N>
constexpr std::enable_if_t< std::is_same< T, decltype(T{}+T{})>::value, Vector< T, N > & > operator+= (Vector< T, N > &lhs, const Vector< T, N > rhs) noexcept
 Increments the left hand side value by the right hand side value.
 
template<typename T , std::size_t N>
constexpr std::enable_if_t< std::is_same< T, decltype(T{} - T{})>::value, Vector< T, N > & > operator-= (Vector< T, N > &lhs, const Vector< T, N > rhs) noexcept
 Decrements the left hand side value by the right hand side value.
 
template<typename T , std::size_t N>
constexpr std::enable_if_t< std::is_same< T, decltype(T{}+T{})>::value, Vector< T, N > > operator+ (Vector< T, N > lhs, const Vector< T, N > rhs) noexcept
 Adds two vectors component-wise.
 
template<typename T , std::size_t N>
constexpr std::enable_if_t< std::is_same< T, decltype(T{} - T{})>::value, Vector< T, N > > operator- (Vector< T, N > lhs, const Vector< T, N > rhs) noexcept
 Subtracts two vectors component-wise.
 
template<typename T1 , typename T2 , std::size_t N>
constexpr std::enable_if_t< std::is_same< T1, decltype(T1{} *T2{})>::value, Vector< T1, N > & > operator*= (Vector< T1, N > &lhs, const T2 rhs) noexcept
 Multiplication assignment operator.
 
template<typename T1 , typename T2 , std::size_t N>
constexpr std::enable_if_t< std::is_same< T1, decltype(T1{}/T2{})>::value, Vector< T1, N > & > operator/= (Vector< T1, N > &lhs, const T2 rhs) noexcept
 Division assignment operator.
 
template<typename T1 , typename T2 , std::size_t A, std::size_t B, std::size_t C, typename OT = decltype(T1{} * T2{})>
constexpr std::enable_if_t< IsMultipliable< T1, T2 >::value, Vector< Vector< OT, C >, A > > operator* (const Vector< Vector< T1, B >, A > &lhs, const Vector< Vector< T2, C >, B > &rhs) noexcept
 Calculates the matrix product of the two given vector of vectors (matrices). More...
 
template<typename T1 , typename T2 , std::size_t A, std::size_t B, typename OT = decltype(T1{} * T2{})>
constexpr std::enable_if_t< IsMultipliable< T1, T2 >::value &&!IsVector< T1 >::value, Vector< OT, B > > operator* (const Vector< T1, A > &lhs, const Vector< Vector< T2, B >, A > &rhs) noexcept
 Multiplies an A-element vector by a A-by-B vector of vectors. More...
 
template<typename T1 , typename T2 , std::size_t A, std::size_t B, typename OT = decltype(T1{} * T2{})>
constexpr std::enable_if_t< IsMultipliable< T1, T2 >::value &&!IsVector< T2 >::value, Vector< OT, B > > operator* (const Vector< Vector< T1, A >, B > &lhs, const Vector< T2, A > &rhs) noexcept
 Multiplies a B-by-A vector of vectors by an A-element vector. More...
 
template<std::size_t N, typename T1 , typename T2 , typename OT = decltype(T1{} * T2{})>
constexpr std::enable_if_t< IsMultipliable< T1, T2 >::value &&!IsVector< T1 >::value, Vector< OT, N > > operator* (const T1 s, Vector< T2, N > a) noexcept
 Multiplication operator for non-vector times vector. More...
 
template<std::size_t N, typename T1 , typename T2 , typename OT = decltype(T1{} * T2{})>
constexpr std::enable_if_t< IsMultipliable< T1, T2 >::value &&!IsVector< T2 >::value, Vector< OT, N > > operator* (Vector< T1, N > a, const T2 s) noexcept
 Multiplication operator for vector times non-vector. More...
 
template<std::size_t N, typename T1 , typename T2 , typename OT = decltype(T1{} / T2{})>
constexpr std::enable_if_t< IsDivisable< T1, T2 >::value &&!IsVector< T2 >::value, Vector< OT, N > > operator/ (Vector< T1, N > a, const T2 s) noexcept
 Division operator.
 
template<std::size_t I, std::size_t N, typename T >
constexpr auto & get (Vector< T, N > &v) noexcept
 Gets the specified element of the given collection.
 
template<std::size_t I, std::size_t N, typename T >
constexpr auto get (const Vector< T, N > &v) noexcept
 Gets the specified element of the given collection.
 
template<typename T , std::size_t N>
::std::ostream & operator<< (::std::ostream &os, const Vector< T, N > &value)
 Output stream operator.
 
constexpr Vec2 GetVec2 (const Vector2< Real > value)
 Gets the given value as a 2-element vector of reals (Vec2).
 
template<typename TYPE >
constexpr bool IsValid (const Vector2< TYPE > &value) noexcept
 Determines whether the given vector contains finite coordinates.
 
template<>
constexpr bool IsValid (const d2::Velocity &value) noexcept
 Determines if the given value is valid.
 
Version GetVersion () noexcept
 Gets the version information of the library.
 
std::string GetBuildDetails () noexcept
 Gets the build details of the library.
 
constexpr bool operator== (Version lhs, Version rhs)
 Equality operator.
 
constexpr bool operator!= (Version lhs, Version rhs)
 Inequality operator.
 
template<>
constexpr bool IsValid (const BodyID &value) noexcept
 Determines if the given value is valid.
 
bool IsSpeedable (BodyType type)
 Is "speedable". More...
 
bool IsAccelerable (BodyType type)
 Is "accelerable". More...
 
ConstraintSolverConf GetRegConstraintSolverConf (const StepConf &conf) noexcept
 Gets the regular phase constraint solver configuration for the given step configuration.
 
ConstraintSolverConf GetToiConstraintSolverConf (const StepConf &conf) noexcept
 Gets the TOI phase constraint solver configuration for the given step configuration.
 
constexpr ConstraintSolverConf GetDefaultPositionSolverConf () noexcept
 Gets the default position solver configuration.
 
constexpr ConstraintSolverConf GetDefaultToiPositionSolverConf () noexcept
 Gets the default TOI position solver configuration.
 
Real MixFriction (Real friction1, Real friction2)
 Mixes friction. More...
 
Real MixRestitution (Real restitution1, Real restitution2) noexcept
 Mixes restitution. More...
 
template<>
constexpr bool IsValid (const ContactID &value) noexcept
 Determines if the given value is valid.
 
constexpr bool operator== (const ContactKey lhs, const ContactKey rhs) noexcept
 Equality operator.
 
constexpr bool operator!= (const ContactKey lhs, const ContactKey rhs) noexcept
 Inequality operator.
 
constexpr bool operator< (const ContactKey lhs, const ContactKey rhs) noexcept
 Less-than operator.
 
constexpr bool operator<= (const ContactKey lhs, const ContactKey rhs) noexcept
 Less-than or equal-to operator.
 
constexpr bool operator> (const ContactKey lhs, const ContactKey rhs) noexcept
 Greater-than operator.
 
constexpr bool operator>= (const ContactKey lhs, const ContactKey rhs) noexcept
 Greater-than or equal-to operator.
 
constexpr bool operator== (const Filter lhs, const Filter rhs) noexcept
 Equality operator.
 
constexpr bool operator!= (const Filter lhs, const Filter rhs) noexcept
 Inequality operator.
 
bool ShouldCollide (const Filter filterA, const Filter filterB) noexcept
 Determines whether collision processing should be performed.
 
template<>
constexpr bool IsValid (const FixtureID &value) noexcept
 Determines if the given value is valid.
 
template<>
constexpr bool IsValid (const JointID &value) noexcept
 Determines if the given value is valid.
 
MovementConf GetMovementConf (const StepConf &conf) noexcept
 Gets the movement configuration from the given value. More...
 
bool IsMaxTranslationWithinTolerance (const StepConf &conf) noexcept
 Determines whether the maximum translation is within tolerance.
 
Length GetMaxRegLinearCorrection (const StepConf &conf) noexcept
 Gets the maximum regular linear correction from the given value.
 
RegStepStatsUpdate (RegStepStats &lhs, const IslandStats &rhs) noexcept
 Updates regular-phase per-step statistics with island statistics.
 

Variables

constexpr auto InvalidIndexPair
 Invalid index-pair value. More...
 
constexpr auto InvalidIndexPair3
 Invalid array of three index-pair elements. More...
 
constexpr auto Pi = Real(3.14159265358979323846264338327950288)
 Pi. More...
 
constexpr auto SquareRootTwo
 Square root of two. More...
 
constexpr auto Centi = Real(1e-2)
 Centi- (1 x 10^-2). More...
 
constexpr auto Deci = Real(1e-1)
 Deci- (1 x 10^-1). More...
 
constexpr auto Kilo = Real(1e3)
 Kilo- (1 x 10^3). More...
 
constexpr auto Mega = Real(1e6)
 Mega- (1 x 10^6). More...
 
constexpr auto Giga = Real(1e9)
 Giga- (1 x 10^9). More...
 
constexpr auto Tera = Real(1e12)
 Tera- (1 x 10^12). More...
 
constexpr auto Peta = Real(1e15)
 Peta- (1 x 10^15). More...
 
constexpr auto Yotta = Real(1e24)
 Yotta- (1 x 10^24). More...
 
constexpr auto MaxSimplexEdges = std::uint8_t{3}
 Maximum number of supportable edges in a simplex.
 
constexpr auto MaxChildCount = std::numeric_limits<std::uint32_t>::max() >> 6
 Max child count.
 
constexpr auto MaxFloat = std::numeric_limits<Real>::max()
 Maximum float value.
 
constexpr auto MaxManifoldPoints = std::uint8_t{2}
 Maximum manifold points. This is the maximum number of contact points between two convex shapes. Do not change this value. More...
 
constexpr auto MaxShapeVertices = std::uint8_t{254}
 Maximum number of vertices for any shape type. More...
 
constexpr auto InvalidVertex = static_cast<VertexCounter>(-1)
 Invalid vertex index.
 
constexpr auto DefaultLinearSlop = detail::Defaults<Real>::GetLinearSlop()
 Default linear slop. More...
 
constexpr auto DefaultMinVertexRadius = DefaultLinearSlop * Real{2}
 Default minimum vertex radius.
 
constexpr auto DefaultMaxVertexRadius = detail::Defaults<Real>::GetMaxVertexRadius()
 Default maximum vertex radius.
 
constexpr auto DefaultAabbExtension = DefaultLinearSlop * Real{20}
 Default AABB extension amount.
 
constexpr auto DefaultDistanceMultiplier = Real{2}
 Default distance multiplier.
 
constexpr auto DefaultAngularSlop = (Pi * 2_rad) / Real{180}
 Default angular slop. More...
 
constexpr auto DefaultMaxLinearCorrection = 0.2_m
 Default maximum linear correction. More...
 
constexpr auto DefaultMaxAngularCorrection = Real(8.0f / 180.0f) * Pi * 1_rad
 Default maximum angular correction. More...
 
constexpr auto DefaultMaxTranslation = 2_m
 Default maximum translation amount.
 
constexpr auto DefaultMaxRotation = Angle{Pi * 1_rad / Real(2)}
 Default maximum rotation per world step. More...
 
constexpr auto DefaultMaxToiIters = std::uint8_t{20}
 Default maximum time of impact iterations.
 
constexpr auto DefaultMaxToiRootIters = std::uint8_t{30}
 Default maximum time of impact root iterator count.
 
constexpr auto DefaultMaxDistanceIters = std::uint8_t{20}
 Default max number of distance iterations.
 
constexpr auto DefaultMaxSubSteps = std::uint8_t{8}
 Default maximum number of sub steps. More...
 
constexpr auto DefaultVelocityThreshold = 1_mps
 Default velocity threshold.
 
constexpr auto DefaultRegMinMomentum = Momentum{0_Ns / 100}
 Default regular-phase minimum momentum.
 
constexpr auto DefaultToiMinMomentum = Momentum{0_Ns / 100}
 Default TOI-phase minimum momentum.
 
constexpr auto MaxFixtures
 Maximum number of fixtures in a world. More...
 
constexpr auto MaxBodies
 Maximum number of bodies in a world. More...
 
constexpr auto InvalidContactIndex = static_cast<ContactCounter>(-1)
 Invalid contact index.
 
constexpr auto MaxContacts = ContactCounter{MaxBodies} * ContactCounter{MaxBodies - 1} / ContactCounter{2}
 Maximum number of contacts in a world (2147319811). More...
 
constexpr auto MaxJoints
 Maximum number of joints in a world. More...
 
constexpr auto DefaultStepTime = Time{1_s / 60}
 Default step time.
 
constexpr auto DefaultStepFrequency = 60_Hz
 Default step frequency.
 
constexpr auto DefaultMinStillTimeToSleep = Time{1_s / 2}
 Default minimum still time to sleep. More...
 
constexpr auto DefaultLinearSleepTolerance = 0.01_mps
 Default linear sleep tolerance. More...
 
constexpr auto DefaultAngularSleepTolerance = Real{(Pi * 2) / 180} * RadianPerSecond
 Default angular sleep tolerance. More...
 
constexpr auto DefaultCirclesRatio = Real{10}
 Default circles ratio. More...
 
constexpr auto InvalidTypeID
 Invalid type ID value. More...
 
constexpr auto Second = PLAYRHO_UNIT(Time, boost::units::si::second)
 Second unit of time. More...
 
constexpr auto SquareSecond = Second * Second
 Square second unit. More...
 
constexpr auto Hertz = PLAYRHO_UNIT(Frequency, boost::units::si::hertz)
 Hertz unit of Frequency. More...
 
constexpr auto Meter = PLAYRHO_UNIT(Length, boost::units::si::meter)
 Meter unit of Length. More...
 
constexpr auto MeterPerSecond = PLAYRHO_UNIT(LinearVelocity, boost::units::si::meter_per_second)
 Meter per second unit of linear velocity. More...
 
constexpr auto MeterPerSquareSecond
 Meter per square second unit of linear acceleration. More...
 
constexpr auto Kilogram = PLAYRHO_UNIT(Mass, boost::units::si::kilogram)
 Kilogram unit of mass. More...
 
constexpr auto SquareMeter = PLAYRHO_UNIT(Area, boost::units::si::square_meter)
 Square meter unit of area. More...
 
constexpr auto CubicMeter = Meter * Meter * Meter
 Cubic meter unit of volume.
 
constexpr auto KilogramPerSquareMeter
 Kilogram per square meter unit of area density. More...
 
constexpr auto Radian = PLAYRHO_UNIT(Angle, boost::units::si::radian)
 Radian unit of angle. More...
 
constexpr auto Degree = Angle{Radian * Pi / Real{180}}
 Degree unit of angle quantity. More...
 
constexpr auto SquareRadian = Radian * Radian
 Square radian unit type. More...
 
constexpr auto RadianPerSecond = PLAYRHO_UNIT(AngularVelocity, boost::units::si::radian_per_second)
 Radian per second unit of angular velocity. More...
 
constexpr auto DegreePerSecond = AngularVelocity{RadianPerSecond * Degree / Radian}
 Degree per second unit of angular velocity. More...
 
constexpr auto RadianPerSquareSecond = Radian / (Second * Second)
 Radian per square second unit of angular acceleration. More...
 
constexpr auto DegreePerSquareSecond = Degree / (Second * Second)
 Degree per square second unit of angular acceleration. More...
 
constexpr auto Newton = PLAYRHO_UNIT(Force, boost::units::si::newton)
 Newton unit of force. More...
 
constexpr auto NewtonMeter = PLAYRHO_UNIT(Torque, boost::units::si::newton_meter)
 Newton meter unit of torque. More...
 
constexpr auto NewtonSecond = Newton * Second
 Newton second unit of momentum. More...
 
constexpr auto NewtonMeterSecond = NewtonMeter * Second
 Newton meter second unit of angular momentum. More...
 
constexpr auto RevolutionsPerMinute = 2 * Pi * Radian / (Real{60} * Second)
 Revolutions per minute units of angular velocity. More...
 
constexpr auto EarthlyLinearAcceleration = Real{-9.8f} * MeterPerSquareSecond
 Earthly gravity. More...
 
constexpr auto BigG = Real{6.67408e-11f} * CubicMeter / (Kilogram * SquareSecond)
 Big "G". More...
 
constexpr auto InvalidBodyID = static_cast<BodyID>(static_cast<BodyID::underlying_type>(-1))
 Invalid body ID value.
 
constexpr auto InvalidContactID
 Invalid contact ID value. More...
 
constexpr auto InvalidFixtureID
 Invalid fixture ID value. More...
 
constexpr auto InvalidJointID = static_cast<JointID>(static_cast<JointID::underlying_type>(-1))
 Invalid joint ID value.
 

Detailed Description

Name space for all PlayRho related names.

Typedef Documentation

◆ BodyCounter

using playrho::BodyCounter = typedef std::remove_const<decltype(MaxBodies)>::type

Count type for bodies.

Note
This type must always be able to contain the MaxBodies value.
Examples
World.cpp, and WorldBody.cpp.

◆ ChildCounter

using playrho::ChildCounter = typedef std::remove_const<decltype(MaxChildCount)>::type

Child counter type.

Relating to "children" of shape where each child is a convex shape possibly comprising a concave shape.

Note
This type must always be able to contain the MaxChildCount value.
Examples
Shape.cpp, World.cpp, and WorldContact.cpp.

◆ ContactCounter

using playrho::ContactCounter = typedef Wider<BodyCounter>::type

Count type for contacts.

Note
This type must be able to contain the squared value of BodyCounter.
Examples
World.cpp.

◆ Fixed32

using playrho::Fixed32 = typedef Fixed<std::int32_t,9>

32-bit fixed precision type.

This is a 32-bit fixed precision type with a Q number-format of Q23.9.

Warning
The available numeric fidelity of any 32-bit fixed point type is very limited. Using a 32-bit fixed point type for Real should only be considered for simulations where it's been found to work and where the dynamics won't be changing between runs.
Note
Maximum value (with 9 fraction bits) is approximately 4194303.99609375.
Minimum value (with 9 fraction bits) is approximately 0.001953125.
See also
Fixed, Real
https://en.wikipedia.org/wiki/Q_(number_format)

◆ FixtureCounter

using playrho::FixtureCounter = typedef std::remove_const<decltype(MaxFixtures)>::type

Counter type for fixtures.

Note
This type must always be able to contain the MaxFixtures value.

◆ Force2

using playrho::Force2 = typedef Vector2<Force>

2-element vector of Force quantities.

Note
Often used as a 2-dimensional force vector.
Examples
World.cpp.

◆ HasNullaryFunctor

template<typename Type , typename Return >
using playrho::HasNullaryFunctor = typedef HasFunctor<Type,Return()>

Has nullary functor type alias.

See also
HasUnaryFunctor.

◆ HasUnaryFunctor

template<typename Type , typename Return , typename Arg >
using playrho::HasUnaryFunctor = typedef HasFunctor<Type,Return(Arg)>

Has unary functor type alias.

See also
HasNullaryFunctor.

◆ IndexPair

using playrho::IndexPair = typedef std::pair<VertexCounter, VertexCounter>

Index pair.

Note
This data structure is at least 2-bytes large.
Using std::array would make more sense if it weren't for the fact that std::pair, but not std::array, has constexpr equality and inequality operators.

◆ IndexPair3

using playrho::IndexPair3 = typedef std::array<IndexPair, MaxSimplexEdges>

Array of three index-pair elements.

Note
An element having the InvalidIndexPair value, denotes an unused or invalid elements.
This data type is 6-bytes large (on at least one 64-bit platform).

◆ JointCounter

using playrho::JointCounter = typedef std::remove_const<decltype(MaxJoints)>::type

Counter type for joints.

Note
This type must be able to contain the MaxJoints value.
Examples
World.cpp.

◆ Length2

using playrho::Length2 = typedef Vector2<Length>

2-element vector of Length quantities.

Note
Often used as a 2-dimensional distance or location vector.
Examples
DistanceJoint.cpp, PrismaticJoint.cpp, PulleyJoint.cpp, RevoluteJoint.cpp, RopeJoint.cpp, Shape.cpp, TargetJoint.cpp, WeldJoint.cpp, WheelJoint.cpp, World.cpp, WorldBody.cpp, and WorldFixture.cpp.

◆ LinearAcceleration2

2-element vector of linear acceleration (LinearAcceleration) quantities.

Note
Often used as a 2-dimensional linear acceleration vector.
Examples
WorldBody.cpp.

◆ LinearVelocity2

2-element vector of linear velocity (LinearVelocity) quantities.

Note
Often used as a 2-dimensional speed vector.
Examples
WorldBody.cpp.

◆ Matrix

template<typename T , std::size_t M, std::size_t N>
using playrho::Matrix = typedef Vector<Vector<T, N>, M>

Generic M by N matrix.

Note
M is the number of rows of the matrix.
N is the number of columns of the matrix.
See also
https://en.wikipedia.org/wiki/Matrix_(mathematics)
Vector, Matrix Traits, IsVector

◆ Momentum2

2-element vector of Momentum quantities.

Note
Often used as a 2-dimensional momentum vector.
Examples
Joint.cpp.

◆ PairLength2

using playrho::PairLength2 = typedef std::pair<Length2, Length2>

Pair of Length2 values.

Note
Uses std::pair because this is a pair and also because std::pair has more support for constant expressions.

◆ Real

using playrho::Real = typedef float

Real-number type.

This is the number type underlying numerical calculations conceptually involving real-numbers. Ideally the implementation of this type doesn't suffer from things like: catastrophic cancellation, catastrophic division, overflows, nor underflows.

Note
This can be implemented using any of the fundamental floating point types ( float, double, or long double).
This can also be implemented using a LiteralType that has the necessary support: all common mathematical functions, support for infinity and NaN, and a specialization of the std::numeric_limits class template for it.
At present, the Fixed32 and Fixed64 aliases of the Fixed template type are provided as examples of qualifying literal types though the usability of these are limited and their use is discouraged.
Regarding division:
  • While dividing 1 by a real, caching the result, and then doing multiplications with the result may well be faster (than repeatedly dividing), dividing 1 by the real can also result in an underflow situation that's then compounded every time it's multiplied with other values.
  • Meanwhile, dividing every time by a real isolates any underflows to the particular division where underflow occurs.
Warning
Using Fixed32 is not advised as its numerical limitations are more likely to result in problems like overflows or underflows.
The note regarding division applies even more so when using a fixed-point type (for Real).
See also
https://en.cppreference.com/w/cpp/language/types
https://en.cppreference.com/w/cpp/types/is_floating_point
https://en.cppreference.com/w/cpp/named_req/LiteralType
Examples
Body.cpp, DistanceJoint.cpp, GearJoint.cpp, MotorJoint.cpp, PrismaticJoint.cpp, PulleyJoint.cpp, RevoluteJoint.cpp, Shape.cpp, TargetJoint.cpp, WeldJoint.cpp, WheelJoint.cpp, World.cpp, WorldBody.cpp, WorldContact.cpp, and WorldFixture.cpp.

◆ TimestepIters

using playrho::TimestepIters = typedef std::uint8_t

Time step iterations type.

A type for counting iterations per time-step.

◆ TupleContainsType

template<typename T , typename Tuple >
using playrho::TupleContainsType = typedef typename HasType<T, Tuple>::type

Tuple contains type alias.

Alias in case the trait itself should be std::true_type or std::false_type.

Note
This is from Piotr Skotnicki's answer on the StackOverflow website to the question of: "How do I find out if a tuple contains a type?".
See also
https://stackoverflow.com/a/25958302/7410358

◆ Vec2

using playrho::Vec2 = typedef Vector2<Real>

Vector with 2 Real elements.

Note
This data structure is two-times the size of the Real type (or 8 using Real of float).
Examples
World.cpp, and WorldBody.cpp.

◆ Vec3

using playrho::Vec3 = typedef Vector3<Real>

A 3-dimensional column vector with 3 elements.

Note
This data structure is 3 times the size of Real - i.e. 12-bytes (with 4-byte Real).

◆ Vector2

template<typename T >
using playrho::Vector2 = typedef Vector<T, 2>

Vector with 2-elements.

Note
This is just a C++11 alias template for 2-element uses of the Vector template.

◆ Vector3

template<typename T >
using playrho::Vector3 = typedef Vector<T, 3>

Vector with 3-elements.

Note
This is just a C++11 alias template for 3-element uses of the Vector template.

◆ VertexCounter

using playrho::VertexCounter = typedef std::remove_const<decltype(MaxShapeVertices)>::type

Vertex count type.

Note
This type must not support more than 255 vertices as that would conflict with the ContactFeature::Index type.

Enumeration Type Documentation

◆ BodyType

enum playrho::BodyType
strong

Type of body.

Note
static: zero mass, zero velocity, may be manually moved.
kinematic: zero mass, non-zero velocity set by user, moved by solver.
dynamic: positive mass, non-zero velocity determined by forces, moved by solver.
See also
IsSpeedable(BodyType), IsAccelerable(BodyType).
Enumerator
Static 

Static body type.

Static bodies have no mass, have no forces applied to them, and aren't moved by physical processes. They are impenetrable.

Note
Physics applied: none.
Kinematic 

Kinematic body type.

Kinematic bodies: have no mass, cannot have forces applied to them, can move at set velocities (they are "speedable"), and are impenetrable.

Note
Physics applied: velocity.
Dynamic 

Dynamic body type.

Dynamic bodies are fully simulated bodies - they are "speedable" and "accelerable". Dynamic bodies always have a positive non-zero mass. They may be penetrable.

Note
Physics applied: velocity, acceleration.

◆ PointState

enum playrho::PointState
strong

Point state enumeration.

Note
This is used for determining the state of contact points.
Enumerator
NullState 

point does not exist

AddState 

point was added in the update

PersistState 

point persisted across the update

RemoveState 

point was removed in the update

◆ RayCastOpcode

Ray cast opcode enumeration.

Instructs some ray casting methods on what to do next.

Enumerator
Terminate 

End the ray-cast search for fixtures.

Use this to stop searching for fixtures.

IgnoreFixture 

Ignore the current fixture.

Use this to continue searching for fixtures along the ray.

ClipRay 

Clip the ray end to the current point.

Use this shorten the ray to the current point and to continue searching for fixtures now along the newly shortened ray.

ResetRay 

Reset the ray end back to the second point.

Use this to restore the ray to its full length and to continue searching for fixtures now along the restored full length ray.

Function Documentation

◆ Alloc()

void * playrho::Alloc ( std::size_t  size)

Allocates memory.

Note
One can change this function to use ones own memory allocator. Be sure to conform to this function's interface: throw a std::bad_alloc exception if unable to allocate non-zero sized memory and return a null pointer if the requested size is zero. This is done to ensure that the behavior is not implementation defined unlike std::malloc.
Exceptions
std::bad_allocIf unable to allocate non-zero sized memory.
Returns
Non-null pointer if size is not zero else nullptr. Pointer must be deallocated with Free(void*) or one of the Realloc functions.
See also
Free, Realloc, ReallocArray.

Referenced by AllocArray(), playrho::BlockAllocator::Allocate(), playrho::StackAllocator::Allocate(), and playrho::StackAllocator::StackAllocator().

◆ AllocArray()

template<typename T >
T* playrho::AllocArray ( std::size_t  size)

Allocates memory for an array.

Exceptions
std::bad_allocIf unable to allocate non-zero sized memory.
Returns
Non-null pointer if size is not zero else nullptr. Pointer must be deallocated with Free(void*) or one of the Realloc functions.
See also
Free, Alloc, ReallocArray.

◆ AlmostZero()

template<typename BT , unsigned int FB>
constexpr bool playrho::AlmostZero ( Fixed< BT, FB >  value)
constexpr

Gets whether a given value is almost zero.

An almost zero value is "subnormal". Dividing by these values can lead to odd results like a divide by zero trap occurring.

Returns
true if the given value is almost zero, false otherwise.

Referenced by AlmostEqual(), playrho::d2::ClipSegmentToLine(), ComputeCentroid(), playrho::d2::Distance(), playrho::d2::GetMassData(), playrho::d2::GetToiViaSat(), Invert(), Normalize(), playrho::d2::RayCast(), and Solve().

◆ EraseAll()

template<typename T , typename U >
auto playrho::EraseAll ( T &  container,
const U &  value 
) -> decltype(distance(container.erase(remove(begin(container), end(container), value), end(container)), end(container)))

Convenience template function for erasing specified value from container.

Note
This basically is the C++20 std::erase function.
Returns
Count of elements erased.
See also
EraseFirst.

Referenced by playrho::d2::WorldImpl::Destroy().

◆ EraseFirst()

template<typename T , typename U >
auto playrho::EraseFirst ( T &  container,
const U &  value 
) -> decltype(container.erase(find(begin(container), end(container), value)) != end(container))

Convenience template function for erasing first found value from container.

Returns
true if value was found and erased, false otherwise.
See also
EraseAll.

◆ Free()

◆ GetCenter()

template<typename T >
constexpr T GetCenter ( const Interval< T > &  v)
constexprnoexcept

Gets the center of the given interval.

Warning
Behavior is undefined if the difference between the given range's max and min values overflows the range of the Interval::value_type.

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

◆ GetIdentity()

template<typename T >
constexpr std::enable_if_t<IsSquareMatrix<T>::value, T> playrho::GetIdentity ( )
constexpr

Gets the identity matrix of the template type and size as given by the argument.

See also
https://en.wikipedia.org/wiki/Identity_matrix
Matrix, IsMatrix, IsSquareMatrix

◆ GetIdentityMatrix()

template<typename T , std::size_t N>
constexpr std::enable_if_t<!IsVector<T>::value, Matrix<T, N, N> > playrho::GetIdentityMatrix ( )
constexpr

Gets the identity matrix of the template type and size.

See also
https://en.wikipedia.org/wiki/Identity_matrix
Matrix, IsMatrix, IsSquareMatrix

◆ GetInvalid()

template<>
constexpr JointID playrho::GetInvalid ( )
constexprnoexcept

Gets an invalid AABB value.

Gets an invalid value for the JointID type.

Gets an invalid value for the FixtureID type.

Gets an invalid value for the ContactID type.

Gets an invalid value for the BodyID type.

Gets an invalid value for the 3-element vector of real (Vec3) type.

Gets an invalid value for the Vec2 type.

Gets an invalid value for the UnitVec type.

Gets an invalid value for the TypeID type.

Gets an invalid value for the std::size_t type.

Gets an invalid value for the long double type.

Gets an invalid value for the double type.

Gets an invalid value for the float type.

Gets an invalid value for the type.

Gets an invalid value for a Mat22.

Gets an invalid value.

Template Parameters
TType to get an invalid value for.
Note
Specialize this function for the types which have an invalid value concept.
See also
IsValid.
Examples
TargetJoint.cpp.

◆ GetMovementConf()

MovementConf GetMovementConf ( const StepConf conf)
noexcept

Gets the movement configuration from the given value.

Returns
The maxTranslation and maxRotation fields of the given value respectively are returned.

Referenced by playrho::d2::WorldImpl::SolveRegIslandViaGS(), and playrho::d2::WorldImpl::SolveToiViaGS().

◆ GetNumValidIndices()

constexpr std::size_t playrho::GetNumValidIndices ( IndexPair3  pairs)
constexprnoexcept

Gets the number of valid indices in the given collection of index pairs.

Note
Any element with a value of InvalidIndexPair is interpreted as being invalid in this context.
Returns
Value between 0 and 3 inclusive.

Referenced by empty(), and size().

◆ GetSize()

template<typename T >
constexpr T playrho::GetSize ( const Interval< T > &  v)
constexprnoexcept

Gets the size of the given interval.

Gets the difference between the max and min values.

Warning
Behavior is undefined if the difference between the given range's max and min values overflows the range of the Interval::value_type.
Returns
Non-negative value unless the given interval is "unset" or invalid.

Referenced by playrho::detail::GetDimensions(), and playrho::d2::GetPerimeter().

◆ IsAccelerable()

bool playrho::IsAccelerable ( BodyType  type)
inline

Is "accelerable".

Whether or not the given type value is for a body which can have a non-zero acceleration associated with it.

Returns
true if the given type value represents an "accelerable" type value, false otherwise.
Note
Would be nice if the Doxygen "relatedalso BodyType" command worked for this but seems that doesn't work for scoped enumeration.
See also
IsSpeedable(BodyType).
Examples
World.cpp.

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

◆ IsSpeedable()

bool playrho::IsSpeedable ( BodyType  type)
inline

Is "speedable".

Whether or not the given type value is for a body which can have a non-zero speed associated with it.

Returns
true if the given type value represents a "speedable" type value, false otherwise.
Note
Would be nice if the Doxygen "relatedalso BodyType" command worked for this but seems that doesn't work for scoped enumeration.
See also
IsAccelerable(BodyType).
Examples
World.cpp.

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

◆ IsValid() [1/2]

template<>
constexpr bool playrho::IsValid ( const Mat22 value)
constexprnoexcept

Determines if the given value is valid.

Determines whether the given vector contains finite coordinates.

◆ IsValid() [2/2]

template<typename T >
constexpr bool playrho::IsValid ( const T &  value)
constexprnoexcept

Determines if the given value is valid.

See also
GetInvalid.

◆ MakeUnsigned()

template<typename T >
constexpr std::enable_if_t<std::is_signed<T>::value, std::make_unsigned_t<T> > playrho::MakeUnsigned ( const T &  arg)
constexprnoexcept

Makes the given value into an unsigned value.

Note
If the given value is negative, this will result in an unsigned value which is the two's complement modulo-wrapped value.
This is different from std::make_unsigned in that this changes the value to the value in the type that's the unsigned type equivalent of the input value. std::make_unsigned merely provides the unsigned type equivalent.

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

◆ max_size()

constexpr auto playrho::max_size ( IndexPair3  pairs) -> decltype(pairs.max_size())
constexpr

Gets the maximum size of the given container of index pairs.

Returns
Always returns 3.

◆ MixFriction()

Real playrho::MixFriction ( Real  friction1,
Real  friction2 
)
inline

Mixes friction.

Friction mixing formula. The idea is to allow either fixture to drive the resulting friction to zero. For example, anything slides on ice.

Warning
Behavior is undefined if either friction values is less than zero.
Parameters
friction1A zero or greater value.
friction2A zero or greater value.

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

◆ MixRestitution()

Real playrho::MixRestitution ( Real  restitution1,
Real  restitution2 
)
inlinenoexcept

Mixes restitution.

Restitution mixing law. The idea is allow for anything to bounce off an inelastic surface. For example, a super ball bounces on anything.

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

◆ operator!=() [1/4]

template<typename LhsValueType , typename LhsCheckerType , typename RhsValueType , typename RhsCheckerType >
constexpr auto operator!= ( const CheckedValue< LhsValueType, LhsCheckerType > &  lhs,
const CheckedValue< RhsValueType, RhsCheckerType > &  rhs 
) -> decltype(LhsValueType(lhs) != RhsValueType(rhs))
constexprnoexcept

Constrained value inequality operator for value types which support it.

Template Parameters
LhsValueTypeType of the value used by the left hand side checked value.
LhsCheckerTypeType of the checker used by the left hand side checked value.
RhsValueTypeType of the value used by the right hand side checked value.
RhsCheckerTypeType of the checker used by the right hand side checked value.

◆ operator!=() [2/4]

template<typename ValueType , typename CheckerType , typename Other >
constexpr auto operator!= ( const CheckedValue< ValueType, CheckerType > &  lhs,
const Other &  rhs 
) -> decltype(ValueType(lhs) != rhs)
constexpr

Constrained value inequality operator.

Template Parameters
ValueTypeType of the value used by the checked value.
CheckerTypeType of the checker used by the checked value.
OtherType of the other value that this operation will operator with.

◆ operator!=() [3/4]

template<typename T >
constexpr bool operator!= ( const Interval< T > &  a,
const Interval< T > &  b 
)
constexprnoexcept

Inequality operator.

Note
Satisfies the EqualityComparable named requirement for Interval objects.
See also
https://en.cppreference.com/w/cpp/named_req/EqualityComparable

◆ operator!=() [4/4]

template<typename ValueType , typename CheckerType , typename Other >
constexpr auto operator!= ( const Other &  lhs,
const CheckedValue< ValueType, CheckerType > &  rhs 
) -> decltype(lhs != ValueType(rhs))
constexpr

Constrained value inequality operator.

Template Parameters
ValueTypeType of the value used by the checked value.
CheckerTypeType of the checker used by the checked value.
OtherType of the other value that this operation will operator with.

◆ operator*() [1/8]

template<typename LhsValueType , typename LhsCheckerType , typename RhsValueType , typename RhsCheckerType >
constexpr auto operator* ( const CheckedValue< LhsValueType, LhsCheckerType > &  lhs,
const CheckedValue< RhsValueType, RhsCheckerType > &  rhs 
) -> decltype(LhsValueType(lhs) * RhsValueType(rhs))
constexpr

Constrained value multiplication operator.

Template Parameters
LhsValueTypeType of the value used by the left hand side checked value.
LhsCheckerTypeType of the checker used by the left hand side checked value.
RhsValueTypeType of the value used by the right hand side checked value.
RhsCheckerTypeType of the checker used by the right hand side checked value.

◆ operator*() [2/8]

template<typename ValueType , typename CheckerType , typename Other >
constexpr auto operator* ( const CheckedValue< ValueType, CheckerType > &  lhs,
const Other &  rhs 
) -> std::enable_if_t<!IsMultipliable<CheckedValue<ValueType, CheckerType>, Other>::value, decltype(ValueType()*Other())>
constexpr

Constrained value multiplication operator.

Template Parameters
ValueTypeType of the value used by the checked value.
CheckerTypeType of the checker used by the checked value.
OtherType of the other value that this operation will operator with.

◆ operator*() [3/8]

template<typename ValueType , typename CheckerType , typename Other >
constexpr auto operator* ( const Other &  lhs,
const CheckedValue< ValueType, CheckerType > &  rhs 
) -> std::enable_if_t<!IsMultipliable<Other, CheckedValue<ValueType, CheckerType>>::value, decltype(Other()*ValueType())>
constexpr

Constrained value multiplication operator.

Template Parameters
ValueTypeType of the value used by the checked value.
CheckerTypeType of the checker used by the checked value.
OtherType of the other value that this operation will operator with.

◆ operator*() [4/8]

template<std::size_t N, typename T1 , typename T2 , typename OT = decltype(T1{} * T2{})>
constexpr std::enable_if_t< IsMultipliable< T1, T2 >::value &&!IsVector< T1 >::value, Vector< OT, N > > operator* ( const T1  s,
Vector< T2, N >  a 
)
constexprnoexcept

Multiplication operator for non-vector times vector.

Note
Explicitly disabled for Vector * Vector to prevent this function from existing in that case and prevent errors like "use of overloaded operator '*' is ambiguous".

◆ operator*() [5/8]

template<typename T1 , typename T2 , std::size_t A, std::size_t B, typename OT = decltype(T1{} * T2{})>
constexpr std::enable_if_t<IsMultipliable<T1, T2>::value && !IsVector<T1>::value, Vector<OT, B> > playrho::operator* ( const Vector< T1, A > &  lhs,
const Vector< Vector< T2, B >, A > &  rhs 
)
constexprnoexcept

Multiplies an A-element vector by a A-by-B vector of vectors.

Note
This algorithm favors column major ordering of the vector of vectors.
This treats the left-hand-side argument as though it's a 1-by-A vector of vectors.
Parameters
lhsLeft-hand-side vector treated as if it were of type: Vector<Vector<T1, A>, 1>.
rhsRight-hand-side vector of vectors.
Returns
B-element vector product.

◆ operator*() [6/8]

template<typename T1 , typename T2 , std::size_t A, std::size_t B, typename OT = decltype(T1{} * T2{})>
constexpr std::enable_if_t<IsMultipliable<T1, T2>::value && !IsVector<T2>::value, Vector<OT, B> > playrho::operator* ( const Vector< Vector< T1, A >, B > &  lhs,
const Vector< T2, A > &  rhs 
)
constexprnoexcept

Multiplies a B-by-A vector of vectors by an A-element vector.

Note
This algorithm favors row major ordering of the vector of vectors.
This treats the right-hand-side argument as though it's an A-by-1 vector of vectors.
Parameters
lhsLeft-hand-side vector of vectors.
rhsRight-hand-side vector treated as if it were of type: Vector<Vector<T2, 1>, A>.
Returns
B-element vector product.

◆ operator*() [7/8]

template<typename T1 , typename T2 , std::size_t A, std::size_t B, std::size_t C, typename OT = decltype(T1{} * T2{})>
constexpr std::enable_if_t< IsMultipliable< T1, T2 >::value, Vector< Vector< OT, C >, A > > operator* ( const Vector< Vector< T1, B >, A > &  lhs,
const Vector< Vector< T2, C >, B > &  rhs 
)
constexprnoexcept

Calculates the matrix product of the two given vector of vectors (matrices).

Multiplies an A-by-B vector of vectors by a B-by-C vector of vectors returning an A-by-C vector of vectors.

Note
From Wikipedia:

Multiplication of two matrices is defined if and only if the number of columns of the left matrix is the same as the number of rows of the right matrix.

Matrix multiplication is not commutative.
Algorithmically speaking, this implementation is called the "naive" algorithm. For small matrices, like 3-by-3 or smaller matrices, its complexity shouldn't be an issue. The matrix dimensions are compile time constants anyway which can help compilers automatically identify loop unrolling and hardware level parallelism opportunities.
Parameters
lhsLeft-hand-side matrix.
rhsRight-hand-side matrix.
Returns
A-by-C matrix product of the left-hand-side matrix and the right-hand-side matrix.
See also
https://en.wikipedia.org/wiki/Matrix_multiplication
https://en.wikipedia.org/wiki/Matrix_multiplication_algorithm
https://en.wikipedia.org/wiki/Commutative_property

◆ operator*() [8/8]

template<std::size_t N, typename T1 , typename T2 , typename OT = decltype(T1{} * T2{})>
constexpr std::enable_if_t< IsMultipliable< T1, T2 >::value &&!IsVector< T2 >::value, Vector< OT, N > > operator* ( Vector< T1, N >  a,
const T2  s 
)
constexprnoexcept

Multiplication operator for vector times non-vector.

Note
Explicitly disabled for Vector * Vector to prevent this function from existing in that case and prevent errors like "use of overloaded operator '*' is ambiguous".

◆ operator+() [1/4]

template<typename LhsValueType , typename LhsCheckerType , typename RhsValueType , typename RhsCheckerType >
constexpr auto operator+ ( const CheckedValue< LhsValueType, LhsCheckerType > &  lhs,
const CheckedValue< RhsValueType, RhsCheckerType > &  rhs 
) -> decltype(LhsValueType(lhs) + RhsValueType(rhs))
constexpr

Constrained value addition operator.

Template Parameters
LhsValueTypeType of the value used by the left hand side checked value.
LhsCheckerTypeType of the checker used by the left hand side checked value.
RhsValueTypeType of the value used by the right hand side checked value.
RhsCheckerTypeType of the checker used by the right hand side checked value.

◆ operator+() [2/4]

template<typename ValueType , typename CheckerType , typename Other >
constexpr auto operator+ ( const CheckedValue< ValueType, CheckerType > &  lhs,
const Other &  rhs 
) -> decltype(ValueType(lhs) + rhs)
constexpr

Constrained value addition operator.

Template Parameters
ValueTypeType of the value used by the checked value.
CheckerTypeType of the checker used by the checked value.
OtherType of the other value that this operation will operator with.

◆ operator+() [3/4]

template<typename T , std::size_t M, std::size_t N>
constexpr auto playrho::operator+ ( const Matrix< T, M, N > &  lhs,
const Matrix< T, M, N > &  rhs 
)
constexprnoexcept

Matrix addition operator for two same-type, same-sized matrices.

See also
https://en.wikipedia.org/wiki/Matrix_addition

◆ operator+() [4/4]

template<typename ValueType , typename CheckerType , typename Other >
constexpr auto operator+ ( const Other &  lhs,
const CheckedValue< ValueType, CheckerType > &  rhs 
) -> decltype(lhs + ValueType(rhs))
constexpr

Constrained value addition operator.

Template Parameters
ValueTypeType of the value used by the checked value.
CheckerTypeType of the checker used by the checked value.
OtherType of the other value that this operation will operator with.

◆ operator-() [1/4]

template<typename LhsValueType , typename LhsCheckerType , typename RhsValueType , typename RhsCheckerType >
constexpr auto operator- ( const CheckedValue< LhsValueType, LhsCheckerType > &  lhs,
const CheckedValue< RhsValueType, RhsCheckerType > &  rhs 
) -> decltype(LhsValueType(lhs) - RhsValueType(rhs))
constexpr

Constrained value subtraction operator.

Template Parameters
LhsValueTypeType of the value used by the left hand side checked value.
LhsCheckerTypeType of the checker used by the left hand side checked value.
RhsValueTypeType of the value used by the right hand side checked value.
RhsCheckerTypeType of the checker used by the right hand side checked value.

◆ operator-() [2/4]

template<typename ValueType , typename CheckerType , typename Other >
constexpr auto operator- ( const CheckedValue< ValueType, CheckerType > &  lhs,
const Other &  rhs 
) -> decltype(ValueType(lhs) - rhs)
constexpr

Constrained value subtraction operator.

Template Parameters
ValueTypeType of the value used by the checked value.
CheckerTypeType of the checker used by the checked value.
OtherType of the other value that this operation will operator with.

◆ operator-() [3/4]

template<typename T , std::size_t M, std::size_t N>
constexpr auto playrho::operator- ( const Matrix< T, M, N > &  lhs,
const Matrix< T, M, N > &  rhs 
)
constexprnoexcept

Matrix subtraction operator for two same-type, same-sized matrices.

See also
https://en.wikipedia.org/wiki/Matrix_addition

◆ operator-() [4/4]

template<typename ValueType , typename CheckerType , typename Other >
constexpr auto operator- ( const Other &  lhs,
const CheckedValue< ValueType, CheckerType > &  rhs 
) -> decltype(lhs - ValueType(rhs))
constexpr

Constrained value subtraction operator.

Template Parameters
ValueTypeType of the value used by the checked value.
CheckerTypeType of the checker used by the checked value.
OtherType of the other value that this operation will operator with.

◆ operator/() [1/3]

template<typename LhsValueType , typename LhsCheckerType , typename RhsValueType , typename RhsCheckerType >
constexpr auto operator/ ( const CheckedValue< LhsValueType, LhsCheckerType > &  lhs,
const CheckedValue< RhsValueType, RhsCheckerType > &  rhs 
) -> decltype(LhsValueType(lhs) / RhsValueType(rhs))
constexpr

Constrained value division operator.

Template Parameters
LhsValueTypeType of the value used by the left hand side checked value.
LhsCheckerTypeType of the checker used by the left hand side checked value.
RhsValueTypeType of the value used by the right hand side checked value.
RhsCheckerTypeType of the checker used by the right hand side checked value.

◆ operator/() [2/3]

template<typename ValueType , typename CheckerType , typename Other >
constexpr auto operator/ ( const CheckedValue< ValueType, CheckerType > &  lhs,
const Other &  rhs 
) -> decltype(ValueType(lhs) / rhs)
constexpr

Constrained value division operator.

Template Parameters
ValueTypeType of the value used by the checked value.
CheckerTypeType of the checker used by the checked value.
OtherType of the other value that this operation will operator with.

◆ operator/() [3/3]

template<typename ValueType , typename CheckerType , typename Other >
constexpr auto operator/ ( const Other &  lhs,
const CheckedValue< ValueType, CheckerType > &  rhs 
) -> decltype(lhs / ValueType(rhs))
constexpr

Constrained value division operator.

Template Parameters
ValueTypeType of the value used by the checked value.
CheckerTypeType of the checker used by the checked value.
OtherType of the other value that this operation will operator with.

◆ operator<() [1/4]

template<typename LhsValueType , typename LhsCheckerType , typename RhsValueType , typename RhsCheckerType >
constexpr auto operator< ( const CheckedValue< LhsValueType, LhsCheckerType > &  lhs,
const CheckedValue< RhsValueType, RhsCheckerType > &  rhs 
) -> decltype(LhsValueType(lhs) < RhsValueType(rhs))
constexpr

Constrained value less-than operator.

Template Parameters
LhsValueTypeType of the value used by the left hand side checked value.
LhsCheckerTypeType of the checker used by the left hand side checked value.
RhsValueTypeType of the value used by the right hand side checked value.
RhsCheckerTypeType of the checker used by the right hand side checked value.

◆ operator<() [2/4]

template<typename ValueType , typename CheckerType , typename Other >
constexpr auto operator< ( const CheckedValue< ValueType, CheckerType > &  lhs,
const Other &  rhs 
) -> decltype(ValueType(lhs) < rhs)
constexpr

Constrained value less-than operator.

Template Parameters
ValueTypeType of the value used by the checked value.
CheckerTypeType of the checker used by the checked value.
OtherType of the other value that this operation will operator with.

◆ operator<() [3/4]

template<typename T >
constexpr bool operator< ( const Interval< T > &  lhs,
const Interval< T > &  rhs 
)
constexprnoexcept

Less-than operator.

Note
Provides a "strict weak ordering" relation.
This is a lexicographical comparison.
Obeys the LessThanComparable named requirement: for all a, !(a < a); if (a < b) then !(b < a); if (a < b) and (b < c) then (a < c); with equiv = !(a < b) && !(b < a), if equiv(a, b) and equiv(b, c), then equiv(a, c).
See also
https://en.wikipedia.org/wiki/Weak_ordering#Strict_weak_orderings
https://en.cppreference.com/w/cpp/named_req/LessThanComparable

◆ operator<() [4/4]

template<typename ValueType , typename CheckerType , typename Other >
constexpr auto operator< ( const Other &  lhs,
const CheckedValue< ValueType, CheckerType > &  rhs 
) -> decltype(lhs < ValueType(rhs))
constexpr

Constrained value less-than operator.

Template Parameters
ValueTypeType of the value used by the checked value.
CheckerTypeType of the checker used by the checked value.
OtherType of the other value that this operation will operator with.

◆ operator<<()

template<typename ValueType , typename CheckerType >
auto operator<< ( ::std::ostream &  os,
const CheckedValue< ValueType, CheckerType > &  value 
) -> decltype(os << ValueType(value))

Constrained value stream output operator for value types which support it.

Template Parameters
ValueTypeType of the value used by the checked value.
CheckerTypeType of the checker used by the checked value.

◆ operator<=() [1/4]

template<typename LhsValueType , typename LhsCheckerType , typename RhsValueType , typename RhsCheckerType >
constexpr auto operator<= ( const CheckedValue< LhsValueType, LhsCheckerType > &  lhs,
const CheckedValue< RhsValueType, RhsCheckerType > &  rhs 
) -> decltype(LhsValueType(lhs) <= RhsValueType(rhs))
constexpr

Constrained value less-than or equal-to operator.

Template Parameters
LhsValueTypeType of the value used by the left hand side checked value.
LhsCheckerTypeType of the checker used by the left hand side checked value.
RhsValueTypeType of the value used by the right hand side checked value.
RhsCheckerTypeType of the checker used by the right hand side checked value.

◆ operator<=() [2/4]

template<typename ValueType , typename CheckerType , typename Other >
constexpr auto operator<= ( const CheckedValue< ValueType, CheckerType > &  lhs,
const Other &  rhs 
) -> decltype(ValueType(lhs) <= rhs)
constexpr

Constrained value less-than or equal-to operator.

Template Parameters
ValueTypeType of the value used by the checked value.
CheckerTypeType of the checker used by the checked value.
OtherType of the other value that this operation will operator with.

◆ operator<=() [3/4]

template<typename T >
constexpr bool operator<= ( const Interval< T > &  lhs,
const Interval< T > &  rhs 
)
constexprnoexcept

Less-than or equal-to operator.

Note
Provides a "strict weak ordering" relation.
This is a lexicographical comparison.
See also
https://en.wikipedia.org/wiki/Weak_ordering#Strict_weak_orderings

◆ operator<=() [4/4]

template<typename ValueType , typename CheckerType , typename Other >
constexpr auto operator<= ( const Other &  lhs,
const CheckedValue< ValueType, CheckerType > &  rhs 
) -> decltype(lhs <= ValueType(rhs))
constexpr

Constrained value less-than or equal-to operator.

Template Parameters
ValueTypeType of the value used by the checked value.
CheckerTypeType of the checker used by the checked value.
OtherType of the other value that this operation will operator with.

◆ operator==() [1/4]

template<typename LhsValueType , typename LhsCheckerType , typename RhsValueType , typename RhsCheckerType >
constexpr auto operator== ( const CheckedValue< LhsValueType, LhsCheckerType > &  lhs,
const CheckedValue< RhsValueType, RhsCheckerType > &  rhs 
) -> decltype(LhsValueType(lhs) == RhsValueType(rhs))
constexprnoexcept

Constrained value equality operator for value types which support it.

Template Parameters
LhsValueTypeType of the value used by the left hand side checked value.
LhsCheckerTypeType of the checker used by the left hand side checked value.
RhsValueTypeType of the value used by the right hand side checked value.
RhsCheckerTypeType of the checker used by the right hand side checked value.

◆ operator==() [2/4]

template<typename ValueType , typename CheckerType , typename Other >
constexpr auto operator== ( const CheckedValue< ValueType, CheckerType > &  lhs,
const Other &  rhs 
) -> decltype(ValueType(lhs) == rhs)
constexpr

Constrained value equality operator.

Template Parameters
ValueTypeType of the value used by the checked value.
CheckerTypeType of the checker used by the checked value.
OtherType of the other value that this operation will operator with.

◆ operator==() [3/4]

template<typename T >
constexpr bool operator== ( const Interval< T > &  a,
const Interval< T > &  b 
)
constexprnoexcept

Equality operator.

Note
Satisfies the EqualityComparable named requirement for Interval objects.
See also
https://en.cppreference.com/w/cpp/named_req/EqualityComparable

◆ operator==() [4/4]

template<typename ValueType , typename CheckerType , typename Other >
constexpr auto operator== ( const Other &  lhs,
const CheckedValue< ValueType, CheckerType > &  rhs 
) -> decltype(lhs == ValueType(rhs))
constexpr

Constrained value equality operator.

Template Parameters
ValueTypeType of the value used by the checked value.
CheckerTypeType of the checker used by the checked value.
OtherType of the other value that this operation will operator with.

◆ operator>() [1/4]

template<typename LhsValueType , typename LhsCheckerType , typename RhsValueType , typename RhsCheckerType >
constexpr auto operator> ( const CheckedValue< LhsValueType, LhsCheckerType > &  lhs,
const CheckedValue< RhsValueType, RhsCheckerType > &  rhs 
) -> decltype(LhsValueType(lhs) > RhsValueType(rhs))
constexpr

Constrained value greater-than operator.

Template Parameters
LhsValueTypeType of the value used by the left hand side checked value.
LhsCheckerTypeType of the checker used by the left hand side checked value.
RhsValueTypeType of the value used by the right hand side checked value.
RhsCheckerTypeType of the checker used by the right hand side checked value.

◆ operator>() [2/4]

template<typename ValueType , typename CheckerType , typename Other >
constexpr auto operator> ( const CheckedValue< ValueType, CheckerType > &  lhs,
const Other &  rhs 
) -> decltype(ValueType(lhs) > rhs)
constexpr

Constrained value greater-than operator.

Template Parameters
ValueTypeType of the value used by the checked value.
CheckerTypeType of the checker used by the checked value.
OtherType of the other value that this operation will operator with.

◆ operator>() [3/4]

template<typename T >
constexpr bool operator> ( const Interval< T > &  lhs,
const Interval< T > &  rhs 
)
constexprnoexcept

Greater-than operator.

Note
Provides a "strict weak ordering" relation.
This is a lexicographical comparison.
See also
https://en.wikipedia.org/wiki/Weak_ordering#Strict_weak_orderings

◆ operator>() [4/4]

template<typename ValueType , typename CheckerType , typename Other >
constexpr auto operator> ( const Other &  lhs,
const CheckedValue< ValueType, CheckerType > &  rhs 
) -> decltype(lhs > ValueType(rhs))
constexpr

Constrained value greater-than ooperator.

Template Parameters
ValueTypeType of the value used by the checked value.
CheckerTypeType of the checker used by the checked value.
OtherType of the other value that this operation will operator with.

◆ operator>=() [1/4]

template<typename LhsValueType , typename LhsCheckerType , typename RhsValueType , typename RhsCheckerType >
constexpr auto operator>= ( const CheckedValue< LhsValueType, LhsCheckerType > &  lhs,
const CheckedValue< RhsValueType, RhsCheckerType > &  rhs 
) -> decltype(LhsValueType(lhs) >= RhsValueType(rhs))
constexpr

Constrained value greater-than or equal-to operator.

Template Parameters
LhsValueTypeType of the value used by the left hand side checked value.
LhsCheckerTypeType of the checker used by the left hand side checked value.
RhsValueTypeType of the value used by the right hand side checked value.
RhsCheckerTypeType of the checker used by the right hand side checked value.

◆ operator>=() [2/4]

template<typename ValueType , typename CheckerType , typename Other >
constexpr auto operator>= ( const CheckedValue< ValueType, CheckerType > &  lhs,
const Other &  rhs 
) -> decltype(ValueType(lhs) >= rhs)
constexpr

Constrained value greater-than or equal-to operator.

Template Parameters
ValueTypeType of the value used by the checked value.
CheckerTypeType of the checker used by the checked value.
OtherType of the other value that this operation will operator with.

◆ operator>=() [3/4]

template<typename T >
constexpr bool operator>= ( const Interval< T > &  lhs,
const Interval< T > &  rhs 
)
constexprnoexcept

Greater-than or equal-to operator.

Note
Provides a "strict weak ordering" relation.
This is a lexicographical comparison.
See also
https://en.wikipedia.org/wiki/Weak_ordering#Strict_weak_orderings

◆ operator>=() [4/4]

template<typename ValueType , typename CheckerType , typename Other >
constexpr auto operator>= ( const Other &  lhs,
const CheckedValue< ValueType, CheckerType > &  rhs 
) -> decltype(lhs >= ValueType(rhs))
constexpr

Constrained value greater-than or equal-to operator.

Template Parameters
ValueTypeType of the value used by the checked value.
CheckerTypeType of the checker used by the checked value.
OtherType of the other value that this operation will operator with.

◆ Realloc()

void * playrho::Realloc ( void *  ptr,
std::size_t  size 
)

Reallocates memory.

Note
One can change this function to use ones own memory allocator. Be sure to conform to this function's interface: throw a std::bad_alloc exception if unable to allocate non-zero sized memory, return a null pointer if the requested size is zero, and free old memory if the new size is zero. This is done to ensure that the behavior is not implementation defined unlike std::realloc.
If the new size for memory is zero, then the old memory is freed.
Exceptions
std::bad_allocIf unable to reallocate non-zero sized memory. Pointer must be deallocated with Free(void*) or one of the Realloc functions.
Returns
Non-null pointer if size is not zero else nullptr.
See also
Alloc, Free.

Referenced by ReallocArray().

◆ ReallocArray()

template<typename T >
T* playrho::ReallocArray ( T *  ptr,
std::size_t  count 
)

Reallocates memory for an array.

Parameters
ptrPointer to the old memory.
countCount of elements to reallocate for. This value must be less than the value of std::numeric_limits<std::size_t>::max() / sizeof(T) or an exception will be thrown.
Note
If the new size for memory is zero, then the old memory is freed.
Exceptions
std::bad_allocIf unable to reallocate non-zero sized memory.
Returns
Non-null pointer if count is not zero else nullptr. Pointer must be deallocated with Free(void*) or one of the Realloc functions.
See also
Realloc, Free.

◆ size()

◆ to_underlying()

template<typename T >
constexpr auto playrho::to_underlying ( value) -> underlying_type_t<T>
constexprnoexcept

Converts the given value to the value as the underlying type.

Note
This is like std::to_underlying slated for C++23.

Referenced by playrho::d2::WorldImpl::Add(), playrho::d2::WorldImpl::AddContactsToIsland(), playrho::d2::WorldImpl::AddFixture(), playrho::d2::WorldImpl::AddJointsToIsland(), playrho::d2::WorldImpl::AddToIsland(), playrho::d2::At(), playrho::d2::WorldImpl::Clear(), playrho::d2::WorldImpl::CreateAndDestroyProxies(), playrho::d2::WorldImpl::CreateFixture(), playrho::d2::WorldImpl::Destroy(), playrho::d2::WorldImpl::DestroyContacts(), playrho::d2::WorldImpl::GetBody(), playrho::d2::WorldImpl::GetContact(), playrho::d2::WorldImpl::GetContacts(), playrho::d2::WorldImpl::GetFixture(), playrho::d2::WorldImpl::GetFixtures(), playrho::d2::WorldImpl::GetJoint(), playrho::d2::WorldImpl::GetJoints(), playrho::d2::WorldImpl::GetManifold(), GetName(), playrho::d2::VelocityConstraint::GetPoint(), playrho::d2::WorldImpl::GetProxies(), playrho::d2::WorldImpl::GetSoonestContact(), playrho::d2::WorldImpl::InternalDestroy(), playrho::d2::WorldImpl::IsDestroyed(), playrho::d2::WorldImpl::ProcessContactsForTOI(), playrho::d2::WorldImpl::Remove(), playrho::d2::WorldImpl::RemoveFixture(), playrho::d2::WorldImpl::RemoveUnspeedablesFromIslanded(), playrho::d2::WorldImpl::SetBody(), playrho::d2::WorldImpl::SetContact(), playrho::d2::WorldImpl::SetFixture(), playrho::d2::WorldImpl::SetJoint(), playrho::d2::WorldImpl::ShiftOrigin(), playrho::d2::WorldImpl::SolveReg(), playrho::d2::WorldImpl::SolveRegIslandViaGS(), playrho::d2::WorldImpl::SolveToi(), playrho::d2::WorldImpl::SolveToiViaGS(), playrho::d2::WorldImpl::Synchronize(), playrho::d2::WorldImpl::SynchronizeProxies(), playrho::d2::WorldImpl::Update(), playrho::d2::WorldImpl::UpdateContacts(), and playrho::d2::WorldImpl::UpdateContactTOIs().

◆ used()

template<typename T >
ArrayAllocator<T>::size_type playrho::used ( const ArrayAllocator< T > &  array)
noexcept

Gets the number of elements that are used in the specified structure.

Returns
Size of the specified structure minus the size of its free pool.

Referenced by playrho::d2::WorldImpl::SolveToi().

Variable Documentation

◆ DefaultAngularSleepTolerance

constexpr auto playrho::DefaultAngularSleepTolerance = Real{(Pi * 2) / 180} * RadianPerSecond
constexpr

Default angular sleep tolerance.

A body cannot sleep if its angular velocity is above this amount.

◆ DefaultAngularSlop

constexpr auto playrho::DefaultAngularSlop = (Pi * 2_rad) / Real{180}
constexpr

Default angular slop.

A small angle used as a collision and constraint tolerance. Usually it is chosen to be numerically significant, but visually insignificant.

◆ DefaultCirclesRatio

constexpr auto playrho::DefaultCirclesRatio = Real{10}
constexpr

Default circles ratio.

Ratio used for switching between rounded-corner collisions and closest-face biased normal collisions.

◆ DefaultLinearSleepTolerance

constexpr auto playrho::DefaultLinearSleepTolerance = 0.01_mps
constexpr

Default linear sleep tolerance.

A body cannot sleep if the magnitude of its linear velocity is above this amount.

◆ DefaultLinearSlop

constexpr auto playrho::DefaultLinearSlop = detail::Defaults<Real>::GetLinearSlop()
constexpr

Default linear slop.

Length used as a collision and constraint tolerance. Usually chosen to be numerically significant, but visually insignificant. Lower or raise to decrease or increase respectively the minimum of space between bodies at rest.

Note
Smaller values relative to sizes of bodies increases the time it takes for bodies to come to rest.

Referenced by playrho::d2::DiskShapeConf::GetDefaultRadius(), playrho::d2::ChainShapeConf::GetDefaultVertexRadius(), playrho::d2::EdgeShapeConf::GetDefaultVertexRadius(), playrho::d2::MultiShapeConf::GetDefaultVertexRadius(), playrho::d2::PolygonShapeConf::GetDefaultVertexRadius(), and playrho::d2::PolygonShapeConf::Set().

◆ DefaultMaxAngularCorrection

constexpr auto playrho::DefaultMaxAngularCorrection = Real(8.0f / 180.0f) * Pi * 1_rad
constexpr

Default maximum angular correction.

Note
This value should be greater than the angular slop value.

◆ DefaultMaxLinearCorrection

constexpr auto playrho::DefaultMaxLinearCorrection = 0.2_m
constexpr

Default maximum linear correction.

The maximum linear position correction used when solving constraints. This helps to prevent overshoot.

Note
This value should be greater than the linear slop value.

◆ DefaultMaxRotation

constexpr auto playrho::DefaultMaxRotation = Angle{Pi * 1_rad / Real(2)}
constexpr

Default maximum rotation per world step.

Warning
This value should be less than Pi * Radian.
Note
This limit is meant to prevent numerical problems. Adjusting this value isn't advised.
See also
StepConf::maxRotation.

◆ DefaultMaxSubSteps

constexpr auto playrho::DefaultMaxSubSteps = std::uint8_t{8}
constexpr

Default maximum number of sub steps.

This is the default maximum number of sub-steps per contact in continuous physics simulation. In other words, this is the default maximum number of times in a world step that a contact will have continuous collision resolution done for it.

Note
Used in the TOI phase of step processing.

◆ DefaultMinStillTimeToSleep

constexpr auto playrho::DefaultMinStillTimeToSleep = Time{1_s / 2}
constexpr

Default minimum still time to sleep.

The default minimum time bodies must be still for bodies to be put to sleep.

◆ InvalidContactID

constexpr auto playrho::InvalidContactID
constexpr
Initial value:
=
static_cast<ContactID>(static_cast<ContactID::underlying_type>(-1))

Invalid contact ID value.

Referenced by playrho::d2::WorldImpl::Destroy(), playrho::d2::WorldImpl::GetSoonestContact(), playrho::d2::WorldImpl::InternalDestroy(), and playrho::d2::WorldImpl::SolveToi().

◆ InvalidFixtureID

constexpr auto playrho::InvalidFixtureID
constexpr
Initial value:
=
static_cast<FixtureID>(static_cast<FixtureID::underlying_type>(-1))

Invalid fixture ID value.

Examples
DistanceJoint.cpp, World.cpp, and WorldBody.cpp.

◆ InvalidIndexPair

constexpr auto playrho::InvalidIndexPair
constexpr
Initial value:

Invalid index-pair value.

Referenced by playrho::d2::Distance(), playrho::d2::GetIndexPairs(), and GetNumValidIndices().

◆ InvalidIndexPair3

constexpr auto playrho::InvalidIndexPair3
constexpr
Initial value:

Invalid array of three index-pair elements.

◆ InvalidTypeID

constexpr auto playrho::InvalidTypeID
constexpr
Initial value:
=
static_cast<TypeID>(static_cast<TypeID::underlying_type>(nullptr))

Invalid type ID value.

◆ MaxBodies

constexpr auto playrho::MaxBodies
constexpr
Initial value:
= static_cast<std::uint16_t>(std::numeric_limits<std::uint16_t>::max() -
std::uint16_t{1})

Maximum number of bodies in a world.

Note
This is 65534 based off std::uint16_t and eliminating one value for invalid.
Examples
World.cpp.

Referenced by playrho::d2::WorldImpl::AddToIsland(), and playrho::d2::WorldImpl::CreateBody().

◆ MaxContacts

constexpr auto playrho::MaxContacts = ContactCounter{MaxBodies} * ContactCounter{MaxBodies - 1} / ContactCounter{2}
constexpr

Maximum number of contacts in a world (2147319811).

Uses the formula for the maximum number of edges in an unidirectional graph of MaxBodies nodes. This occurs when every possible body is connected to every other body.

Referenced by playrho::d2::WorldImpl::Add().

◆ MaxFixtures

constexpr auto playrho::MaxFixtures
constexpr
Initial value:
= static_cast<std::uint16_t>(std::numeric_limits<std::uint16_t>::max() -
std::uint16_t{1u})

Maximum number of fixtures in a world.

Note
This is 65534 based off std::uint16_t and eliminating one value for invalid.

Referenced by playrho::d2::WorldImpl::CreateFixture().

◆ MaxJoints

constexpr auto playrho::MaxJoints
constexpr
Initial value:
= static_cast<std::uint16_t>(std::numeric_limits<std::uint16_t>::max() -
std::uint16_t{1})

Maximum number of joints in a world.

Note
This is 65534 based off std::uint16_t and eliminating one value for invalid.
Examples
World.cpp.

Referenced by playrho::d2::WorldImpl::CreateJoint().

◆ MaxManifoldPoints

constexpr auto playrho::MaxManifoldPoints = std::uint8_t{2}
constexpr

◆ MaxShapeVertices

constexpr auto playrho::MaxShapeVertices = std::uint8_t{254}
constexpr

Maximum number of vertices for any shape type.

Note
For memory efficiency, uses the smallest integral type that can hold the value minus one that's left out as a sentinel value.

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

◆ Pi

constexpr auto playrho::Pi = Real(3.14159265358979323846264338327950288)
constexpr

Pi.

An "irrational number" that's defined as the ratio of a circle's circumference to its diameter.

Note
While the include file definition of M_PI may be a POSIX compliance requirement and initially attractive to use, it's apparently not a C++ standards requirement and casually including it pollutes the name space of all code that uses this library. Whatever the case, MSVC 2017 doesn't make it part of the cmath include without enabling _USE_MATH_DEFINES. So rather than add yet more C preprocessor macros to all sources that this library may be compiled with, it's simply hard-coded in here instead using a C++ mechanism that also keeps it with the enclosing name space.
Any narrowing is intentional.
See also
https://en.wikipedia.org/wiki/Pi
Examples
World.cpp.

Referenced by GetAreaOfCircle(), GetCircleVertices(), GetDelta(), playrho::d2::ChainShapeConf::GetMassData(), playrho::d2::GetMassData(), GetNormalized(), and playrho::d2::InitVelocity().

◆ SquareRootTwo

constexpr auto playrho::SquareRootTwo
constexpr
Initial value:
=
Real(1.414213562373095048801688724209698078569671875376948073176679737990732478462)

Square root of two.

See also
https://en.wikipedia.org/wiki/Square_root_of_2

Referenced by playrho::d2::UnitVec::GetBottomRight(), and playrho::d2::UnitVec::GetTopRight().

playrho::IndexPair3
std::array< IndexPair, MaxSimplexEdges > IndexPair3
Array of three index-pair elements.
Definition: IndexPair.hpp:47
playrho::InvalidIndexPair
constexpr auto InvalidIndexPair
Invalid index-pair value.
Definition: IndexPair.hpp:39
playrho::IndexPair
std::pair< VertexCounter, VertexCounter > IndexPair
Index pair.
Definition: IndexPair.hpp:36
playrho::ContactID
detail::IndexingNamedType< ContactCounter, struct ContactIdentifier > ContactID
Contact identifier.
Definition: ContactID.hpp:30
playrho::FixtureID
detail::IndexingNamedType< FixtureCounter, struct FixtureIdentifier > FixtureID
Fixture identifier.
Definition: FixtureID.hpp:30
playrho::Real
float Real
Real-number type.
Definition: Real.hpp:69
playrho::TypeID
detail::IndexingNamedType< const char *const *, struct TypeIdentifier > TypeID
Type identifier.
Definition: TypeInfo.hpp:91
playrho::InvalidVertex
constexpr auto InvalidVertex
Invalid vertex index.
Definition: Settings.hpp:125