Main Page | Class Hierarchy | Class List | File List | Class Members | File Members | Related Pages

Matrix4x4 Class Reference

#include <matrix4x4.h>

List of all members.


Detailed Description

A class that contains a 4x4 matrix.

Assumes matrix is affine - including affine code now. This means that the bottow row of the matrix should be [0 0 0 1]


Public Member Functions

 Matrix4x4 ()
 Constructor just creates identity matrix.
 ~Matrix4x4 ()
 Empty destructor.
 Matrix4x4 (const Matrix4x4 &other)
 Copy constructor.
Matrix4x4operator= (const Matrix4x4 &other)
 Equal, like copy.
Matrix4x4 operator+ (const Matrix4x4 &other) const
 Adding time.
Matrix4x4operator+= (const Matrix4x4 &other)
 Adding again.
Matrix4x4 operator- (const Matrix4x4 &other) const
 Subtracting is fun too.
Matrix4x4operator-= (const Matrix4x4 &other)
 More subtracting.
Matrix4x4 operator * (const float other) const
 Multiplication of scalar is simple.
Matrix4x4operator *= (const float other)
 More multiplication.
Matrix4x4 operator * (const Matrix4x4 &o) const
 Multiplication operator.
Matrix4x4operator *= (const Matrix4x4 &o)
 Multiplication operator.
float & operator() (unsigned int i, unsigned int j)
 Indexing operator.
float operator() (unsigned int i, unsigned int j) const
 Indexing operator.
bool operator== (Matrix4x4 &other)
 Comparator.
bool operator!= (Matrix4x4 &other)
 Comparator.
bool isAffine (void)
 This checks if matrix is affine.
void scale (float xin, float yin, float zin)
 Multiply the matrix by a scaling affine.
void trans (float xin, float yin, float zin)
 Multiply the matrix by a translation affine.
void rotate (float xin, float yin, float zin)
 Multiply the matrix by a rotation affine.
void scale (Vec4 in)
 Multiply the matrix by a scaling affine.
void trans (Vec4 in)
 Multiply the matrix by a translation affine.
void rotate (Vec4 in)
 Multiply the matrix by a rotation affine.
void rotX (float in)
 Multiply the matrix by a rotation affine about X.
void rotY (float in)
 Multiply the matrix by a rotation affine about Y.
void rotZ (float in)
 Multiply the matrix by a rotation affine about Z.
void makeScale (float xin, float yin, float zin)
 Create a scaling affine.
void makeTrans (float xin, float yin, float zin)
 Create a translation affine.
void makeRotate (float xin, float yin, float zin)
 Create a rotation affine.
void makeScale (Vec4 in)
 Create scaling matrix (from Vec4).
void makeRotate (Vec4 in)
 Create a rotation affine (from Vec4).
void makeRotX (float in)
 Create a rotation affine about X.
void makeRotY (float in)
 Create a rotation affine about Y.
void makeRotZ (float in)
 Create a rotation affine about Z.
void invert (void)
 Inverts a matrix on itself.
void transpose (void)
 Transpose the 4x4 matrix.
void Identity (void)
 Sets the matrix to an identity matrix.
void Zero (void)
 Sets the whole matrix to zero.
void Print (void)
 Print matrix to cout.
void Clean (void)
 Replace all near-zero values with zero.

Public Attributes

float m [16]
 The matrix itself is publically available, so can be passed to OpenGL easily.


Member Function Documentation

bool Matrix4x4::isAffine void   ) 
 

This checks if matrix is affine.

In this case this means checking the bottom row for the assumptions that we make.

Returns:
True for affine, False otherwise.

Here is the call graph for this function:

Matrix4x4 Matrix4x4::operator * const Matrix4x4 o  )  const
 

Multiplication operator.

WARNING: Assumes affine matrix.

Matrix4x4 & Matrix4x4::operator *= const Matrix4x4 o  ) 
 

Multiplication operator.

WARNING: Assumes affine matrix.

bool Matrix4x4::operator!= Matrix4x4 other  ) 
 

Comparator.

Iterates through the matrix, checking for an exact match.

Parameters:
other Matrix to compare with.
Returns:
False if any cell is not equal with its mate.

Here is the call graph for this function:

float Matrix4x4::operator() unsigned int  i,
unsigned int  j
const [inline]
 

Indexing operator.

This takes indices into the matrix and returns a copy of the correct cell. This solves the problem of the arry being stored in a human-unfriendly column-major format.

Parameters:
i Down.
j Across.
Returns:
Copy of cell.

float & Matrix4x4::operator() unsigned int  i,
unsigned int  j
[inline]
 

Indexing operator.

This takes indices into the matrix and returns a reference to the correct cell. This solves the problem of the arry being stored in a human-unfriendly column-major format.

Parameters:
i Down.
j Across.
Returns:
Changable reference.

bool Matrix4x4::operator== Matrix4x4 other  ) 
 

Comparator.

Iterates through the matrix, checking for an exact match.

Parameters:
other Matrix to compare with.
Returns:
True iff all cells are equal.

Here is the call graph for this function:

void Matrix4x4::transpose void   ) 
 

Transpose the 4x4 matrix.

No assumptions made.


The documentation for this class was generated from the following files:
Generated on Mon Jan 3 15:14:19 2005 for Graviton by  doxygen 1.3.9.1