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

Matrix Class Reference

4x4 matrix class. More...

#include <Math/Matrix.h>

List of all members.

Public Member Functions

 Matrix (void)
 Default constructor. Do nothing.
 Matrix (const double m00, const double m01, const double m02, const double m03, const double m10, const double m11, const double m12, const double m13, const double m20, const double m21, const double m22, const double m23, const double m30, const double m31, const double m32, const double m33)
 Construction from values.
 Matrix (const double *a)
 Construction from array of doubles.
Matrixoperator= (const double *a)
 Assignment operator for array of doubles.
const double & operator() (const uint i, const uint j) const
 Individual member access. returns const.
double & m (const uint i, const uint j)
 Non-const member access.
MatrixTranspose (void)
Matrix operator * (const double s) const
Matrixoperator *= (const double s)
 scaler multiplication, same as operator*
Matrix operator/ (const double s) const
 Scalar division.
Matrixoperator/= (const double s)
 Scalar division. also sets this matrix to the value.
Matrix operator+ (const Matrix &a) const
 Matrix addition.
Matrixoperator+= (const Matrix &a)
 Matrix addition.
Matrix operator- (const Matrix &a) const
 Matrix subtraction.
Matrixoperator-= (const Matrix &a)
 Matrix subtraction.
Matrix operator * (const Matrix &a) const
 Matrix multiplication. calculates the cross product.
Matrixoperator *= (const Matrix &a)
 Matrix multiplication.
Vector operator * (const Vector &v) const
 Vector multiplication. same as matrix multiplication, but for a 1x4 matrix.
void Translation (const Vector &t)
void Scaling (const Vector &s)
 Creates a transformation matrix representing a scaling by the vector 's', the result's are stored in "this".
void Rotation (const double r, const Vector &a)
 Creates a transformation matrix representing a rotation by 'r' radians about the axis vector 'a'. The results are stored in "this".
std::string String (void) const
 Conversion to string (for debugging).

Static Public Member Functions

void Transform2D (const Vector &normal, Matrix &to_plane, Matrix &to_world)
 given a normal, produce two transformation matrices from the world axes

Static Public Attributes

const Matrix Identity
 The identity matrix. Were going ot need this alot anyway, so we define it here.


Detailed Description

4x4 matrix class.

The primary purpose of this is obviously to perform transformation on three-dimensional points (orvectors).

The default copy constructor and assignment operator are fine. Due to the way our data is stored.


Constructor & Destructor Documentation

Matrix::Matrix const double  m00,
const double  m01,
const double  m02,
const double  m03,
const double  m10,
const double  m11,
const double  m12,
const double  m13,
const double  m20,
const double  m21,
const double  m22,
const double  m23,
const double  m30,
const double  m31,
const double  m32,
const double  m33
[inline]
 

Construction from values.

Parameters:
I'm not listing these, figure it out

Matrix::Matrix const double *  a  )  [inline]
 

Construction from array of doubles.

Parameters:
a: pointer to an array of 16 doubles to initialize matrix with


Member Function Documentation

double& Matrix::m const uint  i,
const uint  j
[inline]
 

Non-const member access.

Parameters:
i: The i position in the matrix to retrieve the data from.
j: The j position in the matrix to retrieve the data from.
Returns:
the data member at i,j of this matrix.

Vector Matrix::operator * const Vector v  )  const
 

Vector multiplication. same as matrix multiplication, but for a 1x4 matrix.

Parameters:
v: vector to multiply by
Returns:
the resultant vector
NOTE: This assumes that vectors are actually 4x1 with an implicit 1 as the 4th element.

Matrix Matrix::operator * const Matrix a  )  const
 

Matrix multiplication. calculates the cross product.

Parameters:
a: reference to the matrix to multiply by
Returns:
the resultant matrix

Matrix & Matrix::operator *= const Matrix a  ) 
 

Matrix multiplication.

Parameters:
a: reference to the matrix to multiply by
Returns:
a reference to this, resultant matrix

Matrix & Matrix::operator *= const double  s  ) 
 

scaler multiplication, same as operator*

Parameters:
s: Scaler to multiply by
Returns:
reference this now scaled matrix

const double& Matrix::operator() const uint  i,
const uint  j
const [inline]
 

Individual member access. returns const.

Parameters:
i: The i position in the matrix to retrieve the data from.
j: The j position in the matrix to retrieve the data from.
Returns:
the data member at i,j of this matrix.

Matrix Matrix::operator+ const Matrix a  )  const
 

Matrix addition.

Parameters:
a: matrix to add to this
Returns:
the result of hte addition

Matrix & Matrix::operator+= const Matrix a  ) 
 

Matrix addition.

Parameters:
a: reference to matrix to add to this
Returns:
reference to this result of the addition

Matrix Matrix::operator- const Matrix a  )  const
 

Matrix subtraction.

Parameters:
a: reference to matrix to subtract
Returns:
the resultant matrix

Matrix & Matrix::operator-= const Matrix a  ) 
 

Matrix subtraction.

Parameters:
a: reference to the matrix to subtract from this
Returns:
reference to this matrix, now subtracted from

Matrix Matrix::operator/ const double  s  )  const [inline]
 

Scalar division.

Parameters:
s: value to divide every member by
Returns:
the resultant matrix

Matrix& Matrix::operator/= const double  s  )  [inline]
 

Scalar division. also sets this matrix to the value.

Parameters:
s: value to divide every member by
Returns:
reference to the resultant matrix

Matrix& Matrix::operator= const double *  a  )  [inline]
 

Assignment operator for array of doubles.

Parameters:
a: pointer to an array of 16 doubles to initialize matrix with

void Matrix::Rotation const double  r,
const Vector a
 

Creates a transformation matrix representing a rotation by 'r' radians about the axis vector 'a'. The results are stored in "this".

Parameters:
r: the rotation required in radians
a: the axis to rotate around
Destroys the current contents of the matrix.

void Matrix::Scaling const Vector s  ) 
 

Creates a transformation matrix representing a scaling by the vector 's', the result's are stored in "this".

Parameters:
s: scaling to for the new matrix
If the transformation is applied to a vector 'v', v(0) will be scaled by s(0), v(1) will be scaled by s(1), etc. Destroys the current contents of the matrix.

std::string Matrix::String void   )  const
 

Conversion to string (for debugging).

Returns:
the string conversion of this matrix

void Matrix::Transform2D const Vector normal,
Matrix to_plane,
Matrix to_world
[static]
 

given a normal, produce two transformation matrices from the world axes

Parameters:
normal: normal to the plane
to_plane: ?
to_world: ?
FIXME: not certain what this does


The documentation for this class was generated from the following files:
Generated on Thu Jun 30 16:30:02 2005 for Construct by  doxygen 1.3.8-20040913