#include <gfx_math_matrix.hh>
Public Types | |
| typedef fp | FPM |
| fp precision | |
| typedef FPM | ElemType |
| element type | |
Public Member Functions | |
| Matrix (void) | |
| Default identity matrix. | |
| FPM & | operator[] (uint i) |
| const FPM & | operator[] (uint i) const |
| Vector3 | GetOrigin (void) const |
| void | SetOrigin (const Vector3 &origin) |
| void | Convert (fp out[16]) const |
| void | Identity (void) |
| FPM | RotateX (FPM x, FPM y, FPM z) const |
| FPM | RotateY (FPM x, FPM y, FPM z) const |
| FPM | RotateZ (FPM x, FPM y, FPM z) const |
| template<typename VECTOR_DEST, typename VECTOR_SRC> | |
| VECTOR_DEST | Rotate (const VECTOR_SRC &v) const |
| FPM | RotateTranslateX (FPM x, FPM y, FPM z) const |
| FPM | RotateTranslateY (FPM x, FPM y, FPM z) const |
| FPM | RotateTranslateZ (FPM x, FPM y, FPM z) const |
| template<typename DEST, typename SRC> | |
| DEST | RotateTranslate (const SRC &v) const |
| template<typename DEST, typename SRC> | |
| void | RotateTranslate (Array< DEST > &dest, const Array< SRC > &src) const |
| Rotate then translate (array). Auto-expands destination array. | |
| template<typename DEST, typename SRC> | |
| DEST | TranslateRotate (const SRC &src) const |
| template<typename DEST, typename SRC> | |
| void | TranslateRotate (Array< DEST > &dest, const Array< SRC > &src) const |
| Translate then rotate. Auto-expands destination array. | |
| WorldVertex | Transform (const LocalVertex &v) const |
| local --> world | |
| void | Transform (Array< WorldVertex > &dest, const Array< LocalVertex > &src) const |
| EyeVertex | Transform (const WorldVertex &v) const |
| world --> eye | |
| void | Transform (Array< EyeVertex > &dest, const Array< WorldVertex > &src) const |
| void | Transform (Array< EyeVertex > &dest, const Array< LocalVertex > &src) const |
| local --> eye | |
| template<typename VECTOR> | |
| VECTOR | MoveFixed (uint axis, fp inc) const |
| template<typename VECTOR> | |
| VECTOR | MoveLocal (uint axis, fp inc) const |
| void | TranslateFixed (uint axis, FPM inc) |
| void | TranslateLocal (uint axis, FPM inc) |
| void | RotateFixed (uint axis, Radian rad) |
| void | RotateLocal (uint axis, Radian rad) |
| FPM * | PTR (void) const |
| const FPM * | CONST_PTR (void) const |
Private Member Functions | |
| uint | MIXF (uint i, uint j) const |
| uint | MIXL (uint i, uint j) const |
Private Attributes | |
| FPM | m [12] |
Friends | |
| bool | operator== (const Matrix &m1, const Matrix &m2) |
| Compare matrixs. | |
| bool | operator!= (const Matrix &m1, const Matrix &m2) |
| Compare matrixs. | |
| bool | IfRotationEqual (const Matrix &m1, const Matrix &m2) |
| Compare rotation/orientation elements of two matrixs (excludes origin). | |
| ostream & | operator<< (ostream &strm, const Matrix &m) |
Names of methods may seem vague but the arg types indicate whether the matrix or coords/vertexs are involved. Transform() translates then rotates (used for vertex transformation). RotateTranslate() means rotate then translate (for transforming matrix itself).
| typedef fp gfx::Matrix::FPM |
fp precision
| typedef FPM gfx::Matrix::ElemType |
element type
| gfx::Matrix::Matrix | ( | void | ) | [inline] |
Default identity matrix.
| Vector3 gfx::Matrix::GetOrigin | ( | void | ) | const [inline] |
| void gfx::Matrix::SetOrigin | ( | const Vector3 & | origin | ) | [inline] |
| void gfx::Matrix::Convert | ( | fp | out[16] | ) | const [inline] |
| void gfx::Matrix::Identity | ( | void | ) | [inline] |
Assign matrix with identity mapping.
| VECTOR_DEST gfx::Matrix::Rotate | ( | const VECTOR_SRC & | v | ) | const [inline] |
Rotate vector. Example: mMatrix.Rotate<EyeVertex,WorldVertex>( wv );
Rotate then translate a coordinate.
| DEST gfx::Matrix::RotateTranslate | ( | const SRC & | v | ) | const [inline] |
Rotate then translate.
| void gfx::Matrix::RotateTranslate | ( | Array< DEST > & | dest, | |
| const Array< SRC > & | src | |||
| ) | const [inline] |
Rotate then translate (array). Auto-expands destination array.
| DEST gfx::Matrix::TranslateRotate | ( | const SRC & | src | ) | const [inline] |
Translate then rotate.
| void gfx::Matrix::TranslateRotate | ( | Array< DEST > & | dest, | |
| const Array< SRC > & | src | |||
| ) | const [inline] |
Translate then rotate. Auto-expands destination array.
| WorldVertex gfx::Matrix::Transform | ( | const LocalVertex & | v | ) | const [inline] |
local --> world
Transform vertex. Transform() is a mnemonic for RotateTranslate() or TranslateRotate() and which is inferred from arg type. To transform from local to eye space, this matrix would be the product of matrix multiplication of a Dyna matrix and Eye matrix.
| void gfx::Matrix::Transform | ( | Array< WorldVertex > & | dest, | |
| const Array< LocalVertex > & | src | |||
| ) | const [inline] |
| EyeVertex gfx::Matrix::Transform | ( | const WorldVertex & | v | ) | const [inline] |
world --> eye
| void gfx::Matrix::Transform | ( | Array< EyeVertex > & | dest, | |
| const Array< WorldVertex > & | src | |||
| ) | const [inline] |
| void gfx::Matrix::Transform | ( | Array< EyeVertex > & | dest, | |
| const Array< LocalVertex > & | src | |||
| ) | const [inline] |
local --> eye
For moving a vector along one axis of a matrix. Similar to TranslateFixed() and TranslateLocal().
Translate a matrix along an axis in fixed space. For translating the eye/viewpoint.
Translate a matrix along its own axis. For translating a Dyna.
| void gfx::Matrix::RotateFixed | ( | uint | axis, | |
| Radian | rad | |||
| ) | [inline] |
Rotate a matrix around a fixed axis. This function is suited to rotating the viewpoint/eye. The word "fixed" should be clear by looking at the math. Eg, the value of the X coord won't be changed by a rotation around the X axis.
| void gfx::Matrix::RotateLocal | ( | uint | axis, | |
| Radian | rad | |||
| ) | [inline] |
Rotate matrix around local axis. Rotate a local coordinate system around its own axis. This function is suited to rotating an independent object. The rotation is relative to local coodinate system (not the fixed/eye system). The trick is to load an identity-mapped matrix and rotate it, then transform it thru the given matrix (which defines the local coordinate system) as though it was the coords (1.0, 1.0, 1.0). These coords of course define the X,Y,Z axises. The transformation is effectively a local rotation.
| FPM* gfx::Matrix::PTR | ( | void | ) | const [inline] |
| const FPM* gfx::Matrix::CONST_PTR | ( | void | ) | const [inline] |
Compare rotation/orientation elements of two matrixs (excludes origin).
| ostream& operator<< | ( | ostream & | strm, | |
| const Matrix & | m | |||
| ) | [friend] |
FPM gfx::Matrix::m[12] [private] |
Palomino 3D Engine documents generated by doxygen 1.5.3 on Fri Nov 23 11:26:27 2007