Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

Matrix Class Reference

Defines a column-major 4x4 Matrix. More...

#include <Matrix.h>

List of all members.

Public Methods

 Matrix ()
 Default constructor, initializes the Matrix to identity.

 Matrix (const float *const data)
 Initializes the components to the specified values.

 Matrix (const Vector &col1, const Vector &col2, const Vector &col3)
 Initialize each column of the Matrix with one of the given vectors (the last column is initialized to (0,0,0,1).

 Matrix (const Vector &col1, const Vector &col2, const Vector &col3, const Vector &col4)
 Initialize each column of the Matrix with one of the given vectors.

float & operator() (int row, int col)
 Mutable accessor for a Matrix component.

float operator() (int row, int col) const
 Immutable accessor for a Matrix component.

const float * toArray () const
 Accessor for the raw Matrix data.

const Matrix invert () const
 Invert the Matrix.

const Matrix transpose () const
 Transpose the Matrix.

float determinant () const
 Compute the determinant of the Matrix.

const Matrix multiplyRight (const Matrix &matrix) const
 Multiply this Matrix on the right with another Matrix.

const Matrix multiplyLeft (const Matrix &matrix) const
 Multiply this Matrix on the left with another Matrix.

const Vector multiplyRight (const Vector &vector) const
 Multiply this Matrix on the right with a Vector.


Static Public Attributes

const Matrix IDENTITY
 Constant Matrix representing the identity transformation.


Private Methods

float determinant (int row, int col) const
 Compute the determinant of the Matrix with the given row and column removed.

void initialize (const float *const data)
 Initialize the components to the specified values.

void initialize (const Vector &col1, const Vector &col2, const Vector &col3, const Vector &col4)
 Initialize each column of the Matrix with one of the given vectors.


Private Attributes

float m_data [16]
 The data array containing the Matrix values, stored in column-major format:.


Friends

std::ostream & operator<< (std::ostream &out, const Matrix &matrix)
 Insertion operator for this Matrix into an output stream.


Detailed Description

Defines a column-major 4x4 Matrix.


Constructor & Destructor Documentation

Matrix::Matrix const Vector   col1,
const Vector   col2,
const Vector   col3
 

Initialize each column of the Matrix with one of the given vectors (the last column is initialized to (0,0,0,1).


Member Function Documentation

float Matrix::determinant int    row,
int    col
const [private]
 

Compute the determinant of the Matrix with the given row and column removed.


Friends And Related Function Documentation

std::ostream& operator<< std::ostream &    out,
const Matrix &    matrix
[friend]
 

Insertion operator for this Matrix into an output stream.


Member Data Documentation

float Matrix::m_data[16] [private]
 

The data array containing the Matrix values, stored in column-major format:.

        a0 a4 a8  a12
        a1 a5 a9  a13
        a2 a6 a10 a14
        a3 a7 a11 a15
        


The documentation for this class was generated from the following files:
Generated on Sat Mar 22 15:12:07 2003 for Bumpmap by doxygen1.3-rc2