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

Declarations of general 2-D math related code. More...

#include <cassert>
#include <tuple>
#include <type_traits>
#include <vector>
#include <playrho/Math.hpp>
#include <playrho/Matrix.hpp>
#include <playrho/Real.hpp>
#include <playrho/UnitInterval.hpp>
#include <playrho/Units.hpp>
#include <playrho/Vector2.hpp>
#include <playrho/detail/Checked.hpp>
#include <playrho/d2/UnitVec.hpp>
#include <playrho/d2/Position.hpp>
#include <playrho/d2/Velocity.hpp>
#include <playrho/d2/Transformation.hpp>
#include <playrho/d2/Sweep.hpp>
Include dependency graph for Math.hpp:
This graph shows which files directly or indirectly include this file:

Namespaces

 playrho
 
 playrho::d2
 

Functions

Position playrho::d2::Cap (Position pos, const ConstraintSolverConf &conf)
 Caps the given position by the amounts specified in the given configuration.
 
Angle playrho::d2::GetAngle (const Transformation &value)
 Gets the angle of the given transformation.
 
Angle playrho::d2::GetAngle (const UnitVec &value)
 Gets the angle of the given unit vector.
 
LinearVelocity2 playrho::d2::GetContactRelVelocity (const Velocity &velA, const Length2 &relA, const Velocity &velB, const Length2 &relB) noexcept
 Gets the contact relative velocity. More...
 
InvMass playrho::d2::GetEffectiveInvMass (const InvRotInertia &invRotI, const Length2 &p, const UnitVec &q)
 Gets the "effective" inverse mass.
 
std::vector< UnitVec > playrho::d2::GetFwdNormalsVector (const std::vector< Length2 > &vertices)
 Gets the forward normals for the given container of vertices.
 
Position playrho::d2::GetNormalized (const Position &val) noexcept
 Gets the "normalized" position. More...
 
Sweep playrho::d2::GetNormalized (Sweep sweep) noexcept
 Gets a sweep with the given sweep's angles normalized. More...
 
Position playrho::d2::GetPosition (const Position &pos0, const Position &pos1, Real beta) noexcept
 
constexpr auto playrho::d2::GetReflectionMatrix (const UnitVec &axis)
 Gets the reflection matrix for the given unit vector that defines the normal of the line through the origin that points should be reflected against. More...
 
Transformation playrho::d2::GetTransform0 (const Sweep &sweep) noexcept
 Gets the transform at "time" zero. More...
 
Transformation playrho::d2::GetTransform1 (const Sweep &sweep) noexcept
 Gets the transform at "time" one. More...
 
constexpr Transformation playrho::d2::GetTransformation (const Length2 &ctr, const UnitVec &rot, const Length2 &localCtr) noexcept
 Gets the transformation for the given values.
 
Transformation playrho::d2::GetTransformation (const Position &pos, const Length2 &local_ctr) noexcept
 Gets the transformation for the given values.
 
Transformation playrho::d2::GetTransformation (const Sweep &sweep, const UnitIntervalFF< Real > beta) noexcept
 Gets the interpolated transform at a specific time. More...
 
template<class T >
UnitVec playrho::d2::GetUnitVector (const Vector2< T > &value, const UnitVec &fallback=UnitVec::GetDefaultFallback()) noexcept
 
constexpr Vec2 playrho::d2::GetVec2 (const UnitVec &value)
 Gets a Vec2 representation of the given value.
 
template<class T >
constexpr auto playrho::d2::InverseRotate (const Vector2< T > &vector, const UnitVec &angle) noexcept
 Inverse rotates a vector. More...
 
constexpr Length2 playrho::d2::InverseTransform (const Length2 &v, const Transformation &xfm) noexcept
 Inverse transforms the given 2-D vector with the given transformation. More...
 
bool playrho::d2::IsUnderActive (const Velocity &velocity, const LinearVelocity &linSleepTol, const AngularVelocity &angSleepTol) noexcept
 Gets whether the given velocity is "under active" based on the given tolerances.
 
constexpr Transformation playrho::d2::Mul (const Transformation &A, const Transformation &B) noexcept
 Multiplies a given transformation by another given transformation. More...
 
constexpr Transformation playrho::d2::MulT (const Transformation &A, const Transformation &B) noexcept
 Inverse multiplies a given transformation by another given transformation. More...
 
template<class T , typename U , bool NoExcept>
constexpr Vector2< T > playrho::d2::operator* (const playrho::detail::Checked< T, U, NoExcept > &s, const UnitVec &u) noexcept
 Multiplication operator.
 
template<class T >
constexpr Vector2< T > playrho::d2::operator* (const T &s, const UnitVec &u) noexcept
 Multiplication operator.
 
template<class T , class U , bool NoExcept>
constexpr Vector2< T > playrho::d2::operator* (const UnitVec &u, const playrho::detail::Checked< T, U, NoExcept > &s) noexcept
 Multiplication operator.
 
template<class T >
constexpr Vector2< T > playrho::d2::operator* (const UnitVec &u, const T &s) noexcept
 Multiplication operator.
 
constexpr Vec2 playrho::d2::operator/ (const UnitVec &u, const UnitVec::value_type s) noexcept
 Division operator.
 
template<class T >
constexpr auto playrho::d2::Rotate (const Vector2< T > &vector, const UnitVec &angle) noexcept
 Rotates a vector by a given angle. More...
 
constexpr Length2 playrho::d2::Transform (const Length2 &v, const Transformation &xfm) noexcept
 Transforms the given 2-D vector with the given transformation. More...
 

Detailed Description

Declarations of general 2-D math related code.