|
Code_TYMPAN
4.4.0
Industrial site acoustic simulation
|
The 4x4 matrix class. More...
#include <3d.h>
Public Member Functions | |
| OMatrix () | |
| Default constructor. More... | |
| OMatrix (const OMatrix &matrix) | |
| Copy constructor. More... | |
| OMatrix (double matrix[4][4]) | |
| virtual | ~OMatrix () |
| Destructor. More... | |
| OMatrix & | operator= (const OMatrix &matrix) |
| operators More... | |
| bool | operator== (const OMatrix &matrix) const |
| bool | operator!= (const OMatrix &matrix) const |
| OMatrix | operator+ (const OMatrix &matrix) const |
| OMatrix | operator- (const OMatrix &matrix) const |
| OMatrix | operator* (const OMatrix &matrix) const |
| OVector3D | multNormal (const OVector3D &normal) const |
| Multiplication with a normal (the translation is removed). More... | |
| void | show () |
| Print a matrix (debug). More... | |
| void | reset () |
| Set the matrix elements to zero. More... | |
| void | unite () |
| Initialize the matrix to the identity matrix. More... | |
| int | setTranslation (double x, double y, double z) |
| Update a translation matrix. More... | |
| int | setScale (double x, double y, double z) |
| Update a zoom matrix. More... | |
| int | setRotationOx (double a) |
| Update a rotation matrix (Ox axis). More... | |
| int | setRotationOy (double a) |
| Update a rotation matrix (Oy axis). More... | |
| int | setRotationOz (double a) |
| Update a rotation matrix (Oz axis). More... | |
| int | aligneVecteurSurOx (const OVector3D &vector) |
| Mise a jour d'une matrice d'alignement d'un vecteur quelconque avec l'axe des x. More... | |
| int | aligneVecteurSurOy (const OVector3D &vector) |
| Mise a jour d'une matrice d'alignement d'un vecteur quelconque avec l'axe des y. More... | |
| int | invert () |
| Matrix inversion. More... | |
| OMatrix | getInvert (int *ok=0) const |
| Return the inverse matrix of this matrix. More... | |
| void | adjoint () |
| Calculate the adjoint matrix from this matrix. More... | |
| OMatrix | getAdjoint () |
| Return the adjoint matrix. More... | |
| double | determinant () |
| Compute the matrix determinant. More... | |
| OCoord3D | dot (const OCoord3D &coord) const |
| Multiplication with a 3D coordinate. More... | |
| OCoord3D | scale (const OCoord3D &coord) const |
| void | toOpenGL (double mat[16]) |
| Store content of this matrix in column-major format at mat. More... | |
Static Public Member Functions | |
| static double | mat2x2Det (double a, double b, double c, double d) |
| Compute a 2 x 2 matrix determinant. More... | |
| static double | mat3x3Det (double a1, double a2, double a3, double b1, double b2, double b3, double c1, double c2, double c3) |
| Compute a 3 x 3 matrix determinant. More... | |
| static OMatrix | fromOpenGL (double mat[16]) |
| Construct an OMatrix from a matrix obtained from a glGetDoublev(PROJECTION_MATRIX, target) More... | |
Public Attributes | |
| double | _m [4][4] |
| The 4x4 matrix array. More... | |
| OMatrix::OMatrix | ( | ) |
| void OMatrix::adjoint | ( | ) |
Calculate the adjoint matrix from this matrix.
Remarque : Algorithm by Richard Carling, from Graphic Gems I.
Principe :
Calculate the adjoint of a 4x4 matrix:
Let a denotes the minor determinant of matrix A obtained by
ij
deleting the ith row and jth column from A.
i+j
Let b = (-1) a
ij ji
The matrix B = (b ) is the adjoint of A.
ij
Definition at line 824 of file 3d.cpp.


| int OMatrix::aligneVecteurSurOx | ( | const OVector3D & | vector | ) |
Mise a jour d'une matrice d'alignement d'un vecteur quelconque avec l'axe des x.
Remarque :
Principe :
Rotation de V autour de Oz pour le placer dans le plan xOz == rotation de -a1 avec a1 = angle entre Ox et la projection de V dans le plan xOy sin(a1) = Vy/sqrt(Vx**2+Vy**2) cos(a1) = Vx/sqrt(Vx**2+Vy**2) => M1 = cos1 sin1 0 0 -sin1 cos1 0 0 0 0 1 0 0 0 0 1
=> on obtient V1
Definition at line 700 of file 3d.cpp.

| int OMatrix::aligneVecteurSurOy | ( | const OVector3D & | vector | ) |
Mise a jour d'une matrice d'alignement d'un vecteur quelconque avec l'axe des y.
Remarque :
Principe :
Rotation de V autour de Oz pour le placer dans le plan yOz == rotation de a1 avec a1 = angle entre Oy et la projection de V dans le plan xOy sin(a1) = Vx/sqrt(Vx**2+Vy**2) cos(a1) = Vy/sqrt(Vx**2+Vy**2) => M1 = cos1 -sin1 0 0 sin1 cos1 0 0 0 0 1 0 0 0 0 1
=> on obtient V1
Definition at line 743 of file 3d.cpp.

| double OMatrix::determinant | ( | ) |
|
inlinestatic |
| OMatrix OMatrix::getAdjoint | ( | ) |
| OMatrix OMatrix::getInvert | ( | int * | ok = 0 | ) | const |
| int OMatrix::invert | ( | ) |
Matrix inversion.
Note : Algorithm by Richard Carling, from Graphic Gems I.
Principle :
-1
A = ___1__ adjoint A
det A
Definition at line 792 of file 3d.cpp.


|
static |
|
static |
| bool OMatrix::operator!= | ( | const OMatrix & | matrix | ) | const |
| bool OMatrix::operator== | ( | const OMatrix & | matrix | ) | const |
| void OMatrix::reset | ( | ) |
| int OMatrix::setRotationOx | ( | double | a | ) |
| int OMatrix::setRotationOy | ( | double | a | ) |
| int OMatrix::setRotationOz | ( | double | a | ) |
| int OMatrix::setScale | ( | double | x, |
| double | y, | ||
| double | z | ||
| ) |
| int OMatrix::setTranslation | ( | double | x, |
| double | y, | ||
| double | z | ||
| ) |
|
inline |
| void OMatrix::unite | ( | ) |