Main Page | Modules | Class Hierarchy | Alphabetical List | Class List | Class Members

Matrix Class Reference
[Core]

#include <lvt/Vec.h>

List of all members.


Detailed Description

A 4x4 homogeneous matrix.

The Matrix class encapsulates a 4x4 homogeneous matrix. The semantics of vector multiplication is that of post-multiplication by column vectors. However, the matrix data is stored internally in column-major format, so that a matrix can be passed directly to a call to e.g. glMultMatrix(). The general rule of thumb is: don't manually modify the values in a Matrix, but rather rely on the arithmetic operators.


Public Member Functions

MatrixLoadIdentity ()
 Sets the matrix to the identity matrix.
 Matrix (const Vec &u, const Vec &v, const Vec &w)
 Constructs a new matrix with column entries equal to u, v, w.
 Matrix ()
 Default constructor.
 operator float * ()
 Converts the matrix to a float array.
Matrix Transpose ()
 Returns a new Matrix that is the transpose of the current Matrix.
float & operator() (int r, int c)
 Returns a reference to the element in the rth row and cth column.
float & operator[] (int i)
 Returns a reference to the ith element of the Matrix.


Constructor & Destructor Documentation

Matrix  )  [inline]
 

Default constructor.

Sets the Matrix to the identity.

Matrix const Vec u,
const Vec v,
const Vec w
[inline]
 

Constructs a new matrix with column entries equal to u, v, w.


Member Function Documentation

Matrix& LoadIdentity  )  [inline]
 

Sets the matrix to the identity matrix.

operator float *  )  [inline]
 

Converts the matrix to a float array.

This is intended for use in the gl*Matrix() family of functions.

float& operator() int  r,
int  c
[inline]
 

Returns a reference to the element in the rth row and cth column.

float& operator[] int  i  )  [inline]
 

Returns a reference to the ith element of the Matrix.

Note that since the internal format of the Matrix is column-major, the element returned might not be the one intended. Consider using the () operator instead of this operator.

Matrix Transpose  )  [inline]
 

Returns a new Matrix that is the transpose of the current Matrix.


Generated on Thu Feb 17 09:45:47 2005 for liblvt by  doxygen 1.4.1