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

Name space for internal/detail related PlayRho names. More...

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...
 
class  IndexingNamedType
 An indexable, hashable, named "strong type" template class. More...
 
struct  IsIterableImpl
 Low-level implementation of the is-iterable default value trait. More...
 
struct  IsIterableImpl< T, std::void_t< 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...
 

Functions

template<std::size_t N>
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>
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.
 
template<std::size_t N>
bool operator<= (const AABB< N > &lhs, const AABB< N > &rhs) noexcept
 Less-than or equal-to operator.
 
template<std::size_t N>
bool operator> (const AABB< N > &lhs, const AABB< N > &rhs) noexcept
 Greater-than operator.
 
template<std::size_t N>
bool operator>= (const AABB< N > &lhs, const AABB< N > &rhs) noexcept
 Greater-than or equal-to operator.
 
template<std::size_t N>
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>
constexpr AABB< N > GetIntersectingAABB (const AABB< N > &a, const AABB< N > &b) noexcept
 Gets the intersecting AABB of the two given AABBs'.
 
template<std::size_t N>
constexpr Vector< Length, N > GetCenter (const AABB< N > &aabb) noexcept
 Gets the center of the AABB.
 
template<std::size_t N>
constexpr Vector< Length, N > GetDimensions (const AABB< N > &aabb) noexcept
 Gets dimensions of the given AABB.
 
template<std::size_t N>
constexpr Vector< Length, N > GetExtents (const AABB< N > &aabb) noexcept
 Gets the extents of the AABB (half-widths).
 
template<std::size_t N>
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>
constexpr AABB< N > & Include (AABB< N > &var, const Vector< Length, N > &value) noexcept
 Includes the given location into the given AABB.
 
template<std::size_t N>
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>
constexpr AABB< N > & Move (AABB< N > &var, const Vector< Length, N > value) noexcept
 Moves the given AABB by the given value.
 
template<std::size_t N>
constexpr AABB< N > & Fatten (AABB< N > &var, const NonNegative< Length > amount) noexcept
 Fattens an AABB by the given amount.
 
template<std::size_t N>
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.
 
template<std::size_t N>
constexpr AABB< N > GetFattenedAABB (AABB< N > aabb, const Length amount)
 Gets the fattened AABB result.
 
template<std::size_t N>
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.
 
template<std::size_t N>
constexpr AABB< N > GetEnclosingAABB (AABB< N > a, const AABB< N > &b)
 Gets the AABB that minimally encloses the given AABBs.
 
template<std::size_t N>
constexpr Vector< Length, N > GetLowerBound (const AABB< N > &aabb) noexcept
 Gets the lower bound.
 
template<std::size_t N>
constexpr Vector< Length, N > GetUpperBound (const AABB< N > &aabb) noexcept
 Gets the upper bound.
 
template<std::size_t N>
inline ::std::ostream & operator<< (::std::ostream &os, const AABB< N > &value)
 Output stream operator.
 
template<std::size_t N>
constexpr bool operator== (MassData< N > lhs, MassData< N > rhs)
 Equality operator for mass data.
 
template<std::size_t N>
constexpr bool operator!= (MassData< N > lhs, MassData< N > rhs)
 Inequality operator for mass data.
 
constexpr auto factorial (std::int64_t n)
 Computes the factorial.
 
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.
 
template<typename T , typename Tag >
constexpr T & UnderlyingValue (IndexingNamedType< T, Tag > &o) noexcept
 Gets the underlying value.
 
template<typename T , typename Tag >
constexpr const T & UnderlyingValue (const IndexingNamedType< T, Tag > &o) noexcept
 Gets the underlying value.
 
template<class T >
constexpr auto max_size (const T &arg) -> decltype(arg.max_size())
 Gets the maximum size of the given container.
 
template<class T >
constexpr auto IsFull (const T &arg) -> decltype(size(arg)==max_size(arg))
 Checks whether the given container is full.
 
template<typename T >
static auto Data (T &v)
 Internal helper template function to avoid confusion for use within classes that define their own data() method.
 
template<typename T >
static auto Size (T &v)
 Internal helper template function to avoid confusion for use within classes that define their own size() method.
 
template<typename T >
static constexpr const char * GetNameForTypeInfo () noexcept
 Gets a null-terminated byte string identifying this function. More...
 

Variables

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

Detailed Description

Name space for internal/detail related PlayRho names.

Function Documentation

◆ atan()

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

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

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

◆ ComputeSqrt()

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

Computes the square root of a non-negative value.

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

Referenced by playrho::sqrt().

◆ Contains()

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

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.

◆ cos()

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

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

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

◆ exp()

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

◆ GetNameForTypeInfo()

template<typename T >
static constexpr const char* playrho::detail::GetNameForTypeInfo ( )
staticconstexprnoexcept

Gets a null-terminated byte string identifying this function.

Note
Intended for use by TypeInfo to set the value of its name variable to something dependent on the type and avoid issues like TypeInfo::name being a non-unique address like happens on MSVC when whole program is turned on. Such an issue is documented in Issue #370.
See also
https://github.com/louis-langholtz/PlayRho/issues/370

◆ Include()

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

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.

◆ log()

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

◆ operator!=()

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

Gets whether the two AABB objects are not equal.

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

◆ operator==()

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

Gets whether the two AABB objects are equal.

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

◆ sin()

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

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

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

◆ TestOverlap()

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

Tests for overlap between two axis aligned bounding boxes.

Note
This function's complexity is constant.