Public Member Functions | Public Attributes

m4x4< Real > Class Template Reference

#include <m4x4.h>

List of all members.

Public Member Functions

 m4x4 ()
 m4x4 (const m3x3< Real > &mat)
 m4x4 (const m4x4< Real > &mat)
 m4x4 (const Real *f)
 m4x4 (const Real a, const Real b, const Real c, const Real d, const Real e, const Real f, const Real g, const Real h, const Real i, const Real j, const Real k, const Real l, const Real m, const Real n, const Real o, const Real p)
m4x4< Real > & set (const Real a, const Real b, const Real c, const Real d, const Real e, const Real f, const Real g, const Real h, const Real i, const Real j, const Real k, const Real l, const Real m, const Real n, const Real o, const Real p)
m4x4< Real > & get (Real &a, Real &b, Real &c, Real &d, Real &e, Real &f, Real &g, Real &h, Real &i, Real &j, Real &k, Real &l, Real &m, Real &n, Real &o, Real &p)
m4x4< Real > & zero (void)
m4x4< Real > & identity (void)
 Set identity matrix.
Real det (void)
 Determinant of matrix.
m4x4< Real > & transpose (void)
 Transpose matrix.
m4x4< Real > & invert (void)
 Invert matrix.
m4x4< Real > & asTranslation (const Real x, const Real y, const Real z)
 Set the matrix to a tramslation matix.
m4x4< Real > & asRotation (const Real x, const Real y, const Real z)
 Set the matrix to a rotation matix.
m4x4< Real > & asRotationX (const Real angle)
 Set the matrix to a x-rotation-matix.
m4x4< Real > & asRotationY (const Real angle)
 Set the matrix to a y-rotation-matix.
m4x4< Real > & asRotationZ (const Real angle)
 Set the matrix to a z-rotation-matix.
m4x4< Real > & asScale (const Real x, const Real y, const Real z)
 Set the matrix to a scale matix.
m4x4< Real > & projection (const int width, const int height, const Real Near, const Real Far, const Real FOV)
m4x4< Real > & lookAt (const v3< Real > &camPos, const v3< Real > &camDirUnion, const v3< Real > &camUp)
m4x4< Real > & lookAt (const Real eyex, const Real eyey, const Real eyez, const Real centerx, const Real centery, const Real centerz, const Real upx, const Real upy, const Real upz)
m3x3< Real > as3x3 (void)
 Convert to a 3x3 matrix.
const m3x3< Real > as3x3 (void) const
 Convert to a 3x3 matrix.
m4x4< Real > & operator= (const m4x4< Real > &a)
m4x4< Real > & operator+= (const m4x4< Real > &a)
m4x4< Real > & operator-= (const m4x4< Real > &a)
m4x4< Real > & operator*= (const m4x4< Real > &a)
bool operator== (const m4x4< Real > &a)
bool operator!= (const m4x4< Real > &a)
v4< Real > & operator[] (const int i)
const v4< Real > & operator[] (const int i) const
Real & operator() (const int i)
const Real operator() (const int i) const
Real & operator() (const int row, const int col)
const Real operator() (const int row, const int col) const

Public Attributes

union {
   struct {
      Real   m [4][4]
   } 
   struct {
      Real   m16 [16]
   } 
   struct {
      v4< Real >   v [4]
   } 
}; 

Detailed Description

template<typename Real = RV_PRECISSION_TYPENAME>
class m4x4< Real >

4x4 Real matrix. This class can be used to define 3D transformations like rotating or transforming.

Definition at line 6 of file m4x4.h.


Constructor & Destructor Documentation

template<typename Real = RV_PRECISSION_TYPENAME>
m4x4< Real >::m4x4 (  )  [inline]

Default constructor. This constructor does not initialize the class with values.

Definition at line 17 of file m4x4.h.

template<typename Real = RV_PRECISSION_TYPENAME>
m4x4< Real >::m4x4 ( const m3x3< Real > &  mat  )  [inline]

Copy constructor. Copy an existing class. The copied class does not have the same memory as the class that was copied. Only the values are copied.

Definition at line 23 of file m4x4.h.

template<typename Real = RV_PRECISSION_TYPENAME>
m4x4< Real >::m4x4 ( const m4x4< Real > &  mat  )  [inline]

Copy constructor. Copy an existing class. The copied class does not have the same memory as the class that was copied. Only the values are copied.

Definition at line 37 of file m4x4.h.

template<typename Real = RV_PRECISSION_TYPENAME>
m4x4< Real >::m4x4 ( const Real *  f  )  [inline]

Constructor. Initialize the class with the defined values.

Definition at line 45 of file m4x4.h.

template<typename Real = RV_PRECISSION_TYPENAME>
m4x4< Real >::m4x4 ( const Real  a,
const Real  b,
const Real  c,
const Real  d,
const Real  e,
const Real  f,
const Real  g,
const Real  h,
const Real  i,
const Real  j,
const Real  k,
const Real  l,
const Real  m,
const Real  n,
const Real  o,
const Real  p 
) [inline]

Constructor. Initialize the class with the defined values.

Definition at line 54 of file m4x4.h.


Member Function Documentation

template<typename Real >
m3x3< Real > m4x4< Real >::as3x3 ( void   )  [inline]

Convert to a 3x3 matrix.

Definition at line 155 of file m4x4.inl.

template<typename Real >
const m3x3< Real > m4x4< Real >::as3x3 ( void   )  const [inline]

Convert to a 3x3 matrix.

Definition at line 163 of file m4x4.inl.

template<typename Real>
m4x4< Real > & m4x4< Real >::asRotation ( const Real  x,
const Real  y,
const Real  z 
) [inline]

Set the matrix to a rotation matix.

Definition at line 93 of file m4x4.inl.

template<typename Real>
m4x4< Real > & m4x4< Real >::asRotationX ( const Real  angle  )  [inline]

Set the matrix to a x-rotation-matix.

Definition at line 113 of file m4x4.inl.

template<typename Real>
m4x4< Real > & m4x4< Real >::asRotationY ( const Real  angle  )  [inline]

Set the matrix to a y-rotation-matix.

Definition at line 124 of file m4x4.inl.

template<typename Real>
m4x4< Real > & m4x4< Real >::asRotationZ ( const Real  angle  )  [inline]

Set the matrix to a z-rotation-matix.

Definition at line 135 of file m4x4.inl.

template<typename Real>
m4x4< Real > & m4x4< Real >::asScale ( const Real  x,
const Real  y,
const Real  z 
) [inline]

Set the matrix to a scale matix.

Definition at line 146 of file m4x4.inl.

template<typename Real>
m4x4< Real > & m4x4< Real >::asTranslation ( const Real  x,
const Real  y,
const Real  z 
) [inline]

Set the matrix to a tramslation matix.

Definition at line 84 of file m4x4.inl.

template<typename Real >
Real m4x4< Real >::det ( void   )  [inline]

Determinant of matrix.

Definition at line 49 of file m4x4.inl.

template<typename Real>
m4x4< Real > & m4x4< Real >::get ( Real &  a,
Real &  b,
Real &  c,
Real &  d,
Real &  e,
Real &  f,
Real &  g,
Real &  h,
Real &  i,
Real &  j,
Real &  k,
Real &  l,
Real &  m,
Real &  n,
Real &  o,
Real &  p 
) [inline]

Definition at line 17 of file m4x4.inl.

template<typename Real >
m4x4< Real > & m4x4< Real >::identity ( void   )  [inline]

Set identity matrix.

Definition at line 40 of file m4x4.inl.

template<typename Real >
m4x4< Real > & m4x4< Real >::invert ( void   )  [inline]

Invert matrix.

Definition at line 79 of file m4x4.inl.

template<typename Real>
m4x4< Real > & m4x4< Real >::lookAt ( const Real  eyex,
const Real  eyey,
const Real  eyez,
const Real  centerx,
const Real  centery,
const Real  centerz,
const Real  upx,
const Real  upy,
const Real  upz 
) [inline]

Definition at line 197 of file m4x4.inl.

template<typename Real>
m4x4< Real > & m4x4< Real >::lookAt ( const v3< Real > &  camPos,
const v3< Real > &  camDirUnion,
const v3< Real > &  camUp 
) [inline]

Definition at line 184 of file m4x4.inl.

template<typename Real>
bool m4x4< Real >::operator!= ( const m4x4< Real > &  a  )  [inline]

Definition at line 249 of file m4x4.inl.

template<typename Real >
Real & m4x4< Real >::operator() ( const int  row,
const int  col 
) [inline]

Definition at line 281 of file m4x4.inl.

template<typename Real >
Real & m4x4< Real >::operator() ( const int  i  )  [inline]

Definition at line 269 of file m4x4.inl.

template<typename Real >
const Real m4x4< Real >::operator() ( const int  i  )  const [inline]

Definition at line 275 of file m4x4.inl.

template<typename Real >
const Real m4x4< Real >::operator() ( const int  row,
const int  col 
) const [inline]

Definition at line 288 of file m4x4.inl.

template<typename Real>
m4x4< Real > & m4x4< Real >::operator*= ( const m4x4< Real > &  a  )  [inline]

Definition at line 236 of file m4x4.inl.

template<typename Real>
m4x4< Real > & m4x4< Real >::operator+= ( const m4x4< Real > &  a  )  [inline]

Definition at line 218 of file m4x4.inl.

template<typename Real>
m4x4< Real > & m4x4< Real >::operator-= ( const m4x4< Real > &  a  )  [inline]

Definition at line 227 of file m4x4.inl.

template<typename Real>
m4x4< Real > & m4x4< Real >::operator= ( const m4x4< Real > &  a  )  [inline]

Definition at line 209 of file m4x4.inl.

template<typename Real>
bool m4x4< Real >::operator== ( const m4x4< Real > &  a  )  [inline]

Definition at line 241 of file m4x4.inl.

template<typename Real >
const v4< Real > & m4x4< Real >::operator[] ( const int  i  )  const [inline]

Definition at line 263 of file m4x4.inl.

template<typename Real >
v4< Real > & m4x4< Real >::operator[] ( const int  i  )  [inline]

Definition at line 257 of file m4x4.inl.

template<typename Real>
m4x4< Real > & m4x4< Real >::projection ( const int  width,
const int  height,
const Real  Near,
const Real  Far,
const Real  FOV 
) [inline]

Definition at line 171 of file m4x4.inl.

template<typename Real>
m4x4< Real > & m4x4< Real >::set ( const Real  a,
const Real  b,
const Real  c,
const Real  d,
const Real  e,
const Real  f,
const Real  g,
const Real  h,
const Real  i,
const Real  j,
const Real  k,
const Real  l,
const Real  m,
const Real  n,
const Real  o,
const Real  p 
) [inline]

Definition at line 3 of file m4x4.inl.

template<typename Real >
m4x4< Real > & m4x4< Real >::transpose ( void   )  [inline]

Transpose matrix.

Definition at line 67 of file m4x4.inl.

template<typename Real >
m4x4< Real > & m4x4< Real >::zero ( void   )  [inline]

Definition at line 31 of file m4x4.inl.


Member Data Documentation

union { ... }
template<typename Real = RV_PRECISSION_TYPENAME>
Real m4x4< Real >::m[4][4]

Definition at line 9 of file m4x4.h.

template<typename Real = RV_PRECISSION_TYPENAME>
Real m4x4< Real >::m16[16]

Definition at line 10 of file m4x4.h.

template<typename Real = RV_PRECISSION_TYPENAME>
v4<Real> m4x4< Real >::v[4]

Definition at line 11 of file m4x4.h.


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