Matrix.h File Reference

#include <common/math/Point.h>
#include <ostream>
#include <common/math/Matrix.inl>

Go to the source code of this file.

Classes

class  Matrix< M, N, T >
 A Matrix is templated to store M rows and N columns of data of type T. If left off, T will default to a "real_t" data type. Also, if N is not specified, the template will default to a square MxM matrix. More...

Defines

#define MATRIX_NO_ELEMENTS   (M * N)
#define MATRIX_SIZE   (sizeof(T) * MATRIX_NO_ELEMENTS)

Typedefs

typedef Matrix< 4, 4 > Matrix4x4
 Standard 4x4 matrix of real_ts.
typedef Matrix< 3, 3 > Matrix3x3
 Standard 3x3 matrix of real_ts.
typedef Matrix< 2, 2 > Matrix2x2
 Standard 2x2 matrix of real_ts.

Functions

Extra operators where Matrix is on right-hand side
template<unsigned M, unsigned N, typename T>
Vector< N, T > operator* (const Vector< M, T > &lhs, const Matrix< M, N, T > &rhs)
 1xM row vector * MxN matrix yields a 1xN vector
template<unsigned M, unsigned N, typename T>
Matrix< M, N, T > operator* (const T &scale, const Matrix< M, N, T > &rhs)
template<unsigned M, unsigned N, typename T>
std::ostream & operator<< (std::ostream &os, const Matrix< M, N, T > &m)
 Prints a Matrix to an output stream.
Routines which generate specific-purpose transformation matrices
Matrix4x4 getScaleMat (const Vector3 &v)
Matrix4x4 getTransMat (const Vector3 &v)
Matrix4x4 getRotXMat (const real_t radians)
Matrix4x4 getRotYMat (const real_t radians)
Matrix4x4 getRotZMat (const real_t radians)
Matrix4x4 getRotMat (const Point3 &p, const Vector3 &v, const real_t a)
Routines which generate specific-purpose inverse transformation matrices
Matrix4x4 getInvScaleMat (const Vector3 &v)
Matrix4x4 getInvTransMat (const Vector3 &v)
Matrix4x4 getInvRotXMat (const real_t radians)
Matrix4x4 getInvRotYMat (const real_t radians)
Matrix4x4 getInvRotZMat (const real_t radians)
Matrix4x4 getInvRotMat (const Point3 &p, const Vector3 &v, const real_t a)


Define Documentation

#define MATRIX_NO_ELEMENTS   (M * N)

Definition at line 30 of file Matrix.h.

#define MATRIX_SIZE   (sizeof(T) * MATRIX_NO_ELEMENTS)

Definition at line 31 of file Matrix.h.


Typedef Documentation

typedef Matrix<2, 2> Matrix2x2

Standard 2x2 matrix of real_ts.

Definition at line 261 of file Matrix.h.

typedef Matrix<3, 3> Matrix3x3

Standard 3x3 matrix of real_ts.

Definition at line 258 of file Matrix.h.

typedef Matrix<4, 4> Matrix4x4

Standard 4x4 matrix of real_ts.

Definition at line 255 of file Matrix.h.


Function Documentation

Matrix4x4 getInvRotMat ( const Point3 p,
const Vector3 v,
const real_t  a 
)

Returns:
the inverse rotation matrix around the vector and point by the specified angle

Matrix4x4 getInvRotXMat ( const real_t  radians  ) 

Returns:
the inverse rotation matrix about the x axis by the specified angle

Definition at line 122 of file Matrix.cpp.

Matrix4x4 getInvRotYMat ( const real_t  radians  ) 

Returns:
the inverse rotation matrix about the y axis by the specified angle

Definition at line 133 of file Matrix.cpp.

Matrix4x4 getInvRotZMat ( const real_t  radians  ) 

Returns:
the inverse rotation matrix about the z axis by the specified angle

Definition at line 144 of file Matrix.cpp.

Matrix4x4 getInvScaleMat ( const Vector3 v  ) 

Returns:
the inverse scale matrix described by the vector

Matrix4x4 getInvTransMat ( const Vector3 v  ) 

Returns:
the inverse translation matrix described by the vector

Matrix4x4 getRotMat ( const Point3 p,
const Vector3 v,
const real_t  a 
)

Returns:
the rotation matrix around the vector and point by the specified angle

Matrix4x4 getRotXMat ( const real_t  radians  ) 

Returns:
the rotation matrix about the x axis by the specified angle

Definition at line 48 of file Matrix.cpp.

Matrix4x4 getRotYMat ( const real_t  radians  ) 

Returns:
the rotation matrix about the y axis by the specified angle

Definition at line 59 of file Matrix.cpp.

Matrix4x4 getRotZMat ( const real_t  radians  ) 

Returns:
the rotation matrix about the z axis by the specified angle

Definition at line 70 of file Matrix.cpp.

Matrix4x4 getScaleMat ( const Vector3 v  ) 

Returns:
the scale matrix described by the vector

Matrix4x4 getTransMat ( const Vector3 v  ) 

Returns:
the translation matrix described by the vector

template<unsigned M, unsigned N, typename T>
Matrix<M, N, T> operator* ( const T &  scale,
const Matrix< M, N, T > &  rhs 
) [inline]

Returns:
the MxN matrix resulting from multiplying a scalar by an MxN matrix

Definition at line 361 of file Matrix.inl.

template<unsigned M, unsigned N, typename T>
Vector<N, T> operator* ( const Vector< M, T > &  lhs,
const Matrix< M, N, T > &  rhs 
) [inline]

1xM row vector * MxN matrix yields a 1xN vector

Definition at line 349 of file Matrix.inl.

template<unsigned M, unsigned N, typename T>
std::ostream& operator<< ( std::ostream &  os,
const Matrix< M, N, T > &  m 
) [inline]

Prints a Matrix to an output stream.

Definition at line 368 of file Matrix.inl.


Generated on 28 Feb 2009 for Milton by doxygen 1.5.6