AGXDynamics  2.31.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
agx::AffineMatrix4x4T< T > Class Template Reference

Matrix class for rigid transformations (translation, rotation). More...

#include <AffineMatrix4x4.h>

+ Inheritance diagram for agx::AffineMatrix4x4T< T >:

Public Types

typedef T Type
 

Public Member Functions

 AffineMatrix4x4T ()
 Creates a new matrix, initialized to be an identity matrix. More...
 
template<typename T2 >
 AffineMatrix4x4T (const AffineMatrix4x4T< T2 > &mat)
 Copy constructor. More...
 
 AffineMatrix4x4T (T const *const ptr)
 Create a matrix from a vector of 16 reals. More...
 
 AffineMatrix4x4T (const QuatT< T > &rotation, const Vec3T< T > &translation=Vec3T< T >())
 Create a matrix from a quaternion. More...
 
 AffineMatrix4x4T (const EulerAngles &rotation, const Vec3T< T > &translation=Vec3T< T >())
 Create a matrix from Euler angles. More...
 
 AffineMatrix4x4T (const OrthoMatrix3x3 &rotation, const Vec3T< T > &translation=Vec3T< T >())
 Create a matrix from a 3x3 rotation matrix. More...
 
 AffineMatrix4x4T (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...
 
 ~AffineMatrix4x4T ()=default
 Destructor. More...
 
Matrix4x4T< T > & addTranslate (const Vec3T< T > &t)
 
Matrix4x4T< T > & addTranslate (T tx, T ty, T tz)
 
Real at (size_t i, size_t j) const
 
void get (QuatT< T > &q) const
 
void get (OrthoMatrix3x3 &m3) const
 
void get (EulerAngles &e) const
 
agx::Vec4T< T > getCol (size_t col) const
 
Vec3T< T > getInvTranslate () const
 
QuatT< T > getRotate () const
 
agx::Vec4T< T > getRow (size_t row) const
 
Vec3T< T > getTranslate () const
 
AffineMatrix4x4T< T > inverse () const
 Quick inverse, transpose rotation part, and change sign of translation part. More...
 
bool isFinite () const
 
bool isIdentity () const
 
bool isNaN () const
 
bool isRigidTransformation () const
 
void mult (const Matrix4x4T< T > &, const Matrix4x4T< T > &)
 
void mult (const AffineMatrix4x4T< T > &, const AffineMatrix4x4T< T > &)
 
void multSSE (const Matrix4x4T< T > &lhs, const Matrix4x4T< T > &rhs)
 
void multSSE (const AffineMatrix4x4T< T > &lhs, const AffineMatrix4x4T< T > &rhs)
 
template<>
void multSSE (const AffineMatrix4x4T< Real32 > &lhs, const AffineMatrix4x4T< Real32 > &rhs)
 
template<>
void multSSE (const AffineMatrix4x4T< Real64 > &lhs, const AffineMatrix4x4T< Real64 > &rhs)
 
template<>
void multSSE (const Matrix4x4T< Real32 > &lhs, const Matrix4x4T< Real32 > &rhs)
 
template<>
void multSSE (const Matrix4x4T< Real64 > &lhs, const Matrix4x4T< Real64 > &rhs)
 
bool operator!= (const Matrix4x4T< T > &m) const
 
bool operator!= (const AffineMatrix4x4T< T > &m) const
 
T & operator() (size_t row, size_t col)
 
T operator() (size_t row, size_t col) const
 
AffineMatrix4x4T< T > operator* (const AffineMatrix4x4T< T > &m) 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)
 
void operator*= (const AffineMatrix4x4T< T > &other)
 
AffineMatrix4x4T< T > & operator= (const AffineMatrix4x4T< T > &rhs)
 
bool operator== (const Matrix4x4T< T > &m) const
 
bool operator== (const AffineMatrix4x4T< T > &m) const
 
Vec3T< T > postMult (const Vec3T< T > &v) const
 
Vec4T< T > postMult (const Vec4T< T > &v) const
 
void postMult (const Matrix4x4T< T > &)
 
void postMult (const AffineMatrix4x4T< T > &)
 
AffineMatrix4x4T< T > & postMultTranslate (const Vec3T< T > &v)
 
Vec3T< T > preMult (const Vec3T< T > &v) const
 
Vec4T< T > preMult (const Vec4T< T > &v) const
 
void preMult (const Matrix4x4T< T > &)
 
void preMult (const AffineMatrix4x4T< T > &)
 
AffineMatrix4x4T< T > & preMultTranslate (const Vec3T< T > &v)
 
T * ptr ()
 
const T * ptr () const
 
AffineMatrix4x4T< T > & set (T const *const ptr)
 Set the entire matrix using values from the array with 16 elements using the following order: More...
 
AffineMatrix4x4T< 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)
 Set the entire matrix using values from the 16 elements using the following order: More...
 
AffineMatrix4x4T< T > & set (const QuatT< T > &q)
 Set the rotational part of the matrix using the specified quaternion and the translational part to 0,0,0. More...
 
AffineMatrix4x4T< T > & set (const OrthoMatrix3x3 &m3)
 Set the rotational part of the matrix using the specified rotation matrix and the translational part to 0,0,0. More...
 
AffineMatrix4x4T< T > & set (const EulerAngles &euler)
 Set the rotational part of the matrix using the specified euler angles and the translational part to 0,0,0. More...
 
void set (Real val, size_t i, size_t j)
 Set the value of element i,j. More...
 
void setCol (size_t col, const agx::Vec4T< T > &vec)
 
AffineMatrix4x4T< T > & setIdentity ()
 Set the value of the matrix to the identity matrix. More...
 
AffineMatrix4x4T< T > & setRotate (const QuatT< T > &q)
 Set the rotational part of the matrix using the specified quaternion leaving the translational part untouched. More...
 
AffineMatrix4x4T< T > & setRotate (const OrthoMatrix3x3 &m3)
 Set the rotational part of the matrix using the specified rotation matrix leaving the translational part untouched. More...
 
AffineMatrix4x4T< T > & setRotate (const EulerAngles &euler)
 Set the rotational part of the matrix using the specified euler angles leaving the translational part untouched. More...
 
AffineMatrix4x4T< T > & setRotate (const Vec3T< T > &from, const Vec3T< T > &to)
 Set the rotational part of the matrix using the specified two vectors. More...
 
AffineMatrix4x4T< T > & setRotate (T angle, const Vec3T< T > &axis)
 Set the rotational part of a matrix which rotate angle radians around vector axis. More...
 
AffineMatrix4x4T< T > & setRotate (T angle, T x, T y, T z)
 Set the rotational part of a matrix which rotate angle radians around vector x y z. More...
 
AffineMatrix4x4T< T > & setRotate (T angle1, const Vec3T< T > &axis1, T angle2, const Vec3T< T > &axis2, T angle3, const Vec3T< T > &axis3)
 Set the rotational part of a matrix which rotate angle1 radians around vector axis1 and angle2 radians around vector axis2 angle3 radians around vector axis3. More...
 
void setRow (size_t row, const agx::Vec4T< T > &vec)
 Set the row of the matrix,. More...
 
AffineMatrix4x4T< T > & setTranslate (const Vec3T< T > &t)
 Set the translational part of the matrix using the vector t. More...
 
AffineMatrix4x4T< T > & setTranslate (T tx, T ty, T tz)
 Set the translational part of the matrix using the vector x, y, z. More...
 
Vec3T< T > & transform3x3 (const Vec3T< T > &vIn, Vec3T< T > &vOut) const
 
Vec3T< T > transform3x3 (const Vec3T< T > &vIn) const
 
Vec3T< T > & transform3x3Inv (const Vec3T< T > &vIn, Vec3T< T > &vOut) const
 
Vec3T< T > transform3x3Inv (const Vec3T< T > &vIn) const
 
agx::Vec3T< T > transformPoint (const agx::Vec3T< T > &point) const
 Transforms a (mathematical) point, using both rotation and translation. More...
 
agx::Vec3T< T > transformVector (const agx::Vec3T< T > &vector) const
 Transforms a (mathematical) vector, using only rotation. More...
 
Matrix4x4T< T > transpose () const
 
bool valid () const
 

Static Public Member Functions

static AffineMatrix4x4T< T > crossMatrix (const Vec3T< T > &vec)
 Generates a new matrix of a specific type. More...
 
static AffineMatrix4x4T< T > rotate (const Vec3T< T > &from, const Vec3T< T > &to)
 Return a matrix which rotate a vector from from to to. More...
 
static AffineMatrix4x4T< T > rotate (T angle, T x, T y, T z)
 Return a matrix which rotate angle radians around vector [x,y,z]. More...
 
static AffineMatrix4x4T< T > rotate (T angle, const Vec3T< T > &axis)
 Return a matrix which rotate angle radians around vector axis. More...
 
static AffineMatrix4x4T< T > rotate (T angle1, const Vec3T< T > &axis1, T angle2, const Vec3T< T > &axis2, T angle3, const Vec3T< T > &axis3)
 Return a matrix which rotate angle1 radians around vector axis1 and angle2 radians around vector axis2 angle3 radians around vector axis3. More...
 
static AffineMatrix4x4T< T > rotate (const EulerAngles &euler)
 
static AffineMatrix4x4T< T > translate (const Vec3T< T > &dv)
 Return a matrix which translates according to dv. More...
 
static AffineMatrix4x4T< T > translate (T x, T y, T z)
 Return a matrix which translates according to vector [x,y,z]. More...
 

Protected Member Functions

bool invert (const Matrix4x4T< T > &mat)
 
bool invert (const AffineMatrix4x4T< T > &rhs)
 

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]
 

Detailed Description

template<typename T>
class agx::AffineMatrix4x4T< T >

Matrix class for rigid transformations (translation, rotation).

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. The submatrix containing the first three rows and columns contains the rotational part and is assumed to be orthonormal.

Definition at line 52 of file AffineMatrix4x4.h.

Member Typedef Documentation

template<typename T>
typedef T agx::Matrix4x4T< T >::Type
inherited

Definition at line 58 of file Matrix4x4.h.

Constructor & Destructor Documentation

template<typename T >
agx::AffineMatrix4x4T< T >::AffineMatrix4x4T ( )

Creates a new matrix, initialized to be an identity matrix.

Definition at line 406 of file AffineMatrix4x4.h.

template<typename T >
template<typename T2 >
agx::AffineMatrix4x4T< T >::AffineMatrix4x4T ( const AffineMatrix4x4T< T2 > &  mat)
explicit

Copy constructor.

Definition at line 412 of file AffineMatrix4x4.h.

template<typename T>
agx::AffineMatrix4x4T< T >::AffineMatrix4x4T ( T const *const  ptr)
explicit

Create a matrix from a vector of 16 reals.

Definition at line 426 of file AffineMatrix4x4.h.

template<typename T>
agx::AffineMatrix4x4T< T >::AffineMatrix4x4T ( const QuatT< T > &  rotation,
const Vec3T< T > &  translation = Vec3T<T>() 
)
explicit

Create a matrix from a quaternion.

Definition at line 433 of file AffineMatrix4x4.h.

template<typename T>
agx::AffineMatrix4x4T< T >::AffineMatrix4x4T ( const EulerAngles &  rotation,
const Vec3T< T > &  translation = Vec3T<T>() 
)
explicit

Create a matrix from Euler angles.

Definition at line 443 of file AffineMatrix4x4.h.

template<typename T>
agx::AffineMatrix4x4T< T >::AffineMatrix4x4T ( const OrthoMatrix3x3 &  rotation,
const Vec3T< T > &  translation = Vec3T<T>() 
)
explicit

Create a matrix from a 3x3 rotation matrix.

Definition at line 438 of file AffineMatrix4x4.h.

template<typename T>
agx::AffineMatrix4x4T< T >::AffineMatrix4x4T ( 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 417 of file AffineMatrix4x4.h.

References agxAssert, and agx::Matrix4x4T< T >::isRigidTransformation().

template<typename T>
agx::AffineMatrix4x4T< T >::~AffineMatrix4x4T ( )
default

Destructor.

Member Function Documentation

template<typename T >
Matrix4x4T< T > & agx::Matrix4x4T< T >::addTranslate ( const Vec3T< T > &  t)
inherited

Definition at line 620 of file Matrix4x4.h.

template<typename T >
Matrix4x4T< T > & agx::Matrix4x4T< T >::addTranslate ( T  tx,
T  ty,
T  tz 
)
inherited

Definition at line 630 of file Matrix4x4.h.

template<typename T >
Real agx::AffineMatrix4x4T< T >::at ( size_t  i,
size_t  j 
) const
Returns
the element at i,j.

Definition at line 955 of file AffineMatrix4x4.h.

template<typename T>
AffineMatrix4x4T< T > agx::AffineMatrix4x4T< T >::crossMatrix ( const Vec3T< T > &  vec)
inlinestatic

Generates a new matrix of a specific type.

Definition at line 635 of file AffineMatrix4x4.h.

References agx::Vec3T< T >::x(), agx::Vec3T< T >::y(), and agx::Vec3T< T >::z().

template<typename T>
void agx::Matrix4x4T< T >::get ( QuatT< T > &  q) const
inherited
Returns
a quaternion of the rotation part of this matrix (real part > 0 by convention)
template<typename T >
void agx::Matrix4x4T< T >::get ( OrthoMatrix3x3 &  m3) const
inherited

Definition at line 667 of file Matrix4x4.h.

template<typename T>
void agx::Matrix4x4T< T >::get ( EulerAngles &  e) const
inherited
template<typename T>
agx::Vec4T<T> agx::Matrix4x4T< T >::getCol ( size_t  col) const
inlineinherited

Definition at line 191 of file Matrix4x4.h.

References agx::Matrix4x4T< T >::m_data.

template<typename T >
Vec3T< T > agx::AffineMatrix4x4T< T >::getInvTranslate ( ) const
Returns
The inverse translation

Definition at line 463 of file AffineMatrix4x4.h.

template<typename T >
QuatT< T > agx::Matrix4x4T< T >::getRotate ( ) const
inherited

Definition at line 659 of file Matrix4x4.h.

template<typename T>
agx::Vec4T<T> agx::Matrix4x4T< T >::getRow ( size_t  row) const
inlineinherited

Definition at line 181 of file Matrix4x4.h.

References agx::Matrix4x4T< T >::m_data.

template<typename T >
Vec3T< T > agx::Matrix4x4T< T >::getTranslate ( ) const
inherited

Definition at line 652 of file Matrix4x4.h.

Referenced by agxCollide::Sphere::calculateBound(), and agx::Frame::getTranslate().

template<typename T>
bool agx::Matrix4x4T< T >::invert ( const Matrix4x4T< T > &  mat)
protectedinherited
template<typename T>
bool agx::AffineMatrix4x4T< T >::invert ( const AffineMatrix4x4T< T > &  rhs)
protected

Definition at line 867 of file AffineMatrix4x4.h.

References agx::Matrix4x4T< T >::m_data.

Referenced by agx::AffineMatrix4x4T< T >::inverse().

template<typename T >
bool agx::Matrix4x4T< T >::isFinite ( ) const
inherited
Returns
true if all the elements are non-NaN and non-inf

Definition at line 434 of file Matrix4x4.h.

template<typename T >
bool agx::Matrix4x4T< T >::isIdentity ( ) const
inherited
Returns
true if the matrix is identity.

Definition at line 447 of file Matrix4x4.h.

template<typename T >
bool agx::Matrix4x4T< T >::isNaN ( ) const
inherited
Returns
true if the matrix is a valid one.

Definition at line 420 of file Matrix4x4.h.

template<typename T >
bool agx::Matrix4x4T< T >::isRigidTransformation ( ) const
inherited
Returns
true if the matrix is rigid transformation.

Definition at line 453 of file Matrix4x4.h.

References agx::equivalent().

Referenced by agx::AffineMatrix4x4T< T >::AffineMatrix4x4T().

template<typename T >
void agx::Matrix4x4T< T >::mult ( const Matrix4x4T< T > &  lhs,
const Matrix4x4T< T > &  rhs 
)
inherited

Definition at line 770 of file Matrix4x4.h.

References AGX_MATRIX4X4_INNER_PRODUCT.

Referenced by agx::AffineMatrix4x4T< T >::operator*().

template<typename T>
void agx::AffineMatrix4x4T< T >::mult ( const AffineMatrix4x4T< T > &  lhs,
const AffineMatrix4x4T< T > &  rhs 
)
template<typename T>
void agx::Matrix4x4T< T >::multSSE ( const Matrix4x4T< T > &  lhs,
const Matrix4x4T< T > &  rhs 
)
inherited
template<typename T>
void agx::AffineMatrix4x4T< T >::multSSE ( const AffineMatrix4x4T< T > &  lhs,
const AffineMatrix4x4T< T > &  rhs 
)
template<>
void agx::AffineMatrix4x4T< Real32 >::multSSE ( const AffineMatrix4x4T< Real32 > &  lhs,
const AffineMatrix4x4T< Real32 > &  rhs 
)

Definition at line 920 of file AffineMatrix4x4.h.

References agx::mult(), and agx::Matrix4x4T< T >::ptr().

template<>
void agx::AffineMatrix4x4T< Real64 >::multSSE ( const AffineMatrix4x4T< Real64 > &  lhs,
const AffineMatrix4x4T< Real64 > &  rhs 
)

Definition at line 930 of file AffineMatrix4x4.h.

References agx::mult(), and agx::Matrix4x4T< T >::ptr().

template<>
void agx::Matrix4x4T< Real32 >::multSSE ( const Matrix4x4T< Real32 > &  lhs,
const Matrix4x4T< Real32 > &  rhs 
)
inherited

Definition at line 1196 of file Matrix4x4.h.

References agx::mult().

template<>
void agx::Matrix4x4T< Real64 >::multSSE ( const Matrix4x4T< Real64 > &  lhs,
const Matrix4x4T< Real64 > &  rhs 
)
inherited

Definition at line 1206 of file Matrix4x4.h.

References agx::mult().

template<typename T >
void agx::Matrix4x4T< T >::multSSE32Implementation ( Real32 *  out,
const Real32 *  lhs,
const Real32 *  rhs 
)
staticprotectedinherited

Definition at line 1083 of file Matrix4x4.h.

References agxAssert, and agx::isAligned().

template<typename T >
void agx::Matrix4x4T< T >::multSSE64Implementation ( Real64 *  out,
const Real64 *  lhs,
const Real64 *  rhs 
)
staticprotectedinherited

Definition at line 1126 of file Matrix4x4.h.

References agxAssert, and agx::isAligned().

template<typename T >
bool agx::Matrix4x4T< T >::operator!= ( const Matrix4x4T< T > &  m) const
inherited

Definition at line 877 of file Matrix4x4.h.

template<typename T>
bool agx::AffineMatrix4x4T< T >::operator!= ( const AffineMatrix4x4T< T > &  m) const

Definition at line 486 of file AffineMatrix4x4.h.

References agx::Matrix4x4T< T >::m_data.

template<typename T >
T & agx::Matrix4x4T< T >::operator() ( size_t  row,
size_t  col 
)
inherited

Definition at line 884 of file Matrix4x4.h.

template<typename T >
T agx::Matrix4x4T< T >::operator() ( size_t  row,
size_t  col 
) const
inherited

Definition at line 890 of file Matrix4x4.h.

template<typename T>
AffineMatrix4x4T< T > agx::AffineMatrix4x4T< T >::operator* ( const AffineMatrix4x4T< T > &  m) const
inline

Definition at line 812 of file AffineMatrix4x4.h.

References agx::AffineMatrix4x4T< T >::mult().

template<typename T>
Matrix4x4T< T > agx::AffineMatrix4x4T< T >::operator* ( const Matrix4x4T< T > &  m) const
inline

Definition at line 820 of file AffineMatrix4x4.h.

References agx::Matrix4x4T< T >::mult().

template<typename T>
Vec3T< T > agx::AffineMatrix4x4T< T >::operator* ( const Vec3T< T > &  v) const

Definition at line 841 of file AffineMatrix4x4.h.

template<typename T>
Vec4T< T > agx::AffineMatrix4x4T< T >::operator* ( const Vec4T< T > &  v) const

Definition at line 847 of file AffineMatrix4x4.h.

template<typename T >
void agx::Matrix4x4T< T >::operator*= ( const Matrix4x4T< T > &  other)
inherited

Definition at line 905 of file Matrix4x4.h.

template<typename T>
void agx::AffineMatrix4x4T< T >::operator*= ( const AffineMatrix4x4T< T > &  other)

Definition at line 829 of file AffineMatrix4x4.h.

template<typename T>
AffineMatrix4x4T< T > & agx::AffineMatrix4x4T< T >::operator= ( const AffineMatrix4x4T< T > &  rhs)

Definition at line 802 of file AffineMatrix4x4.h.

References agx::Matrix4x4T< T >::ptr().

template<typename T >
bool agx::Matrix4x4T< T >::operator== ( const Matrix4x4T< T > &  m) const
inherited

Definition at line 870 of file Matrix4x4.h.

template<typename T>
bool agx::AffineMatrix4x4T< T >::operator== ( const AffineMatrix4x4T< T > &  m) const

Definition at line 479 of file AffineMatrix4x4.h.

References agx::Matrix4x4T< T >::m_data.

template<typename T >
Vec3T< T > agx::Matrix4x4T< T >::postMult ( const Vec3T< T > &  v) const
inherited

Definition at line 1003 of file Matrix4x4.h.

References agx::Vec3T< T >::x(), agx::Vec3T< T >::y(), and agx::Vec3T< T >::z().

template<typename T >
Vec4T< T > agx::Matrix4x4T< T >::postMult ( const Vec4T< T > &  v) const
inherited
template<typename T >
void agx::Matrix4x4T< T >::postMult ( const Matrix4x4T< T > &  other)
inherited

Definition at line 827 of file Matrix4x4.h.

References AGX_MATRIX4X4_INNER_PRODUCT, and AGX_MATRIX4X4_SET_ROW.

template<typename T>
void agx::AffineMatrix4x4T< T >::postMult ( const AffineMatrix4x4T< T > &  other)
template<typename T>
AffineMatrix4x4T< T > & agx::AffineMatrix4x4T< T >::postMultTranslate ( const Vec3T< T > &  v)

Definition at line 787 of file AffineMatrix4x4.h.

template<typename T >
Vec3T< T > agx::Matrix4x4T< T >::preMult ( const Vec3T< T > &  v) const
inherited

Definition at line 1012 of file Matrix4x4.h.

References agx::Vec3T< T >::x(), agx::Vec3T< T >::y(), and agx::Vec3T< T >::z().

template<typename T >
Vec4T< T > agx::Matrix4x4T< T >::preMult ( const Vec4T< T > &  v) const
inherited
template<typename T >
void agx::Matrix4x4T< T >::preMult ( const Matrix4x4T< T > &  other)
inherited

Definition at line 809 of file Matrix4x4.h.

References AGX_MATRIX4X4_INNER_PRODUCT.

template<typename T>
void agx::AffineMatrix4x4T< T >::preMult ( const AffineMatrix4x4T< T > &  other)
template<typename T>
AffineMatrix4x4T< T > & agx::AffineMatrix4x4T< T >::preMultTranslate ( const Vec3T< T > &  v)

Definition at line 774 of file AffineMatrix4x4.h.

template<typename T >
T * agx::Matrix4x4T< T >::ptr ( )
inherited
template<typename T >
const T * agx::Matrix4x4T< T >::ptr ( ) const
inherited

Definition at line 690 of file Matrix4x4.h.

template<typename T>
AffineMatrix4x4T< T > agx::AffineMatrix4x4T< T >::rotate ( const Vec3T< T > &  from,
const Vec3T< T > &  to 
)
inlinestatic

Return a matrix which rotate a vector from from to to.

Parameters
from- start of rotation
to- end of rotation
Returns
A new matrix with specified rotation

Definition at line 662 of file AffineMatrix4x4.h.

References agx::AffineMatrix4x4T< T >::setRotate().

template<typename T>
AffineMatrix4x4T< T > agx::AffineMatrix4x4T< T >::rotate ( T  angle,
T  x,
T  y,
T  z 
)
inlinestatic

Return a matrix which rotate angle radians around vector [x,y,z].

Parameters
angle- angle in radians
x- x element of vector
y- y element of vector
z- z element of vector
Returns
A new matrix with specified rotation

Definition at line 670 of file AffineMatrix4x4.h.

References agx::AffineMatrix4x4T< T >::setRotate().

template<typename T>
AffineMatrix4x4T< T > agx::AffineMatrix4x4T< T >::rotate ( T  angle,
const Vec3T< T > &  axis 
)
inlinestatic

Return a matrix which rotate angle radians around vector axis.

Parameters
angle- angle in radians
axis- vector
Returns
A new matrix with specified rotation

Definition at line 678 of file AffineMatrix4x4.h.

References agx::AffineMatrix4x4T< T >::setRotate().

template<typename T>
AffineMatrix4x4T< T > agx::AffineMatrix4x4T< T >::rotate ( T  angle1,
const Vec3T< T > &  axis1,
T  angle2,
const Vec3T< T > &  axis2,
T  angle3,
const Vec3T< T > &  axis3 
)
inlinestatic

Return a matrix which rotate angle1 radians around vector axis1 and angle2 radians around vector axis2 angle3 radians around vector axis3.

Parameters
angle1- angle in radians
axis1- vector
angle2- angle in radians
axis2- vector
angle3- angle in radians
axis3- vector
Returns
A new matrix with specified rotation

Definition at line 686 of file AffineMatrix4x4.h.

References agx::AffineMatrix4x4T< T >::setRotate().

template<typename T>
static AffineMatrix4x4T<T> agx::AffineMatrix4x4T< T >::rotate ( const EulerAngles &  euler)
static
template<typename T>
AffineMatrix4x4T< T > & agx::AffineMatrix4x4T< T >::set ( T const *const  ptr)

Set the entire matrix using values from the array with 16 elements using the following order:

m_data[0][0] = ptr[0]; m_data[0][1] = ptr[1]; m_data[0][2] = ptr[2]; m_data[0][3] = ptr[3];

m_data[1][0] = ptr[4];

etc.

Parameters
ptr- pointer to a vector with 16 elements
Returns
reference of the modified matrix with the new values

Definition at line 497 of file AffineMatrix4x4.h.

References agxAssert.

template<typename T>
AffineMatrix4x4T< T > & agx::AffineMatrix4x4T< 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 
)

Set the entire matrix using values from the 16 elements using the following order:

m_data[0][0] = a00; m_data[0][1] = a01; m_data[0][2] = a02; m_data[0][3] = a03;

m_data[1][0] = a04;

etc.

Parameters
a00,a01,a02,a03,a10,a11,a12,a13,a20,a21,a22,a23,a30,a31,a32,a33- Matrix elements
Returns
a reference to the modified matrix with the new values

Definition at line 506 of file AffineMatrix4x4.h.

References agx::Matrix4x4T< T >::set().

template<typename T>
AffineMatrix4x4T< T > & agx::AffineMatrix4x4T< T >::set ( const QuatT< T > &  q)

Set the rotational part of the matrix using the specified quaternion and the translational part to 0,0,0.

Parameters
q- Specified quaternion
Returns
a reference to the modified matrix

Definition at line 517 of file AffineMatrix4x4.h.

template<typename T>
AffineMatrix4x4T< T > & agx::AffineMatrix4x4T< T >::set ( const OrthoMatrix3x3 &  m3)

Set the rotational part of the matrix using the specified rotation matrix and the translational part to 0,0,0.

Parameters
m3- Specified rotation matrix
Returns
a reference to the modified matrix

Definition at line 527 of file AffineMatrix4x4.h.

template<typename T>
AffineMatrix4x4T<T>& agx::AffineMatrix4x4T< T >::set ( const EulerAngles &  euler)

Set the rotational part of the matrix using the specified euler angles and the translational part to 0,0,0.

Parameters
euler- Specified euler angles rotation
Returns
a reference to the modified matrix
template<typename T>
void agx::AffineMatrix4x4T< T >::set ( Real  val,
size_t  i,
size_t  j 
)

Set the value of element i,j.

Definition at line 961 of file AffineMatrix4x4.h.

template<typename T>
void agx::Matrix4x4T< T >::setCol ( size_t  col,
const agx::Vec4T< T > &  vec 
)
inlineinherited

Definition at line 174 of file Matrix4x4.h.

References agx::Matrix4x4T< T >::m_data.

template<typename T >
AffineMatrix4x4T< T > & agx::AffineMatrix4x4T< T >::setIdentity ( )

Set the value of the matrix to the identity matrix.

Returns
a reference to the modified matrix

Definition at line 623 of file AffineMatrix4x4.h.

template<typename T>
AffineMatrix4x4T< T > & agx::AffineMatrix4x4T< T >::setRotate ( const QuatT< T > &  q)

Set the rotational part of the matrix using the specified quaternion leaving the translational part untouched.

Parameters
q- Specified quaternion
Returns
a reference to the modified matrix

Definition at line 536 of file AffineMatrix4x4.h.

References agx::Matrix4x4T< T >::setRotate().

Referenced by agxSDK::getFuturePosition(), and agx::AffineMatrix4x4T< T >::rotate().

template<typename T>
AffineMatrix4x4T< T > & agx::AffineMatrix4x4T< T >::setRotate ( const OrthoMatrix3x3 &  m3)

Set the rotational part of the matrix using the specified rotation matrix leaving the translational part untouched.

Parameters
m3- Specified rotation matrix
Returns
a reference to the modified matrix

Definition at line 544 of file AffineMatrix4x4.h.

template<typename T>
AffineMatrix4x4T<T>& agx::AffineMatrix4x4T< T >::setRotate ( const EulerAngles &  euler)

Set the rotational part of the matrix using the specified euler angles leaving the translational part untouched.

Parameters
euler- Specified euler angles rotation
Returns
a reference to the modified matrix
template<typename T>
AffineMatrix4x4T< T > & agx::AffineMatrix4x4T< T >::setRotate ( const Vec3T< T > &  from,
const Vec3T< T > &  to 
)

Set the rotational part of the matrix using the specified two vectors.

The resulting rotation will be a rotation matrix which rotates a vector from from to to leaving the translational part untouched.

Parameters
from- start of rotation
to- end of rotation
Returns
a reference to the modified matrix

Definition at line 562 of file AffineMatrix4x4.h.

References agx::QuatT< T >::setRotate().

template<typename T>
AffineMatrix4x4T< T > & agx::AffineMatrix4x4T< T >::setRotate ( T  angle,
const Vec3T< T > &  axis 
)

Set the rotational part of a matrix which rotate angle radians around vector axis.

Parameters
angle- angle in radians
axis- vector
Returns
A reference to the modified matrix

Definition at line 571 of file AffineMatrix4x4.h.

References agx::QuatT< T >::setRotate().

template<typename T>
AffineMatrix4x4T< T > & agx::AffineMatrix4x4T< T >::setRotate ( T  angle,
T  x,
T  y,
T  z 
)

Set the rotational part of a matrix which rotate angle radians around vector x y z.

Parameters
angle- angle in radians
x,y,z- vector
Returns
A reference to the modified matrix

Definition at line 580 of file AffineMatrix4x4.h.

References agx::QuatT< T >::setRotate().

template<typename T>
AffineMatrix4x4T< T > & agx::AffineMatrix4x4T< T >::setRotate ( T  angle1,
const Vec3T< T > &  axis1,
T  angle2,
const Vec3T< T > &  axis2,
T  angle3,
const Vec3T< T > &  axis3 
)

Set the rotational part of a matrix which rotate angle1 radians around vector axis1 and angle2 radians around vector axis2 angle3 radians around vector axis3.

Parameters
angle1- angle in radians
axis1- vector
angle2- angle in radians
axis2- vector
angle3- angle in radians
axis3- vector
Returns
A reference to the modified matrix

Definition at line 589 of file AffineMatrix4x4.h.

References agx::QuatT< T >::setRotate().

template<typename T>
void agx::Matrix4x4T< T >::setRow ( size_t  row,
const agx::Vec4T< T > &  vec 
)
inlineinherited

Set the row of the matrix,.

Parameters
rowmust be between [0..3]
vec- value of the row

Definition at line 167 of file Matrix4x4.h.

References agx::Matrix4x4T< T >::m_data.

template<typename T>
AffineMatrix4x4T< T > & agx::AffineMatrix4x4T< T >::setTranslate ( const Vec3T< T > &  t)

Set the translational part of the matrix using the vector t.

Parameters
t- translation vector
Returns
A reference to the modified matrix

Definition at line 602 of file AffineMatrix4x4.h.

Referenced by agxSDK::getFuturePosition(), agx::Frame::transformVectorToLocal(), and agx::AffineMatrix4x4T< T >::translate().

template<typename T>
AffineMatrix4x4T< T > & agx::AffineMatrix4x4T< T >::setTranslate ( T  tx,
T  ty,
T  tz 
)

Set the translational part of the matrix using the vector x, y, z.

Parameters
tx,ty,tz- translation vector
Returns
A reference to the modified matrix

Definition at line 612 of file AffineMatrix4x4.h.

template<typename T >
Vec3T< T > & agx::Matrix4x4T< T >::transform3x3 ( const Vec3T< T > &  vIn,
Vec3T< T > &  vOut 
) const
inherited
template<typename T >
Vec3T< T > agx::Matrix4x4T< T >::transform3x3 ( const Vec3T< T > &  vIn) const
inherited

Definition at line 987 of file Matrix4x4.h.

template<typename T >
Vec3T< T > & agx::Matrix4x4T< T >::transform3x3Inv ( const Vec3T< T > &  vIn,
Vec3T< T > &  vOut 
) const
inherited
template<typename T >
Vec3T< T > agx::Matrix4x4T< T >::transform3x3Inv ( const Vec3T< T > &  vIn) const
inherited

Definition at line 995 of file Matrix4x4.h.

template<typename T>
agx::Vec3T< T > agx::AffineMatrix4x4T< T >::transformPoint ( const agx::Vec3T< T > &  point) const

Transforms a (mathematical) point, using both rotation and translation.

Definition at line 968 of file AffineMatrix4x4.h.

template<typename T>
agx::Vec3T< T > agx::AffineMatrix4x4T< T >::transformVector ( const agx::Vec3T< T > &  vector) const

Transforms a (mathematical) vector, using only rotation.

Definition at line 974 of file AffineMatrix4x4.h.

template<typename T>
AffineMatrix4x4T< T > agx::AffineMatrix4x4T< T >::translate ( const Vec3T< T > &  dv)
inlinestatic

Return a matrix which translates according to dv.

Parameters
dv- translation vector
Returns
A new matrix with specified translation

Definition at line 646 of file AffineMatrix4x4.h.

References agx::AffineMatrix4x4T< T >::setTranslate().

template<typename T>
AffineMatrix4x4T< T > agx::AffineMatrix4x4T< T >::translate ( T  x,
T  y,
T  z 
)
inlinestatic

Return a matrix which translates according to vector [x,y,z].

Parameters
x- x element of vector
y- y element of vector
z- z element of vector
Returns
A new matrix with specified translation

Definition at line 654 of file AffineMatrix4x4.h.

References agx::AffineMatrix4x4T< T >::setTranslate().

template<typename T >
Matrix4x4T< T > agx::Matrix4x4T< T >::transpose ( ) const
inlineinherited
Returns
the transpose

Definition at line 1042 of file Matrix4x4.h.

template<typename T >
bool agx::Matrix4x4T< T >::valid ( ) const
inherited
Returns
true if the matrix is a valid one.

Definition at line 413 of file Matrix4x4.h.

References agx::isNaN().

Member Data Documentation


The documentation for this class was generated from the following file: