FIFE  be64c707dea6b3250bd4355bf5c825d25920087d
FIFE::Matrix< T > Class Template Reference

Minimal matrix class to assist in view 3d calculations. More...

#include <matrix.h>

+ Inheritance diagram for FIFE::Matrix< T >:
+ Collaboration diagram for FIFE::Matrix< T >:

Public Member Functions

 Matrix ()
 
template<typename U >
 Matrix (const Matrix< U > &mat)
 
 ~Matrix ()
 
Matrix inverse () const
 Adjoint method inverse, constant time inversion implementation. More...
 
Matrixoperator/= (T val)
 Divide this matrix by a scalar. More...
 
Matrix adjoint () const
 Get the adjoint matrix. More...
 
MatrixloadRotate (T angle, T x, T y, T z)
 Make this a rotation matrix. More...
 
MatrixapplyScale (T x, T y, T z)
 Apply scale into this matrix. More...
 
MatrixloadScale (T x, T y, T z=1)
 Make this a scale matrix. More...
 
MatrixapplyTranslate (T x, T y, T z)
 Apply translation into this matrix. More...
 
MatrixloadTranslate (const T x, const T y, const T z)
 Make this a translation matrix. More...
 
PointType3D< T > operator* (const PointType3D< T > &vec)
 Transform given point using this matrix. More...
 
T & operator[] (int32_t ind)
 Direct access to the matrix elements, just remember they are in column major format!! More...
 
const T & operator[] (int32_t ind) const
 
Matrixmult3by3 (const Matrix &mat)
 Apply the matrix dot product to this matrix. More...
 
Matrix< T > & Rmult4by4 (const Matrix< T > &mat)
 this->Rmult4by4(temp) == [temp] X [*this] More...
 
Matrix< T > & mult4by4 (const Matrix< T > &mat)
 
MatrixapplyRotate (T angle, T x, T y, T z)
 

Public Attributes

union {
   T   m [16]
 
   struct {
      T   m0
 
      T   m1
 
      T   m2
 
      T   m3
 
      T   m4
 
      T   m5
 
      T   m6
 
      T   m7
 
      T   m8
 
      T   m9
 
      T   m10
 
      T   m11
 
      T   m12
 
      T   m13
 
      T   m14
 
      T   m15
 
   } 
 
}; 
 

Private Member Functions

cofactorm0 () const
 
cofactorm1 () const
 
cofactorm2 () const
 
cofactorm3 () const
 
cofactorm4 () const
 
cofactorm5 () const
 
cofactorm6 () const
 
cofactorm7 () const
 
cofactorm8 () const
 
cofactorm9 () const
 
cofactorm10 () const
 
cofactorm11 () const
 
cofactorm12 () const
 
cofactorm13 () const
 
cofactorm14 () const
 
cofactorm15 () const
 

Friends

template<typename U >
class Matrix
 

Detailed Description

template<typename T>
class FIFE::Matrix< T >

Minimal matrix class to assist in view 3d calculations.

Definition at line 52 of file matrix.h.

Constructor & Destructor Documentation

◆ Matrix() [1/2]

template<typename T>
FIFE::Matrix< T >::Matrix ( )
inline

Definition at line 54 of file matrix.h.

◆ Matrix() [2/2]

template<typename T>
template<typename U >
FIFE::Matrix< T >::Matrix ( const Matrix< U > &  mat)
inline

Definition at line 56 of file matrix.h.

◆ ~Matrix()

template<typename T>
FIFE::Matrix< T >::~Matrix ( )
inline

Definition at line 59 of file matrix.h.

Member Function Documentation

◆ adjoint()

template<typename T>
Matrix FIFE::Matrix< T >::adjoint ( ) const
inline

Get the adjoint matrix.

Definition at line 83 of file matrix.h.

Referenced by FIFE::Matrix< double >::inverse().

+ Here is the caller graph for this function:

◆ applyRotate()

template<typename T>
Matrix& FIFE::Matrix< T >::applyRotate ( angle,
x,
y,
z 
)
inline

Definition at line 306 of file matrix.h.

Referenced by FIFE::Camera::getLogicalCellDimensions(), FIFE::Camera::getOriginalZToY(), and FIFE::Camera::updateMatrices().

+ Here is the caller graph for this function:

◆ applyScale()

template<typename T>
Matrix& FIFE::Matrix< T >::applyScale ( x,
y,
z 
)
inline

Apply scale into this matrix.

Definition at line 148 of file matrix.h.

Referenced by FIFE::CellGrid::updateMatrices(), and FIFE::Camera::updateMatrices().

+ Here is the caller graph for this function:

◆ applyTranslate()

template<typename T>
Matrix& FIFE::Matrix< T >::applyTranslate ( x,
y,
z 
)
inline

Apply translation into this matrix.

Definition at line 180 of file matrix.h.

Referenced by FIFE::Camera::getOriginalZToY(), FIFE::CellGrid::updateMatrices(), and FIFE::Camera::updateMatrices().

+ Here is the caller graph for this function:

◆ cofactorm0()

template<typename T>
T FIFE::Matrix< T >::cofactorm0 ( ) const
inlineprivate

Definition at line 318 of file matrix.h.

Referenced by FIFE::Matrix< double >::adjoint().

+ Here is the caller graph for this function:

◆ cofactorm1()

template<typename T>
T FIFE::Matrix< T >::cofactorm1 ( ) const
inlineprivate

Definition at line 321 of file matrix.h.

Referenced by FIFE::Matrix< double >::adjoint().

+ Here is the caller graph for this function:

◆ cofactorm10()

template<typename T>
T FIFE::Matrix< T >::cofactorm10 ( ) const
inlineprivate

Definition at line 348 of file matrix.h.

Referenced by FIFE::Matrix< double >::adjoint().

+ Here is the caller graph for this function:

◆ cofactorm11()

template<typename T>
T FIFE::Matrix< T >::cofactorm11 ( ) const
inlineprivate

Definition at line 351 of file matrix.h.

Referenced by FIFE::Matrix< double >::adjoint().

+ Here is the caller graph for this function:

◆ cofactorm12()

template<typename T>
T FIFE::Matrix< T >::cofactorm12 ( ) const
inlineprivate

Definition at line 354 of file matrix.h.

Referenced by FIFE::Matrix< double >::adjoint().

+ Here is the caller graph for this function:

◆ cofactorm13()

template<typename T>
T FIFE::Matrix< T >::cofactorm13 ( ) const
inlineprivate

Definition at line 357 of file matrix.h.

Referenced by FIFE::Matrix< double >::adjoint().

+ Here is the caller graph for this function:

◆ cofactorm14()

template<typename T>
T FIFE::Matrix< T >::cofactorm14 ( ) const
inlineprivate

Definition at line 360 of file matrix.h.

Referenced by FIFE::Matrix< double >::adjoint().

+ Here is the caller graph for this function:

◆ cofactorm15()

template<typename T>
T FIFE::Matrix< T >::cofactorm15 ( ) const
inlineprivate

Definition at line 363 of file matrix.h.

Referenced by FIFE::Matrix< double >::adjoint().

+ Here is the caller graph for this function:

◆ cofactorm2()

template<typename T>
T FIFE::Matrix< T >::cofactorm2 ( ) const
inlineprivate

Definition at line 324 of file matrix.h.

Referenced by FIFE::Matrix< double >::adjoint().

+ Here is the caller graph for this function:

◆ cofactorm3()

template<typename T>
T FIFE::Matrix< T >::cofactorm3 ( ) const
inlineprivate

Definition at line 327 of file matrix.h.

Referenced by FIFE::Matrix< double >::adjoint().

+ Here is the caller graph for this function:

◆ cofactorm4()

template<typename T>
T FIFE::Matrix< T >::cofactorm4 ( ) const
inlineprivate

Definition at line 330 of file matrix.h.

Referenced by FIFE::Matrix< double >::adjoint().

+ Here is the caller graph for this function:

◆ cofactorm5()

template<typename T>
T FIFE::Matrix< T >::cofactorm5 ( ) const
inlineprivate

Definition at line 333 of file matrix.h.

Referenced by FIFE::Matrix< double >::adjoint().

+ Here is the caller graph for this function:

◆ cofactorm6()

template<typename T>
T FIFE::Matrix< T >::cofactorm6 ( ) const
inlineprivate

Definition at line 336 of file matrix.h.

Referenced by FIFE::Matrix< double >::adjoint().

+ Here is the caller graph for this function:

◆ cofactorm7()

template<typename T>
T FIFE::Matrix< T >::cofactorm7 ( ) const
inlineprivate

Definition at line 339 of file matrix.h.

Referenced by FIFE::Matrix< double >::adjoint().

+ Here is the caller graph for this function:

◆ cofactorm8()

template<typename T>
T FIFE::Matrix< T >::cofactorm8 ( ) const
inlineprivate

Definition at line 342 of file matrix.h.

Referenced by FIFE::Matrix< double >::adjoint().

+ Here is the caller graph for this function:

◆ cofactorm9()

template<typename T>
T FIFE::Matrix< T >::cofactorm9 ( ) const
inlineprivate

Definition at line 345 of file matrix.h.

Referenced by FIFE::Matrix< double >::adjoint().

+ Here is the caller graph for this function:

◆ inverse()

template<typename T>
Matrix FIFE::Matrix< T >::inverse ( ) const
inline

Adjoint method inverse, constant time inversion implementation.

Definition at line 63 of file matrix.h.

Referenced by FIFE::CellGrid::updateMatrices(), and FIFE::Camera::updateMatrices().

+ Here is the caller graph for this function:

◆ loadRotate()

template<typename T>
Matrix& FIFE::Matrix< T >::loadRotate ( angle,
x,
y,
z 
)
inline

Make this a rotation matrix.

Definition at line 113 of file matrix.h.

Referenced by FIFE::Matrix< double >::applyRotate(), FIFE::Camera::getLogicalCellDimensions(), and FIFE::CellGrid::updateMatrices().

+ Here is the caller graph for this function:

◆ loadScale()

template<typename T>
Matrix& FIFE::Matrix< T >::loadScale ( x,
y,
z = 1 
)
inline

Make this a scale matrix.

Definition at line 157 of file matrix.h.

Referenced by FIFE::Matrix< double >::applyScale(), FIFE::Camera::getOriginalZToY(), and FIFE::Camera::updateMatrices().

+ Here is the caller graph for this function:

◆ loadTranslate()

template<typename T>
Matrix& FIFE::Matrix< T >::loadTranslate ( const T  x,
const T  y,
const T  z 
)
inline

Make this a translation matrix.

Definition at line 189 of file matrix.h.

Referenced by FIFE::Matrix< double >::applyTranslate().

+ Here is the caller graph for this function:

◆ mult3by3()

template<typename T>
Matrix& FIFE::Matrix< T >::mult3by3 ( const Matrix< T > &  mat)
inline

Apply the matrix dot product to this matrix.

Definition at line 233 of file matrix.h.

◆ mult4by4()

template<typename T>
Matrix<T>& FIFE::Matrix< T >::mult4by4 ( const Matrix< T > &  mat)
inline

◆ operator*()

template<typename T>
PointType3D<T> FIFE::Matrix< T >::operator* ( const PointType3D< T > &  vec)
inline

Transform given point using this matrix.

Definition at line 212 of file matrix.h.

◆ operator/=()

template<typename T>
Matrix& FIFE::Matrix< T >::operator/= ( val)
inline

Divide this matrix by a scalar.

Definition at line 75 of file matrix.h.

◆ operator[]() [1/2]

template<typename T>
T& FIFE::Matrix< T >::operator[] ( int32_t  ind)
inline

Direct access to the matrix elements, just remember they are in column major format!!

Definition at line 222 of file matrix.h.

◆ operator[]() [2/2]

template<typename T>
const T& FIFE::Matrix< T >::operator[] ( int32_t  ind) const
inline

Definition at line 226 of file matrix.h.

◆ Rmult4by4()

template<typename T>
Matrix<T>& FIFE::Matrix< T >::Rmult4by4 ( const Matrix< T > &  mat)
inline

this->Rmult4by4(temp) == [temp] X [*this]

also equal to temp->mult4by4(*this)

Definition at line 255 of file matrix.h.

Friends And Related Function Documentation

◆ Matrix

template<typename T>
template<typename U >
friend class Matrix
friend

Definition at line 55 of file matrix.h.

Member Data Documentation

◆ @1

union { ... }

◆ m

◆ m0

◆ m1

◆ m10

◆ m11

◆ m12

◆ m13

◆ m14

◆ m15

◆ m2

◆ m3

◆ m4

◆ m5

◆ m6

◆ m7

◆ m8

◆ m9


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