#include <Matrix4x4.h>
Public Member Functions | |
| Matrix4x4 (void) | |
| Matrix4x4 (const Matrix4x4 &m) | |
| Matrix4x4 & | operator= (const Matrix4x4 &m) |
| void | swap (Matrix4x4 &m) |
| ~Matrix4x4 (void) | |
| Matrix4x4 (const float _11, const float _12, const float _13, const float _14, const float _21, const float _22, const float _23, const float _24, const float _31, const float _32, const float _33, const float _34, const float _41, const float _42, const float _43, const float _44) | |
| Matrix4x4 (const Vector4 &x, const Vector4 &y, const Vector4 &z, const Vector4 &w) | |
| Matrix4x4 (const Vector3 &v, const float phi) | |
| Matrix4x4 (const Quaternion &q) | |
| Matrix4x4 (const Matrix3x3 &m) | |
| Matrix4x4 (const Vector3 &w) | |
| Matrix4x4 (const float sx, const float sy, const float sz) | |
| Matrix4x4 (const float s) | |
| Matrix4x4 (const Quaternion &q, const Vector3 &w) | |
| Matrix4x4 (const Matrix3x3 &m, const Vector3 &w) | |
| Matrix4x4 (const Vector3 &pos, const Vector3 &focus, const Vector3 &up) | |
| Matrix4x4 (const float fov, const float aspect, const float zn, const float zf) | |
| Matrix4x4 (const Vector2 &wh, const float zn, const float zf) | |
| const float | det () const |
| const Matrix4x4 | transposed () const |
| const Matrix4x4 | inverted () const |
| const float | operator[] (unsigned index) const |
| float & | operator[] (unsigned index) |
| const Vector4 | get (unsigned i) const |
| const Matrix4x4 & | set (unsigned i, const Vector4 &v) |
| const Matrix4x4 & | set (const ml7::Vector4 &x, const ml7::Vector4 &y, const ml7::Vector4 &z, const ml7::Vector4 &w) |
| const Vector3 | axis () const |
| const float | angle () const |
| void | axisangle (Vector3 *v, float *phi) const |
| const Quaternion | rotation () const |
| const Vector3 | translation () const |
| const bool | normalized () const |
| const Matrix4x4 | operator- () const |
| const Matrix4x4 | operator+ (const Matrix4x4 &m) const |
| const Matrix4x4 | operator- (const Matrix4x4 &m) const |
| const Matrix4x4 | operator* (const float s) const |
| const Vector3 | operator* (const Vector3 &v) const |
| const Vector4 | operator* (const Vector4 &v) const |
| const Matrix4x4 | operator* (const Matrix4x4 &m) const |
| const Vector3 | trans (const Vector3 &v) const |
| const Vector4 | trans (const Vector4 &v) const |
| const Vector3 | transdir (const Vector3 &v) const |
| const Vector4 | transdir (const Vector4 &v) const |
| const Vector3 | transinv (const Vector3 &v) const |
| const Vector4 | transinv (const Vector4 &v) const |
| const Vector3 | transdirinv (const Vector3 &v) const |
| const Vector4 | transdirinv (const Vector4 &v) const |
| Matrix4x4 & | operator+= (const Matrix4x4 &m) |
| Matrix4x4 & | operator-= (const Matrix4x4 &m) |
| Matrix4x4 & | operator*= (const float s) |
| Matrix4x4 & | operator*= (const Matrix4x4 &m) |
| Matrix4x4 & | clear () |
| Matrix4x4 & | identity () |
| Matrix4x4 & | transpose () |
| Matrix4x4 & | transpose (const Matrix4x4 &m) |
| Matrix4x4 & | invert () |
| Matrix4x4 & | invert (const Matrix4x4 &m) |
| Matrix4x4 & | rotation (const Vector3 &v, const float phi) |
| Matrix4x4 & | rotation (const Vector3 &v) |
| Matrix4x4 & | rotation (const Quaternion &q) |
| Matrix4x4 & | rotation (const Matrix3x3 &m) |
| Matrix4x4 & | rotx (const float alpha) |
| Matrix4x4 & | roty (const float beta) |
| Matrix4x4 & | rotz (const float gamma) |
| Matrix4x4 & | set (const Vector3 &v, const float phi, const Vector3 &w) |
| Matrix4x4 & | set (const Vector3 &v, const Vector3 &w) |
| Matrix4x4 & | translation (const Vector3 &w) |
| Matrix4x4 & | scaling (const float sx, const float sy, const float sz) |
| Matrix4x4 & | scaling (const float s) |
| Matrix4x4 & | transform (const Quaternion &q, const Vector3 &w) |
| Matrix4x4 & | transform (const Matrix3x3 &m, const Vector3 &w) |
| Matrix4x4 & | view (const Vector3 &pos, const Vector3 &focus, const Vector3 &up) |
| Matrix4x4 & | projection (const float fov, const float aspect, const float zn, const float zf) |
| Matrix4x4 & | projection (const Vector2 &wh, const float zn, const float zf) |
| const bool | operator== (const Matrix4x4 &m) const |
| const bool | operator!= (const Matrix4x4 &m) const |
| operator const float *const () const | |
| operator float *const () | |
Public Attributes | |
| union { | |
| struct { | |
| float _11 | |
| float _12 | |
| float _13 | |
| float _14 | |
| float _21 | |
| float _22 | |
| float _23 | |
| float _24 | |
| float _31 | |
| float _32 | |
| float _33 | |
| float _34 | |
| float _41 | |
| float _42 | |
| float _43 | |
| float _44 | |
| } | |
| float data [16] | |
| float m [4][4] | |
| }; | |
Represents a 4x4-matrix for transforming 3d- and 4d-vectors. Used for 3d-graphics.
| ml7::Matrix4x4::Matrix4x4 | ( | void | ) | [inline] |
Default constructor. Creates a new identity matrix representing a zero transformation.
| ml7::Matrix4x4::Matrix4x4 | ( | const Matrix4x4 & | m | ) | [inline] |
Copy constructor. Copies a given matrix m.
| ml7::Matrix4x4::~Matrix4x4 | ( | void | ) | [inline] |
Destructor.
| ml7::Matrix4x4::Matrix4x4 | ( | const float | _11, | |
| const float | _12, | |||
| const float | _13, | |||
| const float | _14, | |||
| const float | _21, | |||
| const float | _22, | |||
| const float | _23, | |||
| const float | _24, | |||
| const float | _31, | |||
| const float | _32, | |||
| const float | _33, | |||
| const float | _34, | |||
| const float | _41, | |||
| const float | _42, | |||
| const float | _43, | |||
| const float | _44 | |||
| ) | [inline] |
Explicit constructor with parameters for each element.
| ml7::Matrix4x4::Matrix4x4 | ( | const Vector4 & | x, | |
| const Vector4 & | y, | |||
| const Vector4 & | z, | |||
| const Vector4 & | w | |||
| ) | [inline] |
Explicit constructor with given four vectors making up the columns.
| ml7::Matrix4x4::Matrix4x4 | ( | const Vector3 & | v, | |
| const float | phi | |||
| ) | [inline] |
Explicit constructor with a given rotation axis v and a clockwise-angle phi.
| ml7::Matrix4x4::Matrix4x4 | ( | const Quaternion & | q | ) | [inline, explicit] |
Explicit constructor with a given rotation quaternion q.
| ml7::Matrix4x4::Matrix4x4 | ( | const Matrix3x3 & | m | ) | [inline, explicit] |
Explicit constructor with a given rotation tensor m.
| ml7::Matrix4x4::Matrix4x4 | ( | const Vector3 & | w | ) | [inline, explicit] |
Explicit constructor with a given translation vector w.
| ml7::Matrix4x4::Matrix4x4 | ( | const float | sx, | |
| const float | sy, | |||
| const float | sz | |||
| ) | [inline] |
Explicit constructor with three scaling parameters sx, sy and sz.
| ml7::Matrix4x4::Matrix4x4 | ( | const float | s | ) | [inline, explicit] |
Explicit constructor with one scaling parameter s.
| ml7::Matrix4x4::Matrix4x4 | ( | const Quaternion & | q, | |
| const Vector3 & | w | |||
| ) | [inline] |
Explicit constructor with a given rotation quaternion q and a given translation vector w.
Explicit constructor with a given rotation tensor m and a given translation vector w.
| ml7::Matrix4x4::Matrix4x4 | ( | const Vector3 & | pos, | |
| const Vector3 & | focus, | |||
| const Vector3 & | up | |||
| ) | [inline] |
Explicit constructor creating a view matrix defined by given a position vector, a focus vector (where the orientation should point to) and an up vector.
| ml7::Matrix4x4::Matrix4x4 | ( | const float | fov, | |
| const float | aspect, | |||
| const float | zn, | |||
| const float | zf | |||
| ) | [inline] |
Explicit constructor creating a perspective projection matrix defined by given a field of vision (fov), an aspect ratio, a near and a far clipping plane.
| ml7::Matrix4x4::Matrix4x4 | ( | const Vector2 & | wh, | |
| const float | zn, | |||
| const float | zf | |||
| ) | [inline] |
Explicit constructor creating an orthographic projection matrix defined by given a width and a height (as a 2d-vector) of the view volume as well as a near and a far clipping plane.
| const float ml7::Matrix4x4::angle | ( | ) | const |
Interprets the 3x3-part of this matrix as a rotation tensor and returns the angle of the clockwise rotation.
| const Vector3 ml7::Matrix4x4::axis | ( | ) | const |
Interprets the 3x3-part of this matrix as a rotation tensor and returns the axis of the clockwise rotation.
| void ml7::Matrix4x4::axisangle | ( | Vector3 * | v, | |
| float * | phi | |||
| ) | const |
Interprets the 3x3-part of this matrix as a rotation tensor and determines the rotation axis v and the clockwise angle phi of the rotation.
| Matrix4x4 & ml7::Matrix4x4::clear | ( | ) |
Forces this matrix to be an empty matrix representing no legal transformation.
| const float ml7::Matrix4x4::det | ( | ) | const |
Returns the determinant of this matrix.
| const Vector4 ml7::Matrix4x4::get | ( | unsigned | i | ) | const [inline] |
Returns the i-th (0-indexed) column vector of this matrix.
| Matrix4x4 & ml7::Matrix4x4::identity | ( | ) |
Forces this matrix to be an identity matrix representing a zero transformation.
Forces this matrix to be an identity matrix representing a zero transformation (no rotation, no translation).
| Matrix4x4 & ml7::Matrix4x4::invert | ( | ) |
Inverts this matrix.
Replaces this matrix by a given matrix m inverted.
| const Matrix4x4 ml7::Matrix4x4::inverted | ( | ) | const |
Copies this matrix and inverts it.
| const bool ml7::Matrix4x4::normalized | ( | ) | const [inline] |
Returns true if _41 = _42 = _43 = 0 and _44 = 1.
| ml7::Matrix4x4::operator const float *const | ( | ) | const [inline] |
| ml7::Matrix4x4::operator float *const | ( | ) | [inline] |
| const bool ml7::Matrix4x4::operator!= | ( | const Matrix4x4 & | m | ) | const |
Checks if a given matrix m and this have non-identical elements.
| const Matrix4x4 ml7::Matrix4x4::operator* | ( | const float | s | ) | const |
Returns a copy of this matrix scaled by a given scalar s.
Returns a copy of a given vector v tranformed by this matrix.
Returns a copy of a given vector v tranformed by this matrix.
Returns a copy of a given matrix m transformed by this.
| Matrix4x4 & ml7::Matrix4x4::operator*= | ( | const float | s | ) |
Scales this matrix by a given scalar s.
Transforms this matrix by a given matrix m. It results in an operation identical to m * this.
Returns a given matrix m added to this.
| const Matrix4x4 ml7::Matrix4x4::operator- | ( | ) | const [inline] |
Returns a copy of this matrix with the elements having signs flipped.
Returns a given matrix m subtracted from this.
Subtracts a given matrix m from this.
Copy assignment operator. Copies the elements of a given matrix m.
| const bool ml7::Matrix4x4::operator== | ( | const Matrix4x4 & | m | ) | const |
Checks if a given matrix m and this have identical elements.
| const float ml7::Matrix4x4::operator[] | ( | unsigned | index | ) | const [inline] |
Indexed component access.
| float& ml7::Matrix4x4::operator[] | ( | unsigned | index | ) | [inline] |
Indexed component access.
Forces this matrix to be an orthographic projection matrix defined by given a width and a height (as a 2d-vector) of the view volume as well as a near and a far clipping plane.
| Matrix4x4 & ml7::Matrix4x4::projection | ( | const float | fov, | |
| const float | aspect, | |||
| const float | zn, | |||
| const float | zf | |||
| ) |
Forces this matrix to be a perspective projection matrix defined by given a field of vision (fov), an aspect ratio, a near and a far clipping plane.
Forces this matrix to be a rotation matrix with rotation axis v and a clockwise-angle phi.
Forces this matrix to be a rotation matrix with rotation axis v and a clockwise-angle given by the length of vector v.
| Matrix4x4 & ml7::Matrix4x4::rotation | ( | const Quaternion & | q | ) |
Forces this matrix to be a rotation matrix defined by the given quaternion q.
Forces this matrix to be a rotation matrix defined by the given tensor m.
| const Quaternion ml7::Matrix4x4::rotation | ( | ) | const |
Interprets the 3x3-part of this matrix as a rotation tensor and returns the rotation quaternion representing the rotation.
| Matrix4x4 & ml7::Matrix4x4::rotx | ( | const float | alpha | ) |
Forces this matrix to be a rotation matrix with rotation axis X and a clockwise-angle alpha.
| Matrix4x4 & ml7::Matrix4x4::roty | ( | const float | beta | ) |
Forces this matrix to be a rotation matrix with rotation axis Y and a clockwise-angle beta.
| Matrix4x4 & ml7::Matrix4x4::rotz | ( | const float | gamma | ) |
Forces this matrix to be a rotation matrix with rotation axis Z and a clockwise-angle gamma.
| Matrix4x4 & ml7::Matrix4x4::scaling | ( | const float | sx, | |
| const float | sy, | |||
| const float | sz | |||
| ) |
Forces this matrix to be a scaling matrix with scales sx, sy and sz.
| Matrix4x4 & ml7::Matrix4x4::scaling | ( | const float | s | ) |
Forces this matrix to be a scaling matrix with scale s.
| const Matrix4x4& ml7::Matrix4x4::set | ( | const ml7::Vector4 & | x, | |
| const ml7::Vector4 & | y, | |||
| const ml7::Vector4 & | z, | |||
| const ml7::Vector4 & | w | |||
| ) | [inline] |
Sets the column vectors of this matrix.
Sets the i-th (0-indexed) column vector of this matrix.
Forces this matrix to be a transformation matrix with rotation axis v and a clockwise-angle phi as well as a translation vector w.
Forces this matrix to be a transformation matrix with rotation axis v and a clockwise-angle given by the length of vector v as well as a translation vector w.
| void ml7::Matrix4x4::swap | ( | Matrix4x4 & | m | ) | [inline] |
Swap operation. Swaps the elements of a given matrix m with this.
Returns a copy of a given vector v transformed by this matrix. Used to transform position vectors rather than direction vectors. This operation is identical to this * v.
Returns a copy of a given vector v transformed by this matrix. Used to transform position vectors rather than direction vectors. This operation is identical to this * v.
Returns a copy of a given vector v rotated by the rotation tensor of this matrix. Used to transform direction vectors rather than position vectors.
Returns a copy of a given vector v rotated by the rotation tensor of this matrix. Used to transform direction vectors rather than position vectors.
Returns a copy of a given vector v rotated by the rotation tensor of this matrix inverted. Used to transform direction vectors rather than position vectors.
Returns a copy of a given vector v rotated by the rotation tensor of this matrix inverted. Used to transform direction vectors rather than position vectors.
| Matrix4x4 & ml7::Matrix4x4::transform | ( | const Quaternion & | q, | |
| const Vector3 & | w | |||
| ) |
Forces this matrix to be a transformation matrix defined by given a rotation quaternion and a translation vector.
Forces this matrix to be a transformation matrix defined by given a rotation tensor and a translation vector.
Returns a copy of a given vector v transformed by this matrix inverted. Used to transform position vectors rather than direction vectors.
Returns a copy of a given vector v transformed by this matrix inverted. Used to transform position vectors rather than direction vectors.
Forces this matrix to be a translation matrix with translation vector w.
| const Vector3 ml7::Matrix4x4::translation | ( | ) | const [inline] |
Returns the translation vector of this matrix.
| Matrix4x4 & ml7::Matrix4x4::transpose | ( | ) |
Transposes this matrix.
Replaces this matrix by a given matrix m transposed.
| const Matrix4x4 ml7::Matrix4x4::transposed | ( | ) | const [inline] |
Copies this matrix and transposes it.
Forces this matrix to be a transformation matrix defined by given a position vector, a focus vector (where the orientation should point to) and an up vector.
Forces this matrix to be a view matrix defined by given a position vector, a focus vector (where the orientation should point to) and an up vector.
| union { ... } |
| float ml7::Matrix4x4::_11 |
Element in the 1st row and 1st column.
| float ml7::Matrix4x4::_12 |
Element in the 1st row and 2nd column.
| float ml7::Matrix4x4::_13 |
Element in the 1st row and 3rd column.
| float ml7::Matrix4x4::_14 |
Element in the 1st row and 4th column.
| float ml7::Matrix4x4::_21 |
Element in the 2nd row and 1st column.
| float ml7::Matrix4x4::_22 |
Element in the 2nd row and 2nd column.
| float ml7::Matrix4x4::_23 |
Element in the 2nd row and 3rd column.
| float ml7::Matrix4x4::_24 |
Element in the 2nd row and 4th column.
| float ml7::Matrix4x4::_31 |
Element in the 3rd row and 1st column.
| float ml7::Matrix4x4::_32 |
Element in the 3rd row and 2nd column.
| float ml7::Matrix4x4::_33 |
Element in the 3rd row and 3rd column.
| float ml7::Matrix4x4::_34 |
Element in the 3rd row and 4th column.
| float ml7::Matrix4x4::_41 |
Element in the 4th row and 1st column.
| float ml7::Matrix4x4::_42 |
Element in the 4th row and 2nd column.
| float ml7::Matrix4x4::_43 |
Element in the 4th row and 3rd column.
| float ml7::Matrix4x4::_44 |
Element in the 4th row and 4th column.
| float ml7::Matrix4x4::data[16] |
Array of the elements.
| float ml7::Matrix4x4::m[4][4] |
2d-array of the elements.
1.7.1