|
AGX Dynamics
2.35.0.1
|
Matrix class for affine transformations. More...
#include <Matrix4x4.h>
Inheritance diagram for agx::Matrix4x4T< T >:Public Types | |
| typedef T | Type |
Public Member Functions | |
| Matrix4x4T () | |
| Creates a new matrix, initialized to be an identity matrix. More... | |
| Matrix4x4T (const EulerAngles &rotation, const Vec3T< T > &translation=Vec3T< T >()) | |
| Create a matrix from Euler angles. More... | |
| template<typename T2 > | |
| Matrix4x4T (const Matrix4x4T< T2 > &mat) | |
| Copy constructor. More... | |
| Matrix4x4T (const OrthoMatrix3x3 &rotation, const Vec3T< T > &translation=Vec3T< T >()) | |
| Create a matrix from a 3x3 rotation matrix. More... | |
| Matrix4x4T (const QuatT< T > &rotation, const Vec3T< T > &translation=Vec3T< T >()) | |
| Create a matrix from a quaternion. More... | |
| Matrix4x4T (T a00, T a01, T a02, T a03, T a10, T a11, T a12, T a13, T a20, T a21, T a22, T a23, T a30, T a31, T a32, T a33) | |
| Create a matrix from 16 T scalars. More... | |
| Matrix4x4T (T const *const ptr) | |
| Create a matrix from a vector of 16 reals. More... | |
| ~Matrix4x4T ()=default | |
| Destructor. More... | |
| Matrix4x4T< T > & | addTranslate (const Vec3T< T > &t) |
| Matrix4x4T< T > & | addTranslate (T tx, T ty, T tz) |
| void | get (EulerAngles &e) const |
| void | get (OrthoMatrix3x3 &m3) const |
| void | get (QuatT< T > &q) const |
| agx::Vec4T< T > | getCol (size_t col) const |
| QuatT< T > | getRotate () const |
| agx::Vec4T< T > | getRow (size_t row) const |
| Vec3T< T > | getTranslate () const |
| Matrix4x4T< T > | inverse () const |
| Matrix inverse. More... | |
| bool | isFinite () const |
| bool | isIdentity () const |
| bool | isNaN () const |
| bool | isRigidTransformation () const |
| void | mult (const Matrix4x4T< T > &, const Matrix4x4T< T > &) |
| void | multSSE (const Matrix4x4T< Real32 > &lhs, const Matrix4x4T< Real32 > &rhs) |
| void | multSSE (const Matrix4x4T< Real64 > &lhs, const Matrix4x4T< Real64 > &rhs) |
| void | multSSE (const Matrix4x4T< T > &lhs, const Matrix4x4T< T > &rhs) |
| bool | operator!= (const Matrix4x4T< T > &m) const |
| T & | operator() (size_t row, size_t col) |
| T | operator() (size_t row, size_t col) const |
| Matrix4x4T< T > | operator* (const Matrix4x4T< T > &m) const |
| Vec3T< T > | operator* (const Vec3T< T > &v) const |
| Vec4T< T > | operator* (const Vec4T< T > &v) const |
| void | operator*= (const Matrix4x4T< T > &other) |
| Matrix4x4T< T > & | operator= (const Matrix4x4T< T > &rhs) |
| bool | operator== (const Matrix4x4T< T > &m) const |
| void | postMult (const Matrix4x4T< T > &) |
| Vec3T< T > | postMult (const Vec3T< T > &v) const |
| Vec4T< T > | postMult (const Vec4T< T > &v) const |
| Matrix4x4T< T > & | postMultTranslate (const Vec3T< T > &v) |
| void | preMult (const Matrix4x4T< T > &) |
| Vec3T< T > | preMult (const Vec3T< T > &v) const |
| Vec4T< T > | preMult (const Vec4T< T > &v) const |
| Matrix4x4T< T > & | preMultTranslate (const Vec3T< T > &v) |
| T * | ptr () |
| const T * | ptr () const |
| Matrix4x4T< T > & | set (const EulerAngles &e) |
| Matrix4x4T< T > & | set (const OrthoMatrix3x3 &m3) |
| Matrix4x4T< T > & | set (const QuatT< T > &q) |
| Matrix4x4T< T > & | set (T a00, T a01, T a02, T a03, T a10, T a11, T a12, T a13, T a20, T a21, T a22, T a23, T a30, T a31, T a32, T a33) |
| Matrix4x4T< T > & | set (T const *const ptr) |
| void | setCol (size_t col, const agx::Vec4T< T > &vec) |
| Matrix4x4T< T > & | setIdentity () |
| Matrix4x4T< T > & | setRotate (const EulerAngles &euler) |
| Matrix4x4T< T > & | setRotate (const OrthoMatrix3x3 &m3) |
| Matrix4x4T< T > & | setRotate (const QuatT< T > &q) |
| Matrix4x4T< T > & | setRotate (const Vec3T< T > &from, const Vec3T< T > &to) |
| Matrix4x4T< T > & | setRotate (T angle, const Vec3T< T > &axis) |
| Matrix4x4T< T > & | setRotate (T angle, T x, T y, T z) |
| Matrix4x4T< T > & | setRotate (T angle1, const Vec3T< T > &axis1, T angle2, const Vec3T< T > &axis2, T angle3, const Vec3T< T > &axis3) |
| void | setRow (size_t row, const agx::Vec4T< T > &vec) |
| Set the row of the matrix,. More... | |
| Matrix4x4T< T > & | setTranslate (const Vec3T< T > &t) |
| Matrix4x4T< T > & | setTranslate (T tx, T ty, T tz) |
| Vec3T< T > | transform3x3 (const Vec3T< T > &vIn) const |
| Vec3T< T > & | transform3x3 (const Vec3T< T > &vIn, Vec3T< T > &vOut) const |
| Vec3T< T > | transform3x3Inv (const Vec3T< T > &vIn) const |
| Vec3T< T > & | transform3x3Inv (const Vec3T< T > &vIn, Vec3T< T > &vOut) const |
| Matrix4x4T< T > | transpose () const |
| bool | valid () const |
Static Public Member Functions | |
| static Matrix4x4T< T > | crossMatrix (const Vec3T< T > &vec) |
| Generates a new matrix of a specific type. More... | |
| static Matrix4x4T< T > | rotate (const Vec3T< T > &from, const Vec3T< T > &to) |
| static Matrix4x4T< T > | rotate (T angle, const Vec3T< T > &axis) |
| static Matrix4x4T< T > | rotate (T angle, T x, T y, T z) |
| static Matrix4x4T< T > | rotate (T angle1, const Vec3T< T > &axis1, T angle2, const Vec3T< T > &axis2, T angle3, const Vec3T< T > &axis3) |
| static Matrix4x4T< T > | translate (const Vec3T< T > &dv) |
| static Matrix4x4T< T > | translate (T x, T y, T z) |
Protected Member Functions | |
| bool | invert (const Matrix4x4T< T > &mat) |
Static Protected Member Functions | |
| static void | multSSE32Implementation (Real32 *out, const Real32 *lhs, const Real32 *rhs) |
| static void | multSSE64Implementation (Real64 *out, const Real64 *lhs, const Real64 *rhs) |
Protected Attributes | |
| T | m_data [4][4] |
Matrix class for affine transformations.
Translations are stored in the last row. The last column will be assumed to be [0 0 0 1]' in all operations, even if it is set to something else.
Definition at line 55 of file Matrix4x4.h.
| typedef T agx::Matrix4x4T< T >::Type |
Definition at line 58 of file Matrix4x4.h.
| agx::Matrix4x4T< T >::Matrix4x4T |
Creates a new matrix, initialized to be an identity matrix.
Definition at line 326 of file Matrix4x4.h.
|
explicit |
Copy constructor.
Definition at line 332 of file Matrix4x4.h.
|
explicit |
Create a matrix from a vector of 16 reals.
Definition at line 384 of file Matrix4x4.h.
| agx::Matrix4x4T< T >::Matrix4x4T | ( | const QuatT< T > & | rotation, |
| const Vec3T< T > & | translation = Vec3T<T>() |
||
| ) |
Create a matrix from a quaternion.
Definition at line 391 of file Matrix4x4.h.
| agx::Matrix4x4T< T >::Matrix4x4T | ( | const EulerAngles & | rotation, |
| const Vec3T< T > & | translation = Vec3T< T >() |
||
| ) |
Create a matrix from Euler angles.
| agx::Matrix4x4T< T >::Matrix4x4T | ( | const OrthoMatrix3x3 & | rotation, |
| const Vec3T< T > & | translation = Vec3T<T>() |
||
| ) |
Create a matrix from a 3x3 rotation matrix.
Definition at line 399 of file Matrix4x4.h.
| agx::Matrix4x4T< T >::Matrix4x4T | ( | T | a00, |
| T | a01, | ||
| T | a02, | ||
| T | a03, | ||
| T | a10, | ||
| T | a11, | ||
| T | a12, | ||
| T | a13, | ||
| T | a20, | ||
| T | a21, | ||
| T | a22, | ||
| T | a23, | ||
| T | a30, | ||
| T | a31, | ||
| T | a32, | ||
| T | a33 | ||
| ) |
Create a matrix from 16 T scalars.
Definition at line 356 of file Matrix4x4.h.
|
default |
Destructor.
| Matrix4x4T< T > & agx::Matrix4x4T< T >::addTranslate | ( | const Vec3T< T > & | t | ) |
Definition at line 620 of file Matrix4x4.h.
| Matrix4x4T< T > & agx::Matrix4x4T< T >::addTranslate | ( | T | tx, |
| T | ty, | ||
| T | tz | ||
| ) |
Definition at line 630 of file Matrix4x4.h.
|
inlinestatic |
Generates a new matrix of a specific type.
Definition at line 704 of file Matrix4x4.h.
References agx::Vec3T< T >::x(), agx::Vec3T< T >::y(), and agx::Vec3T< T >::z().
| void agx::Matrix4x4T< T >::get | ( | EulerAngles & | e | ) | const |
| void agx::Matrix4x4T< T >::get | ( | OrthoMatrix3x3 & | m3 | ) | const |
Definition at line 667 of file Matrix4x4.h.
| void agx::Matrix4x4T< T >::get | ( | QuatT< T > & | q | ) | const |
|
inline |
Definition at line 191 of file Matrix4x4.h.
References agx::Matrix4x4T< T >::m_data.
| QuatT< T > agx::Matrix4x4T< T >::getRotate |
Definition at line 659 of file Matrix4x4.h.
|
inline |
Definition at line 181 of file Matrix4x4.h.
References agx::Matrix4x4T< T >::m_data.
| Vec3T< T > agx::Matrix4x4T< T >::getTranslate |
Definition at line 652 of file Matrix4x4.h.
Referenced by agx::Frame::getTranslate().
|
inline |
Matrix inverse.
Definition at line 1052 of file Matrix4x4.h.
References agx::Matrix4x4T< T >::invert().
Referenced by agx::inverse< Matrix4x4d >(), and agx::inverse< Matrix4x4f >().
|
protected |
Referenced by agx::Matrix4x4T< T >::inverse().
| bool agx::Matrix4x4T< T >::isFinite |
Definition at line 434 of file Matrix4x4.h.
| bool agx::Matrix4x4T< T >::isIdentity |
Definition at line 447 of file Matrix4x4.h.
| bool agx::Matrix4x4T< T >::isNaN |
Definition at line 420 of file Matrix4x4.h.
| bool agx::Matrix4x4T< T >::isRigidTransformation |
Definition at line 453 of file Matrix4x4.h.
References agx::equivalent().
Referenced by agx::AffineMatrix4x4T< T >::AffineMatrix4x4T().
| void agx::Matrix4x4T< T >::mult | ( | const Matrix4x4T< T > & | lhs, |
| const Matrix4x4T< T > & | rhs | ||
| ) |
Definition at line 770 of file Matrix4x4.h.
References AGX_MATRIX4X4_INNER_PRODUCT, and agx::Matrix4x4T< T >::m_data.
Referenced by agx::AffineMatrix4x4T< T >::operator*(), and agx::Matrix4x4T< T >::operator*().
| void agx::Matrix4x4T< Real32 >::multSSE | ( | const Matrix4x4T< Real32 > & | lhs, |
| const Matrix4x4T< Real32 > & | rhs | ||
| ) |
Definition at line 1196 of file Matrix4x4.h.
References agx::mult(), and agx::Matrix4x4T< T >::ptr().
| void agx::Matrix4x4T< Real64 >::multSSE | ( | const Matrix4x4T< Real64 > & | lhs, |
| const Matrix4x4T< Real64 > & | rhs | ||
| ) |
Definition at line 1206 of file Matrix4x4.h.
References agx::mult(), and agx::Matrix4x4T< T >::ptr().
| void agx::Matrix4x4T< T >::multSSE | ( | const Matrix4x4T< T > & | lhs, |
| const Matrix4x4T< T > & | rhs | ||
| ) |
|
staticprotected |
Definition at line 1116 of file Matrix4x4.h.
References agxAbort1.
|
staticprotected |
Definition at line 1188 of file Matrix4x4.h.
References agxAbort1.
| bool agx::Matrix4x4T< T >::operator!= | ( | const Matrix4x4T< T > & | m | ) | const |
Definition at line 877 of file Matrix4x4.h.
References agx::Matrix4x4T< T >::m_data.
| T & agx::Matrix4x4T< T >::operator() | ( | size_t | row, |
| size_t | col | ||
| ) |
Definition at line 884 of file Matrix4x4.h.
| T agx::Matrix4x4T< T >::operator() | ( | size_t | row, |
| size_t | col | ||
| ) | const |
Definition at line 890 of file Matrix4x4.h.
| Matrix4x4T< T > agx::Matrix4x4T< T >::operator* | ( | const Matrix4x4T< T > & | m | ) | const |
Definition at line 916 of file Matrix4x4.h.
References agx::Matrix4x4T< T >::mult().
| Vec3T< T > agx::Matrix4x4T< T >::operator* | ( | const Vec3T< T > & | v | ) | const |
Definition at line 924 of file Matrix4x4.h.
| Vec4T< T > agx::Matrix4x4T< T >::operator* | ( | const Vec4T< T > & | v | ) | const |
Definition at line 930 of file Matrix4x4.h.
| void agx::Matrix4x4T< T >::operator*= | ( | const Matrix4x4T< T > & | other | ) |
Definition at line 905 of file Matrix4x4.h.
| Matrix4x4T< T > & agx::Matrix4x4T< T >::operator= | ( | const Matrix4x4T< T > & | rhs | ) |
Definition at line 896 of file Matrix4x4.h.
References agx::Matrix4x4T< T >::ptr().
| bool agx::Matrix4x4T< T >::operator== | ( | const Matrix4x4T< T > & | m | ) | const |
Definition at line 870 of file Matrix4x4.h.
References agx::Matrix4x4T< T >::m_data.
| void agx::Matrix4x4T< T >::postMult | ( | const Matrix4x4T< T > & | other | ) |
Definition at line 827 of file Matrix4x4.h.
References AGX_MATRIX4X4_INNER_PRODUCT, and AGX_MATRIX4X4_SET_ROW.
| Vec3T< T > agx::Matrix4x4T< T >::postMult | ( | const Vec3T< T > & | v | ) | const |
Definition at line 1003 of file Matrix4x4.h.
References agx::Vec3T< T >::x(), agx::Vec3T< T >::y(), and agx::Vec3T< T >::z().
| Vec4T< T > agx::Matrix4x4T< T >::postMult | ( | const Vec4T< T > & | v | ) | const |
Definition at line 1021 of file Matrix4x4.h.
References agx::Vec4T< T >::w(), agx::Vec4T< T >::x(), agx::Vec4T< T >::y(), and agx::Vec4T< T >::z().
| Matrix4x4T< T > & agx::Matrix4x4T< T >::postMultTranslate | ( | const Vec3T< T > & | v | ) |
Definition at line 857 of file Matrix4x4.h.
| void agx::Matrix4x4T< T >::preMult | ( | const Matrix4x4T< T > & | other | ) |
Definition at line 809 of file Matrix4x4.h.
References AGX_MATRIX4X4_INNER_PRODUCT.
| Vec3T< T > agx::Matrix4x4T< T >::preMult | ( | const Vec3T< T > & | v | ) | const |
Definition at line 1012 of file Matrix4x4.h.
References agx::Vec3T< T >::x(), agx::Vec3T< T >::y(), and agx::Vec3T< T >::z().
Referenced by agx::operator*().
| Vec4T< T > agx::Matrix4x4T< T >::preMult | ( | const Vec4T< T > & | v | ) | const |
Definition at line 1031 of file Matrix4x4.h.
References agx::Vec4T< T >::w(), agx::Vec4T< T >::x(), agx::Vec4T< T >::y(), and agx::Vec4T< T >::z().
| Matrix4x4T< T > & agx::Matrix4x4T< T >::preMultTranslate | ( | const Vec3T< T > & | v | ) |
Definition at line 844 of file Matrix4x4.h.
| T * agx::Matrix4x4T< T >::ptr |
Definition at line 684 of file Matrix4x4.h.
Referenced by agx::AffineMatrix4x4T< T >::multSSE(), agx::Matrix4x4T< T >::multSSE(), agx::AffineMatrix4x4T< T >::operator=(), and agx::Matrix4x4T< T >::operator=().
| const T * agx::Matrix4x4T< T >::ptr |
Definition at line 690 of file Matrix4x4.h.
|
inlinestatic |
Definition at line 731 of file Matrix4x4.h.
References agx::Matrix4x4T< T >::setRotate().
|
static |
Definition at line 747 of file Matrix4x4.h.
References agx::Matrix4x4T< T >::setRotate().
|
inlinestatic |
Definition at line 739 of file Matrix4x4.h.
References agx::Matrix4x4T< T >::setRotate().
|
static |
Definition at line 755 of file Matrix4x4.h.
References agx::Matrix4x4T< T >::setRotate().
| Matrix4x4T<T>& agx::Matrix4x4T< T >::set | ( | const EulerAngles & | e | ) |
| Matrix4x4T< T > & agx::Matrix4x4T< T >::set | ( | const OrthoMatrix3x3 & | m3 | ) |
Definition at line 530 of file Matrix4x4.h.
| Matrix4x4T< T > & agx::Matrix4x4T< T >::set | ( | const QuatT< T > & | q | ) |
Definition at line 520 of file Matrix4x4.h.
| Matrix4x4T< T > & agx::Matrix4x4T< T >::set | ( | T | a00, |
| T | a01, | ||
| T | a02, | ||
| T | a03, | ||
| T | a10, | ||
| T | a11, | ||
| T | a12, | ||
| T | a13, | ||
| T | a20, | ||
| T | a21, | ||
| T | a22, | ||
| T | a23, | ||
| T | a30, | ||
| T | a31, | ||
| T | a32, | ||
| T | a33 | ||
| ) |
Definition at line 491 of file Matrix4x4.h.
| Matrix4x4T< T > & agx::Matrix4x4T< T >::set | ( | T const *const | ptr | ) |
They all return a reference to the updated matrix, enabling chained commands. E.g: matrix.setRotate(q).setTranslate(pos)
Definition at line 483 of file Matrix4x4.h.
Referenced by agx::AffineMatrix4x4T< T >::set().
|
inline |
Definition at line 174 of file Matrix4x4.h.
References agx::Matrix4x4T< T >::m_data.
| Matrix4x4T< T > & agx::Matrix4x4T< T >::setIdentity |
Definition at line 641 of file Matrix4x4.h.
| Matrix4x4T<T>& agx::Matrix4x4T< T >::setRotate | ( | const EulerAngles & | euler | ) |
| Matrix4x4T< T > & agx::Matrix4x4T< T >::setRotate | ( | const OrthoMatrix3x3 & | m3 | ) |
Definition at line 541 of file Matrix4x4.h.
| Matrix4x4T<T>& agx::Matrix4x4T< T >::setRotate | ( | const QuatT< T > & | q | ) |
Referenced by agx::Matrix4x4T< T >::rotate(), and agx::AffineMatrix4x4T< T >::setRotate().
| Matrix4x4T< T > & agx::Matrix4x4T< T >::setRotate | ( | const Vec3T< T > & | from, |
| const Vec3T< T > & | to | ||
| ) |
Definition at line 560 of file Matrix4x4.h.
References agx::QuatT< T >::setRotate().
| Matrix4x4T< T > & agx::Matrix4x4T< T >::setRotate | ( | T | angle, |
| const Vec3T< T > & | axis | ||
| ) |
Definition at line 569 of file Matrix4x4.h.
References agx::QuatT< T >::setRotate().
| Matrix4x4T< T > & agx::Matrix4x4T< T >::setRotate | ( | T | angle, |
| T | x, | ||
| T | y, | ||
| T | z | ||
| ) |
Definition at line 578 of file Matrix4x4.h.
References agx::QuatT< T >::setRotate().
| Matrix4x4T< T > & agx::Matrix4x4T< T >::setRotate | ( | T | angle1, |
| const Vec3T< T > & | axis1, | ||
| T | angle2, | ||
| const Vec3T< T > & | axis2, | ||
| T | angle3, | ||
| const Vec3T< T > & | axis3 | ||
| ) |
Definition at line 587 of file Matrix4x4.h.
References agx::QuatT< T >::setRotate().
|
inline |
Set the row of the matrix,.
| row | must be between [0..3] |
| vec | - value of the row |
Definition at line 167 of file Matrix4x4.h.
References agx::Matrix4x4T< T >::m_data.
| Matrix4x4T< T > & agx::Matrix4x4T< T >::setTranslate | ( | const Vec3T< T > & | t | ) |
Definition at line 600 of file Matrix4x4.h.
Referenced by agx::Matrix4x4T< T >::translate().
| Matrix4x4T< T > & agx::Matrix4x4T< T >::setTranslate | ( | T | tx, |
| T | ty, | ||
| T | tz | ||
| ) |
Definition at line 610 of file Matrix4x4.h.
| Vec3T< T > agx::Matrix4x4T< T >::transform3x3 | ( | const Vec3T< T > & | vIn | ) | const |
Definition at line 987 of file Matrix4x4.h.
| Vec3T< T > & agx::Matrix4x4T< T >::transform3x3 | ( | const Vec3T< T > & | vIn, |
| Vec3T< T > & | vOut | ||
| ) | const |
Definition at line 967 of file Matrix4x4.h.
References agx::Vec3T< T >::set(), agx::Vec3T< T >::x(), agx::Vec3T< T >::y(), and agx::Vec3T< T >::z().
Referenced by agx::Frame::transformVectorToWorld().
| Vec3T< T > agx::Matrix4x4T< T >::transform3x3Inv | ( | const Vec3T< T > & | vIn | ) | const |
Definition at line 995 of file Matrix4x4.h.
| Vec3T< T > & agx::Matrix4x4T< T >::transform3x3Inv | ( | const Vec3T< T > & | vIn, |
| Vec3T< T > & | vOut | ||
| ) | const |
Definition at line 977 of file Matrix4x4.h.
References agx::Vec3T< T >::set(), agx::Vec3T< T >::x(), agx::Vec3T< T >::y(), and agx::Vec3T< T >::z().
|
inlinestatic |
Definition at line 715 of file Matrix4x4.h.
References agx::Matrix4x4T< T >::setTranslate().
|
inlinestatic |
Definition at line 723 of file Matrix4x4.h.
References agx::Matrix4x4T< T >::setTranslate().
|
inline |
Definition at line 1042 of file Matrix4x4.h.
| bool agx::Matrix4x4T< T >::valid |
Definition at line 413 of file Matrix4x4.h.
References agx::isNaN().
|
protected |
Definition at line 301 of file Matrix4x4.h.
Referenced by agx::Matrix4x4T< T >::getCol(), agx::Matrix4x4T< T >::getRow(), agx::AffineMatrix4x4T< T >::invert(), agx::AffineMatrix4x4T< T >::mult(), agx::Matrix4x4T< T >::mult(), agx::AffineMatrix4x4T< T >::operator!=(), agx::Matrix4x4T< T >::operator!=(), agx::AffineMatrix4x4T< T >::operator==(), agx::Matrix4x4T< T >::operator==(), agx::AffineMatrix4x4T< T >::postMult(), agx::Matrix4x4T< T >::setCol(), and agx::Matrix4x4T< T >::setRow().