Mathter
A configurable 3D math library for game developers.
Namespaces | Functions
VectorFunction.hpp File Reference
#include "VectorImpl.hpp"
#include "../Matrix.hpp"

Go to the source code of this file.

Namespaces

 mathter
 

Functions

template<class T , int Dim, bool Packed>
bool mathter::IsNullvector (const Vector< T, Dim, Packed > &v)
 Returns true if the vector's length is too small for precise calculations (i.e. normalization). More...
 
template<class T , int Dim, bool Packed>
mathter::LengthSquared (const Vector< T, Dim, Packed > &v)
 Returns the squared length of the vector. More...
 
template<class T , int Dim, bool Packed>
mathter::Length (const Vector< T, Dim, Packed > &v)
 Returns the length of the vector. More...
 
template<class T , int Dim, bool Packed>
mathter::LengthPrecise (const Vector< T, Dim, Packed > &v)
 Returns the length of the vector, avoids overflow and underflow, so it's more expensive. More...
 
template<class T , class U , int Dim, bool Packed1, bool Packed2>
auto mathter::Distance (const Vector< T, Dim, Packed1 > &lhs, const Vector< U, Dim, Packed2 > &rhs)
 Returns the euclidean distance between to vectors. More...
 
template<class T , int Dim, bool Packed>
Vector< T, Dim, Packed > mathter::Normalize (const Vector< T, Dim, Packed > &v)
 Makes a unit vector, but keeps direction. More...
 
template<class T , int Dim, bool Packed>
bool mathter::IsNormalized (const Vector< T, Dim, Packed > &v)
 Checks if the vector is unit vector. There's some tolerance due to floating points. More...
 
template<class T , int Dim, bool Packed>
Vector< T, Dim, Packed > mathter::SafeNormalize (const Vector< T, Dim, Packed > &v)
 Makes a unit vector, but keeps direction. Leans towards (1,0,0...) for nullvectors, costs more. More...
 
template<class T , int Dim, bool Packed>
Vector< T, Dim, Packed > mathter::SafeNormalize (const Vector< T, Dim, Packed > &v, const Vector< T, Dim, Packed > &degenerate)
 Makes a unit vector, but keeps direction. Leans towards degenerate for nullvectors, costs more. More...
 
template<class T , int Dim, bool Packed>
void mathter::Fill (Vector< T, Dim, Packed > &lhs, T all)
 Sets all elements of the vector to the same value. More...
 
template<class T , int Dim, bool Packed>
mathter::Dot (const Vector< T, Dim, Packed > &lhs, const Vector< T, Dim, Packed > &rhs)
 Calculates the scalar product (dot product) of the two arguments. More...
 
template<class T , int Dim, bool Packed, class... Args>
auto mathter::Cross (const Vector< T, Dim, Packed > &head, Args &&... args) -> Vector< T, Dim, Packed >
 Returns the generalized cross-product in N dimensions. More...
 
template<class T , int Dim, bool Packed>
auto mathter::Cross (const std::array< const Vector< T, Dim, Packed > *, Dim - 1 > &args) -> Vector< T, Dim, Packed >
 Returns the generalized cross-product in N dimensions. More...
 
template<class T , bool Packed>
Vector< T, 2, Packed > mathter::Cross (const Vector< T, 2, Packed > &arg)
 Returns the 2-dimensional cross prodct, which is a vector perpendicular to the argument. More...
 
template<class T , bool Packed>
Vector< T, 2, Packed > mathter::Cross (const std::array< const Vector< T, 2, Packed > *, 1 > &arg)
 Returns the 2-dimensional cross prodct, which is a vector perpendicular to the argument. More...
 
template<class T , bool Packed>
Vector< T, 3, Packed > mathter::Cross (const Vector< T, 3, Packed > &lhs, const Vector< T, 3, Packed > &rhs)
 Returns the 3-dimensional cross-product. More...
 
template<class T , bool Packed>
Vector< T, 3, Packed > mathter::Cross (const std::array< const Vector< T, 3, Packed > *, 2 > &args)
 Returns the 3-dimensional cross-product. More...
 
template<class T , int Dim, bool Packed>
Vector< T, Dim, Packed > mathter::Min (const Vector< T, Dim, Packed > &lhs, const Vector< T, Dim, Packed > &rhs)
 Returns the element-wise minimum of arguments More...
 
template<class T , int Dim, bool Packed>
Vector< T, Dim, Packed > mathter::Max (const Vector< T, Dim, Packed > &lhs, const Vector< T, Dim, Packed > &rhs)
 Returns the element-wise maximum of arguments More...