PlayRho  2.0.0
An interactive physics engine & library.
UnitVec.hpp File Reference

Declarations of the UnitVec class and free functions associated with it. More...

#include <cassert>
#include <cmath>
#include <cstdlib>
#include <iostream>
#include <utility>
#include <type_traits>
#include <playrho/InvalidArgument.hpp>
#include <playrho/Real.hpp>
#include <playrho/RealConstants.hpp>
#include <playrho/Templates.hpp>
#include <playrho/Units.hpp>
#include <playrho/Vector.hpp>
#include <playrho/detail/UnitMagnitudeChecker.hpp>
Include dependency graph for UnitVec.hpp:
This graph shows which files directly or indirectly include this file:

Classes

class  std::tuple_element< I, playrho::d2::UnitVec >
 Tuple element type info for playrho::d2::UnitVec. More...
 
class  std::tuple_size< playrho::d2::UnitVec >
 Tuple size info for playrho::d2::UnitVec. More...
 
class  playrho::d2::UnitVec
 2-D unit vector. More...
 

Namespaces

 playrho
 
 playrho::d2
 

Functions

d2::UnitVec playrho::abs (const d2::UnitVec &v) noexcept
 Gets the absolute value of the given value.
 
template<std::size_t I>
constexpr UnitVec::value_type playrho::d2::get (const UnitVec &v) noexcept
 Gets the specified element of the given collection.
 
template<>
constexpr UnitVec::value_type playrho::d2::get< 0 > (const UnitVec &v) noexcept
 Gets element 0 of the given collection.
 
template<>
constexpr UnitVec::value_type playrho::d2::get< 1 > (const UnitVec &v) noexcept
 Gets element 1 of the given collection.
 
constexpr UnitVec playrho::d2::GetFwdPerpendicular (const UnitVec &vector) noexcept
 Gets a vector clockwise (forward-clockwise) perpendicular to the given vector. More...
 
constexpr UnitVec playrho::d2::GetRevPerpendicular (const UnitVec &vector) noexcept
 Gets a vector counter-clockwise (reverse-clockwise) perpendicular to the given vector. More...
 
constexpr auto playrho::d2::GetX (const UnitVec &value)
 Gets the "X" element of the given value - i.e. the first element.
 
constexpr UnitVec playrho::d2::GetXAxis (const UnitVec &rot) noexcept
 Gets the "X-axis".
 
constexpr auto playrho::d2::GetY (const UnitVec &value) -> decltype(get< 1 >(value))
 Gets the "Y" element of the given value - i.e. the second element.
 
constexpr UnitVec playrho::d2::GetYAxis (const UnitVec &rot) noexcept
 Gets the "Y-axis". More...
 
constexpr UnitVec playrho::d2::InverseRotate (const UnitVec &vector, const UnitVec &angle) noexcept
 Inverse rotates a vector.
 
constexpr auto playrho::IsValid (const d2::UnitVec &value) noexcept -> bool
 Determines if the given value is valid.
 
constexpr bool playrho::d2::operator!= (const UnitVec &a, const UnitVec &b) noexcept
 Inequality operator.
 
inline ::std::ostream & playrho::d2::operator<< (::std::ostream &os, const UnitVec &value)
 Output stream operator.
 
constexpr bool playrho::d2::operator== (const UnitVec &a, const UnitVec &b) noexcept
 Equality operator.
 
constexpr UnitVec playrho::d2::Rotate (const UnitVec &vector, const UnitVec &angle) noexcept
 Rotates a unit vector by the angle expressed by the second unit vector. More...
 

Detailed Description

Declarations of the UnitVec class and free functions associated with it.