Mathter
A configurable 3D math library for game developers.
Namespaces | Classes | Enumerations | Functions | Variables
mathter Namespace Reference

Namespaces

 impl
 
 quat_literals
 
 traits
 

Classes

struct  ApproxHelper
 
class  BezierCurve
 
class  Constants
 Accurate mathematical constants. More...
 
class  DecompositionLU
 A utility class that can do common operations with the LU decomposition, i.e. solving equation systems. More...
 
class  DecompositionLUP
 A utility class that can do common operations with the LUP decomposition, i.e. solving equation systems. More...
 
class  DecompositionQR
 A utility class that can do common operations with the QR decomposition, i.e. solving equation systems. More...
 
class  DecompositionSVD
 A utility class that can do common operations with the singular value decomposition, i.e. solving equation systems. More...
 
class  Hyperplane
 
class  IdentityBuilder
 
class  Intersection
 
class  Intersection< Hyperplane< T, 2 >, Hyperplane< T, 2 > >
 
class  Intersection< Hyperplane< T, Dim >, Line< T, Dim > >
 
class  Intersection< Hyperplane< T, Dim >, LineSegment< T, Dim > >
 
class  Intersection< Line< T, 2 >, Line< T, 2 > >
 
class  Intersection< Line< T, 2 >, LineSegment< T, 2 > >
 
class  Intersection< Line< T, Dim >, Hyperplane< T, Dim > >
 
class  Intersection< LineSegment< T, 2 >, Line< T, 2 > >
 
class  Intersection< LineSegment< T, 2 >, LineSegment< T, 2 > >
 
class  Intersection< LineSegment< T, Dim >, Hyperplane< T, Dim > >
 
class  Intersection< Ray< T, 3 >, Triangle3D< T > >
 
class  Line
 
class  LineSegment
 
class  Matrix
 
class  MatrixData
 
class  OrthographicBuilder
 
class  PerspectiveBuilder
 
class  Quaternion
 Allows you to do quaternion math and represent rotation in a compact way. More...
 
class  RangeHelper
 
class  Ray
 
class  Rotation2DBuilder
 
class  Rotation3DAxisAngleBuilder
 
class  Rotation3DAxisBuilder
 
class  Rotation3DTriAxisBuilder
 
class  ScaleBuilder
 
class  ShearBuilder
 
union  Simd
 2,4 or 8 dimension float or double parameters accepted. Uses SSE2 or AVX acceleration if enabled in the compiler. More...
 
union  Simd< double, 2 >
 
union  Simd< double, 4 >
 
union  Simd< float, 4 >
 
union  Simd< float, 8 >
 
class  SubmatrixHelper
 
class  Swizzle
 Enables element swizzling (reordering elements) for vectors. More...
 
class  TranslationBuilder
 
class  Triangle3D
 
class  Vector
 Represents a vector in N-dimensional space. More...
 
class  VectorData
 
class  VectorData< double, 2, false >
 
class  VectorData< double, 3, false >
 
class  VectorData< double, 4, false >
 
class  VectorData< float, 2, false >
 
class  VectorData< float, 3, false >
 
class  VectorData< float, 4, false >
 
class  VectorData< float, 8, false >
 
class  VectorData< T, 2, Packed >
 
class  VectorData< T, 3, Packed >
 
class  VectorData< T, 4, Packed >
 
class  ViewBuilder
 
class  ZeroBuilder
 

Enumerations

enum  eMatrixOrder { eMatrixOrder::PRECEDE_VECTOR, eMatrixOrder::FOLLOW_VECTOR }
 Determines if you want to left- or right-multiply your matrices with vectors. More...
 
enum  eMatrixLayout { eMatrixLayout::ROW_MAJOR, eMatrixLayout::COLUMN_MAJOR }
 Determines the memory layout of matrices. More...
 
enum  eEnclosingBracket { eEnclosingBracket::NONE, eEnclosingBracket::PARANTHESE, eEnclosingBracket::BRACKET, eEnclosingBracket::BRACE }
 

Functions

template<class T >
bool AlmostEqual (T d1, T d2, std::true_type)
 
template<class T >
bool AlmostEqual (T d1, T d2, std::false_type)
 
template<class T , class = std::enable_if_t<traits::NotVector<T>::value && traits::NotMatrix<T>::value && traits::NotQuaternion<T>::value>>
bool AlmostEqual (T d1, T d2)
 
template<class T , int Dim, bool Packed1, bool Packed2>
bool AlmostEqual (const Vector< T, Dim, Packed1 > &lhs, const Vector< T, Dim, Packed2 > &rhs)
 
template<class T , bool Packed1, bool Packed2>
bool AlmostEqual (const Quaternion< T, Packed1 > &lhs, const Quaternion< T, Packed2 > &rhs)
 
template<class T , int Rows, int Columns, eMatrixOrder Order1, eMatrixLayout Layout1, bool Packed1, eMatrixOrder Order2, eMatrixLayout Layout2, bool Packed2>
bool AlmostEqual (const Matrix< T, Rows, Columns, Order1, Layout1, Packed1 > &lhs, const Matrix< T, Rows, Columns, Order2, Layout2, Packed2 > &rhs)
 
template<class LinalgClass1 , class LinalgClass2 >
bool operator== (const ApproxHelper< LinalgClass1 > &lhs, const LinalgClass2 &rhs)
 
template<class LinalgClass1 , class LinalgClass2 >
bool operator== (const LinalgClass1 &lhs, const ApproxHelper< LinalgClass2 > &rhs)
 
template<class LinalgClass1 , class LinalgClass2 >
bool operator== (const ApproxHelper< LinalgClass1 > &lhs, const ApproxHelper< LinalgClass2 > &rhs)
 
template<class LinalgClass >
std::ostream & operator<< (std::ostream &os, const ApproxHelper< LinalgClass > &arg)
 
template<class LinalgClass >
ApproxHelper< LinalgClass > ApproxVec (const LinalgClass &arg)
 
template<class T >
RangeHelper< T > Range (T first, T last, T step)
 
template<class T >
RangeHelper< T > Range (T first, T last)
 
template<class T >
RangeHelper< T > Range (T last)
 
template<class T , int Dim, eMatrixOrder Order, eMatrixLayout Layout, bool Packed>
auto DecomposeLU (const Matrix< T, Dim, Dim, Order, Layout, Packed > &m)
 
template<class T , int Dim, eMatrixOrder Order, eMatrixLayout Layout, bool Packed>
auto DecomposeLUP (const Matrix< T, Dim, Dim, Order, Layout, Packed > &m, int &parity)
 Implements LU decomposition with partial pivoting. More...
 
template<class T , int Dim, eMatrixOrder Order, eMatrixLayout Layout, bool Packed>
auto DecomposeLUP (const Matrix< T, Dim, Dim, Order, Layout, Packed > &m)
 Implements LU decomposition with partial pivoting. More...
 
template<class T , int Rows, int Columns, eMatrixOrder Order, eMatrixLayout Layout, bool Packed>
auto DecomposeQR (Matrix< T, Rows, Columns, Order, Layout, Packed > m)
 Calculates the QR decomposition of the matrix using Householder transforms. More...
 
template<class T , int Rows, int Columns, eMatrixOrder Order, eMatrixLayout Layout, bool Packed>
auto DecomposeSVD (Matrix< T, Rows, Columns, Order, Layout, Packed > m)
 Calculates the thin SVD of the matrix. More...
 
template<class T , class U >
auto Intersect (const T &t, const U &u)
 
template<class T , int Dim, bool Packed>
std::ostream & operator<< (std::ostream &os, const mathter::Vector< T, Dim, Packed > &v)
 Prints the vector like [1,2,3]. More...
 
template<class T , int Dim, bool Packed>
Vector< T, Dim, Packed > strtovec (const char *str, const char **end)
 Parses a vector from a string. More...
 
template<class VectorT >
VectorT strtovec (const char *str, const char **end)
 
template<class T , int Rows, int Columns, eMatrixOrder Order, eMatrixLayout Layout, bool Packed>
std::ostream & operator<< (std::ostream &os, const Matrix< T, Rows, Columns, Order, Layout, Packed > &mat)
 
template<class T , int Rows, int Columns, eMatrixOrder Order, eMatrixLayout Layout, bool Packed>
Matrix< T, Rows, Columns, Order, Layout, Packed > strtomat (const char *str, const char **end)
 
template<class MatrixT >
MatrixT strtomat (const char *str, const char **end)
 
template<class T , bool Packed>
std::ostream & operator<< (std::ostream &os, const Quaternion< T, Packed > &q)
 
template<class T , class U , int Rows1, int Match, int Columns2, eMatrixOrder Order1, eMatrixOrder Order2, bool Packed, class V >
auto operator* (const Matrix< T, Rows1, Match, Order1, eMatrixLayout::ROW_MAJOR, Packed > &lhs, const Matrix< U, Match, Columns2, Order2, eMatrixLayout::ROW_MAJOR, Packed > &rhs) -> Matrix< V, Rows1, Columns2, Order1, eMatrixLayout::ROW_MAJOR, Packed >
 
template<class T , class U , int Rows1, int Match, int Columns2, eMatrixOrder Order1, eMatrixOrder Order2, bool Packed, class V >
auto operator* (const Matrix< T, Rows1, Match, Order1, eMatrixLayout::ROW_MAJOR, Packed > &lhs, const Matrix< U, Match, Columns2, Order2, eMatrixLayout::COLUMN_MAJOR, Packed > &rhs) -> Matrix< V, Rows1, Columns2, Order1, eMatrixLayout::ROW_MAJOR, Packed >
 
template<class T , class U , int Rows1, int Match, int Columns2, eMatrixOrder Order1, eMatrixOrder Order2, bool Packed, class V >
auto operator* (const Matrix< T, Rows1, Match, Order1, eMatrixLayout::COLUMN_MAJOR, Packed > &lhs, const Matrix< U, Match, Columns2, Order2, eMatrixLayout::COLUMN_MAJOR, Packed > &rhs) -> Matrix< V, Rows1, Columns2, Order1, eMatrixLayout::COLUMN_MAJOR, Packed >
 
template<class T , class U , int Rows1, int Match, int Columns2, eMatrixOrder Order1, eMatrixOrder Order2, bool Packed, class V >
auto operator* (const Matrix< T, Rows1, Match, Order1, eMatrixLayout::COLUMN_MAJOR, Packed > &lhs, const Matrix< U, Match, Columns2, Order2, eMatrixLayout::ROW_MAJOR, Packed > &rhs) -> Matrix< V, Rows1, Columns2, Order1, eMatrixLayout::COLUMN_MAJOR, Packed >
 
template<class T1 , class T2 , int Rows1, int Match, int Columns2, eMatrixOrder Order1, eMatrixOrder Order2, eMatrixLayout Layout1, eMatrixLayout Layout2, bool PackedA>
auto operator* (const Matrix< T1, Rows1, Match, Order1, Layout1, PackedA > &lhs, const Matrix< T2, Match, Columns2, Order2, Layout2, PackedA > &rhs) -> Matrix< traits::MatMulElemT< T1, T2 >, Rows1, Columns2, Order1, Layout1, PackedA >
 
template<class T1 , class T2 , int Dim, eMatrixOrder Order1, eMatrixOrder Order2, eMatrixLayout Layout1, eMatrixLayout Layout2, bool Packed>
Matrix< T1, Dim, Dim, Order1, Layout1, Packed > & operator*= (Matrix< T1, Dim, Dim, Order1, Layout1, Packed > &lhs, const Matrix< T2, Dim, Dim, Order2, Layout2, Packed > &rhs)
 
template<class T , class U , int Rows, int Columns, eMatrixOrder Order1, eMatrixOrder Order2, eMatrixLayout SameLayout, bool Packed, class V = decltype(T() + U())>
Matrix< U, Rows, Columns, Order1, SameLayout, Packed > operator+ (const Matrix< T, Rows, Columns, Order1, SameLayout, Packed > &lhs, const Matrix< U, Rows, Columns, Order2, SameLayout, Packed > &rhs)
 
template<class T , class U , int Rows, int Columns, eMatrixOrder Order1, eMatrixOrder Order2, eMatrixLayout SameLayout, bool Packed, class V = decltype(T() - U())>
Matrix< U, Rows, Columns, Order1, SameLayout, Packed > operator- (const Matrix< T, Rows, Columns, Order1, SameLayout, Packed > &lhs, const Matrix< U, Rows, Columns, Order2, SameLayout, Packed > &rhs)
 
template<class T , class U , int Rows, int Columns, eMatrixOrder Order1, eMatrixOrder Order2, eMatrixLayout Layout1, eMatrixLayout Layout2, bool Packed, class V , class = typename std::enable_if<Layout1 != Layout2>::type>
Matrix< U, Rows, Columns, Order1, Layout1, Packed > operator+ (const Matrix< T, Rows, Columns, Order1, Layout1, Packed > &lhs, const Matrix< U, Rows, Columns, Order2, Layout2, Packed > &rhs)
 
template<class T , class U , int Rows, int Columns, eMatrixOrder Order1, eMatrixOrder Order2, eMatrixLayout Layout1, eMatrixLayout Layout2, bool Packed, class V , class = typename std::enable_if<Layout1 != Layout2>::type>
Matrix< U, Rows, Columns, Order1, Layout1, Packed > operator- (const Matrix< T, Rows, Columns, Order1, Layout1, Packed > &lhs, const Matrix< U, Rows, Columns, Order2, Layout2, Packed > &rhs)
 
template<class T , class U , int Rows, int Columns, eMatrixOrder Order1, eMatrixOrder Order2, eMatrixLayout Layout1, eMatrixLayout Layout2, bool Packed, class V >
Matrix< U, Rows, Columns, Order1, Layout1, Packed > & operator+= (Matrix< T, Rows, Columns, Order1, Layout1, Packed > &lhs, const Matrix< U, Rows, Columns, Order2, Layout2, Packed > &rhs)
 Performs matrix addition and stores result in this. More...
 
template<class T , class U , int Rows, int Columns, eMatrixOrder Order1, eMatrixOrder Order2, eMatrixLayout Layout1, eMatrixLayout Layout2, bool Packed, class V >
Matrix< U, Rows, Columns, Order1, Layout1, Packed > & operator-= (Matrix< T, Rows, Columns, Order1, Layout1, Packed > &lhs, const Matrix< U, Rows, Columns, Order2, Layout2, Packed > &rhs)
 Performs matrix subtraction and stores result in this. More...
 
template<class T , int Rows, int Columns, eMatrixOrder Order, eMatrixLayout Layout, bool Packed>
Matrix< T, Rows, Columns, Order, Layout, Packed > & operator*= (Matrix< T, Rows, Columns, Order, Layout, Packed > &mat, T s)
 Multiplies all elements of the matrix by scalar. More...
 
template<class T , int Rows, int Columns, eMatrixOrder Order, eMatrixLayout Layout, bool Packed>
Matrix< T, Rows, Columns, Order, Layout, Packed > & operator/= (Matrix< T, Rows, Columns, Order, Layout, Packed > &mat, T s)
 Divides all elements of the matrix by scalar. More...
 
template<class T , int Rows, int Columns, eMatrixOrder Order, eMatrixLayout Layout, bool Packed>
Matrix< T, Rows, Columns, Order, Layout, Packed > operator* (T s, const Matrix< T, Rows, Columns, Order, Layout, Packed > &mat)
 
template<class T , int Rows, int Columns, eMatrixOrder Order, eMatrixLayout Layout, bool Packed>
Matrix< T, Rows, Columns, Order, Layout, Packed > operator/ (T s, const Matrix< T, Rows, Columns, Order, Layout, Packed > &mat)
 
template<class T , int Rows, int Columns, eMatrixOrder Order, eMatrixLayout Layout, bool Packed>
Matrix< T, Rows, Columns, Order, Layout, Packed > operator* (const Matrix< T, Rows, Columns, Order, Layout, Packed > &mat, T s)
 
template<class T , int Rows, int Columns, eMatrixOrder Order, eMatrixLayout Layout, bool Packed>
Matrix< T, Rows, Columns, Order, Layout, Packed > operator/ (const Matrix< T, Rows, Columns, Order, Layout, Packed > &mat, T s)
 
template<class T , class T2 , int Rows, int Columns, eMatrixOrder Order, eMatrixOrder Order2, eMatrixLayout Layout, bool Packed>
auto MulElementwise (const Matrix< T, Rows, Columns, Order, Layout, Packed > &lhs, const Matrix< T2, Rows, Columns, Order2, Layout, Packed > &rhs)
 
template<class T , class T2 , int Rows, int Columns, eMatrixOrder Order, eMatrixOrder Order2, eMatrixLayout Layout, bool Packed>
auto MulElementwise (const Matrix< T, Rows, Columns, Order, Layout, Packed > &lhs, const Matrix< T2, Rows, Columns, Order2, traits::OppositeLayout< Layout >::value, Packed > &rhs)
 
template<class T , class T2 , int Rows, int Columns, eMatrixOrder Order, eMatrixOrder Order2, eMatrixLayout Layout, bool Packed>
auto DivElementwise (const Matrix< T, Rows, Columns, Order, Layout, Packed > &lhs, const Matrix< T2, Rows, Columns, Order2, Layout, Packed > &rhs)
 
template<class T , class T2 , int Rows, int Columns, eMatrixOrder Order, eMatrixOrder Order2, eMatrixLayout Layout, bool Packed>
auto DivElementwise (const Matrix< T, Rows, Columns, Order, Layout, Packed > &lhs, const Matrix< T2, Rows, Columns, Order2, traits::OppositeLayout< Layout >::value, Packed > &rhs)
 
template<class U , class T , int Rows, int Columns, eMatrixOrder Order, eMatrixLayout Layout, bool Packed>
Matrix< T, Rows, Columns, Order, Layout, Packed > operator+ (const Matrix< T, Rows, Columns, Order, Layout, Packed > &mat)
 
template<class U , class T , int Rows, int Columns, eMatrixOrder Order, eMatrixLayout Layout, bool Packed>
Matrix< T, Rows, Columns, Order, Layout, Packed > operator- (const Matrix< T, Rows, Columns, Order, Layout, Packed > &mat)
 
template<int Rows, int Columns, class T1 , class T2 , eMatrixOrder Order1, eMatrixOrder Order2, eMatrixLayout Layout1, eMatrixLayout Layout2, bool Packed1, bool Packed2>
bool operator== (const Matrix< T1, Rows, Columns, Order1, Layout1, Packed1 > &lhs, const Matrix< T2, Rows, Columns, Order2, Layout2, Packed2 > &rhs)
 
template<int Rows, int Columns, class T1 , class T2 , eMatrixOrder Order1, eMatrixOrder Order2, eMatrixLayout Layout1, eMatrixLayout Layout2, bool Packed1, bool Packed2>
bool operator!= (const Matrix< T1, Rows, Columns, Order1, Layout1, Packed1 > &lhs, const Matrix< T2, Rows, Columns, Order2, Layout2, Packed2 > &rhs)
 
template<class T , int Dim, eMatrixOrder Order, eMatrixLayout Layout, bool Packed>
Trace (const Matrix< T, Dim, Dim, Order, Layout, Packed > &m)
 Returns the trace (sum of diagonal elements) of the matrix. More...
 
template<class T , int Dim, eMatrixOrder Order, eMatrixLayout Layout, bool Packed>
Determinant (const Matrix< T, Dim, Dim, Order, Layout, Packed > &m)
 Returns the determinant of the matrix. More...
 
template<class T , int Rows, int Columns, eMatrixOrder Order, eMatrixLayout Layout, bool Packed>
Matrix< T, Columns, Rows, Order, Layout, Packed > Transpose (const Matrix< T, Rows, Columns, Order, Layout, Packed > &m)
 Transposes the matrix in-place. More...
 
template<class T , int Dim, eMatrixOrder Order, eMatrixLayout Layout, bool Packed>
Matrix< T, Dim, Dim, Order, Layout, Packed > Inverse (const Matrix< T, Dim, Dim, Order, Layout, Packed > &m)
 Returns the inverse of the matrix. More...
 
template<class T , int Rows, int Columns, eMatrixOrder Order, eMatrixLayout Layout, bool Packed>
NormSquared (const Matrix< T, Rows, Columns, Order, Layout, Packed > &m)
 Calculates the square of the Frobenius norm of the matrix. More...
 
template<class T , int Rows, int Columns, eMatrixOrder Order, eMatrixLayout Layout, bool Packed>
Norm (const Matrix< T, Rows, Columns, Order, Layout, Packed > &m)
 Calculates the Frobenius norm of the matrix. More...
 
template<class Vt , class Mt , int Vd, int Mcol, eMatrixOrder Morder, bool Packed, class Rt >
Vector< Rt, Mcol, Packed > operator* (const Vector< Vt, Vd, Packed > &vec, const Matrix< Mt, Vd, Mcol, Morder, eMatrixLayout::ROW_MAJOR, Packed > &mat)
 
template<class Vt , class Mt , int Vd, int Mcol, eMatrixOrder Morder, bool Packed, class Rt >
Vector< Rt, Mcol, Packed > operator* (const Vector< Vt, Vd, Packed > &vec, const Matrix< Mt, Vd, Mcol, Morder, eMatrixLayout::COLUMN_MAJOR, Packed > &mat)
 
template<class Vt , class Mt , int Vd, int Mcol, eMatrixOrder Morder, eMatrixLayout Mlayout, bool Packed>
Vector< traits::MatMulElemT< Vt, Mt >, Mcol, Packed > operator* (const Vector< Vt, Vd, Packed > &vec, const Matrix< Mt, Vd, Mcol, Morder, Mlayout, Packed > &mat)
 
template<class Vt , class Mt , int Vd, eMatrixLayout Mlayout, eMatrixOrder Morder, bool Packed, class Rt = traits::MatMulElemT<Vt, Mt>>
Vector< Rt, Vd, Packed > operator* (const Vector< Vt, Vd, Packed > &vec, const Matrix< Mt, Vd+1, Vd, Morder, Mlayout, Packed > &mat)
 
template<class Vt , class Mt , int Vd, eMatrixLayout Mlayout, eMatrixOrder Morder, bool Packed, class Rt = traits::MatMulElemT<Vt, Mt>>
Vector< Rt, Vd, Packed > operator* (const Vector< Vt, Vd, Packed > &vec, const Matrix< Mt, Vd+1, Vd+1, Morder, Mlayout, Packed > &mat)
 
template<class Vt , class Mt , int Vd, int Mrow, eMatrixOrder Morder, bool Packed, class Rt >
Vector< Rt, Mrow, Packed > operator* (const Matrix< Mt, Mrow, Vd, Morder, eMatrixLayout::ROW_MAJOR, Packed > &mat, const Vector< Vt, Vd, Packed > &vec)
 
template<class Vt , class Mt , int Vd, int Mrow, eMatrixOrder Morder, bool Packed, class Rt >
Vector< Rt, Mrow, Packed > operator* (const Matrix< Mt, Mrow, Vd, Morder, eMatrixLayout::COLUMN_MAJOR, Packed > &mat, const Vector< Vt, Vd, Packed > &vec)
 
template<class Vt , class Mt , int Vd, int Mrow, eMatrixOrder Morder, eMatrixLayout Mlayout, bool Packed>
Vector< traits::MatMulElemT< Vt, Mt >, Mrow, Packed > operator* (const Matrix< Mt, Mrow, Vd, Morder, Mlayout, Packed > &mat, const Vector< Vt, Vd, Packed > &vec)
 
template<class Vt , class Mt , int Vd, eMatrixLayout Mlayout, eMatrixOrder Morder, bool Packed, class Rt = traits::MatMulElemT<Vt, Mt>>
Vector< Rt, Vd, Packed > operator* (const Matrix< Mt, Vd, Vd+1, Morder, Mlayout, Packed > &mat, const Vector< Vt, Vd, Packed > &vec)
 
template<class Vt , class Mt , int Vd, eMatrixLayout Mlayout, eMatrixOrder Morder, bool Packed, class Rt = traits::MatMulElemT<Vt, Mt>>
Vector< Rt, Vd, Packed > operator* (const Matrix< Mt, Vd+1, Vd+1, Morder, Mlayout, Packed > &mat, const Vector< Vt, Vd, Packed > &vec)
 
template<class Vt , class Mt , int Vd, eMatrixOrder Morder, eMatrixLayout Layout, bool Packed>
Vector< Vt, Vd, Packed > & operator*= (Vector< Vt, Vd, Packed > &vec, const Matrix< Mt, Vd, Vd, Morder, Layout, Packed > &mat)
 
template<class T , bool Packed>
Quaternion< T, Packed > & operator+= (Quaternion< T, Packed > &lhs, const Quaternion< T, Packed > &rhs)
 
template<class T , bool Packed>
Quaternion< T, Packed > & operator-= (Quaternion< T, Packed > &lhs, const Quaternion< T, Packed > &rhs)
 
template<class T , bool Packed>
Quaternion< T, Packed > & operator*= (Quaternion< T, Packed > &lhs, const Quaternion< T, Packed > &rhs)
 
template<class T , bool Packed>
Quaternion< T, Packed > & operator*= (Quaternion< T, Packed > &lhs, T s)
 
template<class T , bool Packed>
Quaternion< T, Packed > & operator/= (Quaternion< T, Packed > &lhs, T s)
 
template<class T , bool Packed>
Quaternion< T, Packed > operator+ (const Quaternion< T, Packed > &lhs, const Quaternion< T, Packed > &rhs)
 
template<class T , bool Packed>
Quaternion< T, Packed > operator- (const Quaternion< T, Packed > &lhs, const Quaternion< T, Packed > &rhs)
 
template<class T , bool Packed>
Quaternion< T, Packed > operator* (const Quaternion< T, Packed > &lhs, const Quaternion< T, Packed > &rhs)
 
template<class T , bool Packed>
Quaternion< T, Packed > operator* (const Quaternion< T, Packed > &lhs, T s)
 
template<class T , bool Packed>
Quaternion< T, Packed > operator/ (const Quaternion< T, Packed > &lhs, T s)
 
template<class T , bool Packed>
Quaternion< T, Packed > operator+ (const Quaternion< T, Packed > &arg)
 
template<class T , bool Packed>
Quaternion< T, Packed > operator- (const Quaternion< T, Packed > &arg)
 
template<class T , bool Packed, class U , class = typename std::enable_if<!std::is_same<U, Quaternion<T, Packed>>::value>::type>
Quaternion< T, Packed > operator* (U s, const Quaternion< T, Packed > &rhs)
 Multiplies all coefficients of the quaternion by s . More...
 
template<class T , bool Packed, class U , class = typename std::enable_if<!std::is_same<U, Quaternion<T, Packed>>::value>::type>
Quaternion< T, Packed > operator/ (U s, const Quaternion< T, Packed > &rhs)
 Divides all coefficients of the quaternion by s . More...
 
template<class T , bool Packed, class U , class = typename std::enable_if<!traits::IsQuaternion<U>::value>::type>
Quaternion< T, Packed > operator+ (const U &lhs, const Quaternion< T, Packed > &rhs)
 Adds a real to the real part of the quaternion. More...
 
template<class T , bool Packed>
bool operator== (const Quaternion< T, Packed > &lhs, const Quaternion< T, Packed > &rhs)
 Check exact equality of coefficients. More...
 
template<class T , bool Packed>
bool operator!= (const Quaternion< T, Packed > &lhs, const Quaternion< T, Packed > &rhs)
 Check exact unequality of coefficients. More...
 
template<class T , bool Packed>
Abs (const Quaternion< T, Packed > &q)
 The euclidean length of the vector of the 4 elements of the quaternion. More...
 
template<class T , bool Packed>
Quaternion< T, Packed > Conjugate (const Quaternion< T, Packed > &q)
 Negates the imaginary values of the quaternion. More...
 
template<class T , bool Packed>
Quaternion< T, Packed > Exp (const Quaternion< T, Packed > &q)
 Natural quaternion exponentiation, base e. More...
 
template<class T , bool Packed>
Quaternion< T, Packed > Log (const Quaternion< T, Packed > &q)
 Natural quaternion logarithm, base e. More...
 
template<class T , bool Packed>
Quaternion< T, Packed > Pow (const Quaternion< T, Packed > &q, T a)
 Raises q to the power of a . More...
 
template<class T , bool Packed>
LengthSquared (const Quaternion< T, Packed > &q)
 Returns the square of the absolute value. More...
 
template<class T , bool Packed>
Length (const Quaternion< T, Packed > &q)
 Returns the absolute value of the quaternion. More...
 
template<class T , bool Packed>
Quaternion< T, Packed > Normalize (const Quaternion< T, Packed > &q)
 Returns the unit quaternion of the same direction. Does not change this object. More...
 
template<class T , bool Packed>
Quaternion< T, Packed > Inverse (const Quaternion< T, Packed > &q)
 Returns the quaternion of opposite rotation. More...
 
template<class T , bool Packed>
bool IsNormalized (const Quaternion< T, Packed > &q)
 Check if the quaternion is a unit quaternion, with some tolerance for floats. More...
 
template<class T , bool QPacked, bool PackedA>
Vector< T, 3, PackedA > operator* (const Quaternion< T, QPacked > &q, const Vector< T, 3, PackedA > &vec)
 Rotates (and scales) vector by quaternion. More...
 
template<class T , bool QPacked, bool PackedA>
Vector< T, 3, PackedA > operator* (const Vector< T, 3, PackedA > &vec, const Quaternion< T, QPacked > &q)
 Rotates (and scales) vector by quaternion. More...
 
template<class T , bool QPacked, bool PackedA>
Vector< T, 3, PackedA > & operator*= (Vector< T, 3, PackedA > &vec, const Quaternion< T, QPacked > &q)
 Rotates (and scales) vector by quaternion. More...
 
auto Identity ()
 Creates an identity matrix or identity quaternion. More...
 
template<class T , int Dim, bool Packed>
auto Orthographic (const Vector< T, Dim, Packed > &minBounds, const Vector< T, Dim, Packed > &maxBounds, T projNearPlane=T(0), T projFarPlane=T(1))
 Creates an orthographics projection matrix. The volume before projection is an axis-aligned hypercube and it is projected onto a unit hypercube. More...
 
template<class T , int DimMinus1, bool Packed>
auto Perspective (T fovX, const Vector< T, DimMinus1, Packed > &ratios, T nearPlane, T farPlane, T projNearPlane=T(0), T projFarPlane=T(1))
 Creates a perspective projection matrix. More...
 
template<class T >
auto Perspective (T fov, T nearPlane, T farPlane, T projNearPlane=T(0), T projFarPlane=T(1))
 Creates a 2D projection matrix. More...
 
template<class T >
auto Perspective (T fov, T aspectRatio, T nearPlane, T farPlane, T projNearPlane=T(0), T projFarPlane=T(1))
 Creates a 3D projection matrix. More...
 
template<class T >
auto Rotation (const T &angle)
 Creates a 2D rotation matrix. More...
 
template<class T >
auto RotationAxis (T angle, int axis)
 Rotates around coordinate axis. More...
 
template<int Axis, class T >
auto RotationAxis (T angle)
 Rotates around coordinate axis. More...
 
template<class T >
auto RotationX (T angle)
 Rotates around the X axis according to the right (left) hand rule. More...
 
template<class T >
auto RotationY (T angle)
 Rotates around the Y axis according to the right (left) hand rule. More...
 
template<class T >
auto RotationZ (T angle)
 Rotates around the Z axis according to the right (left) hand rule. More...
 
template<int FirstAxis, int SecondAxis, int ThirdAxis, class T >
auto RotationAxis3 (T angle0, T angle1, T angle2)
 Rotates around three axes in succession. More...
 
template<class T >
auto RotationEuler (T z1, T x2, T z3)
 Rotation matrix from Euler angles. Rotations are Z-X-Z. More...
 
template<class T >
auto RotationRPY (T x1, T y2, T z3)
 Rotation matrix from roll-pitch-yaw angles. Rotations are X-Y-Z. More...
 
template<class T , bool Vpacked, class U >
auto RotationAxisAngle (const Vector< T, 3, Vpacked > &axis, U angle)
 Rotates around an arbitrary axis. More...
 
template<class T , int Rows, int Columns, eMatrixOrder Order, eMatrixLayout Layout, bool Packed>
bool IsRotationMatrix3D (const Matrix< T, Rows, Columns, Order, Layout, Packed > &m)
 Determines if the matrix is a proper rotation matrix. More...
 
template<class Vt , int Vdim, bool Vpacked>
auto Scale (const Vector< Vt, Vdim, Vpacked > &scale)
 Creates a scaling matrix. More...
 
template<class... Args, typename std::enable_if<(traits::All< traits::IsScalar, typename std::decay< Args >::type... >::value), int >::type = 0>
auto Scale (Args &&... scales)
 Creates a scaling matrix. More...
 
template<class T >
auto Shear (T slope, int principalAxis, int modulatorAxis)
 Creates a shear matrix. More...
 
template<class T , int Dim, bool Packed>
auto Translation (const Vector< T, Dim, Packed > &translation)
 Creates a translation matrix. More...
 
template<class... Args, typename std::enable_if<(traits::All< traits::IsScalar, typename std::decay< Args >::type... >::value), int >::type = 0>
auto Translation (const Args &... coordinates)
 Creates a translation matrix. More...
 
template<class T , int Dim, bool Packed, size_t BaseDim, size_t FlipDim>
auto LookAt (const Vector< T, Dim, Packed > &eye, const Vector< T, Dim, Packed > &target, const std::array< Vector< T, Dim, Packed >, BaseDim > &bases, const std::array< bool, FlipDim > &flipAxes)
 Creates a camera look-at matrix. More...
 
template<class T , bool Packed>
auto LookAt (const Vector< T, 2, Packed > &eye, const Vector< T, 2, Packed > &target, bool positiveYForward=true, bool flipX=false)
 Creates a 2D look-at matrix. More...
 
template<class T , bool Packed>
auto LookAt (const Vector< T, 3, Packed > &eye, const Vector< T, 3, Packed > &target, const Vector< T, 3, Packed > &up, bool positiveZForward=true, bool flipX=false, bool flipY=false)
 Creates a 3D look-at matrix. More...
 
auto Zero ()
 Creates a matrix with all elements zero. More...
 
template<class Scalar >
auto Rad2Deg (Scalar rad)
 Converts radians to degrees. More...
 
template<class Scalar >
auto Deg2Rad (Scalar deg)
 Converts degrees to radians. More...
 
template<class Scalar >
Scalar Clamp (Scalar arg, Scalar lower, Scalar upper)
 Limits arg to the range [lower, upper], making it either lower or upper if out of range. More...
 
template<class T , int Dim, bool Packed>
Vector< T, Dim, Packed > Clamp (const Vector< T, Dim, Packed > &arg, T lower, T upper)
 Clamps all elements of the vector according to the scalar clamp. More...
 
template<class Scalar >
Scalar Saturate (Scalar arg)
 Clamps argument into range [0,1]. More...
 
template<class T , int Dim, bool Packed>
Vector< T, Dim, Packed > Saturate (const Vector< T, Dim, Packed > &arg)
 Clamps all elements into range [0,1]. More...
 
template<class T , int Dim, bool Packed>
Vector< T, Dim, Packed > operator* (const Vector< T, Dim, Packed > &lhs, const Vector< T, Dim, Packed > &rhs)
 Elementwise (Hadamard) vector product. More...
 
template<class T , int Dim, bool Packed>
Vector< T, Dim, Packed > operator/ (const Vector< T, Dim, Packed > &lhs, const Vector< T, Dim, Packed > &rhs)
 Elementwise vector division. More...
 
template<class T , int Dim, bool Packed>
Vector< T, Dim, Packed > operator+ (const Vector< T, Dim, Packed > &lhs, const Vector< T, Dim, Packed > &rhs)
 Elementwise vector addition. More...
 
template<class T , int Dim, bool Packed>
Vector< T, Dim, Packed > operator- (const Vector< T, Dim, Packed > &lhs, const Vector< T, Dim, Packed > &rhs)
 Elementwise vector subtraction. More...
 
template<class T , int Dim, bool Packed>
Vector< T, Dim, Packed > & operator*= (Vector< T, Dim, Packed > &lhs, const Vector< T, Dim, Packed > &rhs)
 Elementwise (Hadamard) vector product. More...
 
template<class T , int Dim, bool Packed>
Vector< T, Dim, Packed > & operator/= (Vector< T, Dim, Packed > &lhs, const Vector< T, Dim, Packed > &rhs)
 Elementwise vector division. More...
 
template<class T , int Dim, bool Packed>
Vector< T, Dim, Packed > & operator+= (Vector< T, Dim, Packed > &lhs, const Vector< T, Dim, Packed > &rhs)
 Elementwise vector addition. More...
 
template<class T , int Dim, bool Packed>
Vector< T, Dim, Packed > & operator-= (Vector< T, Dim, Packed > &lhs, const Vector< T, Dim, Packed > &rhs)
 Elementwise vector subtraction. More...
 
template<class T , int Dim, bool Packed>
Vector< T, Dim, Packed > & operator*= (Vector< T, Dim, Packed > &lhs, T rhs)
 Scales the vector by rhs . More...
 
template<class T , int Dim, bool Packed>
Vector< T, Dim, Packed > & operator/= (Vector< T, Dim, Packed > &lhs, T rhs)
 Scales the vector by 1/rhs . More...
 
template<class T , int Dim, bool Packed>
Vector< T, Dim, Packed > & operator+= (Vector< T, Dim, Packed > &lhs, T rhs)
 Adds rhs to each element of the vector. More...
 
template<class T , int Dim, bool Packed>
Vector< T, Dim, Packed > & operator-= (Vector< T, Dim, Packed > &lhs, T rhs)
 Subtracts rhs from each element of the vector. More...
 
template<class T , int Dim, bool Packed>
Vector< T, Dim, Packed > operator* (const Vector< T, Dim, Packed > &lhs, T rhs)
 Scales the vector by rhs . More...
 
template<class T , int Dim, bool Packed>
Vector< T, Dim, Packed > operator/ (const Vector< T, Dim, Packed > &lhs, T rhs)
 Scales the vector by 1/rhs . More...
 
template<class T , int Dim, bool Packed>
Vector< T, Dim, Packed > operator+ (const Vector< T, Dim, Packed > &lhs, T rhs)
 Adds rhs to each element of the vector. More...
 
template<class T , int Dim, bool Packed>
Vector< T, Dim, Packed > operator- (const Vector< T, Dim, Packed > &lhs, T rhs)
 Subtracts rhs from each element of the vector. More...
 
template<class T , int Dim, bool Packed, class U , class = typename std::enable_if<std::is_convertible<U, T>::value>::type>
Vector< T, Dim, Packed > operator* (U lhs, const Vector< T, Dim, Packed > &rhs)
 Scales vector by lhs . More...
 
template<class T , int Dim, bool Packed, class U , class = typename std::enable_if<std::is_convertible<U, T>::value>::type>
Vector< T, Dim, Packed > operator+ (U lhs, const Vector< T, Dim, Packed > &rhs)
 Adds lhs to all elements of the vector. More...
 
template<class T , int Dim, bool Packed, class U , class = typename std::enable_if<std::is_convertible<U, T>::value>::type>
Vector< T, Dim, Packed > operator- (U lhs, const Vector< T, Dim, Packed > &rhs)
 Makes a vector with lhs as all elements, then subtracts rhs from it. More...
 
template<class T , int Dim, bool Packed, class U , class = typename std::enable_if<std::is_convertible<U, T>::value>::type>
Vector< T, Dim, Packed > operator/ (U lhs, const Vector< T, Dim, Packed > &rhs)
 Makes a vector with lhs as all elements, then divides it by rhs . More...
 
template<class T , int Dim, bool Packed>
Vector< T, Dim, Packed > MultiplyAdd (const Vector< T, Dim, Packed > &a, const Vector< T, Dim, Packed > &b, const Vector< T, Dim, Packed > &c)
 Return (a*b)+c. Performs MAD or FMA if supported by target architecture. More...
 
template<class T , int Dim, bool Packed>
Vector< T, Dim, Packed > operator- (const Vector< T, Dim, Packed > &arg)
 Negates all elements of the vector. More...
 
template<class T , int Dim, bool Packed>
Vector< T, Dim, Packed > operator+ (const Vector< T, Dim, Packed > &arg)
 Optional plus sign, leaves the vector as is. More...
 
template<class T , int Dim, bool Packed, int... Indices>
std::enable_if_t< Dim==sizeof...(Indices), Vector< T, Dim, Packed > > operator* (const Vector< T, Dim, Packed > &v, const Swizzle< T, Indices... > &s)
 
template<class T , int Dim, bool Packed, int... Indices>
std::enable_if_t< Dim==sizeof...(Indices), Vector< T, Dim, Packed > > operator/ (const Vector< T, Dim, Packed > &v, const Swizzle< T, Indices... > &s)
 
template<class T , int Dim, bool Packed, int... Indices>
std::enable_if_t< Dim==sizeof...(Indices), Vector< T, Dim, Packed > > operator+ (const Vector< T, Dim, Packed > &v, const Swizzle< T, Indices... > &s)
 
template<class T , int Dim, bool Packed, int... Indices>
std::enable_if_t< Dim==sizeof...(Indices), Vector< T, Dim, Packed > > operator- (const Vector< T, Dim, Packed > &v, const Swizzle< T, Indices... > &s)
 
template<class T , int Dim, bool Packed, int... Indices>
std::enable_if_t< Dim==sizeof...(Indices), Vector< T, Dim, Packed > > operator* (const Swizzle< T, Indices... > &s, const Vector< T, Dim, Packed > &v)
 
template<class T , int Dim, bool Packed, int... Indices>
std::enable_if_t< Dim==sizeof...(Indices), Vector< T, Dim, Packed > > operator/ (const Swizzle< T, Indices... > &s, const Vector< T, Dim, Packed > &v)
 
template<class T , int Dim, bool Packed, int... Indices>
std::enable_if_t< Dim==sizeof...(Indices), Vector< T, Dim, Packed > > operator+ (const Swizzle< T, Indices... > &s, const Vector< T, Dim, Packed > &v)
 
template<class T , int Dim, bool Packed, int... Indices>
std::enable_if_t< Dim==sizeof...(Indices), Vector< T, Dim, Packed > > operator- (const Swizzle< T, Indices... > &s, const Vector< T, Dim, Packed > &v)
 
template<class T , int Dim, bool Packed, int... Indices>
std::enable_if_t< Dim==sizeof...(Indices), Vector< T, Dim, Packed > > & operator*= (const Vector< T, Dim, Packed > &v, const Swizzle< T, Indices... > &s)
 
template<class T , int Dim, bool Packed, int... Indices>
std::enable_if_t< Dim==sizeof...(Indices), Vector< T, Dim, Packed > > & operator/= (const Vector< T, Dim, Packed > &v, const Swizzle< T, Indices... > &s)
 
template<class T , int Dim, bool Packed, int... Indices>
std::enable_if_t< Dim==sizeof...(Indices), Vector< T, Dim, Packed > > & operator+= (const Vector< T, Dim, Packed > &v, const Swizzle< T, Indices... > &s)
 
template<class T , int Dim, bool Packed, int... Indices>
std::enable_if_t< Dim==sizeof...(Indices), Vector< T, Dim, Packed > > & operator-= (const Vector< T, Dim, Packed > &v, const Swizzle< T, Indices... > &s)
 
template<class T , int Dim, bool Packed>
bool operator== (const Vector< T, Dim, Packed > &lhs, const Vector< T, Dim, Packed > &rhs)
 Exactly compares two vectors. More...
 
template<class T , int Dim, bool Packed>
bool operator!= (const Vector< T, Dim, Packed > &lhs, const Vector< T, Dim, Packed > &rhs)
 Exactly compares two vectors. More...
 
template<class T , int Dim, bool Packed, class U >
mathter::Vector< T, Dim+1, Packed > operator| (const mathter::Vector< T, Dim, Packed > &lhs, U rhs)
 Concatenates the arguments, and returns the concatenated vector. More...
 
template<class T1 , int Dim1, class T2 , int Dim2, bool Packed>
mathter::Vector< T1, Dim1+Dim2, Packed > operator| (const mathter::Vector< T1, Dim1, Packed > &lhs, const mathter::Vector< T2, Dim2, Packed > &rhs)
 Concatenates the arguments, and returns the concatenated vector. More...
 
template<class T , int Dim, bool Packed, class U >
mathter::Vector< T, Dim+1, Packed > operator| (U lhs, const mathter::Vector< T, Dim, Packed > &rhs)
 Concatenates the arguments, and returns the concatenated vector. More...
 
template<class T1 , int... Indices1, class T2 , int... Indices2>
Vector< T1, sizeof...(Indices2)+sizeof...(Indices2), falseoperator| (const Swizzle< T1, Indices1... > &lhs, const Swizzle< T2, Indices2... > &rhs)
 Concatenates the arguments, and returns the concatenated vector. More...
 
template<class T1 , int... Indices1, class T2 , int Dim, bool Packed>
Vector< T1, sizeof...(Indices1)+Dim, Packed > operator| (const Swizzle< T1, Indices1... > &lhs, const Vector< T2, Dim, Packed > &rhs)
 Concatenates the arguments, and returns the concatenated vector. More...
 
template<class T1 , int... Indices1, class T2 , int Dim, bool Packed>
Vector< T1, sizeof...(Indices1)+Dim, Packed > operator| (const Vector< T2, Dim, Packed > &lhs, const Swizzle< T1, Indices1... > &rhs)
 Concatenates the arguments, and returns the concatenated vector. More...
 
template<class T1 , int... Indices1, class U >
Vector< T1, sizeof...(Indices1)+1, falseoperator| (const Swizzle< T1, Indices1... > &lhs, U rhs)
 Concatenates the arguments, and returns the concatenated vector. More...
 
template<class T1 , int... Indices1, class U >
Vector< T1, sizeof...(Indices1)+1, falseoperator| (U lhs, const Swizzle< T1, Indices1... > &rhs)
 Concatenates the arguments, and returns the concatenated vector. More...
 
template<class T , int Dim, bool Packed>
bool 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>
LengthSquared (const Vector< T, Dim, Packed > &v)
 Returns the squared length of the vector. More...
 
template<class T , int Dim, bool Packed>
Length (const Vector< T, Dim, Packed > &v)
 Returns the length of the vector. More...
 
template<class T , int Dim, bool Packed>
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 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 > Normalize (const Vector< T, Dim, Packed > &v)
 Makes a unit vector, but keeps direction. More...
 
template<class T , int Dim, bool Packed>
bool 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 > 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 > 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 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>
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 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 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 > 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 > 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 > 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 > 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 > 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 > Max (const Vector< T, Dim, Packed > &lhs, const Vector< T, Dim, Packed > &rhs)
 Returns the element-wise maximum of arguments More...
 
 false () const
 
 true () const
 

Variables

constexpr int DYNAMIC = -1
 Specify this as Vector or Matrix dimension template parameter to set size at runtime. PLEASE NOTE THAT DYNAMICALLY SIZED VECTORS AND MATRICES ARE NOT SUPPORTED YET. More...
 

Enumeration Type Documentation

◆ eEnclosingBracket

Enumerator
NONE 
PARANTHESE 
BRACKET 
BRACE 

◆ eMatrixLayout

Determines the memory layout of matrices.

For ROW_MAJOR layout, the matrix's first row comes first in memory, followed immediately by the second row's elements. For COLUMN_MAJOR matrices, the memory region begins with the first column.

This does not affect arithmetic or matrix generator function in any way. Your arithmetic will work the same way if you change this.

Please note that changing this flag may affect performance of arithmetic operations. Profile your code to determine optimal settings. Performance may depend on multiple factors.

Enumerator
ROW_MAJOR 
COLUMN_MAJOR 

◆ eMatrixOrder

enum mathter::eMatrixOrder
strong

Determines if you want to left- or right-multiply your matrices with vectors.

This flag affects the generated transformation matrices. If you want to write M2*M1*v in your code, then choose PRECEDE_VECTOR, if you want v*M1*M2, choose FOLLOW_VECTOR. Matrices generated by Transform, Scale, Rotation and similar functions will match your order of multiplication. (I.e. bottom row is translation if you choose FOLLOW_VECTOR).

You can still use M*v and v*M in your code.

Enumerator
PRECEDE_VECTOR 
FOLLOW_VECTOR 

Function Documentation

◆ Abs()

template<class T , bool Packed>
T mathter::Abs ( const Quaternion< T, Packed > &  q)

The euclidean length of the vector of the 4 elements of the quaternion.

◆ AlmostEqual() [1/6]

template<class T >
bool mathter::AlmostEqual ( d1,
d2,
std::true_type   
)

◆ AlmostEqual() [2/6]

template<class T >
bool mathter::AlmostEqual ( d1,
d2,
std::false_type   
)

◆ AlmostEqual() [3/6]

template<class T , class = std::enable_if_t<traits::NotVector<T>::value && traits::NotMatrix<T>::value && traits::NotQuaternion<T>::value>>
bool mathter::AlmostEqual ( d1,
d2 
)

◆ AlmostEqual() [4/6]

template<class T , int Dim, bool Packed1, bool Packed2>
bool mathter::AlmostEqual ( const Vector< T, Dim, Packed1 > &  lhs,
const Vector< T, Dim, Packed2 > &  rhs 
)

◆ AlmostEqual() [5/6]

template<class T , bool Packed1, bool Packed2>
bool mathter::AlmostEqual ( const Quaternion< T, Packed1 > &  lhs,
const Quaternion< T, Packed2 > &  rhs 
)

◆ AlmostEqual() [6/6]

template<class T , int Rows, int Columns, eMatrixOrder Order1, eMatrixLayout Layout1, bool Packed1, eMatrixOrder Order2, eMatrixLayout Layout2, bool Packed2>
bool mathter::AlmostEqual ( const Matrix< T, Rows, Columns, Order1, Layout1, Packed1 > &  lhs,
const Matrix< T, Rows, Columns, Order2, Layout2, Packed2 > &  rhs 
)

◆ ApproxVec()

template<class LinalgClass >
ApproxHelper<LinalgClass> mathter::ApproxVec ( const LinalgClass &  arg)

◆ Clamp() [1/2]

template<class Scalar >
Scalar mathter::Clamp ( Scalar  arg,
Scalar  lower,
Scalar  upper 
)

Limits arg to the range [lower, upper], making it either lower or upper if out of range.

◆ Clamp() [2/2]

template<class T , int Dim, bool Packed>
Vector< T, Dim, Packed > mathter::Clamp ( const Vector< T, Dim, Packed > &  arg,
lower,
upper 
)

Clamps all elements of the vector according to the scalar clamp.

◆ Conjugate()

template<class T , bool Packed>
Quaternion<T, Packed> mathter::Conjugate ( const Quaternion< T, Packed > &  q)

Negates the imaginary values of the quaternion.

◆ Cross() [1/6]

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.

You must supply N-1 arguments of type Vector<N>. The function returns the generalized cross product as defined by https://en.wikipedia.org/wiki/Cross_product#Multilinear_algebra.

◆ Cross() [2/6]

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.

See https://en.wikipedia.org/wiki/Cross_product#Multilinear_algebra for definition.

◆ Cross() [3/6]

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.

◆ Cross() [4/6]

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.

◆ Cross() [5/6]

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.

◆ Cross() [6/6]

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.

◆ DecomposeLU()

template<class T , int Dim, eMatrixOrder Order, eMatrixLayout Layout, bool Packed>
auto mathter::DecomposeLU ( const Matrix< T, Dim, Dim, Order, Layout, Packed > &  m)

◆ DecomposeLUP() [1/2]

template<class T , int Dim, eMatrixOrder Order, eMatrixLayout Layout, bool Packed>
auto mathter::DecomposeLUP ( const Matrix< T, Dim, Dim, Order, Layout, Packed > &  m,
int &  parity 
)

Implements LU decomposition with partial pivoting.

Handles singular matrices as well.

Parameters
LLower triangular matrix, LU=P'A.
UUpper triangular matrix, LU=P'A.
PRow permutations. LU=P'A, where P' is a matrix whose i-th row's P[i]-th element is one.
parityThe parity of the permutation described by P. Odd: 1, Even: -1.

◆ DecomposeLUP() [2/2]

template<class T , int Dim, eMatrixOrder Order, eMatrixLayout Layout, bool Packed>
auto mathter::DecomposeLUP ( const Matrix< T, Dim, Dim, Order, Layout, Packed > &  m)

Implements LU decomposition with partial pivoting.

Handles singular matrices as well.

◆ DecomposeQR()

template<class T , int Rows, int Columns, eMatrixOrder Order, eMatrixLayout Layout, bool Packed>
auto mathter::DecomposeQR ( Matrix< T, Rows, Columns, Order, Layout, Packed >  m)

Calculates the QR decomposition of the matrix using Householder transforms.

The matrix must have Rows <= Columns. It's a full QR decomposition, not a thin one.

◆ DecomposeSVD()

template<class T , int Rows, int Columns, eMatrixOrder Order, eMatrixLayout Layout, bool Packed>
auto mathter::DecomposeSVD ( Matrix< T, Rows, Columns, Order, Layout, Packed >  m)

Calculates the thin SVD of the matrix.

For wide matrices, V is wide while U and S square. For tall matrices, U is tall while S and V square.

◆ Deg2Rad()

template<class Scalar >
auto mathter::Deg2Rad ( Scalar  deg)

Converts degrees to radians.

◆ Determinant()

template<class T , int Dim, eMatrixOrder Order, eMatrixLayout Layout, bool Packed>
T mathter::Determinant ( const Matrix< T, Dim, Dim, Order, Layout, Packed > &  m)

Returns the determinant of the matrix.

◆ Distance()

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.

◆ DivElementwise() [1/2]

template<class T , class T2 , int Rows, int Columns, eMatrixOrder Order, eMatrixOrder Order2, eMatrixLayout Layout, bool Packed>
auto mathter::DivElementwise ( const Matrix< T, Rows, Columns, Order, Layout, Packed > &  lhs,
const Matrix< T2, Rows, Columns, Order2, Layout, Packed > &  rhs 
)

◆ DivElementwise() [2/2]

template<class T , class T2 , int Rows, int Columns, eMatrixOrder Order, eMatrixOrder Order2, eMatrixLayout Layout, bool Packed>
auto mathter::DivElementwise ( const Matrix< T, Rows, Columns, Order, Layout, Packed > &  lhs,
const Matrix< T2, Rows, Columns, Order2, traits::OppositeLayout< Layout >::value, Packed > &  rhs 
)

◆ Dot()

template<class T , int Dim, bool Packed>
T mathter::Dot ( const Vector< T, Dim, Packed > &  lhs,
const Vector< T, Dim, Packed > &  rhs 
)

Calculates the scalar product (dot product) of the two arguments.

◆ Exp()

template<class T , bool Packed>
Quaternion<T, Packed> mathter::Exp ( const Quaternion< T, Packed > &  q)

Natural quaternion exponentiation, base e.

◆ false()

mathter::false ( ) const

◆ Fill()

template<class T , int Dim, bool Packed>
void mathter::Fill ( Vector< T, Dim, Packed > &  lhs,
all 
)

Sets all elements of the vector to the same value.

◆ Identity()

auto mathter::Identity ( )
inline

Creates an identity matrix or identity quaternion.

If the matrix is not square, it will look like a truncated larger square identity matrix.

◆ Intersect()

template<class T , class U >
auto mathter::Intersect ( const T &  t,
const U &  u 
)

◆ Inverse() [1/2]

template<class T , int Dim, eMatrixOrder Order, eMatrixLayout Layout, bool Packed>
Matrix<T, Dim, Dim, Order, Layout, Packed> mathter::Inverse ( const Matrix< T, Dim, Dim, Order, Layout, Packed > &  m)

Returns the inverse of the matrix.

◆ Inverse() [2/2]

template<class T , bool Packed>
Quaternion<T, Packed> mathter::Inverse ( const Quaternion< T, Packed > &  q)

Returns the quaternion of opposite rotation.

◆ IsNormalized() [1/2]

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.

◆ IsNormalized() [2/2]

template<class T , bool Packed>
bool mathter::IsNormalized ( const Quaternion< T, Packed > &  q)

Check if the quaternion is a unit quaternion, with some tolerance for floats.

◆ IsNullvector()

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).

"Too small" means smaller than the square root of the smallest number representable by the underlying scalar. This value is ~10^-18 for floats and ~10^-154 for doubles.

◆ IsRotationMatrix3D()

template<class T , int Rows, int Columns, eMatrixOrder Order, eMatrixLayout Layout, bool Packed>
bool mathter::IsRotationMatrix3D ( const Matrix< T, Rows, Columns, Order, Layout, Packed > &  m)

Determines if the matrix is a proper rotation matrix.

Proper rotation matrices are orthogonal and have a determinant of +1.

◆ Length() [1/2]

template<class T , int Dim, bool Packed>
T mathter::Length ( const Vector< T, Dim, Packed > &  v)

Returns the length of the vector.

◆ Length() [2/2]

template<class T , bool Packed>
T mathter::Length ( const Quaternion< T, Packed > &  q)

Returns the absolute value of the quaternion.

Just like complex numbers, it's the length of the vector formed by the coefficients.

◆ LengthPrecise()

template<class T , int Dim, bool Packed>
T mathter::LengthPrecise ( const Vector< T, Dim, Packed > &  v)

Returns the length of the vector, avoids overflow and underflow, so it's more expensive.

◆ LengthSquared() [1/2]

template<class T , int Dim, bool Packed>
T mathter::LengthSquared ( const Vector< T, Dim, Packed > &  v)

Returns the squared length of the vector.

◆ LengthSquared() [2/2]

template<class T , bool Packed>
T mathter::LengthSquared ( const Quaternion< T, Packed > &  q)

Returns the square of the absolute value.

Just like complex numbers, it's the square of the length of the vector formed by the coefficients. This is much faster than .

◆ Log()

template<class T , bool Packed>
Quaternion<T, Packed> mathter::Log ( const Quaternion< T, Packed > &  q)

Natural quaternion logarithm, base e.

◆ LookAt() [1/3]

template<class T , int Dim, bool Packed, size_t BaseDim, size_t FlipDim>
auto mathter::LookAt ( const Vector< T, Dim, Packed > &  eye,
const Vector< T, Dim, Packed > &  target,
const std::array< Vector< T, Dim, Packed >, BaseDim > &  bases,
const std::array< bool, FlipDim > &  flipAxes 
)

Creates a camera look-at matrix.

Parameters
eyeThe camera's position.
targetThe camera's target.
basesBasis vectors fixing the camera's orientation.
flipAxisSet any element to true to flip an axis in camera space.

The camera look down the vector going from eye to target , but it can still rotate around that vector. To fix the rotation, an "up" vector must be provided in 3 dimensions. In higher dimensions, we need multiple up vectors. Unfortunately I can't fucking remember how these basis vectors are used, but they are orthogonalized to each-other and to the look vector. I can't remember the order of orthogonalization.

◆ LookAt() [2/3]

template<class T , bool Packed>
auto mathter::LookAt ( const Vector< T, 2, Packed > &  eye,
const Vector< T, 2, Packed > &  target,
bool  positiveYForward = true,
bool  flipX = false 
)

Creates a 2D look-at matrix.

Parameters
eyeThe camera's position.
targetThe camera's target.
positiveYForwardTrue if the camera looks towards +Y, false if -Y.
flipXTrue to flip X in camera space.

◆ LookAt() [3/3]

template<class T , bool Packed>
auto mathter::LookAt ( const Vector< T, 3, Packed > &  eye,
const Vector< T, 3, Packed > &  target,
const Vector< T, 3, Packed > &  up,
bool  positiveZForward = true,
bool  flipX = false,
bool  flipY = false 
)

Creates a 3D look-at matrix.

Parameters
eyeThe camera's position.
targetThe camera's target.
upUp direction in world space.
positiveZForwardTrue if the camera looks towards +Z, false if -Z.
flipXTrue to flip X in camera space.
flipYTrue to flip Y in camera space.

◆ Max()

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

◆ Min()

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

◆ MulElementwise() [1/2]

template<class T , class T2 , int Rows, int Columns, eMatrixOrder Order, eMatrixOrder Order2, eMatrixLayout Layout, bool Packed>
auto mathter::MulElementwise ( const Matrix< T, Rows, Columns, Order, Layout, Packed > &  lhs,
const Matrix< T2, Rows, Columns, Order2, Layout, Packed > &  rhs 
)

◆ MulElementwise() [2/2]

template<class T , class T2 , int Rows, int Columns, eMatrixOrder Order, eMatrixOrder Order2, eMatrixLayout Layout, bool Packed>
auto mathter::MulElementwise ( const Matrix< T, Rows, Columns, Order, Layout, Packed > &  lhs,
const Matrix< T2, Rows, Columns, Order2, traits::OppositeLayout< Layout >::value, Packed > &  rhs 
)

◆ MultiplyAdd()

template<class T , int Dim, bool Packed>
Vector<T, Dim, Packed> mathter::MultiplyAdd ( const Vector< T, Dim, Packed > &  a,
const Vector< T, Dim, Packed > &  b,
const Vector< T, Dim, Packed > &  c 
)
inline

Return (a*b)+c. Performs MAD or FMA if supported by target architecture.

◆ Norm()

template<class T , int Rows, int Columns, eMatrixOrder Order, eMatrixLayout Layout, bool Packed>
T mathter::Norm ( const Matrix< T, Rows, Columns, Order, Layout, Packed > &  m)

Calculates the Frobenius norm of the matrix.

◆ Normalize() [1/2]

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.

◆ Normalize() [2/2]

template<class T , bool Packed>
Quaternion<T, Packed> mathter::Normalize ( const Quaternion< T, Packed > &  q)

Returns the unit quaternion of the same direction. Does not change this object.

◆ NormSquared()

template<class T , int Rows, int Columns, eMatrixOrder Order, eMatrixLayout Layout, bool Packed>
T mathter::NormSquared ( const Matrix< T, Rows, Columns, Order, Layout, Packed > &  m)

Calculates the square of the Frobenius norm of the matrix.

◆ operator!=() [1/3]

template<class T , bool Packed>
bool mathter::operator!= ( const Quaternion< T, Packed > &  lhs,
const Quaternion< T, Packed > &  rhs 
)

Check exact unequality of coefficients.

◆ operator!=() [2/3]

template<int Rows, int Columns, class T1 , class T2 , eMatrixOrder Order1, eMatrixOrder Order2, eMatrixLayout Layout1, eMatrixLayout Layout2, bool Packed1, bool Packed2>
bool mathter::operator!= ( const Matrix< T1, Rows, Columns, Order1, Layout1, Packed1 > &  lhs,
const Matrix< T2, Rows, Columns, Order2, Layout2, Packed2 > &  rhs 
)

◆ operator!=() [3/3]

template<class T , int Dim, bool Packed>
bool mathter::operator!= ( const Vector< T, Dim, Packed > &  lhs,
const Vector< T, Dim, Packed > &  rhs 
)

Exactly compares two vectors.

<The usual warning about floating point numbers>

◆ operator*() [1/27]

template<class T , int Dim, bool Packed>
Vector<T, Dim, Packed> mathter::operator* ( const Vector< T, Dim, Packed > &  lhs,
const Vector< T, Dim, Packed > &  rhs 
)
inline

Elementwise (Hadamard) vector product.

◆ operator*() [2/27]

template<class T , bool QPacked, bool PackedA>
Vector<T, 3, PackedA> mathter::operator* ( const Quaternion< T, QPacked > &  q,
const Vector< T, 3, PackedA > &  vec 
)

Rotates (and scales) vector by quaternion.

◆ operator*() [3/27]

template<class T , bool QPacked, bool PackedA>
Vector<T, 3, PackedA> mathter::operator* ( const Vector< T, 3, PackedA > &  vec,
const Quaternion< T, QPacked > &  q 
)

Rotates (and scales) vector by quaternion.

◆ operator*() [4/27]

template<class Vt , class Mt , int Vd, int Mcol, eMatrixOrder Morder, bool Packed, class Rt >
Vector<Rt, Mcol, Packed> mathter::operator* ( const Vector< Vt, Vd, Packed > &  vec,
const Matrix< Mt, Vd, Mcol, Morder, eMatrixLayout::ROW_MAJOR, Packed > &  mat 
)
inline

◆ operator*() [5/27]

template<class Vt , class Mt , int Vd, int Mcol, eMatrixOrder Morder, bool Packed, class Rt >
Vector<Rt, Mcol, Packed> mathter::operator* ( const Vector< Vt, Vd, Packed > &  vec,
const Matrix< Mt, Vd, Mcol, Morder, eMatrixLayout::COLUMN_MAJOR, Packed > &  mat 
)
inline

◆ operator*() [6/27]

template<class Vt , class Mt , int Vd, int Mcol, eMatrixOrder Morder, eMatrixLayout Mlayout, bool Packed>
Vector<traits::MatMulElemT<Vt, Mt>, Mcol, Packed> mathter::operator* ( const Vector< Vt, Vd, Packed > &  vec,
const Matrix< Mt, Vd, Mcol, Morder, Mlayout, Packed > &  mat 
)
inline

◆ operator*() [7/27]

template<class Vt , class Mt , int Vd, eMatrixLayout Mlayout, eMatrixOrder Morder, bool Packed, class Rt = traits::MatMulElemT<Vt, Mt>>
Vector<Rt, Vd, Packed> mathter::operator* ( const Vector< Vt, Vd, Packed > &  vec,
const Matrix< Mt, Vd+1, Vd, Morder, Mlayout, Packed > &  mat 
)

◆ operator*() [8/27]

template<class T , class U , int Rows1, int Match, int Columns2, eMatrixOrder Order1, eMatrixOrder Order2, bool Packed, class V >
auto mathter::operator* ( const Matrix< T, Rows1, Match, Order1, eMatrixLayout::ROW_MAJOR, Packed > &  lhs,
const Matrix< U, Match, Columns2, Order2, eMatrixLayout::ROW_MAJOR, Packed > &  rhs 
) -> Matrix<V, Rows1, Columns2, Order1, eMatrixLayout::ROW_MAJOR, Packed>
inline

◆ operator*() [9/27]

template<class Vt , class Mt , int Vd, eMatrixLayout Mlayout, eMatrixOrder Morder, bool Packed, class Rt = traits::MatMulElemT<Vt, Mt>>
Vector<Rt, Vd, Packed> mathter::operator* ( const Vector< Vt, Vd, Packed > &  vec,
const Matrix< Mt, Vd+1, Vd+1, Morder, Mlayout, Packed > &  mat 
)

◆ operator*() [10/27]

template<class Vt , class Mt , int Vd, int Mrow, eMatrixOrder Morder, bool Packed, class Rt >
Vector<Rt, Mrow, Packed> mathter::operator* ( const Matrix< Mt, Mrow, Vd, Morder, eMatrixLayout::ROW_MAJOR, Packed > &  mat,
const Vector< Vt, Vd, Packed > &  vec 
)
inline

◆ operator*() [11/27]

template<class Vt , class Mt , int Vd, int Mrow, eMatrixOrder Morder, bool Packed, class Rt >
Vector<Rt, Mrow, Packed> mathter::operator* ( const Matrix< Mt, Mrow, Vd, Morder, eMatrixLayout::COLUMN_MAJOR, Packed > &  mat,
const Vector< Vt, Vd, Packed > &  vec 
)
inline

◆ operator*() [12/27]

template<class T , class U , int Rows1, int Match, int Columns2, eMatrixOrder Order1, eMatrixOrder Order2, bool Packed, class V >
auto mathter::operator* ( const Matrix< T, Rows1, Match, Order1, eMatrixLayout::ROW_MAJOR, Packed > &  lhs,
const Matrix< U, Match, Columns2, Order2, eMatrixLayout::COLUMN_MAJOR, Packed > &  rhs 
) -> Matrix<V, Rows1, Columns2, Order1, eMatrixLayout::ROW_MAJOR, Packed>
inline

◆ operator*() [13/27]

template<class T , bool Packed>
Quaternion<T, Packed> mathter::operator* ( const Quaternion< T, Packed > &  lhs,
const Quaternion< T, Packed > &  rhs 
)

◆ operator*() [14/27]

template<class Vt , class Mt , int Vd, int Mrow, eMatrixOrder Morder, eMatrixLayout Mlayout, bool Packed>
Vector<traits::MatMulElemT<Vt, Mt>, Mrow, Packed> mathter::operator* ( const Matrix< Mt, Mrow, Vd, Morder, Mlayout, Packed > &  mat,
const Vector< Vt, Vd, Packed > &  vec 
)

◆ operator*() [15/27]

template<class T , bool Packed>
Quaternion<T, Packed> mathter::operator* ( const Quaternion< T, Packed > &  lhs,
s 
)

◆ operator*() [16/27]

template<class T , class U , int Rows1, int Match, int Columns2, eMatrixOrder Order1, eMatrixOrder Order2, bool Packed, class V >
auto mathter::operator* ( const Matrix< T, Rows1, Match, Order1, eMatrixLayout::COLUMN_MAJOR, Packed > &  lhs,
const Matrix< U, Match, Columns2, Order2, eMatrixLayout::COLUMN_MAJOR, Packed > &  rhs 
) -> Matrix<V, Rows1, Columns2, Order1, eMatrixLayout::COLUMN_MAJOR, Packed>
inline

◆ operator*() [17/27]

template<class Vt , class Mt , int Vd, eMatrixLayout Mlayout, eMatrixOrder Morder, bool Packed, class Rt = traits::MatMulElemT<Vt, Mt>>
Vector<Rt, Vd, Packed> mathter::operator* ( const Matrix< Mt, Vd, Vd+1, Morder, Mlayout, Packed > &  mat,
const Vector< Vt, Vd, Packed > &  vec 
)

◆ operator*() [18/27]

template<class Vt , class Mt , int Vd, eMatrixLayout Mlayout, eMatrixOrder Morder, bool Packed, class Rt = traits::MatMulElemT<Vt, Mt>>
Vector<Rt, Vd, Packed> mathter::operator* ( const Matrix< Mt, Vd+1, Vd+1, Morder, Mlayout, Packed > &  mat,
const Vector< Vt, Vd, Packed > &  vec 
)

◆ operator*() [19/27]

template<class T , bool Packed, class U , class = typename std::enable_if<!std::is_same<U, Quaternion<T, Packed>>::value>::type>
Quaternion<T, Packed> mathter::operator* ( s,
const Quaternion< T, Packed > &  rhs 
)

Multiplies all coefficients of the quaternion by s .

◆ operator*() [20/27]

template<class T , class U , int Rows1, int Match, int Columns2, eMatrixOrder Order1, eMatrixOrder Order2, bool Packed, class V >
auto mathter::operator* ( const Matrix< T, Rows1, Match, Order1, eMatrixLayout::COLUMN_MAJOR, Packed > &  lhs,
const Matrix< U, Match, Columns2, Order2, eMatrixLayout::ROW_MAJOR, Packed > &  rhs 
) -> Matrix<V, Rows1, Columns2, Order1, eMatrixLayout::COLUMN_MAJOR, Packed>
inline

◆ operator*() [21/27]

template<class T1 , class T2 , int Rows1, int Match, int Columns2, eMatrixOrder Order1, eMatrixOrder Order2, eMatrixLayout Layout1, eMatrixLayout Layout2, bool PackedA>
auto mathter::operator* ( const Matrix< T1, Rows1, Match, Order1, Layout1, PackedA > &  lhs,
const Matrix< T2, Match, Columns2, Order2, Layout2, PackedA > &  rhs 
) -> Matrix<traits::MatMulElemT<T1, T2>, Rows1, Columns2, Order1, Layout1, PackedA>
inline

◆ operator*() [22/27]

template<class T , int Dim, bool Packed>
Vector<T, Dim, Packed> mathter::operator* ( const Vector< T, Dim, Packed > &  lhs,
rhs 
)
inline

Scales the vector by rhs .

◆ operator*() [23/27]

template<class T , int Dim, bool Packed, class U , class = typename std::enable_if<std::is_convertible<U, T>::value>::type>
Vector<T, Dim, Packed> mathter::operator* ( lhs,
const Vector< T, Dim, Packed > &  rhs 
)
inline

Scales vector by lhs .

◆ operator*() [24/27]

template<class T , int Dim, bool Packed, int... Indices>
std::enable_if_t<Dim == sizeof...(Indices), Vector<T, Dim, Packed> > mathter::operator* ( const Vector< T, Dim, Packed > &  v,
const Swizzle< T, Indices... > &  s 
)

◆ operator*() [25/27]

template<class T , int Dim, bool Packed, int... Indices>
std::enable_if_t<Dim == sizeof...(Indices), Vector<T, Dim, Packed> > mathter::operator* ( const Swizzle< T, Indices... > &  s,
const Vector< T, Dim, Packed > &  v 
)

◆ operator*() [26/27]

template<class T , int Rows, int Columns, eMatrixOrder Order, eMatrixLayout Layout, bool Packed>
Matrix<T, Rows, Columns, Order, Layout, Packed> mathter::operator* ( s,
const Matrix< T, Rows, Columns, Order, Layout, Packed > &  mat 
)

◆ operator*() [27/27]

template<class T , int Rows, int Columns, eMatrixOrder Order, eMatrixLayout Layout, bool Packed>
Matrix<T, Rows, Columns, Order, Layout, Packed> mathter::operator* ( const Matrix< T, Rows, Columns, Order, Layout, Packed > &  mat,
s 
)

◆ operator*=() [1/9]

template<class T , bool QPacked, bool PackedA>
Vector<T, 3, PackedA>& mathter::operator*= ( Vector< T, 3, PackedA > &  vec,
const Quaternion< T, QPacked > &  q 
)

Rotates (and scales) vector by quaternion.

◆ operator*=() [2/9]

template<class T , int Dim, bool Packed>
Vector<T, Dim, Packed>& mathter::operator*= ( Vector< T, Dim, Packed > &  lhs,
const Vector< T, Dim, Packed > &  rhs 
)
inline

Elementwise (Hadamard) vector product.

◆ operator*=() [3/9]

template<class T , bool Packed>
Quaternion<T, Packed>& mathter::operator*= ( Quaternion< T, Packed > &  lhs,
const Quaternion< T, Packed > &  rhs 
)

◆ operator*=() [4/9]

template<class T , bool Packed>
Quaternion<T, Packed>& mathter::operator*= ( Quaternion< T, Packed > &  lhs,
s 
)

◆ operator*=() [5/9]

template<class T , int Dim, bool Packed>
Vector<T, Dim, Packed>& mathter::operator*= ( Vector< T, Dim, Packed > &  lhs,
rhs 
)
inline

Scales the vector by rhs .

◆ operator*=() [6/9]

template<class Vt , class Mt , int Vd, eMatrixOrder Morder, eMatrixLayout Layout, bool Packed>
Vector<Vt, Vd, Packed>& mathter::operator*= ( Vector< Vt, Vd, Packed > &  vec,
const Matrix< Mt, Vd, Vd, Morder, Layout, Packed > &  mat 
)

◆ operator*=() [7/9]

template<class T1 , class T2 , int Dim, eMatrixOrder Order1, eMatrixOrder Order2, eMatrixLayout Layout1, eMatrixLayout Layout2, bool Packed>
Matrix<T1, Dim, Dim, Order1, Layout1, Packed>& mathter::operator*= ( Matrix< T1, Dim, Dim, Order1, Layout1, Packed > &  lhs,
const Matrix< T2, Dim, Dim, Order2, Layout2, Packed > &  rhs 
)
inline

◆ operator*=() [8/9]

template<class T , int Dim, bool Packed, int... Indices>
std::enable_if_t<Dim == sizeof...(Indices), Vector<T, Dim, Packed> >& mathter::operator*= ( const Vector< T, Dim, Packed > &  v,
const Swizzle< T, Indices... > &  s 
)

◆ operator*=() [9/9]

template<class T , int Rows, int Columns, eMatrixOrder Order, eMatrixLayout Layout, bool Packed>
Matrix<T, Rows, Columns, Order, Layout, Packed>& mathter::operator*= ( Matrix< T, Rows, Columns, Order, Layout, Packed > &  mat,
s 
)
inline

Multiplies all elements of the matrix by scalar.

◆ operator+() [1/12]

template<class T , int Dim, bool Packed>
Vector<T, Dim, Packed> mathter::operator+ ( const Vector< T, Dim, Packed > &  lhs,
const Vector< T, Dim, Packed > &  rhs 
)
inline

Elementwise vector addition.

◆ operator+() [2/12]

template<class T , bool Packed>
Quaternion<T, Packed> mathter::operator+ ( const Quaternion< T, Packed > &  lhs,
const Quaternion< T, Packed > &  rhs 
)

◆ operator+() [3/12]

template<class T , bool Packed>
Quaternion<T, Packed> mathter::operator+ ( const Quaternion< T, Packed > &  arg)

◆ operator+() [4/12]

template<class T , bool Packed, class U , class = typename std::enable_if<!traits::IsQuaternion<U>::value>::type>
Quaternion<T, Packed> mathter::operator+ ( const U &  lhs,
const Quaternion< T, Packed > &  rhs 
)

Adds a real to the real part of the quaternion.

◆ operator+() [5/12]

template<class T , int Dim, bool Packed>
Vector<T, Dim, Packed> mathter::operator+ ( const Vector< T, Dim, Packed > &  lhs,
rhs 
)
inline

Adds rhs to each element of the vector.

◆ operator+() [6/12]

template<class T , class U , int Rows, int Columns, eMatrixOrder Order1, eMatrixOrder Order2, eMatrixLayout SameLayout, bool Packed, class V = decltype(T() + U())>
Matrix<U, Rows, Columns, Order1, SameLayout, Packed> mathter::operator+ ( const Matrix< T, Rows, Columns, Order1, SameLayout, Packed > &  lhs,
const Matrix< U, Rows, Columns, Order2, SameLayout, Packed > &  rhs 
)
inline

◆ operator+() [7/12]

template<class T , int Dim, bool Packed, class U , class = typename std::enable_if<std::is_convertible<U, T>::value>::type>
Vector<T, Dim, Packed> mathter::operator+ ( lhs,
const Vector< T, Dim, Packed > &  rhs 
)
inline

Adds lhs to all elements of the vector.

◆ operator+() [8/12]

template<class T , int Dim, bool Packed>
Vector<T, Dim, Packed> mathter::operator+ ( const Vector< T, Dim, Packed > &  arg)
inline

Optional plus sign, leaves the vector as is.

◆ operator+() [9/12]

template<class T , class U , int Rows, int Columns, eMatrixOrder Order1, eMatrixOrder Order2, eMatrixLayout Layout1, eMatrixLayout Layout2, bool Packed, class V , class = typename std::enable_if<Layout1 != Layout2>::type>
Matrix<U, Rows, Columns, Order1, Layout1, Packed> mathter::operator+ ( const Matrix< T, Rows, Columns, Order1, Layout1, Packed > &  lhs,
const Matrix< U, Rows, Columns, Order2, Layout2, Packed > &  rhs 
)
inline

◆ operator+() [10/12]

template<class T , int Dim, bool Packed, int... Indices>
std::enable_if_t<Dim == sizeof...(Indices), Vector<T, Dim, Packed> > mathter::operator+ ( const Vector< T, Dim, Packed > &  v,
const Swizzle< T, Indices... > &  s 
)

◆ operator+() [11/12]

template<class T , int Dim, bool Packed, int... Indices>
std::enable_if_t<Dim == sizeof...(Indices), Vector<T, Dim, Packed> > mathter::operator+ ( const Swizzle< T, Indices... > &  s,
const Vector< T, Dim, Packed > &  v 
)

◆ operator+() [12/12]

template<class U , class T , int Rows, int Columns, eMatrixOrder Order, eMatrixLayout Layout, bool Packed>
Matrix<T, Rows, Columns, Order, Layout, Packed> mathter::operator+ ( const Matrix< T, Rows, Columns, Order, Layout, Packed > &  mat)
inline

◆ operator+=() [1/5]

template<class T , bool Packed>
Quaternion<T, Packed>& mathter::operator+= ( Quaternion< T, Packed > &  lhs,
const Quaternion< T, Packed > &  rhs 
)

◆ operator+=() [2/5]

template<class T , int Dim, bool Packed>
Vector<T, Dim, Packed>& mathter::operator+= ( Vector< T, Dim, Packed > &  lhs,
const Vector< T, Dim, Packed > &  rhs 
)
inline

Elementwise vector addition.

◆ operator+=() [3/5]

template<class T , int Dim, bool Packed>
Vector<T, Dim, Packed>& mathter::operator+= ( Vector< T, Dim, Packed > &  lhs,
rhs 
)
inline

Adds rhs to each element of the vector.

◆ operator+=() [4/5]

template<class T , class U , int Rows, int Columns, eMatrixOrder Order1, eMatrixOrder Order2, eMatrixLayout Layout1, eMatrixLayout Layout2, bool Packed, class V >
Matrix<U, Rows, Columns, Order1, Layout1, Packed>& mathter::operator+= ( Matrix< T, Rows, Columns, Order1, Layout1, Packed > &  lhs,
const Matrix< U, Rows, Columns, Order2, Layout2, Packed > &  rhs 
)
inline

Performs matrix addition and stores result in this.

◆ operator+=() [5/5]

template<class T , int Dim, bool Packed, int... Indices>
std::enable_if_t<Dim == sizeof...(Indices), Vector<T, Dim, Packed> >& mathter::operator+= ( const Vector< T, Dim, Packed > &  v,
const Swizzle< T, Indices... > &  s 
)

◆ operator-() [1/11]

template<class T , int Dim, bool Packed>
Vector<T, Dim, Packed> mathter::operator- ( const Vector< T, Dim, Packed > &  lhs,
const Vector< T, Dim, Packed > &  rhs 
)
inline

Elementwise vector subtraction.

◆ operator-() [2/11]

template<class T , bool Packed>
Quaternion<T, Packed> mathter::operator- ( const Quaternion< T, Packed > &  lhs,
const Quaternion< T, Packed > &  rhs 
)

◆ operator-() [3/11]

template<class T , bool Packed>
Quaternion<T, Packed> mathter::operator- ( const Quaternion< T, Packed > &  arg)

◆ operator-() [4/11]

template<class T , int Dim, bool Packed>
Vector<T, Dim, Packed> mathter::operator- ( const Vector< T, Dim, Packed > &  lhs,
rhs 
)
inline

Subtracts rhs from each element of the vector.

◆ operator-() [5/11]

template<class T , int Dim, bool Packed, class U , class = typename std::enable_if<std::is_convertible<U, T>::value>::type>
Vector<T, Dim, Packed> mathter::operator- ( lhs,
const Vector< T, Dim, Packed > &  rhs 
)
inline

Makes a vector with lhs as all elements, then subtracts rhs from it.

◆ operator-() [6/11]

template<class T , class U , int Rows, int Columns, eMatrixOrder Order1, eMatrixOrder Order2, eMatrixLayout SameLayout, bool Packed, class V = decltype(T() - U())>
Matrix<U, Rows, Columns, Order1, SameLayout, Packed> mathter::operator- ( const Matrix< T, Rows, Columns, Order1, SameLayout, Packed > &  lhs,
const Matrix< U, Rows, Columns, Order2, SameLayout, Packed > &  rhs 
)
inline

◆ operator-() [7/11]

template<class T , int Dim, bool Packed>
Vector<T, Dim, Packed> mathter::operator- ( const Vector< T, Dim, Packed > &  arg)
inline

Negates all elements of the vector.

◆ operator-() [8/11]

template<class T , class U , int Rows, int Columns, eMatrixOrder Order1, eMatrixOrder Order2, eMatrixLayout Layout1, eMatrixLayout Layout2, bool Packed, class V , class = typename std::enable_if<Layout1 != Layout2>::type>
Matrix<U, Rows, Columns, Order1, Layout1, Packed> mathter::operator- ( const Matrix< T, Rows, Columns, Order1, Layout1, Packed > &  lhs,
const Matrix< U, Rows, Columns, Order2, Layout2, Packed > &  rhs 
)
inline

◆ operator-() [9/11]

template<class T , int Dim, bool Packed, int... Indices>
std::enable_if_t<Dim == sizeof...(Indices), Vector<T, Dim, Packed> > mathter::operator- ( const Vector< T, Dim, Packed > &  v,
const Swizzle< T, Indices... > &  s 
)

◆ operator-() [10/11]

template<class T , int Dim, bool Packed, int... Indices>
std::enable_if_t<Dim == sizeof...(Indices), Vector<T, Dim, Packed> > mathter::operator- ( const Swizzle< T, Indices... > &  s,
const Vector< T, Dim, Packed > &  v 
)

◆ operator-() [11/11]

template<class U , class T , int Rows, int Columns, eMatrixOrder Order, eMatrixLayout Layout, bool Packed>
Matrix<T, Rows, Columns, Order, Layout, Packed> mathter::operator- ( const Matrix< T, Rows, Columns, Order, Layout, Packed > &  mat)
inline

◆ operator-=() [1/5]

template<class T , bool Packed>
Quaternion<T, Packed>& mathter::operator-= ( Quaternion< T, Packed > &  lhs,
const Quaternion< T, Packed > &  rhs 
)

◆ operator-=() [2/5]

template<class T , int Dim, bool Packed>
Vector<T, Dim, Packed>& mathter::operator-= ( Vector< T, Dim, Packed > &  lhs,
const Vector< T, Dim, Packed > &  rhs 
)
inline

Elementwise vector subtraction.

◆ operator-=() [3/5]

template<class T , int Dim, bool Packed>
Vector<T, Dim, Packed>& mathter::operator-= ( Vector< T, Dim, Packed > &  lhs,
rhs 
)
inline

Subtracts rhs from each element of the vector.

◆ operator-=() [4/5]

template<class T , class U , int Rows, int Columns, eMatrixOrder Order1, eMatrixOrder Order2, eMatrixLayout Layout1, eMatrixLayout Layout2, bool Packed, class V >
Matrix<U, Rows, Columns, Order1, Layout1, Packed>& mathter::operator-= ( Matrix< T, Rows, Columns, Order1, Layout1, Packed > &  lhs,
const Matrix< U, Rows, Columns, Order2, Layout2, Packed > &  rhs 
)
inline

Performs matrix subtraction and stores result in this.

◆ operator-=() [5/5]

template<class T , int Dim, bool Packed, int... Indices>
std::enable_if_t<Dim == sizeof...(Indices), Vector<T, Dim, Packed> >& mathter::operator-= ( const Vector< T, Dim, Packed > &  v,
const Swizzle< T, Indices... > &  s 
)

◆ operator/() [1/9]

template<class T , int Dim, bool Packed>
Vector<T, Dim, Packed> mathter::operator/ ( const Vector< T, Dim, Packed > &  lhs,
const Vector< T, Dim, Packed > &  rhs 
)
inline

Elementwise vector division.

◆ operator/() [2/9]

template<class T , bool Packed>
Quaternion<T, Packed> mathter::operator/ ( const Quaternion< T, Packed > &  lhs,
s 
)

◆ operator/() [3/9]

template<class T , bool Packed, class U , class = typename std::enable_if<!std::is_same<U, Quaternion<T, Packed>>::value>::type>
Quaternion<T, Packed> mathter::operator/ ( s,
const Quaternion< T, Packed > &  rhs 
)

Divides all coefficients of the quaternion by s .

◆ operator/() [4/9]

template<class T , int Dim, bool Packed>
Vector<T, Dim, Packed> mathter::operator/ ( const Vector< T, Dim, Packed > &  lhs,
rhs 
)
inline

Scales the vector by 1/rhs .

◆ operator/() [5/9]

template<class T , int Dim, bool Packed, class U , class = typename std::enable_if<std::is_convertible<U, T>::value>::type>
Vector<T, Dim, Packed> mathter::operator/ ( lhs,
const Vector< T, Dim, Packed > &  rhs 
)
inline

Makes a vector with lhs as all elements, then divides it by rhs .

◆ operator/() [6/9]

template<class T , int Dim, bool Packed, int... Indices>
std::enable_if_t<Dim == sizeof...(Indices), Vector<T, Dim, Packed> > mathter::operator/ ( const Vector< T, Dim, Packed > &  v,
const Swizzle< T, Indices... > &  s 
)

◆ operator/() [7/9]

template<class T , int Dim, bool Packed, int... Indices>
std::enable_if_t<Dim == sizeof...(Indices), Vector<T, Dim, Packed> > mathter::operator/ ( const Swizzle< T, Indices... > &  s,
const Vector< T, Dim, Packed > &  v 
)

◆ operator/() [8/9]

template<class T , int Rows, int Columns, eMatrixOrder Order, eMatrixLayout Layout, bool Packed>
Matrix<T, Rows, Columns, Order, Layout, Packed> mathter::operator/ ( s,
const Matrix< T, Rows, Columns, Order, Layout, Packed > &  mat 
)

◆ operator/() [9/9]

template<class T , int Rows, int Columns, eMatrixOrder Order, eMatrixLayout Layout, bool Packed>
Matrix<T, Rows, Columns, Order, Layout, Packed> mathter::operator/ ( const Matrix< T, Rows, Columns, Order, Layout, Packed > &  mat,
s 
)

◆ operator/=() [1/5]

template<class T , int Dim, bool Packed>
Vector<T, Dim, Packed>& mathter::operator/= ( Vector< T, Dim, Packed > &  lhs,
const Vector< T, Dim, Packed > &  rhs 
)
inline

Elementwise vector division.

◆ operator/=() [2/5]

template<class T , bool Packed>
Quaternion<T, Packed>& mathter::operator/= ( Quaternion< T, Packed > &  lhs,
s 
)

◆ operator/=() [3/5]

template<class T , int Dim, bool Packed>
Vector<T, Dim, Packed>& mathter::operator/= ( Vector< T, Dim, Packed > &  lhs,
rhs 
)
inline

Scales the vector by 1/rhs .

◆ operator/=() [4/5]

template<class T , int Dim, bool Packed, int... Indices>
std::enable_if_t<Dim == sizeof...(Indices), Vector<T, Dim, Packed> >& mathter::operator/= ( const Vector< T, Dim, Packed > &  v,
const Swizzle< T, Indices... > &  s 
)

◆ operator/=() [5/5]

template<class T , int Rows, int Columns, eMatrixOrder Order, eMatrixLayout Layout, bool Packed>
Matrix<T, Rows, Columns, Order, Layout, Packed>& mathter::operator/= ( Matrix< T, Rows, Columns, Order, Layout, Packed > &  mat,
s 
)
inline

Divides all elements of the matrix by scalar.

◆ operator<<() [1/4]

template<class T , int Dim, bool Packed>
std::ostream& mathter::operator<< ( std::ostream &  os,
const mathter::Vector< T, Dim, Packed > &  v 
)

Prints the vector like [1,2,3].

◆ operator<<() [2/4]

template<class LinalgClass >
std::ostream& mathter::operator<< ( std::ostream &  os,
const ApproxHelper< LinalgClass > &  arg 
)

◆ operator<<() [3/4]

template<class T , int Rows, int Columns, eMatrixOrder Order, eMatrixLayout Layout, bool Packed>
std::ostream& mathter::operator<< ( std::ostream &  os,
const Matrix< T, Rows, Columns, Order, Layout, Packed > &  mat 
)

◆ operator<<() [4/4]

template<class T , bool Packed>
std::ostream& mathter::operator<< ( std::ostream &  os,
const Quaternion< T, Packed > &  q 
)

◆ operator==() [1/6]

template<int Rows, int Columns, class T1 , class T2 , eMatrixOrder Order1, eMatrixOrder Order2, eMatrixLayout Layout1, eMatrixLayout Layout2, bool Packed1, bool Packed2>
bool mathter::operator== ( const Matrix< T1, Rows, Columns, Order1, Layout1, Packed1 > &  lhs,
const Matrix< T2, Rows, Columns, Order2, Layout2, Packed2 > &  rhs 
)

◆ operator==() [2/6]

template<class T , bool Packed>
bool mathter::operator== ( const Quaternion< T, Packed > &  lhs,
const Quaternion< T, Packed > &  rhs 
)

Check exact equality of coefficients.

◆ operator==() [3/6]

template<class T , int Dim, bool Packed>
bool mathter::operator== ( const Vector< T, Dim, Packed > &  lhs,
const Vector< T, Dim, Packed > &  rhs 
)

Exactly compares two vectors.

<The usual warning about floating point numbers>

◆ operator==() [4/6]

template<class LinalgClass1 , class LinalgClass2 >
bool mathter::operator== ( const ApproxHelper< LinalgClass1 > &  lhs,
const LinalgClass2 &  rhs 
)

◆ operator==() [5/6]

template<class LinalgClass1 , class LinalgClass2 >
bool mathter::operator== ( const LinalgClass1 &  lhs,
const ApproxHelper< LinalgClass2 > &  rhs 
)

◆ operator==() [6/6]

template<class LinalgClass1 , class LinalgClass2 >
bool mathter::operator== ( const ApproxHelper< LinalgClass1 > &  lhs,
const ApproxHelper< LinalgClass2 > &  rhs 
)

◆ operator|() [1/8]

template<class T , int Dim, bool Packed, class U >
mathter::Vector<T, Dim + 1, Packed> mathter::operator| ( const mathter::Vector< T, Dim, Packed > &  lhs,
rhs 
)

Concatenates the arguments, and returns the concatenated vector.

◆ operator|() [2/8]

template<class T1 , int Dim1, class T2 , int Dim2, bool Packed>
mathter::Vector<T1, Dim1 + Dim2, Packed> mathter::operator| ( const mathter::Vector< T1, Dim1, Packed > &  lhs,
const mathter::Vector< T2, Dim2, Packed > &  rhs 
)

Concatenates the arguments, and returns the concatenated vector.

◆ operator|() [3/8]

template<class T , int Dim, bool Packed, class U >
mathter::Vector<T, Dim + 1, Packed> mathter::operator| ( lhs,
const mathter::Vector< T, Dim, Packed > &  rhs 
)

Concatenates the arguments, and returns the concatenated vector.

◆ operator|() [4/8]

template<class T1 , int... Indices1, class T2 , int... Indices2>
Vector<T1, sizeof...(Indices2) + sizeof...(Indices2), false> mathter::operator| ( const Swizzle< T1, Indices1... > &  lhs,
const Swizzle< T2, Indices2... > &  rhs 
)

Concatenates the arguments, and returns the concatenated vector.

◆ operator|() [5/8]

template<class T1 , int... Indices1, class T2 , int Dim, bool Packed>
Vector<T1, sizeof...(Indices1) + Dim, Packed> mathter::operator| ( const Swizzle< T1, Indices1... > &  lhs,
const Vector< T2, Dim, Packed > &  rhs 
)

Concatenates the arguments, and returns the concatenated vector.

◆ operator|() [6/8]

template<class T1 , int... Indices1, class T2 , int Dim, bool Packed>
Vector<T1, sizeof...(Indices1) + Dim, Packed> mathter::operator| ( const Vector< T2, Dim, Packed > &  lhs,
const Swizzle< T1, Indices1... > &  rhs 
)

Concatenates the arguments, and returns the concatenated vector.

◆ operator|() [7/8]

template<class T1 , int... Indices1, class U >
Vector<T1, sizeof...(Indices1) + 1, false> mathter::operator| ( const Swizzle< T1, Indices1... > &  lhs,
rhs 
)

Concatenates the arguments, and returns the concatenated vector.

◆ operator|() [8/8]

template<class T1 , int... Indices1, class U >
Vector<T1, sizeof...(Indices1) + 1, false> mathter::operator| ( lhs,
const Swizzle< T1, Indices1... > &  rhs 
)

Concatenates the arguments, and returns the concatenated vector.

◆ Orthographic()

template<class T , int Dim, bool Packed>
auto mathter::Orthographic ( const Vector< T, Dim, Packed > &  minBounds,
const Vector< T, Dim, Packed > &  maxBounds,
projNearPlane = T(0),
projFarPlane = T(1) 
)

Creates an orthographics projection matrix. The volume before projection is an axis-aligned hypercube and it is projected onto a unit hypercube.

Parameters
minBoundsThe "left" corner of the hypercube.
maxBoundsThe "right" corner of the hypercube.
projNearPlaneThe lower bound of the last axis of the projected volume (Z axis in 3D).
projFarPlaneThe upper bound of the last axis of the projected volume (Z axis in 3D).

After projection, all axes range from -1 to 1, except for the last axis, which is specified explicitly.

◆ Perspective() [1/3]

template<class T , int DimMinus1, bool Packed>
auto mathter::Perspective ( fovX,
const Vector< T, DimMinus1, Packed > &  ratios,
nearPlane,
farPlane,
projNearPlane = T(0),
projFarPlane = T(1) 
)

Creates a perspective projection matrix.

Parameters
fovXField of view on the first axis (usually denoted X) in radians.
ratiosAspect ratio (or ratios in higher dimensions). FovX/FovY.
nearPlaneNear bound of the projected volume on the last axis (Z in 3D).
farPlaneFar bound of the projected volume on the last axis (Z in 3D).
projNearPlaneThe near plane is taken here after projection.
projFarPlaneThe far plane is taken here after projection.

Post-projection near and far planes can be inverted. Negative ratios invert image.

◆ Perspective() [2/3]

template<class T >
auto mathter::Perspective ( fov,
nearPlane,
farPlane,
projNearPlane = T(0),
projFarPlane = T(1) 
)

Creates a 2D projection matrix.

Parameters
fovField of view.
nearPlaneLower bound of the volume on the Y axis.
farPlaneUpper bound of the volume on the Y axis.
projNearPlaneNear plane is taken here after projection.
projFarPlaneFar plane is taken here after projection.

Post-projection bounds may be inverted.

◆ Perspective() [3/3]

template<class T >
auto mathter::Perspective ( fov,
aspectRatio,
nearPlane,
farPlane,
projNearPlane = T(0),
projFarPlane = T(1) 
)

Creates a 3D projection matrix.

Parameters
fovField of view.
aspectRatioFovX/FovY, so 1.777 for a 16:9 screen.
nearPlaneLower bound of the volume on the Y axis.
farPlaneUpper bound of the volume on the Y axis.
projNearPlaneNear plane is taken here after projection.
projFarPlaneFar plane is taken here after projection.

Post-projection bounds may be inverted.

◆ Pow()

template<class T , bool Packed>
Quaternion<T, Packed> mathter::Pow ( const Quaternion< T, Packed > &  q,
a 
)

Raises q to the power of a .

◆ Rad2Deg()

template<class Scalar >
auto mathter::Rad2Deg ( Scalar  rad)

Converts radians to degrees.

◆ Range() [1/3]

template<class T >
RangeHelper<T> mathter::Range ( first,
last,
step 
)

◆ Range() [2/3]

template<class T >
RangeHelper<T> mathter::Range ( first,
last 
)

◆ Range() [3/3]

template<class T >
RangeHelper<T> mathter::Range ( last)

◆ Rotation()

template<class T >
auto mathter::Rotation ( const T &  angle)

Creates a 2D rotation matrix.

Parameters
angleCounter-clockwise angle in radians.

◆ RotationAxis() [1/2]

template<class T >
auto mathter::RotationAxis ( angle,
int  axis 
)

Rotates around coordinate axis.

Parameters
axis0 for X, 1 for Y, 2 for Z and so on...
angleAngle of rotation in radians.

Positive angles rotate according to the right-hand rule in right-handed coordinate systems (left-handed likewise).

◆ RotationAxis() [2/2]

template<int Axis, class T >
auto mathter::RotationAxis ( angle)

Rotates around coordinate axis.

Template Parameters
Axis0 for X, 1 for Y, 2 for Z and so on...
Parameters
angleAngle of rotation in radians.

Positive angles rotate according to the right-hand rule in right-handed coordinate systems (left-handed likewise).

◆ RotationAxis3()

template<int FirstAxis, int SecondAxis, int ThirdAxis, class T >
auto mathter::RotationAxis3 ( angle0,
angle1,
angle2 
)

Rotates around three axes in succession.

Axes: 0 for X, 1 for Y and 2 for Z. Angles in radians.

◆ RotationAxisAngle()

template<class T , bool Vpacked, class U >
auto mathter::RotationAxisAngle ( const Vector< T, 3, Vpacked > &  axis,
angle 
)

Rotates around an arbitrary axis.

Parameters
axisAxis of rotation, must be normalized.
angleAngle of rotation in radians.

Right-hand (left-hand) rule is followed in right-handed (left-handed) systems.

◆ RotationEuler()

template<class T >
auto mathter::RotationEuler ( z1,
x2,
z3 
)

Rotation matrix from Euler angles. Rotations are Z-X-Z.

Parameters
z1Angle of the first rotation around Z in radians.
x2Angle of the second rotation around X in radians.
z3Angle of the third rotation around Z in radians.

◆ RotationRPY()

template<class T >
auto mathter::RotationRPY ( x1,
y2,
z3 
)

Rotation matrix from roll-pitch-yaw angles. Rotations are X-Y-Z.

Parameters
z1Angle of the first rotation around X in radians.
x2Angle of the second rotation around Y in radians.
z3Angle of the third rotation around Z in radians.

◆ RotationX()

template<class T >
auto mathter::RotationX ( angle)

Rotates around the X axis according to the right (left) hand rule.

Parameters
angleAngle of rotation in radians.

◆ RotationY()

template<class T >
auto mathter::RotationY ( angle)

Rotates around the Y axis according to the right (left) hand rule.

Parameters
angleAngle of rotation in radians.

◆ RotationZ()

template<class T >
auto mathter::RotationZ ( angle)

Rotates around the Z axis according to the right (left) hand rule.

Parameters
angleAngle of rotation in radians.

◆ SafeNormalize() [1/2]

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.

◆ SafeNormalize() [2/2]

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.

Parameters
degenerateMust be a unit vector.

◆ Saturate() [1/2]

template<class Scalar >
Scalar mathter::Saturate ( Scalar  arg)

Clamps argument into range [0,1].

◆ Saturate() [2/2]

template<class T , int Dim, bool Packed>
Vector< T, Dim, Packed > mathter::Saturate ( const Vector< T, Dim, Packed > &  arg)

Clamps all elements into range [0,1].

◆ Scale() [1/2]

template<class Vt , int Vdim, bool Vpacked>
auto mathter::Scale ( const Vector< Vt, Vdim, Vpacked > &  scale)

Creates a scaling matrix.

Parameters
scaleA vector containing the scales of respective axes. The vector's dimension must be less than or equal to the matrix dimension.

◆ Scale() [2/2]

template<class... Args, typename std::enable_if<(traits::All< traits::IsScalar, typename std::decay< Args >::type... >::value), int >::type = 0>
auto mathter::Scale ( Args &&...  scales)

Creates a scaling matrix.

Parameters
scalesA list of scalars corresponding to scaling on respective axes. The number of arguments must be less than or equal to the matrix dimension.

◆ Shear()

template<class T >
auto mathter::Shear ( slope,
int  principalAxis,
int  modulatorAxis 
)

Creates a shear matrix.

Parameters
slopeStrength of the shear.
principalAxisPoints are moved along this axis.
modulatorAxisThe displacement of points is proportional to this coordinate's value.

The formula for displacement along the pricipal axis is slope pos[modulatorAxis ].

◆ strtomat() [1/2]

template<class T , int Rows, int Columns, eMatrixOrder Order, eMatrixLayout Layout, bool Packed>
Matrix<T, Rows, Columns, Order, Layout, Packed> mathter::strtomat ( const char *  str,
const char **  end 
)

◆ strtomat() [2/2]

template<class MatrixT >
MatrixT mathter::strtomat ( const char *  str,
const char **  end 
)

◆ strtovec() [1/2]

template<class T , int Dim, bool Packed>
Vector<T, Dim, Packed> mathter::strtovec ( const char *  str,
const char **  end 
)

Parses a vector from a string.

◆ strtovec() [2/2]

template<class VectorT >
VectorT mathter::strtovec ( const char *  str,
const char **  end 
)

◆ Trace()

template<class T , int Dim, eMatrixOrder Order, eMatrixLayout Layout, bool Packed>
T mathter::Trace ( const Matrix< T, Dim, Dim, Order, Layout, Packed > &  m)

Returns the trace (sum of diagonal elements) of the matrix.

◆ Translation() [1/2]

template<class T , int Dim, bool Packed>
auto mathter::Translation ( const Vector< T, Dim, Packed > &  translation)

Creates a translation matrix.

Parameters
translationThe movement vector.

◆ Translation() [2/2]

template<class... Args, typename std::enable_if<(traits::All< traits::IsScalar, typename std::decay< Args >::type... >::value), int >::type = 0>
auto mathter::Translation ( const Args &...  coordinates)

Creates a translation matrix.

Parameters
coordinatesA list of scalars that specify movement along repsective axes.

◆ Transpose()

template<class T , int Rows, int Columns, eMatrixOrder Order, eMatrixLayout Layout, bool Packed>
Matrix<T, Columns, Rows, Order, Layout, Packed> mathter::Transpose ( const Matrix< T, Rows, Columns, Order, Layout, Packed > &  m)

Transposes the matrix in-place.

◆ true()

mathter::true ( ) const

◆ Zero()

auto mathter::Zero ( )
inline

Creates a matrix with all elements zero.

Variable Documentation

◆ DYNAMIC

constexpr int mathter::DYNAMIC = -1

Specify this as Vector or Matrix dimension template parameter to set size at runtime. PLEASE NOTE THAT DYNAMICALLY SIZED VECTORS AND MATRICES ARE NOT SUPPORTED YET.