[]Jimmy's World.org
Because you all make me very, very tired.
[]
Jimmy's World Games
Not a Member? - Login or Create an Account
[] Tuesday the 6th of January 2009 @ 04:49am
News Journal Creative Writing Projects Your JW About

LibN2L-4 Library Code Reference

Classes
Compounds
Files
Members
Method Index
Full Reference

n2l::cMatrix44< TComponent > Class Template Reference

A template class representing a 4x4 matrix with any type. More...

#include <cMatrix44.h>

List of all members.

Public Types

  • typedef cMatrix44< TComponent > tThisMatrix
  • typedef TComponent tComponent
  • typedef cVector3< TComponent,
    TComponent, TComponent > tVector3
  • enum {
      _00 = 0, _01 = 4, _02 = 8, _03 = 12,
      _10 = 1, _11 = 5, _12 = 9, _13 = 13,
      _20 = 2, _21 = 6, _22 = 10, _23 = 14,
      _30 = 3, _31 = 7, _32 = 11, _33 = 15
    }
    Provide an enum for mapping row/column pairs to the matrix array which lets me not worry about the storage order, and just use things by name without the cost of calculating the value. More...

Public Member Functions


Detailed Description

template<class TComponent>
class n2l::cMatrix44< TComponent >

A template class representing a 4x4 matrix with any type.

This is a specialized version of cMatrix and is much faster, and has more functionality than the generalized counterpart.

Definition at line 84 of file cMatrix44.h.


Member Typedef Documentation

template<class TComponent>
typedef TComponent n2l::cMatrix44< TComponent >::tComponent
 

Definition at line 88 of file cMatrix44.h.

template<class TComponent>
typedef cMatrix44<TComponent> n2l::cMatrix44< TComponent >::tThisMatrix
 

Definition at line 87 of file cMatrix44.h.

template<class TComponent>
typedef cVector3<TComponent,TComponent,TComponent> n2l::cMatrix44< TComponent >::tVector3
 

Definition at line 89 of file cMatrix44.h.


Member Enumeration Documentation

template<class TComponent>
anonymous enum
 

Provide an enum for mapping row/column pairs to the matrix array which lets me not worry about the storage order, and just use things by name without the cost of calculating the value.

Enumerator:
_00 
_01 
_02 
_03 
_10 
_11 
_12 
_13 
_20 
_21 
_22 
_23 
_30 
_31 
_32 
_33 

Definition at line 95 of file cMatrix44.h.


Constructor & Destructor Documentation

template<class TComponent>
n2l::cMatrix44< TComponent >::cMatrix44  )  [inline]
 

Definition at line 104 of file cMatrix44.h.

template<class TComponent>
n2l::cMatrix44< TComponent >::cMatrix44 const tThisMatrix iM  )  [inline]
 

Definition at line 107 of file cMatrix44.h.

References n2l::cMatrix44< TComponent >::mM, and n2l::cMatrix44< TComponent >::set().

template<class TComponent>
n2l::cMatrix44< TComponent >::cMatrix44 const tComponent iM  )  [inline]
 

Definition at line 108 of file cMatrix44.h.

References n2l::cMatrix44< TComponent >::set().

template<class TComponent>
n2l::cMatrix44< TComponent >::cMatrix44 const tComponent i00,
const tComponent i01,
const tComponent i02,
const tComponent i03,
const tComponent i10,
const tComponent i11,
const tComponent i12,
const tComponent i13,
const tComponent i20,
const tComponent i21,
const tComponent i22,
const tComponent i23,
const tComponent i30,
const tComponent i31,
const tComponent i32,
const tComponent i33
[inline]
 

Definition at line 109 of file cMatrix44.h.

References n2l::cMatrix44< TComponent >::set().


Member Function Documentation

template<class TComponent>
const tComponent& n2l::cMatrix44< TComponent >::at const tUint  iRow,
const tUint  iCol
const [inline]
 

Definition at line 601 of file cMatrix44.h.

template<class TComponent>
tComponent& n2l::cMatrix44< TComponent >::at const tUint  iRow,
const tUint  iCol
[inline]
 

Definition at line 596 of file cMatrix44.h.

Referenced by n2l::cMatrix44< TComponent >::column(), n2l::cMatrix44< TComponent >::dump(), and n2l::cMatrix44< TComponent >::row().

template<class TComponent>
void n2l::cMatrix44< TComponent >::column const tUint  iCol,
const tComponent i0,
const tComponent i1,
const tComponent i2,
const tComponent i3
[inline]
 

Definition at line 617 of file cMatrix44.h.

References n2l::cMatrix44< TComponent >::at().

template<class TComponent>
const tBool n2l::cMatrix44< TComponent >::containsNaN  )  const [inline]
 

Definition at line 177 of file cMatrix44.h.

template<class TComponent>
const tBool n2l::cMatrix44< TComponent >::containsSpecialNumber  )  const [inline]
 

Definition at line 169 of file cMatrix44.h.

template<class TComponent>
const tComponent* const n2l::cMatrix44< TComponent >::data  )  const [inline]
 

Definition at line 578 of file cMatrix44.h.

template<class TComponent>
tComponent* const n2l::cMatrix44< TComponent >::data  )  [inline]
 

Accessor for the raw tComponent array, in column major order.

Definition at line 577 of file cMatrix44.h.

Referenced by n2l::cMatrix44< TComponent >::operator *(), and n2l::cGuiModelView::update().

template<class TComponent>
const tComponent n2l::cMatrix44< TComponent >::determinant  )  const [inline]
 

Definition at line 447 of file cMatrix44.h.

References n2l::cMatrix44< TComponent >::_00, n2l::cMatrix44< TComponent >::_01, n2l::cMatrix44< TComponent >::_02, n2l::cMatrix44< TComponent >::_03, n2l::cMatrix44< TComponent >::_10, n2l::cMatrix44< TComponent >::_11, n2l::cMatrix44< TComponent >::_12, n2l::cMatrix44< TComponent >::_13, n2l::cMatrix44< TComponent >::_20, n2l::cMatrix44< TComponent >::_21, n2l::cMatrix44< TComponent >::_22, n2l::cMatrix44< TComponent >::_23, n2l::cMatrix44< TComponent >::_30, n2l::cMatrix44< TComponent >::_31, n2l::cMatrix44< TComponent >::_32, and n2l::cMatrix44< TComponent >::_33.

template<class TComponent>
const tString n2l::cMatrix44< TComponent >::dump  )  [inline]
 

Definition at line 669 of file cMatrix44.h.

References n2l::asString(), and n2l::cMatrix44< TComponent >::at().

template<class TComponent>
void n2l::cMatrix44< TComponent >::eulerRotD const tComponent iX,
const tComponent iY,
const tComponent iZ
[inline]
 

Definition at line 130 of file cMatrix44.h.

References n2l::cMatrix44< TComponent >::eulerRotR(), and n2l::n2lDegToRad().

template<class TComponent>
void n2l::cMatrix44< TComponent >::eulerRotD const tVector3 iRot  )  [inline]
 

Definition at line 124 of file cMatrix44.h.

References n2l::cVector3< TComponent, TComponentDiff, TMagnitude >::x(), n2l::cVector3< TComponent, TComponentDiff, TMagnitude >::y(), and n2l::cVector3< TComponent, TComponentDiff, TMagnitude >::z().

Referenced by n2l::cGuiSEModelOrbit::actOn().

template<class TComponent>
void n2l::cMatrix44< TComponent >::eulerRotR const tComponent iX,
const tComponent iY,
const tComponent iZ
[inline]
 

Definition at line 137 of file cMatrix44.h.

References n2l::cMatrix44< TComponent >::_00, n2l::cMatrix44< TComponent >::_01, n2l::cMatrix44< TComponent >::_02, n2l::cMatrix44< TComponent >::_03, n2l::cMatrix44< TComponent >::_10, n2l::cMatrix44< TComponent >::_11, n2l::cMatrix44< TComponent >::_12, n2l::cMatrix44< TComponent >::_13, n2l::cMatrix44< TComponent >::_20, n2l::cMatrix44< TComponent >::_21, n2l::cMatrix44< TComponent >::_22, n2l::cMatrix44< TComponent >::_23, n2l::cMatrix44< TComponent >::_30, n2l::cMatrix44< TComponent >::_31, n2l::cMatrix44< TComponent >::_32, and n2l::cMatrix44< TComponent >::_33.

Referenced by n2l::cMatrix44< TComponent >::eulerRotD().

template<class TComponent>
void n2l::cMatrix44< TComponent >::fixNaN  )  [inline]
 

Definition at line 193 of file cMatrix44.h.

Referenced by n2l::cMatrix44< TComponent >::fixSpecialNumbers().

template<class TComponent>
void n2l::cMatrix44< TComponent >::fixSpecialNumbers  )  [inline]
 

Definition at line 185 of file cMatrix44.h.

References n2l::cMatrix44< TComponent >::fixNaN().

template<class TComponent>
tThisMatrix& n2l::cMatrix44< TComponent >::identity  )  [inline]
 

Set this matrix to the identity matrix, returning self.

Note:
That the method returns self is helpful for creating static identities initalized like: static const tMatrix44f Identity( tMatrix44f.identity() );

Definition at line 645 of file cMatrix44.h.

Referenced by n2l::asMatrix44f(), and n2l::cRFrustum::cRFrustum().

template<class TComponent>
const tThisMatrix n2l::cMatrix44< TComponent >::inverse  )  const [inline]
 

Return an copy of this matrix inverted.

If this matrix may not be inverted, return a zero vector.

Note:
This solution is found using methods learned from XEngine, http://xengine.sourceforge.net

Definition at line 470 of file cMatrix44.h.

References n2l::cMatrix44< TComponent >::_00, n2l::cMatrix44< TComponent >::_01, n2l::cMatrix44< TComponent >::_02, n2l::cMatrix44< TComponent >::_03, n2l::cMatrix44< TComponent >::_10, n2l::cMatrix44< TComponent >::_11, n2l::cMatrix44< TComponent >::_12, n2l::cMatrix44< TComponent >::_13, n2l::cMatrix44< TComponent >::_20, n2l::cMatrix44< TComponent >::_21, n2l::cMatrix44< TComponent >::_22, n2l::cMatrix44< TComponent >::_23, n2l::cMatrix44< TComponent >::_30, n2l::cMatrix44< TComponent >::_31, n2l::cMatrix44< TComponent >::_32, n2l::cMatrix44< TComponent >::_33, n2l::cMatrix44< TComponent >::mM, and n2l::cMatrix44< TComponent >::zero().

Referenced by n2l::cMatrix44< TComponent >::invert().

template<class TComponent>
void n2l::cMatrix44< TComponent >::invert  )  [inline]
 

Definition at line 567 of file cMatrix44.h.

References n2l::cMatrix44< TComponent >::inverse(), and n2l::cMatrix44< TComponent >::set().

Referenced by n2l::cPlane3< TComponent >::intersect().

template<class TComponent>
const tBool n2l::cMatrix44< TComponent >::isZero  )  const [inline]
 

Definition at line 661 of file cMatrix44.h.

Referenced by n2l::cPlane3< TComponent >::intersect().

template<class TComponent>
void n2l::cMatrix44< TComponent >::multiply tFloat  oV[4],
const tFloat  iV[4]
const [inline]
 

Definition at line 348 of file cMatrix44.h.

template<class TComponent>
const tVector3 n2l::cMatrix44< TComponent >::multiply const tVector3 iV  )  const [inline]
 

Definition at line 307 of file cMatrix44.h.

template<class TComponent>
tVector3& n2l::cMatrix44< TComponent >::multiply tVector3 oV,
const tVector3 iV
const [inline]
 

Set oV to iV as transformed by this.

This method applies only the top 3x3 matrix to iV to create iV.

Note:
The provided oV is returned as a convinence for constructs like tVector3f tmp; myVector = myMatrix.multiply( tmp, myVector ); which can be more efficient for translating batches of vectors than returning temporarys repeatedly.

Definition at line 300 of file cMatrix44.h.

template<class TComponent>
void n2l::cMatrix44< TComponent >::multiply tThisMatrix oM,
const tThisMatrix iM
const [inline]
 

Set oC to the matrix multiplication of this and iB.

Definition at line 240 of file cMatrix44.h.

References n2l::cMatrix44< TComponent >::mM.

Referenced by n2l::cMatrix44< TComponent >::operator *=(), n2l::cRFrustum::projectPoint(), n2l::cTriangle3< TComponent >::rotate(), n2l::cRFrustum::set(), n2l::cTriangle3< TComponent >::translate(), and n2l::cPEmitter::updateInto().

template<class TComponent>
const tVector3 n2l::cMatrix44< TComponent >::multiply34 const tVector3 iV  )  const [inline]
 

Definition at line 332 of file cMatrix44.h.

template<class TComponent>
tVector3& n2l::cMatrix44< TComponent >::multiply34 tVector3 oV,
const tVector3 iV
const [inline]
 

Definition at line 317 of file cMatrix44.h.

template<class TComponent>
const tThisMatrix n2l::cMatrix44< TComponent >::operator * const tThisMatrix iM  )  const [inline]
 

Definition at line 392 of file cMatrix44.h.

References n2l::cMatrix44< TComponent >::data(), and n2l::cMatrix44< TComponent >::mM.

template<class TComponent>
void n2l::cMatrix44< TComponent >::operator *= const tThisMatrix iM  )  [inline]
 

Multiply ourselves by iM.

Definition at line 384 of file cMatrix44.h.

References n2l::cMatrix44< TComponent >::multiply(), and n2l::cMatrix44< TComponent >::set().

template<class TComponent>
tComponent& n2l::cMatrix44< TComponent >::operator() const tUint  iRow,
const tUint  iCol
[inline]
 

Definition at line 590 of file cMatrix44.h.

template<class TComponent>
const tComponent& n2l::cMatrix44< TComponent >::operator() const tUint  iRow,
const tUint  iCol
const [inline]
 

Get the value at row by column with each starting at zero.

Definition at line 583 of file cMatrix44.h.

template<class TComponent>
tThisMatrix& n2l::cMatrix44< TComponent >::operator= const tThisMatrix iM  )  [inline]
 

Definition at line 232 of file cMatrix44.h.

References n2l::cMatrix44< TComponent >::mM, and n2l::cMatrix44< TComponent >::set().

template<class TComponent>
tThisMatrix& n2l::cMatrix44< TComponent >::operator= const tComponent iM  )  [inline]
 

Definition at line 226 of file cMatrix44.h.

References n2l::cMatrix44< TComponent >::set().

template<class TComponent>
tComponent& n2l::cMatrix44< TComponent >::operator[] const tUint  iI  )  [inline]
 

Definition at line 633 of file cMatrix44.h.

template<class TComponent>
const tComponent& n2l::cMatrix44< TComponent >::operator[] const tUint  iI  )  const [inline]
 

Definition at line 627 of file cMatrix44.h.

template<class TComponent>
void n2l::cMatrix44< TComponent >::row const tUint  iRow,
const tComponent i0,
const tComponent i1,
const tComponent i2,
const tComponent i3
[inline]
 

Definition at line 608 of file cMatrix44.h.

References n2l::cMatrix44< TComponent >::at().

Referenced by n2l::cPlane3< TComponent >::intersect().

template<class TComponent>
void n2l::cMatrix44< TComponent >::set const tThisMatrix iM  )  [inline]
 

Definition at line 223 of file cMatrix44.h.

References n2l::cMatrix44< TComponent >::mM, and n2l::cMatrix44< TComponent >::set().

template<class TComponent>
void n2l::cMatrix44< TComponent >::set const tComponent iM  )  [inline]
 

Definition at line 217 of file cMatrix44.h.

template<class TComponent>
void n2l::cMatrix44< TComponent >::set const tComponent i00,
const tComponent i01,
const tComponent i02,
const tComponent i03,
const tComponent i10,
const tComponent i11,
const tComponent i12,
const tComponent i13,
const tComponent i20,
const tComponent i21,
const tComponent i22,
const tComponent i23,
const tComponent i30,
const tComponent i31,
const tComponent i32,
const tComponent i33
[inline]
 

Definition at line 200 of file cMatrix44.h.

Referenced by n2l::cMatrix44< TComponent >::cMatrix44(), n2l::cMatrix44< TComponent >::invert(), n2l::cMatrix44< TComponent >::operator *=(), n2l::cMatrix44< TComponent >::operator=(), and n2l::cMatrix44< TComponent >::set().

template<class TComponent>
void n2l::cMatrix44< TComponent >::transposed tThisMatrix oM  )  const [inline]
 

Set the oM to the transpose of this.

Definition at line 366 of file cMatrix44.h.

References n2l::cMatrix44< TComponent >::_00, n2l::cMatrix44< TComponent >::_01, n2l::cMatrix44< TComponent >::_02, n2l::cMatrix44< TComponent >::_03, n2l::cMatrix44< TComponent >::_10, n2l::cMatrix44< TComponent >::_11, n2l::cMatrix44< TComponent >::_12, n2l::cMatrix44< TComponent >::_13, n2l::cMatrix44< TComponent >::_20, n2l::cMatrix44< TComponent >::_21, n2l::cMatrix44< TComponent >::_22, n2l::cMatrix44< TComponent >::_23, n2l::cMatrix44< TComponent >::_30, n2l::cMatrix44< TComponent >::_31, n2l::cMatrix44< TComponent >::_32, and n2l::cMatrix44< TComponent >::_33.

template<class TComponent>
void n2l::cMatrix44< TComponent >::zero  )  [inline]
 

Definition at line 655 of file cMatrix44.h.

Referenced by n2l::cMatrix44< TComponent >::inverse().


The documentation for this class was generated from the following file:
©2009 Aaron Cameron
Benchmarks