A matrix of nine values for 3d calculations. More...
Public Member Functions | |
Matrix3 () | |
Creates an uninitialized matrix. More... | |
Matrix3 (int i) | |
Creates a unit matrix. More... | |
template<class T2 , class M2 > | |
Matrix3 (const Matrix3< T2, M2 > &x) | |
Copy constructor. More... | |
template<class S > | |
Matrix3 (S m00, S m01, S m02, S m10, S m11, S m12, S m20, S m21, S m22) | |
Creates matrix from elements specified in row-major order. More... | |
template<class T2 , class M2 > | |
Matrix3 (const Vector3< T2, M2 > &v0, const Vector3< T2, M2 > &v1, const Vector3< T2, M2 > &v2) | |
Creates matrix from three column vectors. More... | |
Matrix3 (const Matrix4< T, M > &x) | |
Casting from Matrix4. More... | |
template<class T2 , class M2 > | |
Matrix3 (const Matrix4< T2, M2 > &x) | |
Casting from Matrix4. More... | |
template<class T2 , class M2 > | |
Matrix3 (const Quaternion< T2, M2 > &q) | |
Casting from Quaternion. More... | |
void | loadIdentity () |
Make this matrix identity, i.e. More... | |
Matrix3< T, M > | transpose () const |
Creates a transposed version of the matrix. More... | |
T | determinant () const |
Calculates the determinant. More... | |
Matrix3< T, M > | comatrix () const |
Calculates the comatrix. More... | |
Matrix3< T, M > | inverse () const |
Returns the inverse of the matrix. More... | |
Matrix3< T, M > & | operator= (const Matrix3< T, M > &o) |
Copy operator. More... | |
template<class T2 , class M2 > | |
Matrix3< T, M > & | operator= (const Matrix3< T2, M2 > &o) |
Copy operator. More... | |
operator const T * () const | |
Casts this matrix to an array representation. More... | |
operator T * () | |
Casts this matrix to an array representation. More... | |
const T & | operator() (int i, int j) const |
Index access (row,col) More... | |
const T & | operator[] (int i) const |
Index operator. More... | |
T & | operator() (int i, int j) |
Index access (row,col) More... | |
T & | operator[] (int i) |
Index operator. More... | |
Static Public Member Functions | |
template<class S , class T2 , class M2 > | |
static Matrix3< T, M > | fromAxisAngle (const Vector3< T2, M2 > &v, S a) |
Creates a matrix representing a rotation around the specified axis. More... | |
template<class T2 , class M2 > | |
static Matrix3< T, M > | fromScale (const Vector3< T2, M2 > &s) |
Creates a scaling matrix. More... | |
Public Attributes | |
T | m [9] |
Matrix cell data. More... | |
A matrix of nine values for 3d calculations.
Observe that the data is stored in column-major mode for easy interfacing with OpenGL. The interfaces are specified in row-major mode (for example the constructor and print operator).
|
inline |
Creates an uninitialized matrix.
|
inlineexplicit |
Creates a unit matrix.
References a3d::Matrix3< T, M >::loadIdentity().
|
inline |
Copy constructor.
References a3d::Matrix3< T, M >::m.
|
inline |
Creates matrix from elements specified in row-major order.
References a3d::Matrix3< T, M >::m.
|
inline |
Creates matrix from three column vectors.
References a3d::Matrix3< T, M >::m.
|
inlineexplicit |
Casting from Matrix4.
References a3d::Matrix3< T, M >::m, and a3d::Matrix4< T, M >::m.
|
inlineexplicit |
Casting from Matrix4.
References a3d::Matrix3< T, M >::m, and a3d::Matrix4< T, M >::m.
|
inlineexplicit |
Casting from Quaternion.
References a3d::Matrix3< T, M >::m, a3d::Quaternion< T, M >::s, and a3d::Quaternion< T, M >::v.
|
inline |
Calculates the comatrix.
References A3D_WARNING_EXPENSIVE, and a3d::Matrix3< T, M >::m.
Referenced by a3d::Matrix3< T, M >::inverse().
|
inline |
Calculates the determinant.
References A3D_WARNING_EXPENSIVE, and a3d::Matrix3< T, M >::m.
Referenced by a3d::Matrix3< T, M >::inverse().
|
inlinestatic |
Creates a matrix representing a rotation around the specified axis.
The vector represented by (x,y,z) MUST be of unit length or the result will be wrong!
References a3d::Matrix3< T, M >::m, and a3d::Vector3< T, M >::v.
|
inlinestatic |
Creates a scaling matrix.
|
inline |
Returns the inverse of the matrix.
This function is not optimized and is therefore extremely inefficient.
References A3D_WARNING_EXPENSIVE, a3d::Matrix3< T, M >::comatrix(), and a3d::Matrix3< T, M >::determinant().
|
inline |
Make this matrix identity, i.e.
ones in diagonal.
References a3d::Matrix3< T, M >::m.
Referenced by a3d::Matrix3< T, M >::Matrix3().
|
inline |
Casts this matrix to an array representation.
This makes it possible to provide for example a float matrix as an array argument in for example OpenGL.
Use like this:
Matrix3f m; glGetParamv( GL_MODELVIEW_MATRIX, (float*)m );
References a3d::Matrix3< T, M >::m.
|
inline |
Casts this matrix to an array representation.
This makes it possible to provide for example a float matrix as an array argument in for example OpenGL. Anything written in the returned array will end up in the matrix.
References a3d::Matrix3< T, M >::m.
|
inline |
Index access (row,col)
References a3d::Matrix3< T, M >::m.
|
inline |
Index access (row,col)
References a3d::Matrix3< T, M >::m.
|
inline |
Copy operator.
References a3d::Matrix3< T, M >::m.
|
inline |
Copy operator.
References a3d::Matrix3< T, M >::m.
|
inline |
|
inline |
|
inline |
Creates a transposed version of the matrix.
References a3d::Matrix3< T, M >::m.
T a3d::Matrix3< T, M >::m[9] |
Matrix cell data.
Referenced by a3d::Matrix3< T, M >::comatrix(), a3d::Matrix3< T, M >::determinant(), a3d::Matrix3< T, M >::fromAxisAngle(), a3d::Matrix3< T, M >::loadIdentity(), a3d::Matrix3< T, M >::Matrix3(), a3d::Matrix4< T, M >::Matrix4(), a3d::Matrix3< T, M >::operator const T *(), a3d::Matrix3< T, M >::operator T *(), a3d::Matrix3< T, M >::operator()(), a3d::Matrix3< T, M >::operator=(), a3d::Matrix3< T, M >::operator[](), and a3d::Matrix3< T, M >::transpose().