AGX Dynamics 2.42.3.0
Loading...
Searching...
No Matches
agx::Matrix3x3T< T > Class Template Reference

#include <Matrix3x3.h>

Public Types

typedef T Type
 

Public Member Functions

 Matrix3x3T ()
 Default constructor, provides an identity matrix.
 
template<typename T2 >
 Matrix3x3T (const AffineMatrix4x4T< T2 > &m)
 Init from the top left 3x3 part of an 4x4 matrix.
 
 Matrix3x3T (const EulerAngles &e)
 Init from EulerAngles.
 
 Matrix3x3T (const Matrix3x3T< T > &mat)=default
 Copy constructor is default.
 
 Matrix3x3T (const Quat &q)
 Init from a quaternion.
 
 Matrix3x3T (const SPDMatrix3x3 &m)
 Init from a SPDMatrix3x3.
 
 Matrix3x3T (const Vec3T< T > &v)
 Construct a Matrix34Init with a specified diagonal.
 
 Matrix3x3T (T a00, T a01, T a02, T a10, T a11, T a12, T a20, T a21, T a22)
 Explicitly set all values.
 
 Matrix3x3T (T const *const ptr)
 Init from 12 values in row major order.
 
void add (const Matrix3x3T< T > &a, const Matrix3x3T< T > &b)
 Set the value of this matrix to the result of the sum between the matrix m and the matrix b.
 
T determinant () const
 Calculate the determinant.
 
T dotColumn (const Vec3T< T > &vec, size_t col) const
 
Vec3T< T > getDiagonal () const
 Get the diagonal elements.
 
Matrix3x3T< T > inverse () const
 Calculate the inverse.
 
bool isDiagonal () const
 Test if matrix is diagonal.
 
bool isIdentity () const
 
bool isNaN () const
 
bool isValid () const
 State queries.
 
void makeIdentity ()
 Set all values.
 
void mult (const Matrix3x3T< T > &lhs, const Matrix3x3T< T > &rhs)
 Set the value of this matrix to the result of the multiplication between the matrix lhs m and the matrix rhs.
 
void mult (const Matrix3x3T< T > &m, const T &r)
 Set the value of this matrix to the result of the product between the matrix m and the scalar r.
 
 operator AffineMatrix4x4T< T > () const
 Cast operator.
 
bool operator!= (const Matrix3x3T< T > &m) const
 
T & operator() (size_t row, size_t col)
 Element accessors.
 
T operator() (size_t row, size_t col) const
 
Matrix3x3T< T > operator* (const Matrix3x3T< T > &m) const
 
Matrix3x3T< T > operator* (const T &r) const
 
Vec3T< T > operator* (const Vec3T< T > &v) const
 
void operator*= (const T &r)
 Set the value of the matrix to the result of the product between this matrix and the scalar r.
 
Matrix3x3T< T > operator+ (const Matrix3x3T< T > &m) const
 
void operator+= (const Matrix3x3T< T > &m)
 Set the value of the matrix to the result of the sum between this matrix and the matrix m.
 
Matrix3x3T< T > operator- (const Matrix3x3T< T > &m) const
 
void operator-= (const Matrix3x3T< T > &m)
 Set the value of the matrix to the result of the subtraction between this matrix and the matrix m.
 
Matrix3x3T< T > operator/ (const T &r) const
 
void operator/= (const T &d)
 Set the value of the matrix to the quotient of the division between this matrix and the divisor r.
 
Matrix3x3T< T > & operator= (const Matrix3x3T< T > &rhs)=default
 
bool operator== (const Matrix3x3T< T > &m) const
 Equality test (no threshold, must be exact same bits).
 
void postMult (const Matrix3x3T< T > &m)
 Set the value of this matrix to the result of the product this * m.
 
Vec3T< T > postMult (const Vec3T< T > &v) const
 
void preMult (const Matrix3x3T< T > &m)
 Set the value of this matrix to the result of the product m * this.
 
Vec3T< T > preMult (const Vec3T< T > &v) const
 
T * ptr ()
 Access internal buffer.
 
const T * ptr () const
 
void set (const EulerAngles &e)
 Set the rotation from a specified EulerAngles.
 
void set (const Quat &q)
 Set the rotation from a specified quaternion.
 
void set (const Vec3T< T > &diagonal)
 Set the diagonal values of the Matrix and the rest of the elements to zero.
 
void set (T a00, T a01, T a02, T a10, T a11, T a12, T a20, T a21, T a22)
 Set all elements of the matrix.
 
void set (T const *const ptr)
 
void sub (const Matrix3x3T< T > &a, const Matrix3x3T< T > &b)
 Set the value of this matrix to the result of the subtraction between the matrix m and the matrix b.
 
Matrix3x3T< T > transpose () const
 Calculate the transpose.
 

Static Public Member Functions

static Matrix3x3T< T > crossMatrix (const Vec3T< T > &v)
 Create a cross product matrix.
 

Protected Attributes

T m_data [3][4]
 

Detailed Description

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

Definition at line 32 of file Matrix3x3.h.

Member Typedef Documentation

◆ Type

template<typename T >
typedef T agx::Matrix3x3T< T >::Type

Definition at line 35 of file Matrix3x3.h.

Constructor & Destructor Documentation

◆ Matrix3x3T() [1/9]

template<typename T >
agx::Matrix3x3T< T >::Matrix3x3T

Default constructor, provides an identity matrix.

Definition at line 314 of file Matrix3x3.h.

◆ Matrix3x3T() [2/9]

template<typename T >
agx::Matrix3x3T< T >::Matrix3x3T ( const Matrix3x3T< T > &  mat)
default

Copy constructor is default.

◆ Matrix3x3T() [3/9]

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

Init from 12 values in row major order.

Each row includes a forth element as padding.

Definition at line 320 of file Matrix3x3.h.

◆ Matrix3x3T() [4/9]

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

Init from the top left 3x3 part of an 4x4 matrix.

Definition at line 326 of file Matrix3x3.h.

◆ Matrix3x3T() [5/9]

template<typename T >
agx::Matrix3x3T< T >::Matrix3x3T ( const Quat &  q)
explicit

Init from a quaternion.

Definition at line 345 of file Matrix3x3.h.

◆ Matrix3x3T() [6/9]

template<typename T >
agx::Matrix3x3T< T >::Matrix3x3T ( const EulerAngles &  e)
explicit

Init from EulerAngles.

Definition at line 351 of file Matrix3x3.h.

◆ Matrix3x3T() [7/9]

template<typename T >
agx::Matrix3x3T< T >::Matrix3x3T ( const SPDMatrix3x3 &  m)
explicit

Init from a SPDMatrix3x3.

◆ Matrix3x3T() [8/9]

template<typename T >
agx::Matrix3x3T< T >::Matrix3x3T ( T  a00,
T  a01,
T  a02,
T  a10,
T  a11,
T  a12,
T  a20,
T  a21,
T  a22 
)

Explicitly set all values.

Definition at line 358 of file Matrix3x3.h.

◆ Matrix3x3T() [9/9]

template<typename T >
agx::Matrix3x3T< T >::Matrix3x3T ( const Vec3T< T > &  v)
explicit

Construct a Matrix34Init with a specified diagonal.

Effectively specifying a scaling matrix.

Definition at line 377 of file Matrix3x3.h.

Member Function Documentation

◆ add()

template<typename T >
void agx::Matrix3x3T< T >::add ( const Matrix3x3T< T > &  a,
const Matrix3x3T< T > &  b 
)

Set the value of this matrix to the result of the sum between the matrix m and the matrix b.

Definition at line 577 of file Matrix3x3.h.

Referenced by agx::Matrix3x3T< T >::operator+().

◆ crossMatrix()

template<typename T >
Matrix3x3T< T > agx::Matrix3x3T< T >::crossMatrix ( const Vec3T< T > &  v)
static

Create a cross product matrix.

Definition at line 530 of file Matrix3x3.h.

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

◆ determinant()

template<typename T >
T agx::Matrix3x3T< T >::determinant

Calculate the determinant.

Definition at line 538 of file Matrix3x3.h.

◆ dotColumn()

template<typename T >
T agx::Matrix3x3T< T >::dotColumn ( const Vec3T< T > &  vec,
size_t  col 
) const
inline
Returns
a scalar which is the result from the dot product between vec and the col :th column of this matrix

Definition at line 770 of file Matrix3x3.h.

References agxAssert.

◆ getDiagonal()

template<typename T >
Vec3T< T > agx::Matrix3x3T< T >::getDiagonal

Get the diagonal elements.

Definition at line 524 of file Matrix3x3.h.

◆ inverse()

template<typename T >
Matrix3x3T< T > agx::Matrix3x3T< T >::inverse

Calculate the inverse.

Definition at line 834 of file Matrix3x3.h.

References agx::RealEpsilon.

◆ isDiagonal()

template<typename T >
bool agx::Matrix3x3T< T >::isDiagonal

Test if matrix is diagonal.

Definition at line 546 of file Matrix3x3.h.

◆ isIdentity()

template<typename T >
bool agx::Matrix3x3T< T >::isIdentity

Definition at line 453 of file Matrix3x3.h.

◆ isNaN()

template<typename T >
bool agx::Matrix3x3T< T >::isNaN

Definition at line 445 of file Matrix3x3.h.

◆ isValid()

template<typename T >
bool agx::Matrix3x3T< T >::isValid

State queries.

Definition at line 439 of file Matrix3x3.h.

References agx::isNaN().

◆ makeIdentity()

template<typename T >
void agx::Matrix3x3T< T >::makeIdentity

Set all values.

Definition at line 459 of file Matrix3x3.h.

References SET_ROW.

◆ mult() [1/2]

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

Set the value of this matrix to the result of the multiplication between the matrix lhs m and the matrix rhs.

Definition at line 745 of file Matrix3x3.h.

References INNER_PRODUCT.

◆ mult() [2/2]

template<typename T >
void agx::Matrix3x3T< T >::mult ( const Matrix3x3T< T > &  m,
const T &  r 
)

Set the value of this matrix to the result of the product between the matrix m and the scalar r.

Definition at line 563 of file Matrix3x3.h.

Referenced by agx::Matrix3x3T< T >::operator*(), agx::operator*(), and agx::Matrix3x3T< T >::operator/().

◆ operator AffineMatrix4x4T< T >()

template<typename T >
agx::Matrix3x3T< T >::operator AffineMatrix4x4T< T >
inline

Cast operator.

Definition at line 394 of file Matrix3x3.h.

◆ operator!=()

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

Definition at line 420 of file Matrix3x3.h.

◆ operator()() [1/2]

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

Element accessors.

Definition at line 426 of file Matrix3x3.h.

◆ operator()() [2/2]

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

Definition at line 432 of file Matrix3x3.h.

◆ operator*() [1/3]

template<typename T >
Matrix3x3T< T > agx::Matrix3x3T< T >::operator* ( const Matrix3x3T< T > &  m) const
Returns
the result from the multiplication this *
Parameters
m

Definition at line 777 of file Matrix3x3.h.

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

◆ operator*() [2/3]

template<typename T >
Matrix3x3T< T > agx::Matrix3x3T< T >::operator* ( const T &  r) const
Returns
the product result from the multiplication between this matrix and the scalar r

Definition at line 630 of file Matrix3x3.h.

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

◆ operator*() [3/3]

template<typename T >
Vec3T< T > agx::Matrix3x3T< T >::operator* ( const Vec3T< T > &  v) const
Returns
the post multiplication product between this matrix and the vector v

Definition at line 791 of file Matrix3x3.h.

◆ operator*=()

template<typename T >
void agx::Matrix3x3T< T >::operator*= ( const T &  r)

Set the value of the matrix to the result of the product between this matrix and the scalar r.

Definition at line 606 of file Matrix3x3.h.

References agx::mult().

◆ operator+()

template<typename T >
Matrix3x3T< T > agx::Matrix3x3T< T >::operator+ ( const Matrix3x3T< T > &  m) const
Returns
the result of the addition between this matrix and the matrix m

Definition at line 646 of file Matrix3x3.h.

References agx::Matrix3x3T< T >::add().

◆ operator+=()

template<typename T >
void agx::Matrix3x3T< T >::operator+= ( const Matrix3x3T< T > &  m)

Set the value of the matrix to the result of the sum between this matrix and the matrix m.

Definition at line 618 of file Matrix3x3.h.

◆ operator-()

template<typename T >
Matrix3x3T< T > agx::Matrix3x3T< T >::operator- ( const Matrix3x3T< T > &  m) const
Returns
the result of the subtraction between this matrix and the matrix m

Definition at line 654 of file Matrix3x3.h.

References agx::Matrix3x3T< T >::sub().

◆ operator-=()

template<typename T >
void agx::Matrix3x3T< T >::operator-= ( const Matrix3x3T< T > &  m)

Set the value of the matrix to the result of the subtraction between this matrix and the matrix m.

Definition at line 624 of file Matrix3x3.h.

◆ operator/()

template<typename T >
Matrix3x3T< T > agx::Matrix3x3T< T >::operator/ ( const T &  r) const
Returns
the quotient of the division between this matrix and the divisor r

Definition at line 638 of file Matrix3x3.h.

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

◆ operator/=()

template<typename T >
void agx::Matrix3x3T< T >::operator/= ( const T &  d)

Set the value of the matrix to the quotient of the division between this matrix and the divisor r.

Definition at line 612 of file Matrix3x3.h.

References agx::mult().

◆ operator=()

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

◆ operator==()

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

Equality test (no threshold, must be exact same bits).

Definition at line 406 of file Matrix3x3.h.

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

◆ postMult() [1/2]

template<typename T >
void agx::Matrix3x3T< T >::postMult ( const Matrix3x3T< T > &  m)

Set the value of this matrix to the result of the product this * m.

Definition at line 711 of file Matrix3x3.h.

References INNER_PRODUCT.

◆ postMult() [2/2]

template<typename T >
Vec3T< T > agx::Matrix3x3T< T >::postMult ( const Vec3T< T > &  v) const
Returns
the result of the product of the vector v and this matrix as M * v

Definition at line 662 of file Matrix3x3.h.

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

◆ preMult() [1/2]

template<typename T >
void agx::Matrix3x3T< T >::preMult ( const Matrix3x3T< T > &  m)

Set the value of this matrix to the result of the product m * this.

Definition at line 678 of file Matrix3x3.h.

References INNER_PRODUCT.

◆ preMult() [2/2]

template<typename T >
Vec3T< T > agx::Matrix3x3T< T >::preMult ( const Vec3T< T > &  v) const
Returns
the result of the product of the vector v and this matrix as v * M

Definition at line 670 of file Matrix3x3.h.

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

Referenced by agx::operator*().

◆ ptr() [1/2]

template<typename T >
T * agx::Matrix3x3T< T >::ptr

Access internal buffer.

Definition at line 512 of file Matrix3x3.h.

Referenced by agx::mult().

◆ ptr() [2/2]

template<typename T >
const T * agx::Matrix3x3T< T >::ptr

Definition at line 518 of file Matrix3x3.h.

◆ set() [1/5]

template<typename T >
void agx::Matrix3x3T< T >::set ( const EulerAngles &  e)

Set the rotation from a specified EulerAngles.

Parameters
e- Set the matrix from the EulerAngles definition

◆ set() [2/5]

template<typename T >
void agx::Matrix3x3T< T >::set ( const Quat &  q)

Set the rotation from a specified quaternion.

Parameters
q- Set the matrix from the quaternion definition

◆ set() [3/5]

template<typename T >
void agx::Matrix3x3T< T >::set ( const Vec3T< T > &  diagonal)

Set the diagonal values of the Matrix and the rest of the elements to zero.

Parameters
diagonal- The diagonal value of the matrix

Definition at line 498 of file Matrix3x3.h.

◆ set() [4/5]

template<typename T >
void agx::Matrix3x3T< T >::set ( T  a00,
T  a01,
T  a02,
T  a10,
T  a11,
T  a12,
T  a20,
T  a21,
T  a22 
)

Set all elements of the matrix.

Definition at line 482 of file Matrix3x3.h.

◆ set() [5/5]

template<typename T >
void agx::Matrix3x3T< T >::set ( T const *const  ptr)

Definition at line 467 of file Matrix3x3.h.

Referenced by agx::VirtualConstraintInertia::Transformed::reset().

◆ sub()

template<typename T >
void agx::Matrix3x3T< T >::sub ( const Matrix3x3T< T > &  a,
const Matrix3x3T< T > &  b 
)

Set the value of this matrix to the result of the subtraction between the matrix m and the matrix b.

Definition at line 591 of file Matrix3x3.h.

Referenced by agx::Matrix3x3T< T >::operator-().

◆ transpose()

template<typename T >
Matrix3x3T< T > agx::Matrix3x3T< T >::transpose

Calculate the transpose.

Definition at line 555 of file Matrix3x3.h.

Member Data Documentation

◆ m_data

template<typename T >
T agx::Matrix3x3T< T >::m_data[3][4]
protected

Definition at line 283 of file Matrix3x3.h.

Referenced by agx::Matrix3x3T< T >::operator==().


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