playrho::detail Namespace Reference

Classes

struct  AABB
 N-dimensional Axis Aligned Bounding Box. More...
 
struct  Defaults
 Defaults object for real types. More...
 
struct  Defaults< Fixed< std::int32_t, FRACTION_BITS > >
 Specialization of defaults object for fixed point types. More...
 
struct  IsIterableImpl
 Low-level implementation of the is-iterable default value trait. More...
 
struct  IsIterableImpl< T, VoidT< decltype(begin(std::declval< T >())), decltype(end(std::declval< T >())), decltype(++std::declval< decltype(begin(std::declval< T & >()))& >()), decltype(*begin(std::declval< T >())) > >
 Low-level implementation of the is-iterable true value trait. More...
 
struct  LengthIndices
 Length and vertex counter array of indices. More...
 
struct  MassData
 Mass data. More...
 
struct  RayCastInput
 Ray-cast input data for N-dimensions. More...
 
struct  SeparationInfo
 Separation information. More...
 
struct  Voidify
 Voiding template class. More...
 

Typedefs

template<class... Ts>
using VoidT = typename Voidify< Ts... >::type
 Void type templated alias. More...
 

Functions

template<std::size_t N>
PLAYRHO_CONSTEXPR bool operator== (const AABB< N > &lhs, const AABB< N > &rhs) noexcept
 Gets whether the two AABB objects are equal. More...
 
template<std::size_t N>
PLAYRHO_CONSTEXPR bool operator!= (const AABB< N > &lhs, const AABB< N > &rhs) noexcept
 Gets whether the two AABB objects are not equal. More...
 
template<std::size_t N>
bool operator< (const AABB< N > &lhs, const AABB< N > &rhs) noexcept
 Less-than operator. More...
 
template<std::size_t N>
bool operator<= (const AABB< N > &lhs, const AABB< N > &rhs) noexcept
 Less-than or equal-to operator. More...
 
template<std::size_t N>
bool operator> (const AABB< N > &lhs, const AABB< N > &rhs) noexcept
 Greater-than operator. More...
 
template<std::size_t N>
bool operator>= (const AABB< N > &lhs, const AABB< N > &rhs) noexcept
 Greater-than or equal-to operator. More...
 
template<std::size_t N>
PLAYRHO_CONSTEXPR bool TestOverlap (const AABB< N > &a, const AABB< N > &b) noexcept
 Tests for overlap between two axis aligned bounding boxes. More...
 
template<std::size_t N>
PLAYRHO_CONSTEXPR AABB< N > GetIntersectingAABB (const AABB< N > &a, const AABB< N > &b) noexcept
 Gets the intersecting AABB of the two given AABBs'. More...
 
template<std::size_t N>
PLAYRHO_CONSTEXPR Vector< Length, N > GetCenter (const AABB< N > &aabb) noexcept
 Gets the center of the AABB. More...
 
template<std::size_t N>
PLAYRHO_CONSTEXPR Vector< Length, N > GetDimensions (const AABB< N > &aabb) noexcept
 Gets dimensions of the given AABB. More...
 
template<std::size_t N>
PLAYRHO_CONSTEXPR Vector< Length, N > GetExtents (const AABB< N > &aabb) noexcept
 Gets the extents of the AABB (half-widths). More...
 
template<std::size_t N>
PLAYRHO_CONSTEXPR bool Contains (const AABB< N > &a, const AABB< N > &b) noexcept
 Checks whether the first AABB fully contains the second AABB. More...
 
template<std::size_t N>
PLAYRHO_CONSTEXPR AABB< N > & Include (AABB< N > &var, const Vector< Length, N > &value) noexcept
 Includes the given location into the given AABB. More...
 
template<std::size_t N>
PLAYRHO_CONSTEXPR AABB< N > & Include (AABB< N > &var, const AABB< N > &val) noexcept
 Includes the second AABB into the first one. More...
 
template<std::size_t N>
PLAYRHO_CONSTEXPR AABB< N > & Move (AABB< N > &var, const Vector< Length, N > value) noexcept
 Moves the given AABB by the given value. More...
 
template<std::size_t N>
PLAYRHO_CONSTEXPR AABB< N > & Fatten (AABB< N > &var, const NonNegative< Length > amount) noexcept
 Fattens an AABB by the given amount. More...
 
template<std::size_t N>
PLAYRHO_CONSTEXPR AABB< N > GetDisplacedAABB (AABB< N > aabb, const Vector< Length, N > displacement)
 Gets the AABB that the result of displacing the given AABB by the given displacement amount. More...
 
template<std::size_t N>
PLAYRHO_CONSTEXPR AABB< N > GetFattenedAABB (AABB< N > aabb, const Length amount)
 Gets the fattened AABB result. More...
 
template<std::size_t N>
PLAYRHO_CONSTEXPR AABB< N > GetMovedAABB (AABB< N > aabb, const Vector< Length, N > value) noexcept
 Gets the result of moving the given AABB by the given value. More...
 
template<std::size_t N>
PLAYRHO_CONSTEXPR AABB< N > GetEnclosingAABB (AABB< N > a, const AABB< N > &b)
 Gets the AABB that minimally encloses the given AABBs. More...
 
template<std::size_t N>
PLAYRHO_CONSTEXPR Vector< Length, N > GetLowerBound (const AABB< N > &aabb) noexcept
 Gets the lower bound. More...
 
template<std::size_t N>
PLAYRHO_CONSTEXPR Vector< Length, N > GetUpperBound (const AABB< N > &aabb) noexcept
 Gets the upper bound. More...
 
template<std::size_t N>
inline ::std::ostream & operator<< (::std::ostream &os, const AABB< N > &value)
 Output stream operator. More...
 
template<std::size_t N>
PLAYRHO_CONSTEXPR bool operator== (MassData< N > lhs, MassData< N > rhs)
 Equality operator for mass data. More...
 
template<std::size_t N>
PLAYRHO_CONSTEXPR bool operator!= (MassData< N > lhs, MassData< N > rhs)
 Inequality operator for mass data. More...
 
constexpr auto factorial (std::int64_t n)
 Computes the factorial. More...
 
template<typename BT , unsigned int FB, int N = 6>
constexpr Fixed< BT, FB > exp (Fixed< BT, FB > arg)
 Computes Euler's number raised to the given power argument. More...
 
template<typename BT , unsigned int FB, int N = 6>
Fixed< BT, FB > log (Fixed< BT, FB > arg)
 Computes the natural logarithm. More...
 
template<typename BT , unsigned int FB, int N = 5>
constexpr Fixed< BT, FB > sin (Fixed< BT, FB > arg)
 Computes the sine of the given argument via Maclaurin series approximation. More...
 
template<typename BT , unsigned int FB, int N = 5>
constexpr Fixed< BT, FB > cos (Fixed< BT, FB > arg)
 Computes the cosine of the given argument via Maclaurin series approximation. More...
 
template<typename BT , unsigned int FB, int N = 5>
constexpr Fixed< BT, FB > atan (Fixed< BT, FB > arg)
 Computes the arctangent of the given argument via Maclaurin series approximation. More...
 
template<typename BT , unsigned int FB>
constexpr auto ComputeSqrt (Fixed< BT, FB > arg)
 Computes the square root of a non-negative value. More...
 
template<typename BT , unsigned int FB>
auto AngularNormalize (Fixed< BT, FB > angleInRadians)
 Normalizes the given angular argument. More...
 
template<class T >
PLAYRHO_CONSTEXPR auto max_size (const T &arg) -> decltype(arg.max_size())
 Gets the maximum size of the given container. More...
 
template<class T >
PLAYRHO_CONSTEXPR auto IsFull (const T &arg) -> decltype(size(arg)==max_size(arg))
 Checks whether the given container is full. More...
 

Variables

template<typename BT , unsigned int FB>
constexpr const auto FixedPi = Fixed<BT, FB>{3.14159265358979323846264338327950288}
 Fixed point pi value. More...
 

Detailed Description

Name space for internal/detail related PlayRho names.

Typedef Documentation

◆ VoidT

template<class... Ts>
using playrho::detail::VoidT = typedef typename Voidify<Ts...>::type

Void type templated alias.

Definition at line 56 of file Templates.hpp.

Function Documentation

◆ operator==() [1/2]

template<std::size_t N>
PLAYRHO_CONSTEXPR bool operator== ( const AABB< N > &  lhs,
const AABB< N > &  rhs 
)
inlinenoexcept

Gets whether the two AABB objects are equal.

Returns
true if the two values are equal, false otherwise.

Definition at line 115 of file AABB.hpp.

◆ operator!=() [1/2]

template<std::size_t N>
PLAYRHO_CONSTEXPR bool operator!= ( const AABB< N > &  lhs,
const AABB< N > &  rhs 
)
inlinenoexcept

Gets whether the two AABB objects are not equal.

Returns
true if the two values are not equal, false otherwise.

Definition at line 131 of file AABB.hpp.

◆ operator<()

template<std::size_t N>
bool operator< ( const AABB< N > &  lhs,
const AABB< N > &  rhs 
)
inlinenoexcept

Less-than operator.

Definition at line 139 of file AABB.hpp.

◆ operator<=()

template<std::size_t N>
bool operator<= ( const AABB< N > &  lhs,
const AABB< N > &  rhs 
)
inlinenoexcept

Less-than or equal-to operator.

Definition at line 149 of file AABB.hpp.

◆ operator>()

template<std::size_t N>
bool operator> ( const AABB< N > &  lhs,
const AABB< N > &  rhs 
)
inlinenoexcept

Greater-than operator.

Definition at line 161 of file AABB.hpp.

◆ operator>=()

template<std::size_t N>
bool operator>= ( const AABB< N > &  lhs,
const AABB< N > &  rhs 
)
inlinenoexcept

Greater-than or equal-to operator.

Definition at line 171 of file AABB.hpp.

◆ TestOverlap()

template<std::size_t N>
PLAYRHO_CONSTEXPR bool TestOverlap ( const AABB< N > &  a,
const AABB< N > &  b 
)
inlinenoexcept

Tests for overlap between two axis aligned bounding boxes.

Note
This function's complexity is constant.

Definition at line 184 of file AABB.hpp.

◆ GetIntersectingAABB()

template<std::size_t N>
PLAYRHO_CONSTEXPR AABB<N> playrho::detail::GetIntersectingAABB ( const AABB< N > &  a,
const AABB< N > &  b 
)
inlinenoexcept

Gets the intersecting AABB of the two given AABBs'.

Definition at line 198 of file AABB.hpp.

◆ GetCenter()

template<std::size_t N>
PLAYRHO_CONSTEXPR Vector< Length, N > GetCenter ( const AABB< N > &  aabb)
inlinenoexcept

Gets the center of the AABB.

Definition at line 211 of file AABB.hpp.

◆ GetDimensions()

template<std::size_t N>
PLAYRHO_CONSTEXPR Vector< Length, N > GetDimensions ( const AABB< N > &  aabb)
inlinenoexcept

Gets dimensions of the given AABB.

Definition at line 224 of file AABB.hpp.

◆ GetExtents()

template<std::size_t N>
PLAYRHO_CONSTEXPR Vector< Length, N > GetExtents ( const AABB< N > &  aabb)
inlinenoexcept

Gets the extents of the AABB (half-widths).

Definition at line 237 of file AABB.hpp.

◆ Contains()

template<std::size_t N>
PLAYRHO_CONSTEXPR bool Contains ( const AABB< N > &  a,
const AABB< N > &  b 
)
inlinenoexcept

Checks whether the first AABB fully contains the second AABB.

Whether the first AABB contains the entirety of the second AABB where containment is defined as being equal-to or within an AABB.

Note
The "unset" AABB is contained by all valid AABBs including the "unset" AABB itself.
Parameters
aAABB to test whether it contains the second AABB.
bAABB to test whether it's contained by the first AABB.

Definition at line 252 of file AABB.hpp.

◆ Include() [1/2]

template<std::size_t N>
PLAYRHO_CONSTEXPR AABB< N > & Include ( AABB< N > &  var,
const Vector< Length, N > &  value 
)
inlinenoexcept

Includes the given location into the given AABB.

Definition at line 267 of file AABB.hpp.

◆ Include() [2/2]

template<std::size_t N>
PLAYRHO_CONSTEXPR AABB< N > & Include ( AABB< N > &  var,
const AABB< N > &  val 
)
inlinenoexcept

Includes the second AABB into the first one.

Note
If an unset AABB is added to the first AABB, the result will be the first AABB.
If the first AABB is unset and another AABB is added to it, the result will be the other AABB.

Definition at line 282 of file AABB.hpp.

◆ Move()

template<std::size_t N>
PLAYRHO_CONSTEXPR AABB<N>& playrho::detail::Move ( AABB< N > &  var,
const Vector< Length, N >  value 
)
inlinenoexcept

Moves the given AABB by the given value.

Definition at line 293 of file AABB.hpp.

◆ Fatten()

template<std::size_t N>
PLAYRHO_CONSTEXPR AABB< N > & Fatten ( AABB< N > &  var,
const NonNegative< Length amount 
)
inlinenoexcept

Fattens an AABB by the given amount.

Definition at line 305 of file AABB.hpp.

◆ GetDisplacedAABB()

template<std::size_t N>
PLAYRHO_CONSTEXPR AABB< N > GetDisplacedAABB ( AABB< N >  aabb,
const Vector< Length, N >  displacement 
)
inline

Gets the AABB that the result of displacing the given AABB by the given displacement amount.

Definition at line 318 of file AABB.hpp.

◆ GetFattenedAABB()

template<std::size_t N>
PLAYRHO_CONSTEXPR AABB< N > GetFattenedAABB ( AABB< N >  aabb,
const Length  amount 
)
inline

Gets the fattened AABB result.

Definition at line 330 of file AABB.hpp.

◆ GetMovedAABB()

template<std::size_t N>
PLAYRHO_CONSTEXPR AABB< N > GetMovedAABB ( AABB< N >  aabb,
const Vector< Length, N >  value 
)
inlinenoexcept

Gets the result of moving the given AABB by the given value.

Definition at line 338 of file AABB.hpp.

◆ GetEnclosingAABB()

template<std::size_t N>
PLAYRHO_CONSTEXPR AABB< N > GetEnclosingAABB ( AABB< N >  a,
const AABB< N > &  b 
)
inline

Gets the AABB that minimally encloses the given AABBs.

Definition at line 346 of file AABB.hpp.

◆ GetLowerBound()

template<std::size_t N>
PLAYRHO_CONSTEXPR Vector< Length, N > GetLowerBound ( const AABB< N > &  aabb)
inlinenoexcept

Gets the lower bound.

Definition at line 354 of file AABB.hpp.

◆ GetUpperBound()

template<std::size_t N>
PLAYRHO_CONSTEXPR Vector< Length, N > GetUpperBound ( const AABB< N > &  aabb)
inlinenoexcept

Gets the upper bound.

Definition at line 367 of file AABB.hpp.

◆ operator<<()

template<std::size_t N>
inline ::std::ostream& playrho::detail::operator<< ( ::std::ostream &  os,
const AABB< N > &  value 
)

Output stream operator.

Definition at line 379 of file AABB.hpp.

◆ operator==() [2/2]

template<std::size_t N>
PLAYRHO_CONSTEXPR bool operator== ( MassData< N >  lhs,
MassData< N >  rhs 
)
inline

Equality operator for mass data.

Definition at line 56 of file MassData.hpp.

◆ operator!=() [2/2]

template<std::size_t N>
PLAYRHO_CONSTEXPR bool operator!= ( MassData< N >  lhs,
MassData< N >  rhs 
)
inline

Inequality operator for mass data.

Definition at line 64 of file MassData.hpp.

◆ factorial()

constexpr auto playrho::detail::factorial ( std::int64_t  n)
inlineconstexpr

Computes the factorial.

Definition at line 116 of file FixedMath.hpp.

◆ exp()

template<typename BT , unsigned int FB, int N = 6>
constexpr Fixed<BT, FB> playrho::detail::exp ( Fixed< BT, FB >  arg)
inlineconstexpr

Computes Euler's number raised to the given power argument.

Note
Uses Maclaurin series approximation.
See also
http://en.cppreference.com/w/cpp/numeric/math/exp
https://en.wikipedia.org/wiki/Taylor_series
https://en.wikipedia.org/wiki/Exponentiation
https://en.wikipedia.org/wiki/Exponential_function

Definition at line 134 of file FixedMath.hpp.

◆ log()

template<typename BT , unsigned int FB, int N = 6>
Fixed<BT, FB> playrho::detail::log ( Fixed< BT, FB >  arg)

Computes the natural logarithm.

Note
A better method may be explained in https://math.stackexchange.com/a/61236/408405
See also
http://en.cppreference.com/w/cpp/numeric/math/log
https://en.wikipedia.org/wiki/Natural_logarithm

Definition at line 166 of file FixedMath.hpp.

◆ sin()

template<typename BT , unsigned int FB, int N = 5>
constexpr Fixed<BT, FB> playrho::detail::sin ( Fixed< BT, FB >  arg)
inlineconstexpr

Computes the sine of the given argument via Maclaurin series approximation.

See also
https://en.wikipedia.org/wiki/Taylor_series
Examples
World.cpp.

Definition at line 218 of file FixedMath.hpp.

◆ cos()

template<typename BT , unsigned int FB, int N = 5>
constexpr Fixed<BT, FB> playrho::detail::cos ( Fixed< BT, FB >  arg)
inlineconstexpr

Computes the cosine of the given argument via Maclaurin series approximation.

See also
https://en.wikipedia.org/wiki/Taylor_series
Examples
World.cpp.

Definition at line 247 of file FixedMath.hpp.

◆ atan()

template<typename BT , unsigned int FB, int N = 5>
constexpr Fixed<BT, FB> playrho::detail::atan ( Fixed< BT, FB >  arg)
inlineconstexpr

Computes the arctangent of the given argument via Maclaurin series approximation.

See also
http://en.cppreference.com/w/cpp/numeric/math/atan
https://en.wikipedia.org/wiki/Taylor_series

Definition at line 275 of file FixedMath.hpp.

◆ ComputeSqrt()

template<typename BT , unsigned int FB>
constexpr auto playrho::detail::ComputeSqrt ( Fixed< BT, FB >  arg)
inlineconstexpr

Computes the square root of a non-negative value.

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

Definition at line 310 of file FixedMath.hpp.

◆ AngularNormalize()

template<typename BT , unsigned int FB>
auto playrho::detail::AngularNormalize ( Fixed< BT, FB >  angleInRadians)
inline

Normalizes the given angular argument.

Definition at line 410 of file FixedMath.hpp.

◆ max_size()

template<class T >
PLAYRHO_CONSTEXPR auto playrho::detail::max_size ( const T &  arg) -> decltype(arg.max_size())
inline

Gets the maximum size of the given container.

Definition at line 75 of file Templates.hpp.

◆ IsFull()

template<class T >
PLAYRHO_CONSTEXPR auto playrho::detail::IsFull ( const T &  arg) -> decltype(size(arg) == max_size(arg))
inline

Checks whether the given container is full.

Definition at line 82 of file Templates.hpp.

Variable Documentation

◆ FixedPi

template<typename BT , unsigned int FB>
constexpr const auto playrho::detail::FixedPi = Fixed<BT, FB>{3.14159265358979323846264338327950288}
constexpr

Fixed point pi value.

Definition at line 113 of file FixedMath.hpp.