SLProject
4.2.000
A platform independent 3D computer graphics framework for desktop OS, Android, iOS and online in web browsers
|
3x3 matrix template class More...
#include <SLMat3.h>
Public Member Functions | |
SLMat3 () | |
Sets identity matrix. More... | |
SLMat3 (const SLMat3 &A) | |
Sets mat by other SLMat3. More... | |
SLMat3 (const T M0, const T M3, const T M6, const T M1, const T M4, const T M7, const T M2, const T M5, const T M8) | |
Sets matrix by components. More... | |
SLMat3 (const T angleDEG, const T axis_x, const T axis_y, const T axis_z) | |
Sets rotate matrix from axis & angle. More... | |
SLMat3 (const T angleDEG, const SLVec3< T > axis) | |
Sets rotate matrix. More... | |
SLMat3 (const T scale_xyz) | |
Sets uniform scaling matrix. More... | |
SLMat3 (const T angleXRAD, const T angleYRAD, const T angleZRAD) | |
Sets rotation matrix from Euler angles in radians. More... | |
void | setMatrix (const SLMat3 &A) |
void | setMatrix (const SLMat3 *A) |
void | setMatrix (const T *M) |
void | setMatrix (T M0, T M3, T M6, T M1, T M4, T M7, T M2, T M5, T M8) |
void | m (int i, T val) |
const T * | m () const |
T | m (int i) const |
SLMat3< T > & | operator= (const SLMat3 &A) |
SLMat3< T > & | operator*= (const SLMat3 &A) |
SLMat3< T > & | operator= (const T *a) |
SLMat3< T > | operator+ (const SLMat3 &A) const |
SLMat3< T > | operator- (const SLMat3 &A) const |
SLMat3< T > | operator* (const SLMat3 &A) const |
SLVec3< T > | operator* (const SLVec3< T > &v) const |
SLMat3< T > | operator* (T a) const |
scalar multiplication More... | |
SLMat3< T > & | operator*= (T a) |
scalar multiplication More... | |
SLMat3< T > | operator/ (T a) const |
scalar division More... | |
SLMat3< T > & | operator/= (T a) |
scalar division More... | |
operator const T * () const | |
operator T* () | |
T & | operator() (SLint row, SLint col) |
const T & | operator() (SLint row, SLint col) const |
void | rotation (const T angleDEG, const SLVec3< T > &axis) |
Sets the rotation components More... | |
void | rotation (const T angleDEG, const T axisx, const T axisy, const T axisz) |
void | rotation (const T zAngleRAD, const T yAngleRAD, const T xAngleRAD) |
void | scale (const T sx, const T sy, const T sz) |
Sets the scaling components. More... | |
void | scale (const SLVec3< T > &s) |
void | scale (const T s) |
void | identity () |
void | transpose () |
Transposes the matrix. More... | |
SLMat3< T > | transposed () const |
Returns the transposed of the matrix and leaves the itself unchanged. More... | |
void | invert () |
Inverts the matrix. More... | |
SLMat3< T > | inverted () |
Returns the inverse of the matrix and leaves itself unchanged. More... | |
T | trace () const |
T | det () const |
det returns the determinant More... | |
void | toAngleAxis (T &angleDEG, SLVec3< T > &axis) const |
Conversion to axis and angle in radians. More... | |
void | toEulerAnglesXYZ (T &xRotRAD, T &yRotRAD, T &zRotRAD) |
void | toEulerAnglesZYX (T &zRotRAD, T &yRotRAD, T &xRotRAD) |
void | fromEulerAnglesXYZ (const T angleXRAD, const T angleYRAD, const T angleZRAD) |
void | fromEulerAnglesZYX (const T angleZ1RAD, const T angleY2RAD, const T angleX3RAD) |
void | fromEulerAnglesZXZ (const T angleZ1RAD, const T angleX2RAD, const T angleZ2RAD) |
void | print (const SLchar *str) const |
Static Public Member Functions | |
static void | swap (T &a, T &b) |
Public Attributes | |
T | _m [9] |
3x3 matrix template class
Implements a 3 by 3 matrix template. 9 floats were used instead of the normal [3][3] array. The order is columnwise as in OpenGL
| 0 3 6 | | 1 4 7 | | 2 5 8 |
type definitions for 3x3 matrice:
Use SLMat3f for a specific float type 3x3 matrix
Use SLMat3d for a specific double type 3x3 matrix
Sets identity matrix.
SLMat3< T >::SLMat3 | ( | const T | angleDEG, |
const T | axis_x, | ||
const T | axis_y, | ||
const T | axis_z | ||
) |
Sets rotate matrix from axis & angle.
Definition at line 155 of file SLMat3.h.
Sets uniform scaling matrix.
Definition at line 167 of file SLMat3.h.
Sets rotation matrix from Euler angles in radians.
Definition at line 173 of file SLMat3.h.
|
inline |
void SLMat3< T >::fromEulerAnglesXYZ | ( | const T | angleX1RAD, |
const T | angleY2RAD, | ||
const T | angleZ3RAD | ||
) |
Sets the linear 3x3 sub-matrix as a rotation matrix from the 3 euler angles in radians around the z-axis, y-axis & x-axis := Rx * Ry * Rz See: http://en.wikipedia.org/wiki/Euler_angles
Definition at line 683 of file SLMat3.h.
void SLMat3< T >::fromEulerAnglesZXZ | ( | const T | angleZ1RAD, |
const T | angleX2RAD, | ||
const T | angleZ3RAD | ||
) |
Sets the linear 3x3 sub-matrix as a rotation matrix from the 3 euler angles in radians around the z-axis, x-axis & z-axis:= Z1*X2*Z3 See: http://en.wikipedia.org/wiki/Euler_angles
Definition at line 721 of file SLMat3.h.
void SLMat3< T >::fromEulerAnglesZYX | ( | const T | angleZ1RAD, |
const T | angleY2RAD, | ||
const T | angleX3RAD | ||
) |
Sets the linear 3x3 sub-matrix as a rotation matrix from the 3 euler angles in radians around the x-axis, y-axis & z-axis := Rz * Ry * Rx See: http://en.wikipedia.org/wiki/Euler_angles
Definition at line 702 of file SLMat3.h.
Inverts the matrix.
Definition at line 356 of file SLMat3.h.
|
inline |
|
inline |
|
inline |
|
inline |
void SLMat3< T >::rotation | ( | const T | angleDEG, |
const T | axisx, | ||
const T | axisy, | ||
const T | axisz | ||
) |
void SLMat3< T >::rotation | ( | const T | zAngleRAD, |
const T | yAngleRAD, | ||
const T | xAngleRAD | ||
) |
|
inline |