|
AGX Dynamics 2.42.3.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 ()=default | |
| Creates a new matrix, initialized to be an identity matrix. | |
| Matrix4x4T (const EulerAngles &rotation, const Vec3T< T > &translation=Vec3T< T >()) | |
| Create a matrix from Euler angles. | |
| Matrix4x4T (const Matrix4x4T< T > &)=default | |
| template<typename T2 , std::enable_if_t< std::is_same< T, T2 >::value==0, bool > = false> | |
| Matrix4x4T (const Matrix4x4T< T2 > &mat) | |
| Copy constructor. | |
| Matrix4x4T (const OrthoMatrix3x3 &rotation, const Vec3T< T > &translation=Vec3T< T >()) | |
| Create a matrix from a 3x3 rotation matrix. | |
| Matrix4x4T (const QuatT< T > &rotation, const Vec3T< T > &translation=Vec3T< T >()) | |
| Create a matrix from a quaternion. | |
| 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. | |
| Matrix4x4T (T const *const ptr) | |
| Create a matrix from a vector of 16 reals. | |
| ~Matrix4x4T ()=default | |
| Destructor. | |
| 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 |
| Return a quaternion of the rotation part of this matrix (real part > 0 by convention) | |
| 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. | |
| 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)=default |
| 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,. | |
| 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. | |
| 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] = {{1,0,0,0}, {0,1,0,0}, {0,0,1,0}, {0,0,0,1}} |
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 57 of file Matrix4x4.h.
| typedef T agx::Matrix4x4T< T >::Type |
Definition at line 60 of file Matrix4x4.h.
|
default |
Creates a new matrix, initialized to be an identity matrix.
|
default |
|
explicit |
Copy constructor.
Definition at line 342 of file Matrix4x4.h.
|
explicit |
Create a matrix from a vector of 16 reals.
Definition at line 395 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 402 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 410 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 367 of file Matrix4x4.h.
|
default |
Destructor.
| Matrix4x4T< T > & agx::Matrix4x4T< T >::addTranslate | ( | const Vec3T< T > & | t | ) |
Definition at line 631 of file Matrix4x4.h.
| Matrix4x4T< T > & agx::Matrix4x4T< T >::addTranslate | ( | T | tx, |
| T | ty, | ||
| T | tz | ||
| ) |
Definition at line 641 of file Matrix4x4.h.
|
inlinestatic |
Generates a new matrix of a specific type.
Definition at line 715 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 678 of file Matrix4x4.h.
| void agx::Matrix4x4T< T >::get | ( | QuatT< T > & | q | ) | const |
Return a quaternion of the rotation part of this matrix (real part > 0 by convention)
|
inline |
Definition at line 199 of file Matrix4x4.h.
References agx::Matrix4x4T< T >::m_data.
| QuatT< T > agx::Matrix4x4T< T >::getRotate |
Definition at line 670 of file Matrix4x4.h.
|
inline |
Definition at line 189 of file Matrix4x4.h.
References agx::Matrix4x4T< T >::m_data.
| Vec3T< T > agx::Matrix4x4T< T >::getTranslate |
Definition at line 663 of file Matrix4x4.h.
Referenced by agx::Frame::getTranslate().
|
inline |
Matrix inverse.
Definition at line 1054 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 445 of file Matrix4x4.h.
| bool agx::Matrix4x4T< T >::isIdentity |
Definition at line 458 of file Matrix4x4.h.
| bool agx::Matrix4x4T< T >::isNaN |
Definition at line 431 of file Matrix4x4.h.
| bool agx::Matrix4x4T< T >::isRigidTransformation |
Definition at line 464 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 781 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 1198 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 1208 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 1118 of file Matrix4x4.h.
References agxAbort1.
|
staticprotected |
Definition at line 1190 of file Matrix4x4.h.
References agxAbort1.
| bool agx::Matrix4x4T< T >::operator!= | ( | const Matrix4x4T< T > & | m | ) | const |
Definition at line 888 of file Matrix4x4.h.
References agx::Matrix4x4T< T >::m_data.
| T & agx::Matrix4x4T< T >::operator() | ( | size_t | row, |
| size_t | col | ||
| ) |
Definition at line 895 of file Matrix4x4.h.
| T agx::Matrix4x4T< T >::operator() | ( | size_t | row, |
| size_t | col | ||
| ) | const |
Definition at line 901 of file Matrix4x4.h.
| Matrix4x4T< T > agx::Matrix4x4T< T >::operator* | ( | const Matrix4x4T< T > & | m | ) | const |
Definition at line 918 of file Matrix4x4.h.
References agx::Matrix4x4T< T >::mult().
| Vec3T< T > agx::Matrix4x4T< T >::operator* | ( | const Vec3T< T > & | v | ) | const |
Definition at line 926 of file Matrix4x4.h.
| Vec4T< T > agx::Matrix4x4T< T >::operator* | ( | const Vec4T< T > & | v | ) | const |
Definition at line 932 of file Matrix4x4.h.
| void agx::Matrix4x4T< T >::operator*= | ( | const Matrix4x4T< T > & | other | ) |
Definition at line 907 of file Matrix4x4.h.
|
default |
| bool agx::Matrix4x4T< T >::operator== | ( | const Matrix4x4T< T > & | m | ) | const |
Definition at line 881 of file Matrix4x4.h.
References agx::Matrix4x4T< T >::m_data.
| void agx::Matrix4x4T< T >::postMult | ( | const Matrix4x4T< T > & | other | ) |
Definition at line 838 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 1005 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 1023 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 868 of file Matrix4x4.h.
| void agx::Matrix4x4T< T >::preMult | ( | const Matrix4x4T< T > & | other | ) |
Definition at line 820 of file Matrix4x4.h.
References AGX_MATRIX4X4_INNER_PRODUCT.
| Vec3T< T > agx::Matrix4x4T< T >::preMult | ( | const Vec3T< T > & | v | ) | const |
Definition at line 1014 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 1033 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 855 of file Matrix4x4.h.
| T * agx::Matrix4x4T< T >::ptr |
Definition at line 695 of file Matrix4x4.h.
Referenced by agx::AffineMatrix4x4T< T >::multSSE(), and agx::Matrix4x4T< T >::multSSE().
| const T * agx::Matrix4x4T< T >::ptr |
Definition at line 701 of file Matrix4x4.h.
|
inlinestatic |
Definition at line 742 of file Matrix4x4.h.
References agx::Matrix4x4T< T >::setRotate().
|
static |
Definition at line 758 of file Matrix4x4.h.
References agx::Matrix4x4T< T >::setRotate().
|
inlinestatic |
Definition at line 750 of file Matrix4x4.h.
References agx::Matrix4x4T< T >::setRotate().
|
static |
Definition at line 766 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 541 of file Matrix4x4.h.
| Matrix4x4T< T > & agx::Matrix4x4T< T >::set | ( | const QuatT< T > & | q | ) |
Definition at line 531 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 502 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 494 of file Matrix4x4.h.
Referenced by agx::AffineMatrix4x4T< T >::set().
|
inline |
Definition at line 182 of file Matrix4x4.h.
References agx::Matrix4x4T< T >::m_data.
| Matrix4x4T< T > & agx::Matrix4x4T< T >::setIdentity |
Definition at line 652 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 552 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 571 of file Matrix4x4.h.
References agx::QuatT< T >::setRotate().
| Matrix4x4T< T > & agx::Matrix4x4T< T >::setRotate | ( | T | angle, |
| const Vec3T< T > & | axis | ||
| ) |
Definition at line 580 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 589 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 598 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 175 of file Matrix4x4.h.
References agx::Matrix4x4T< T >::m_data.
| Matrix4x4T< T > & agx::Matrix4x4T< T >::setTranslate | ( | const Vec3T< T > & | t | ) |
Definition at line 611 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 621 of file Matrix4x4.h.
| Vec3T< T > agx::Matrix4x4T< T >::transform3x3 | ( | const Vec3T< T > & | vIn | ) | const |
Definition at line 989 of file Matrix4x4.h.
| Vec3T< T > & agx::Matrix4x4T< T >::transform3x3 | ( | const Vec3T< T > & | vIn, |
| Vec3T< T > & | vOut | ||
| ) | const |
Definition at line 969 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 997 of file Matrix4x4.h.
| Vec3T< T > & agx::Matrix4x4T< T >::transform3x3Inv | ( | const Vec3T< T > & | vIn, |
| Vec3T< T > & | vOut | ||
| ) | const |
Definition at line 979 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 726 of file Matrix4x4.h.
References agx::Matrix4x4T< T >::setTranslate().
|
inlinestatic |
Definition at line 734 of file Matrix4x4.h.
References agx::Matrix4x4T< T >::setTranslate().
|
inline |
Definition at line 1044 of file Matrix4x4.h.
| bool agx::Matrix4x4T< T >::valid |
Definition at line 424 of file Matrix4x4.h.
References agx::isNaN().
|
protected |
Definition at line 310 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().