#include <Matrix.h>
Collaboration diagram for Teddy::Maths::Matrix:
Public Methods | |
Matrix () | |
Matrix (const float f) | |
Matrix (const float *pf) | |
Matrix (const Quaternion &q) | |
void | zeroMatrix () |
operator float * () | |
float & | operator() (const int i, const int j) |
operator const float * () const | |
float | operator() (const int i, const int j) const |
void | operator= (const float k) |
void | operator= (const float *pf) |
void | operator= (const Quaternion &q) |
Matrix | operator- () const |
Matrix | operator * (const Matrix &mat) const |
const Matrix & | operator *= (const Matrix &mat) |
Vector | operator * (const Vector &vec) const |
Vector4 | operator * (const Vector4 &vec) const |
Vector | transformVector (const Vector &vec) const |
Vector4 | transformVector4 (const Vector4 &vec) const |
Vector4 | getRow (const int i) const |
Vector4 | getColumn (const int i) const |
void | setRow (const int i, const Vector4 &v) |
void | setColumn (const int i, const Vector4 &v) |
Vector | get3Row (const int i) const |
Vector | get3Column (const int i) const |
void | set3Row (const int i, const Vector &v) |
void | set3Column (const int i, const Vector &v) |
Vector | uniformTransformNormal (const Vector &vec) const |
| |
void | modelMatrix (const Quaternion &q, const Vector &vFrom) |
void | translateMatrix (const TVector< double > &v) |
void | translateMatrix (const Vector &v) |
void | translateMatrix (const float x, const float y, const float z) |
void | translate (const float x, const float y, const float z) |
void | translate (const float *pf) |
void | scaleMatrix (const float x, const float y, const float z) |
void | scaleMatrix (const float *pf) |
void | scale (const float x, const float y, const float z) |
void | scale (const float *pf) |
void | rotateXMatrix (const float radians) |
void | rotateX (const float radians) |
void | rotateYMatrix (const float radians) |
void | rotateY (const float radians) |
void | rotateZMatrix (const float radians) |
void | rotateZ (const float radians) |
void | rotateMatrix (const Vector &vec, const double radians) |
void | rotate (const Vector &vec, const double f) |
void | direction (const Vector &vec) |
bool | invert () |
void | transpose () |
Public Attributes | |
float | m [4][4] |
Static Public Attributes | |
const Matrix | IDENTITY |
const Matrix | SWAP_XY |
const Matrix | SWAP_XZ |
const Matrix | SWAP_YZ |
const Matrix | MIRROR_X |
const Matrix | MIRROR_Y |
const Matrix | MIRROR_Z |
This class implements a 4x4 matrix. Several functions and operators are defined to make working with matrices easier. The values are kept in column- major order to make it easier to use with OpenGL. For performance reasons, most of the functions assume that all matrices are orthogonal, which means the bottom row is [ 0 0 0 1 ]. Since I plan to use the GL_PROJECTION matrix to handle the projection matrix, I should never need to use any other kind of matrix, and I get a decent performance boost by ignoring the bottom row.
Note: This class is not templatized because integral data types don't make sense and there's no need for double-precision.
Definition at line 69 of file Matrix.h.
|
Definition at line 86 of file Matrix.h. Referenced by operator *, operator *=, operator-, and rotate. |
|
|
|
|
|
|
|
|
|
|
|
|
|
Definition at line 160 of file Matrix.h. Referenced by invert. |
|
|
|
Definition at line 449 of file Matrix.h. References CrossVector4, getColumn, setRow, and Vector4. |
|
|
|
Definition at line 136 of file Matrix.h. References transformVector4, and Vector4. |
|
Definition at line 135 of file Matrix.h. References transformVector, and Vector. |
|
Definition at line 116 of file Matrix.cpp. |
|
Definition at line 134 of file Matrix.h. References Matrix. |
|
Definition at line 101 of file Matrix.h. References m. |
|
Definition at line 99 of file Matrix.h. References m. |
|
Definition at line 102 of file Matrix.h. References m. |
|
Definition at line 100 of file Matrix.h. References m. |
|
|
|
Definition at line 97 of file Matrix.cpp. References m. |
|
Definition at line 112 of file Matrix.h. References m. |
|
Definition at line 104 of file Matrix.h. References m. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Definition at line 280 of file Matrix.h. References scale. |
|
Definition at line 269 of file Matrix.h. References m. Referenced by scale. |
|
Definition at line 265 of file Matrix.h. References scaleMatrix. |
|
Definition at line 250 of file Matrix.h. References m. Referenced by scaleMatrix. |
|
|
|
|
|
|
|
|
|
Definition at line 138 of file Matrix.h. Referenced by operator *. |
|
Definition at line 150 of file Matrix.h. Referenced by operator *. |
|
Definition at line 245 of file Matrix.h. References translate. |
|
Definition at line 234 of file Matrix.h. References m. Referenced by translate. |
|
Definition at line 218 of file Matrix.h. References m. |
|
|
|
Definition at line 189 of file Matrix.h. References m. |
|
Definition at line 480 of file Matrix.h. References m. Referenced by Teddy::Scenes::Camera::updatePlanes. |
|
|
|
Definition at line 92 of file Matrix.h. References m. |
|
|
|
Definition at line 84 of file Matrix.h. Referenced by get3Column, get3Row, getColumn, getRow, modelMatrix, operator *, operator const float *, operator float *, operator(), operator-, operator=, rotateMatrix, rotateX, rotateXMatrix, rotateY, rotateYMatrix, rotateZ, rotateZMatrix, scale, scaleMatrix, set3Column, set3Row, setColumn, setRow, transformVector, transformVector4, translate, translateMatrix, transpose, uniformTransformNormal, and zeroMatrix. |
|
|
|
|
|
|
|
|
|
|
|
|