philsupertramp/game-math
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Public Attributes | Friends | List of all members
mat3< T > Struct Template Reference

#include <mat3.h>

Public Member Functions

 mat3 ()
 
 mat3 (const T &_a, const T &_b, const T &_c, const T &_d, const T &_e, const T &_f, const T &_g, const T &_h, const T &_i)
 
 mat3 (const vec3< T > &A, const vec3< T > &B, const vec3< T > &C)
 
 mat3 (T *vals)
 
 ~mat3 ()=default
 
mat3< T > Transpose ()
 
mat3< T > Inverse ()
 
bool IsSymmetric ()
 
float Determinant ()
 
mat3< T > & operator+= (const mat3< T > &rhs)
 
mat3< T > & operator-= (const mat3< T > &rhs)
 
mat3< T > & operator*= (const mat3< T > &rhs)
 
mat3< T > & operator*= (const T &rhs)
 
mat3< T > & operator/= (const T &rhs)
 
T * operator[] (int index)
 
const T * operator[] (int index) const
 

Static Public Member Functions

static mat3< T > Unit ()
 

Public Attributes

values [3][3]
 loosely packed data More...
 

Friends

mat3< T > operator+ (mat3< T > lhs, const mat3< T > &rhs)
 
mat3< T > operator- (mat3< T > lhs, const mat3< T > &rhs)
 
mat3< T > operator* (mat3< T > lhs, const T &rhs)
 
vec3< T > operator* (mat3< T > lhs, const vec3< T > &rhs)
 
mat3< T > operator* (mat3< T > lhs, const mat3< T > &rhs)
 
mat3< T > operator/ (mat3< T > lhs, const T &rhs)
 
template<class U >
std::ostream & operator<< (std::ostream &, const mat3< U > &)
 

Detailed Description

template<class T>
struct mat3< T >

3D-Matrix representation

Template Parameters
T
Examples
TestUtils.cpp, and mat/TestMat3.cpp.

Constructor & Destructor Documentation

◆ mat3() [1/4]

template<class T >
mat3< T >::mat3 ( )
inline

default constructor, initializes null matrix

◆ mat3() [2/4]

template<class T >
mat3< T >::mat3 ( const T &  _a,
const T &  _b,
const T &  _c,
const T &  _d,
const T &  _e,
const T &  _f,
const T &  _g,
const T &  _h,
const T &  _i 
)
inline

9-element constructor

Parameters
_a
_b
_c
_d
_e
_f
_g
_h
_i

◆ mat3() [3/4]

template<class T >
mat3< T >::mat3 ( const vec3< T > &  A,
const vec3< T > &  B,
const vec3< T > &  C 
)
inline

mat3(A, B, C) -> [A.x, B.x, C.x, A.y, B.y, C.y, A.z, B.z, C.z]

Parameters
Afirst column vector
Bsecond column vector
Cthird column vector

◆ mat3() [4/4]

template<class T >
mat3< T >::mat3 ( T *  vals)
inlineexplicit

Constructor from pointer of values

Parameters
valsarray of arrays of values

◆ ~mat3()

template<class T >
mat3< T >::~mat3 ( )
default

default destructor

Member Function Documentation

◆ Determinant()

template<class T >
float mat3< T >::Determinant ( )
inline

calculates determinant

Returns

◆ Inverse()

template<class T >
mat3< T > mat3< T >::Inverse ( )
inline

Potentially calculates the inverse matrix

Returns
inverse (A -> A^-1)

◆ IsSymmetric()

template<class T >
bool mat3< T >::IsSymmetric ( )
inline

test for symmetry

Returns
Examples
mat/TestMat3.cpp.

◆ operator*=() [1/2]

template<class T >
mat3< T > & mat3< T >::operator*= ( const mat3< T > &  rhs)
inline

matrix-matrix multiplication

Parameters
rhs
Returns

◆ operator*=() [2/2]

template<class T >
mat3< T > & mat3< T >::operator*= ( const T &  rhs)
inline

matrix-scalar multiplication

Parameters
rhs
Returns

◆ operator+=()

template<class T >
mat3< T > & mat3< T >::operator+= ( const mat3< T > &  rhs)
inline

matrix-matrix addition

Parameters
rhs
Returns

◆ operator-=()

template<class T >
mat3< T > & mat3< T >::operator-= ( const mat3< T > &  rhs)
inline

matrix-matrix subtraction

Parameters
rhs
Returns

◆ operator/=()

template<class T >
mat3< T > & mat3< T >::operator/= ( const T &  rhs)
inline

matrix-scalar division

Parameters
rhs
Returns

◆ operator[]() [1/2]

template<class T >
T * mat3< T >::operator[] ( int  index)
inline

member access

Parameters
index
Returns

◆ operator[]() [2/2]

template<class T >
const T * mat3< T >::operator[] ( int  index) const
inline

member access

Parameters
index
Returns

◆ Transpose()

template<class T >
mat3< T > mat3< T >::Transpose ( )
inline

Getter for transposed matrix

Returns
Examples
mat/TestMat3.cpp.

◆ Unit()

template<class T >
static mat3< T > mat3< T >::Unit ( )
inlinestatic

3D-Unit-matrix generator

Returns
Examples
mat/TestMat3.cpp.

Friends And Related Function Documentation

◆ operator* [1/3]

template<class T >
mat3< T > operator* ( mat3< T >  lhs,
const mat3< T > &  rhs 
)
friend

matrix-matrix multiplication

Parameters
lhs
rhs
Returns

◆ operator* [2/3]

template<class T >
mat3< T > operator* ( mat3< T >  lhs,
const T &  rhs 
)
friend

Matrix-scalar multiplication

Parameters
lhs
rhs
Returns

◆ operator* [3/3]

template<class T >
vec3< T > operator* ( mat3< T >  lhs,
const vec3< T > &  rhs 
)
friend

matrix-matrix multiplication

Parameters
lhs
rhs
Returns

◆ operator+

template<class T >
mat3< T > operator+ ( mat3< T >  lhs,
const mat3< T > &  rhs 
)
friend

matrix-matrix addition

Parameters
lhs
rhs
Returns

◆ operator-

template<class T >
mat3< T > operator- ( mat3< T >  lhs,
const mat3< T > &  rhs 
)
friend

matrix-matrix subtraction

Parameters
lhs
rhs
Returns

◆ operator/

template<class T >
mat3< T > operator/ ( mat3< T >  lhs,
const T &  rhs 
)
friend

matrix-scalar division

Parameters
lhs
rhs
Returns

◆ operator<<

template<class T >
template<class U >
std::ostream & operator<< ( std::ostream &  out,
const mat3< U > &  mat 
)
friend

beautified std::cout operator

Template Parameters
U
Returns

Member Data Documentation

◆ values

template<class T >
T mat3< T >::values[3][3]

loosely packed data


The documentation for this struct was generated from the following file: