Developer Documentation
ACG::Matrix4x4T< Scalar > Class Template Reference

#include <OpenFlipper/libs_required/ACG/Math/Matrix4x4T.hh>

Inheritance diagram for ACG::Matrix4x4T< Scalar >:
ACG::GLMatrixT< Scalar >

Public Types

using value_type = Scalar
 

Public Member Functions

 Matrix4x4T ()
 constructor: uninitialized values More...
 
template<class OtherScalar >
 Matrix4x4T (const Matrix4x4T< OtherScalar > &_rhs)
 construct from other matrix type More...
 
 Matrix4x4T (const Scalar _array[16])
 
 ~Matrix4x4T ()
 destructor More...
 
template<typename otherScalar >
Matrix4x4T< Scalar > & operator= (const Matrix4x4T< otherScalar > &_rhs)
 assignment from other matrix type More...
 
Scalar & operator() (unsigned int row, unsigned int col)
 access operator (read and write) More...
 
const Scalar & operator() (unsigned int row, unsigned int col) const
 access operator (read only) More...
 
bool operator== (const Matrix4x4T< Scalar > &_rhs) const
 compare two matrices (up to some epsilon) More...
 
bool operator!= (const Matrix4x4T< Scalar > &_rhs) const
 compare two matrices More...
 
Matrix4x4T operator+ (Matrix4x4T< Scalar > _rhs) const
 self + _rhs More...
 
Matrix4x4T operator- (Matrix4x4T< Scalar > _rhs) const
 self - _rhs More...
 
Matrix4x4T operator* (const Matrix4x4T< Scalar > &inst) const
 self * _rhs More...
 
Matrix4x4T operator* (const Scalar &scalar)
 self * scalar More...
 
Matrix4x4Toperator+= (const Matrix4x4T< Scalar > &_rhs)
 self += _rhs More...
 
Matrix4x4Toperator-= (const Matrix4x4T< Scalar > &_rhs)
 self -= _rhs More...
 
Matrix4x4Toperator*= (const Matrix4x4T< Scalar > &_rhs)
 self *= _rhs More...
 
Matrix4x4TleftMult (const Matrix4x4T< Scalar > &_rhs)
 multiply from left: self = _rhs * self More...
 
template<typename T >
VectorT< T, 4 > operator* (const VectorT< T, 4 > &_v) const
 matrix by vector multiplication More...
 
template<typename T >
VectorT< T, 3 > transform_point (const VectorT< T, 3 > &_v) const
 transform point (x',y',z',1) = M * (x,y,z,1) More...
 
template<typename T >
VectorT< T, 3 > transform_vector (const VectorT< T, 3 > &_v) const
 transform vector (x',y',z',0) = A * (x,y,z,0) More...
 
void clear ()
 sets all elements to zero More...
 
void identity ()
 setup an identity matrix More...
 
bool is_identity () const
 check if the matrix is the identity ( up to an epsilon ) More...
 
void transpose ()
 transpose matrix More...
 
bool invert ()
 matrix inversion (returns true on success) More...
 
Scalar determinant () const
 
const Scalar * get_raw_data () const
 
const Scalar * raw () const
 
const Scalar * data () const
 

Protected Attributes

Scalar mat_ [16]
 

Detailed Description

template<class Scalar>
class ACG::Matrix4x4T< Scalar >

Simple 4x4 Matrix. Inherited by GLMatrix.

Definition at line 92 of file Matrix4x4T.hh.

Member Typedef Documentation

◆ value_type

template<class Scalar >
using ACG::Matrix4x4T< Scalar >::value_type = Scalar

Definition at line 95 of file Matrix4x4T.hh.

Constructor & Destructor Documentation

◆ Matrix4x4T() [1/3]

template<class Scalar >
ACG::Matrix4x4T< Scalar >::Matrix4x4T ( )
inline

constructor: uninitialized values

Definition at line 98 of file Matrix4x4T.hh.

◆ Matrix4x4T() [2/3]

template<class Scalar >
template<class OtherScalar >
ACG::Matrix4x4T< Scalar >::Matrix4x4T ( const Matrix4x4T< OtherScalar > &  _rhs)
inline

construct from other matrix type

Definition at line 102 of file Matrix4x4T.hh.

◆ Matrix4x4T() [3/3]

template<class Scalar >
ACG::Matrix4x4T< Scalar >::Matrix4x4T ( const Scalar  _array[16])
inline

setup matrix using an array of N*N scalar values. elements are ordered 'column first' (like OpenGL)

Definition at line 108 of file Matrix4x4T.hh.

◆ ~Matrix4x4T()

template<class Scalar >
ACG::Matrix4x4T< Scalar >::~Matrix4x4T ( )
inline

destructor

Definition at line 113 of file Matrix4x4T.hh.

Member Function Documentation

◆ clear()

template<typename Scalar >
void ACG::Matrix4x4T< Scalar >::clear
inline

sets all elements to zero

Definition at line 233 of file Matrix4x4T_impl.hh.

◆ data()

template<class Scalar >
const Scalar * ACG::Matrix4x4T< Scalar >::data ( ) const
inline

Definition at line 259 of file Matrix4x4T.hh.

◆ determinant()

template<class Scalar >
Scalar ACG::Matrix4x4T< Scalar >::determinant ( ) const
inline

Definition at line 238 of file Matrix4x4T.hh.

◆ get_raw_data()

template<class Scalar >
const Scalar * ACG::Matrix4x4T< Scalar >::get_raw_data ( ) const
inline

access to data array. not very nice, but in case of 4x4 matrices this member can be used to pass matrices to OpenGL e.g. glLoadMatrixf(m.get_raw_data());

Definition at line 257 of file Matrix4x4T.hh.

◆ identity()

template<typename Scalar >
void ACG::Matrix4x4T< Scalar >::identity
inline

setup an identity matrix

Definition at line 249 of file Matrix4x4T_impl.hh.

◆ invert()

template<typename Scalar >
bool ACG::Matrix4x4T< Scalar >::invert

matrix inversion (returns true on success)

Definition at line 290 of file Matrix4x4T_impl.hh.

◆ is_identity()

template<class Scalar >
bool ACG::Matrix4x4T< Scalar >::is_identity ( ) const
inline

check if the matrix is the identity ( up to an epsilon )

Definition at line 215 of file Matrix4x4T.hh.

◆ leftMult()

template<typename Scalar >
Matrix4x4T< Scalar > & ACG::Matrix4x4T< Scalar >::leftMult ( const Matrix4x4T< Scalar > &  _rhs)

multiply from left: self = _rhs * self

Definition at line 136 of file Matrix4x4T_impl.hh.

◆ operator!=()

template<class Scalar >
bool ACG::Matrix4x4T< Scalar >::operator!= ( const Matrix4x4T< Scalar > &  _rhs) const
inline

compare two matrices

Definition at line 152 of file Matrix4x4T.hh.

◆ operator()() [1/2]

template<class Scalar >
Scalar & ACG::Matrix4x4T< Scalar >::operator() ( unsigned int  row,
unsigned int  col 
)
inline

access operator (read and write)

Definition at line 130 of file Matrix4x4T.hh.

◆ operator()() [2/2]

template<class Scalar >
const Scalar & ACG::Matrix4x4T< Scalar >::operator() ( unsigned int  row,
unsigned int  col 
) const
inline

access operator (read only)

Definition at line 135 of file Matrix4x4T.hh.

◆ operator*() [1/3]

template<typename Scalar >
Matrix4x4T< Scalar > ACG::Matrix4x4T< Scalar >::operator* ( const Matrix4x4T< Scalar > &  inst) const

self * _rhs

Definition at line 78 of file Matrix4x4T_impl.hh.

◆ operator*() [2/3]

template<typename Scalar >
Matrix4x4T< Scalar > ACG::Matrix4x4T< Scalar >::operator* ( const Scalar &  scalar)

self * scalar

Definition at line 177 of file Matrix4x4T_impl.hh.

◆ operator*() [3/3]

template<typename Scalar >
template<typename T >
VectorT< T, 4 > ACG::Matrix4x4T< Scalar >::operator* ( const VectorT< T, 4 > &  _v) const
inline

matrix by vector multiplication

Definition at line 161 of file Matrix4x4T_impl.hh.

◆ operator*=()

template<typename Scalar >
Matrix4x4T< Scalar > & ACG::Matrix4x4T< Scalar >::operator*= ( const Matrix4x4T< Scalar > &  _rhs)

self *= _rhs

Definition at line 108 of file Matrix4x4T_impl.hh.

◆ operator+()

template<class Scalar >
Matrix4x4T ACG::Matrix4x4T< Scalar >::operator+ ( Matrix4x4T< Scalar >  _rhs) const
inline

self + _rhs

Definition at line 158 of file Matrix4x4T.hh.

◆ operator+=()

template<class Scalar >
Matrix4x4T & ACG::Matrix4x4T< Scalar >::operator+= ( const Matrix4x4T< Scalar > &  _rhs)
inline

self += _rhs

Definition at line 177 of file Matrix4x4T.hh.

◆ operator-()

template<class Scalar >
Matrix4x4T ACG::Matrix4x4T< Scalar >::operator- ( Matrix4x4T< Scalar >  _rhs) const
inline

self - _rhs

Definition at line 164 of file Matrix4x4T.hh.

◆ operator-=()

template<class Scalar >
Matrix4x4T & ACG::Matrix4x4T< Scalar >::operator-= ( const Matrix4x4T< Scalar > &  _rhs)
inline

self -= _rhs

Definition at line 183 of file Matrix4x4T.hh.

◆ operator=()

template<class Scalar >
template<typename otherScalar >
Matrix4x4T< Scalar > & ACG::Matrix4x4T< Scalar >::operator= ( const Matrix4x4T< otherScalar > &  _rhs)
inline

assignment from other matrix type

Definition at line 118 of file Matrix4x4T.hh.

◆ operator==()

template<class Scalar >
bool ACG::Matrix4x4T< Scalar >::operator== ( const Matrix4x4T< Scalar > &  _rhs) const
inline

compare two matrices (up to some epsilon)

Definition at line 141 of file Matrix4x4T.hh.

◆ raw()

template<class Scalar >
const Scalar * ACG::Matrix4x4T< Scalar >::raw ( ) const
inline

Definition at line 258 of file Matrix4x4T.hh.

◆ transform_point()

template<typename Scalar >
template<typename T >
VectorT< T, 3 > ACG::Matrix4x4T< Scalar >::transform_point ( const VectorT< T, 3 > &  _v) const
inline

transform point (x',y',z',1) = M * (x,y,z,1)

Definition at line 195 of file Matrix4x4T_impl.hh.

◆ transform_vector()

template<typename Scalar >
template<typename T >
VectorT< T, 3 > ACG::Matrix4x4T< Scalar >::transform_vector ( const VectorT< T, 3 > &  _v) const
inline

transform vector (x',y',z',0) = A * (x,y,z,0)

Definition at line 218 of file Matrix4x4T_impl.hh.

◆ transpose()

template<typename Scalar >
void ACG::Matrix4x4T< Scalar >::transpose
inline

transpose matrix

Definition at line 265 of file Matrix4x4T_impl.hh.

Member Data Documentation

◆ mat_

template<class Scalar >
Scalar ACG::Matrix4x4T< Scalar >::mat_[16]
protected

Definition at line 263 of file Matrix4x4T.hh.


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