Visualization LibraryA lightweight C++ OpenGL middleware for 2D/3D graphics |
[Home] [Tutorials] [All Classes] [Grouped Classes] |
The Matrix4 class is a template class that implements a generic 4x4 matrix, see also vl::dmat4, vl::fmat4, vl::umat4, vl::imat4. More...
#include <Matrix4.hpp>
Public Types | |
| typedef T_scalar_type | scalar_type |
Public Member Functions | |
| template<typename T > | |
| Matrix4 (const T &m) | |
| Matrix4 () | |
| Matrix4 (T_scalar_type n) | |
| Matrix4 (T_scalar_type e00, T_scalar_type e01, T_scalar_type e02, T_scalar_type e03, T_scalar_type e10, T_scalar_type e11, T_scalar_type e12, T_scalar_type e13, T_scalar_type e20, T_scalar_type e21, T_scalar_type e22, T_scalar_type e23, T_scalar_type e30, T_scalar_type e31, T_scalar_type e32, T_scalar_type e33) | |
| Matrix4 & | fill (T_scalar_type val) |
| T_scalar_type | diff (const Matrix4 &other) |
| const T_scalar_type & | e (unsigned i, unsigned j) const |
| T_scalar_type & | e (unsigned i, unsigned j) |
| const Vector4< T_scalar_type > & | operator[] (unsigned int i) const |
| Vector4< T_scalar_type > & | operator[] (unsigned int i) |
| Vector3< T_scalar_type > | getX () const |
| Vector3< T_scalar_type > | getY () const |
| Vector3< T_scalar_type > | getZ () const |
| Vector3< T_scalar_type > | getT () const |
| Matrix4 & | setX (const Vector3< T_scalar_type > &v) |
| Matrix4 & | setY (const Vector3< T_scalar_type > &v) |
| Matrix4 & | setZ (const Vector3< T_scalar_type > &v) |
| Matrix4 & | setT (const Vector3< T_scalar_type > &v) |
| bool | operator== (const Matrix4 &m) const |
| bool | operator!= (const Matrix4 &m) const |
| Matrix4 & | operator= (const Matrix4 &m) |
| Matrix4 | operator+ (const Matrix4 &m) const |
| Matrix4 & | operator+= (const Matrix4 &m) |
| Matrix4 | operator- (const Matrix4 &m) const |
| Matrix4 & | operator-= (const Matrix4 &m) |
| Matrix4 & | operator*= (const Matrix4 &m) |
| Matrix4 | operator- () const |
| Matrix4 | operator+ (T_scalar_type d) const |
| Matrix4 & | operator+= (T_scalar_type d) |
| Matrix4 | operator- (T_scalar_type d) const |
| Matrix4 & | operator-= (T_scalar_type d) |
| Matrix4 | operator* (T_scalar_type d) const |
| Matrix4 & | operator*= (T_scalar_type d) |
| Matrix4 | operator/ (T_scalar_type d) const |
| Matrix4 & | operator/= (T_scalar_type d) |
| bool | isIdentity () const |
| Matrix4 | as3x3 () const |
| Matrix3< T_scalar_type > | get3x3 () const |
| void | set3x3 (const Matrix3< T_scalar_type > &m) |
| This writes only on the upper 3x3 part of the matrix without touching the last row and column. | |
| T_scalar_type * | ptr () |
| const T_scalar_type * | ptr () const |
| Matrix4 & | transpose () |
| Matrix4 | getTransposed () const |
| void | getTransposed (Matrix4 &dest) const |
| bool | isNull () const |
| void | setIdentity () |
| T_scalar_type | getInverse (Matrix4 &dest) const |
| Matrix4 | getInverse (T_scalar_type *determinant=NULL) const |
| Matrix4 & | invert (T_scalar_type *determinant=NULL) |
| const T_scalar_type & | e (int i, int j) const |
| T_scalar_type & | e (int i, int j) |
| void | getAsLookAt (Vector3< T_scalar_type > &eye, Vector3< T_scalar_type > &look, Vector3< T_scalar_type > &up, Vector3< T_scalar_type > &right) const |
| Matrix4 & | rotate (T_scalar_type degrees, const Vector3< T_scalar_type > &v) |
| Matrix4 & | rotate (T_scalar_type degrees, T_scalar_type x, T_scalar_type y, T_scalar_type z) |
| Matrix4 & | rotate (T_scalar_type degrees1, const Vector3< T_scalar_type > &v1, T_scalar_type degrees2, const Vector3< T_scalar_type > &v2) |
| void | getYXRotationAngles (T_scalar_type °rees_y, T_scalar_type °rees_x) const |
If this matrix can be represented as RY(degrees_y) * RX(degrees_x), where RX and RY are rotation matrices around the X and Y axis respectively, this function returns the rotation angles degrees_y and degrees_x. | |
| Matrix4 & | rotate (T_scalar_type degrees1, const Vector3< T_scalar_type > &v1, T_scalar_type degrees2, const Vector3< T_scalar_type > &v2, T_scalar_type degrees3, const Vector3< T_scalar_type > &v3) |
| Matrix4 & | rotateXYZ (T_scalar_type degX, T_scalar_type degY, T_scalar_type degZ) |
| Matrix4 & | rotateZYX (T_scalar_type degZ, T_scalar_type degY, T_scalar_type degX) |
| Matrix4 & | rotate (const Vector4< T_scalar_type > &from, const Vector4< T_scalar_type > &to) |
| Matrix4 & | rotate (const Vector3< T_scalar_type > &from, const Vector3< T_scalar_type > &to) |
| Matrix4 & | translate (T_scalar_type x, T_scalar_type y, T_scalar_type z) |
| Matrix4 & | translate (const Vector3< T_scalar_type > &v) |
| Matrix4 & | scale (T_scalar_type x, T_scalar_type y, T_scalar_type z) |
Static Public Member Functions | |
| static Matrix4 | perspective (T_scalar_type fovy, T_scalar_type aspect_ratio, T_scalar_type znear, T_scalar_type zfar) |
| static Matrix4 | frustum (T_scalar_type pleft, T_scalar_type pright, T_scalar_type pbottom, T_scalar_type ptop, T_scalar_type pnear, T_scalar_type pfar) |
| static Matrix4 | ortho (T_scalar_type pleft, T_scalar_type pright, T_scalar_type pbottom, T_scalar_type ptop, T_scalar_type pnear, T_scalar_type pfar) |
| static Matrix4 | ortho2D (T_scalar_type pleft, T_scalar_type pright, T_scalar_type pbottom, T_scalar_type ptop) |
| static Matrix4 | lookAt (const Vector3< T_scalar_type > &eye, const Vector3< T_scalar_type > &look, const Vector3< T_scalar_type > &up) |
| static Matrix4 | rotation (T_scalar_type degrees, T_scalar_type x, T_scalar_type y, T_scalar_type z) |
| static Matrix4 | rotation (T_scalar_type degrees, const Vector3< T_scalar_type > &v) |
| static Matrix4 | rotation (T_scalar_type degrees1, const Vector3< T_scalar_type > &v1, T_scalar_type degrees2, const Vector3< T_scalar_type > &v2) |
| static Matrix4 | rotation (T_scalar_type degrees1, const Vector3< T_scalar_type > &v1, T_scalar_type degrees2, const Vector3< T_scalar_type > &v2, T_scalar_type degrees3, const Vector3< T_scalar_type > &v3) |
| static Matrix4 | rotationXYZ (T_scalar_type degX, T_scalar_type degY, T_scalar_type degZ) |
| static Matrix4 | rotationZYX (T_scalar_type degZ, T_scalar_type degY, T_scalar_type degX) |
| static Matrix4 | rotation (const Vector4< T_scalar_type > &from, const Vector4< T_scalar_type > &to) |
| static Matrix4 | rotation (const Vector3< T_scalar_type > &from, const Vector3< T_scalar_type > &to) |
| static Matrix4 | translation (const Vector3< T_scalar_type > &v) |
| static Matrix4 | translation (T_scalar_type x, T_scalar_type y, T_scalar_type z) |
| static Matrix4 | scaling (const Vector3< T_scalar_type > &v) |
| static Matrix4 | scaling (T_scalar_type x, T_scalar_type y, T_scalar_type z) |
Protected Attributes | |
| Vector4< T_scalar_type > | mVec [4] |
The Matrix4 class is a template class that implements a generic 4x4 matrix, see also vl::dmat4, vl::fmat4, vl::umat4, vl::imat4.
| typedef T_scalar_type vl::Matrix4< T_scalar_type >::scalar_type |
| vl::Matrix4< T_scalar_type >::Matrix4 | ( | const T & | m ) | [inline, explicit] |
| vl::Matrix4< T_scalar_type >::Matrix4 | ( | ) | [inline] |
| vl::Matrix4< T_scalar_type >::Matrix4 | ( | T_scalar_type | n ) | [inline] |
| vl::Matrix4< T_scalar_type >::Matrix4 | ( | T_scalar_type | e00, |
| T_scalar_type | e01, | ||
| T_scalar_type | e02, | ||
| T_scalar_type | e03, | ||
| T_scalar_type | e10, | ||
| T_scalar_type | e11, | ||
| T_scalar_type | e12, | ||
| T_scalar_type | e13, | ||
| T_scalar_type | e20, | ||
| T_scalar_type | e21, | ||
| T_scalar_type | e22, | ||
| T_scalar_type | e23, | ||
| T_scalar_type | e30, | ||
| T_scalar_type | e31, | ||
| T_scalar_type | e32, | ||
| T_scalar_type | e33 | ||
| ) | [inline, explicit] |
| Matrix4& vl::Matrix4< T_scalar_type >::fill | ( | T_scalar_type | val ) | [inline] |
| T_scalar_type vl::Matrix4< T_scalar_type >::diff | ( | const Matrix4< T_scalar_type > & | other ) | [inline] |
| const T_scalar_type& vl::Matrix4< T_scalar_type >::e | ( | unsigned | i, |
| unsigned | j | ||
| ) | const [inline] |
| T_scalar_type& vl::Matrix4< T_scalar_type >::e | ( | unsigned | i, |
| unsigned | j | ||
| ) | [inline] |
| const Vector4<T_scalar_type>& vl::Matrix4< T_scalar_type >::operator[] | ( | unsigned int | i ) | const [inline] |
| Vector4<T_scalar_type>& vl::Matrix4< T_scalar_type >::operator[] | ( | unsigned int | i ) | [inline] |
| Vector3<T_scalar_type> vl::Matrix4< T_scalar_type >::getX | ( | ) | const [inline] |
| Vector3<T_scalar_type> vl::Matrix4< T_scalar_type >::getY | ( | ) | const [inline] |
| Vector3<T_scalar_type> vl::Matrix4< T_scalar_type >::getZ | ( | ) | const [inline] |
| Vector3<T_scalar_type> vl::Matrix4< T_scalar_type >::getT | ( | ) | const [inline] |
| Matrix4& vl::Matrix4< T_scalar_type >::setX | ( | const Vector3< T_scalar_type > & | v ) | [inline] |
| Matrix4& vl::Matrix4< T_scalar_type >::setY | ( | const Vector3< T_scalar_type > & | v ) | [inline] |
| Matrix4& vl::Matrix4< T_scalar_type >::setZ | ( | const Vector3< T_scalar_type > & | v ) | [inline] |
| Matrix4& vl::Matrix4< T_scalar_type >::setT | ( | const Vector3< T_scalar_type > & | v ) | [inline] |
| bool vl::Matrix4< T_scalar_type >::operator== | ( | const Matrix4< T_scalar_type > & | m ) | const [inline] |
| bool vl::Matrix4< T_scalar_type >::operator!= | ( | const Matrix4< T_scalar_type > & | m ) | const [inline] |
| Matrix4& vl::Matrix4< T_scalar_type >::operator= | ( | const Matrix4< T_scalar_type > & | m ) | [inline] |
| Matrix4 vl::Matrix4< T_scalar_type >::operator+ | ( | const Matrix4< T_scalar_type > & | m ) | const [inline] |
| Matrix4& vl::Matrix4< T_scalar_type >::operator+= | ( | const Matrix4< T_scalar_type > & | m ) | [inline] |
| Matrix4 vl::Matrix4< T_scalar_type >::operator- | ( | const Matrix4< T_scalar_type > & | m ) | const [inline] |
| Matrix4& vl::Matrix4< T_scalar_type >::operator-= | ( | const Matrix4< T_scalar_type > & | m ) | [inline] |
| Matrix4& vl::Matrix4< T_scalar_type >::operator*= | ( | const Matrix4< T_scalar_type > & | m ) | [inline] |
| Matrix4 vl::Matrix4< T_scalar_type >::operator- | ( | ) | const [inline] |
| Matrix4 vl::Matrix4< T_scalar_type >::operator+ | ( | T_scalar_type | d ) | const [inline] |
| Matrix4& vl::Matrix4< T_scalar_type >::operator+= | ( | T_scalar_type | d ) | [inline] |
| Matrix4 vl::Matrix4< T_scalar_type >::operator- | ( | T_scalar_type | d ) | const [inline] |
| Matrix4& vl::Matrix4< T_scalar_type >::operator-= | ( | T_scalar_type | d ) | [inline] |
| Matrix4 vl::Matrix4< T_scalar_type >::operator* | ( | T_scalar_type | d ) | const [inline] |
| Matrix4& vl::Matrix4< T_scalar_type >::operator*= | ( | T_scalar_type | d ) | [inline] |
| Matrix4 vl::Matrix4< T_scalar_type >::operator/ | ( | T_scalar_type | d ) | const [inline] |
| Matrix4& vl::Matrix4< T_scalar_type >::operator/= | ( | T_scalar_type | d ) | [inline] |
| bool vl::Matrix4< T_scalar_type >::isIdentity | ( | ) | const [inline] |
| Matrix4 vl::Matrix4< T_scalar_type >::as3x3 | ( | ) | const [inline] |
| Matrix3<T_scalar_type> vl::Matrix4< T_scalar_type >::get3x3 | ( | ) | const [inline] |
| void vl::Matrix4< T_scalar_type >::set3x3 | ( | const Matrix3< T_scalar_type > & | m ) | [inline] |
This writes only on the upper 3x3 part of the matrix without touching the last row and column.
| T_scalar_type* vl::Matrix4< T_scalar_type >::ptr | ( | ) | [inline] |
| const T_scalar_type* vl::Matrix4< T_scalar_type >::ptr | ( | ) | const [inline] |
| Matrix4& vl::Matrix4< T_scalar_type >::transpose | ( | ) | [inline] |
| Matrix4 vl::Matrix4< T_scalar_type >::getTransposed | ( | ) | const [inline] |
| void vl::Matrix4< T_scalar_type >::getTransposed | ( | Matrix4< T_scalar_type > & | dest ) | const [inline] |
| bool vl::Matrix4< T_scalar_type >::isNull | ( | ) | const [inline] |
| void vl::Matrix4< T_scalar_type >::setIdentity | ( | ) | [inline] |
| T_scalar_type vl::Matrix4< T_scalar_type >::getInverse | ( | Matrix4< T_scalar_type > & | dest ) | const |
| Matrix4 vl::Matrix4< T_scalar_type >::getInverse | ( | T_scalar_type * | determinant = NULL ) |
const [inline] |
| Matrix4& vl::Matrix4< T_scalar_type >::invert | ( | T_scalar_type * | determinant = NULL ) |
[inline] |
| const T_scalar_type& vl::Matrix4< T_scalar_type >::e | ( | int | i, |
| int | j | ||
| ) | const [inline] |
| T_scalar_type& vl::Matrix4< T_scalar_type >::e | ( | int | i, |
| int | j | ||
| ) | [inline] |
| Matrix4< T_scalar_type > vl::Matrix4< T_scalar_type >::perspective | ( | T_scalar_type | fovy, |
| T_scalar_type | aspect_ratio, | ||
| T_scalar_type | znear, | ||
| T_scalar_type | zfar | ||
| ) | [static] |
| Matrix4< T_scalar_type > vl::Matrix4< T_scalar_type >::frustum | ( | T_scalar_type | pleft, |
| T_scalar_type | pright, | ||
| T_scalar_type | pbottom, | ||
| T_scalar_type | ptop, | ||
| T_scalar_type | pnear, | ||
| T_scalar_type | pfar | ||
| ) | [static] |
| Matrix4< T_scalar_type > vl::Matrix4< T_scalar_type >::ortho | ( | T_scalar_type | pleft, |
| T_scalar_type | pright, | ||
| T_scalar_type | pbottom, | ||
| T_scalar_type | ptop, | ||
| T_scalar_type | pnear, | ||
| T_scalar_type | pfar | ||
| ) | [static] |
| Matrix4< T_scalar_type > vl::Matrix4< T_scalar_type >::ortho2D | ( | T_scalar_type | pleft, |
| T_scalar_type | pright, | ||
| T_scalar_type | pbottom, | ||
| T_scalar_type | ptop | ||
| ) | [static] |
| Matrix4< T_scalar_type > vl::Matrix4< T_scalar_type >::lookAt | ( | const Vector3< T_scalar_type > & | eye, |
| const Vector3< T_scalar_type > & | look, | ||
| const Vector3< T_scalar_type > & | up | ||
| ) | [static] |
| void vl::Matrix4< T_scalar_type >::getAsLookAt | ( | Vector3< T_scalar_type > & | eye, |
| Vector3< T_scalar_type > & | look, | ||
| Vector3< T_scalar_type > & | up, | ||
| Vector3< T_scalar_type > & | right | ||
| ) | const |
| Matrix4< T_scalar_type > vl::Matrix4< T_scalar_type >::rotation | ( | T_scalar_type | degrees, |
| T_scalar_type | x, | ||
| T_scalar_type | y, | ||
| T_scalar_type | z | ||
| ) | [static] |
| static Matrix4 vl::Matrix4< T_scalar_type >::rotation | ( | T_scalar_type | degrees, |
| const Vector3< T_scalar_type > & | v | ||
| ) | [inline, static] |
| static Matrix4 vl::Matrix4< T_scalar_type >::rotation | ( | T_scalar_type | degrees1, |
| const Vector3< T_scalar_type > & | v1, | ||
| T_scalar_type | degrees2, | ||
| const Vector3< T_scalar_type > & | v2 | ||
| ) | [inline, static] |
| static Matrix4 vl::Matrix4< T_scalar_type >::rotation | ( | T_scalar_type | degrees1, |
| const Vector3< T_scalar_type > & | v1, | ||
| T_scalar_type | degrees2, | ||
| const Vector3< T_scalar_type > & | v2, | ||
| T_scalar_type | degrees3, | ||
| const Vector3< T_scalar_type > & | v3 | ||
| ) | [inline, static] |
| Matrix4& vl::Matrix4< T_scalar_type >::rotate | ( | T_scalar_type | degrees, |
| const Vector3< T_scalar_type > & | v | ||
| ) | [inline] |
| Matrix4& vl::Matrix4< T_scalar_type >::rotate | ( | T_scalar_type | degrees, |
| T_scalar_type | x, | ||
| T_scalar_type | y, | ||
| T_scalar_type | z | ||
| ) | [inline] |
| Matrix4& vl::Matrix4< T_scalar_type >::rotate | ( | T_scalar_type | degrees1, |
| const Vector3< T_scalar_type > & | v1, | ||
| T_scalar_type | degrees2, | ||
| const Vector3< T_scalar_type > & | v2 | ||
| ) | [inline] |
| void vl::Matrix4< T_scalar_type >::getYXRotationAngles | ( | T_scalar_type & | degrees_y, |
| T_scalar_type & | degrees_x | ||
| ) | const |
If this matrix can be represented as RY(degrees_y) * RX(degrees_x), where RX and RY are rotation matrices around the X and Y axis respectively, this function returns the rotation angles degrees_y and degrees_x.
| Matrix4& vl::Matrix4< T_scalar_type >::rotate | ( | T_scalar_type | degrees1, |
| const Vector3< T_scalar_type > & | v1, | ||
| T_scalar_type | degrees2, | ||
| const Vector3< T_scalar_type > & | v2, | ||
| T_scalar_type | degrees3, | ||
| const Vector3< T_scalar_type > & | v3 | ||
| ) | [inline] |
| static Matrix4 vl::Matrix4< T_scalar_type >::rotationXYZ | ( | T_scalar_type | degX, |
| T_scalar_type | degY, | ||
| T_scalar_type | degZ | ||
| ) | [inline, static] |
| Matrix4& vl::Matrix4< T_scalar_type >::rotateXYZ | ( | T_scalar_type | degX, |
| T_scalar_type | degY, | ||
| T_scalar_type | degZ | ||
| ) | [inline] |
| static Matrix4 vl::Matrix4< T_scalar_type >::rotationZYX | ( | T_scalar_type | degZ, |
| T_scalar_type | degY, | ||
| T_scalar_type | degX | ||
| ) | [inline, static] |
| Matrix4& vl::Matrix4< T_scalar_type >::rotateZYX | ( | T_scalar_type | degZ, |
| T_scalar_type | degY, | ||
| T_scalar_type | degX | ||
| ) | [inline] |
| static Matrix4 vl::Matrix4< T_scalar_type >::rotation | ( | const Vector4< T_scalar_type > & | from, |
| const Vector4< T_scalar_type > & | to | ||
| ) | [inline, static] |
| Matrix4< T_scalar_type > vl::Matrix4< T_scalar_type >::rotation | ( | const Vector3< T_scalar_type > & | from, |
| const Vector3< T_scalar_type > & | to | ||
| ) | [static] |
| Matrix4& vl::Matrix4< T_scalar_type >::rotate | ( | const Vector4< T_scalar_type > & | from, |
| const Vector4< T_scalar_type > & | to | ||
| ) | [inline] |
| Matrix4& vl::Matrix4< T_scalar_type >::rotate | ( | const Vector3< T_scalar_type > & | from, |
| const Vector3< T_scalar_type > & | to | ||
| ) | [inline] |
| static Matrix4 vl::Matrix4< T_scalar_type >::translation | ( | const Vector3< T_scalar_type > & | v ) | [inline, static] |
| static Matrix4 vl::Matrix4< T_scalar_type >::translation | ( | T_scalar_type | x, |
| T_scalar_type | y, | ||
| T_scalar_type | z | ||
| ) | [inline, static] |
| Matrix4& vl::Matrix4< T_scalar_type >::translate | ( | T_scalar_type | x, |
| T_scalar_type | y, | ||
| T_scalar_type | z | ||
| ) | [inline] |
| Matrix4& vl::Matrix4< T_scalar_type >::translate | ( | const Vector3< T_scalar_type > & | v ) | [inline] |
| static Matrix4 vl::Matrix4< T_scalar_type >::scaling | ( | const Vector3< T_scalar_type > & | v ) | [inline, static] |
| static Matrix4 vl::Matrix4< T_scalar_type >::scaling | ( | T_scalar_type | x, |
| T_scalar_type | y, | ||
| T_scalar_type | z | ||
| ) | [inline, static] |
| Matrix4& vl::Matrix4< T_scalar_type >::scale | ( | T_scalar_type | x, |
| T_scalar_type | y, | ||
| T_scalar_type | z | ||
| ) | [inline] |
Vector4<T_scalar_type> vl::Matrix4< T_scalar_type >::mVec[4] [protected] |