OpenGLPrakt --> math
A class for representing a 4x4 matrix. It supports matrix math too.
this really simplifies matrix math! :-) oh, not to forget: my matrix is built as follows: (due to OpenGL's convention to store matrices column-major - argh!)
_ _ | | | x y z 0 | | x x x | | | | x y z 0 | | y y y | | | | x y z 0 | | z z z | | | | p p p 1 | | x y z | |_ _|
(xx, xy, xz) is the x-axis
(yx, yy, yz) is the y-axis
(zx, zy, zz) is the z-axis
(px, py, pz) is the translation
public cMatrix ( ) ;
default constructor (initializes to identity)
public GLfloat mMatrix [ 4 ] [ 4 ]
Matrix data made public to allow direct access
(operator[] doesnt work with 2-dimensional fields... :-( ) has anyone a better idea?
public inline cVertex operator * ( const cVertex & v ) ;
an operator to multiply a vector with an matrix (which means transforming the vector by the matrix)
m | matrix to multiply with |
public inline cVertex operator / ( const cVertex & v ) ;
an operator to inversely multiply a vector with an matrix (which means transforming the vector by the matrix's inverse)
public inline operator GLfloat * ( ) ;
operator to "convert" matrix to an pointer to GLfloat
public inline cMatrix & Identity ( ) ;
Initialize matrix to identity
public inline cMatrix & Normalize ( ) ;
"normalize" the matrix by normalizing the axis components
This is a very special operation which is only sometimes useful to get orthonormal bases.
public inline void Translate ( const cVertex & v ) ;
translate/move origin of matrix
v | amount to translate |
public inline void Translate ( const GLfloat x , const GLfloat y , const GLfloat z ) ;
translate/move origin of matrix
x | distance to translate |
y | distance to translate |
z | distance to translate |
This documentation was generated automatically by the ccdoc tool (version 0.7a).
Click here to submit a bug report or feature request.
Click here to return to the top of the page.