Momentum Scripting v1
Loading...
Searching...
No Matches
MOMENTUM_NAMESPACE::Matrix3x3 Class Reference

#include <Matrix3x3.h>

Public Member Functions

 Matrix3x3 ()
 
 Matrix3x3 (agx::Matrix3x3 mat)
 
 Matrix3x3 (const Matrix3x3 &mat)
 
 Matrix3x3 (const Quat &rotation)
 
 Matrix3x3 (double a00, double a01, double a02, double a10, double a11, double a12, double a20, double a21, double a22)
 
 Matrix3x3 (double const *const ptr)
 
 ~Matrix3x3 ()
 
double at (size_t row, size_t col) const
 
Quat getAsQuat () const
 
Vec3 getCol (size_t col) const
 
Quat getRotate () const
 
Vec3 getRow (size_t row) const
 
Matrix3x3 inverse () const
 
bool isFinite () const
 
bool isIdentity () const
 
bool isNaN () const
 
bool isRigidTransformation () const
 
void mult (const Matrix3x3 &, const Matrix3x3 &)
 
Vec3 mult (const Vec3 &v) const
 
bool operator!= (const Matrix3x3 &m) const
 
double & operator() (size_t row, size_t col)
 
double operator() (size_t row, size_t col) const
 
Matrix3x3 operator* (const Matrix3x3 &m) const
 
Vec3 operator* (const Vec3 &v) const
 
void operator*= (const Matrix3x3 &other)
 
Matrix3x3 operator= (const Matrix3x3 &rhs)
 
bool operator== (const Matrix3x3 &m) const
 
void postMult (const Matrix3x3 &)
 
void preMult (const Matrix3x3 &)
 
double * ptr ()
 
const double * ptr () const
 
Matrix3x3 set (double a00, double a01, double a02, double a10, double a11, double a12, double a20, double a21, double a22)
 
Matrix3x3 set (double const *const ptr)
 
void setCol (size_t col, const Vec3 &vec)
 
Matrix3x3 setIdentity ()
 
Matrix3x3 setRotate (const Quat &q)
 
Matrix3x3 setRotate (const Vec3 &from, const Vec3 &to)
 
Matrix3x3 setRotate (double angle, const Vec3 &axis)
 
Matrix3x3 setRotate (double angle, double x, double y, double z)
 
Matrix3x3 setRotate (double angle1, const Vec3 &axis1, double angle2, const Vec3 &axis2, double angle3, const Vec3 &axis3)
 
void setRow (size_t row, const Vec3 &vec)
 
Matrix3x3 transpose () const
 
bool valid () const
 

Static Public Member Functions

static Matrix3x3 crossMatrix (const Vec3 &vec)
 
static Matrix3x3 rotate (const Vec3 &from, const Vec3 &to)
 
static Matrix3x3 rotate (double angle, const Vec3 &axis)
 
static Matrix3x3 rotate (double angle, double x, double y, double z)
 
static Matrix3x3 rotate (double angle1, const Vec3 &axis1, double angle2, const Vec3 &axis2, double angle3, const Vec3 &axis3)
 

Detailed Description

Matrix class for inertia.

Constructor & Destructor Documentation

◆ Matrix3x3() [1/6]

MOMENTUM_NAMESPACE::Matrix3x3::Matrix3x3 ( agx::Matrix3x3  mat)

◆ Matrix3x3() [2/6]

MOMENTUM_NAMESPACE::Matrix3x3::Matrix3x3 ( )

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

◆ Matrix3x3() [3/6]

MOMENTUM_NAMESPACE::Matrix3x3::Matrix3x3 ( const Matrix3x3 mat)

Copy constructor.

◆ Matrix3x3() [4/6]

MOMENTUM_NAMESPACE::Matrix3x3::Matrix3x3 ( double const *const  ptr)

Create a matrix from a vector of 9 reals.

◆ Matrix3x3() [5/6]

MOMENTUM_NAMESPACE::Matrix3x3::Matrix3x3 ( const Quat rotation)

Create a matrix from a quaternion.

◆ Matrix3x3() [6/6]

MOMENTUM_NAMESPACE::Matrix3x3::Matrix3x3 ( double  a00,
double  a01,
double  a02,
double  a10,
double  a11,
double  a12,
double  a20,
double  a21,
double  a22 
)

Create a matrix from 9 double scalars.

◆ ~Matrix3x3()

MOMENTUM_NAMESPACE::Matrix3x3::~Matrix3x3 ( )

Destructor.

Member Function Documentation

◆ at()

double MOMENTUM_NAMESPACE::Matrix3x3::at ( size_t  row,
size_t  col 
) const

◆ crossMatrix()

Matrix3x3 MOMENTUM_NAMESPACE::Matrix3x3::crossMatrix ( const Vec3 vec)
static

Generates a new matrix of a specific type.

◆ getAsQuat()

Quat MOMENTUM_NAMESPACE::Matrix3x3::getAsQuat ( ) const
Returns
a quaternion of the rotation part of this matrix (real part > 0 by convention)

◆ getCol()

Vec3 MOMENTUM_NAMESPACE::Matrix3x3::getCol ( size_t  col) const

◆ getRotate()

Quat MOMENTUM_NAMESPACE::Matrix3x3::getRotate ( ) const

◆ getRow()

Vec3 MOMENTUM_NAMESPACE::Matrix3x3::getRow ( size_t  row) const

◆ inverse()

Matrix3x3 MOMENTUM_NAMESPACE::Matrix3x3::inverse ( ) const

Matrix inverse.

Returns
the inverse

◆ isFinite()

bool MOMENTUM_NAMESPACE::Matrix3x3::isFinite ( ) const
Returns
true if all the elements are non-NaN and non-inf

◆ isIdentity()

bool MOMENTUM_NAMESPACE::Matrix3x3::isIdentity ( ) const
Returns
true if the matrix is identity.

◆ isNaN()

bool MOMENTUM_NAMESPACE::Matrix3x3::isNaN ( ) const
Returns
true if the matrix is a valid one.

◆ isRigidTransformation()

bool MOMENTUM_NAMESPACE::Matrix3x3::isRigidTransformation ( ) const
Returns
true if the matrix is rigid transformation.

◆ mult() [1/2]

void MOMENTUM_NAMESPACE::Matrix3x3::mult ( const Matrix3x3 lhs,
const Matrix3x3 rhs 
)

◆ mult() [2/2]

Vec3 MOMENTUM_NAMESPACE::Matrix3x3::mult ( const Vec3 v) const

◆ operator!=()

bool MOMENTUM_NAMESPACE::Matrix3x3::operator!= ( const Matrix3x3 m) const

◆ operator()() [1/2]

double & MOMENTUM_NAMESPACE::Matrix3x3::operator() ( size_t  row,
size_t  col 
)

◆ operator()() [2/2]

double MOMENTUM_NAMESPACE::Matrix3x3::operator() ( size_t  row,
size_t  col 
) const

◆ operator*() [1/2]

Matrix3x3 MOMENTUM_NAMESPACE::Matrix3x3::operator* ( const Matrix3x3 m) const

◆ operator*() [2/2]

Vec3 MOMENTUM_NAMESPACE::Matrix3x3::operator* ( const Vec3 v) const

◆ operator*=()

void MOMENTUM_NAMESPACE::Matrix3x3::operator*= ( const Matrix3x3 other)

◆ operator=()

Matrix3x3 MOMENTUM_NAMESPACE::Matrix3x3::operator= ( const Matrix3x3 rhs)

◆ operator==()

bool MOMENTUM_NAMESPACE::Matrix3x3::operator== ( const Matrix3x3 m) const

◆ postMult()

void MOMENTUM_NAMESPACE::Matrix3x3::postMult ( const Matrix3x3 other)

◆ preMult()

void MOMENTUM_NAMESPACE::Matrix3x3::preMult ( const Matrix3x3 other)

◆ ptr() [1/2]

double * MOMENTUM_NAMESPACE::Matrix3x3::ptr ( )

◆ ptr() [2/2]

const double * MOMENTUM_NAMESPACE::Matrix3x3::ptr ( ) const

◆ rotate() [1/4]

Matrix3x3 MOMENTUM_NAMESPACE::Matrix3x3::rotate ( const Vec3 from,
const Vec3 to 
)
static

◆ rotate() [2/4]

Matrix3x3 MOMENTUM_NAMESPACE::Matrix3x3::rotate ( double  angle,
const Vec3 axis 
)
static

◆ rotate() [3/4]

Matrix3x3 MOMENTUM_NAMESPACE::Matrix3x3::rotate ( double  angle,
double  x,
double  y,
double  z 
)
static

◆ rotate() [4/4]

Matrix3x3 MOMENTUM_NAMESPACE::Matrix3x3::rotate ( double  angle1,
const Vec3 axis1,
double  angle2,
const Vec3 axis2,
double  angle3,
const Vec3 axis3 
)
static

◆ set() [1/2]

Matrix3x3 MOMENTUM_NAMESPACE::Matrix3x3::set ( double  a00,
double  a01,
double  a02,
double  a10,
double  a11,
double  a12,
double  a20,
double  a21,
double  a22 
)

◆ set() [2/2]

Matrix3x3 MOMENTUM_NAMESPACE::Matrix3x3::set ( double const *const  ptr)
  • set(arg) sets the entire matrix, overwriting all previous values.
  • setRotate(arg) sets the rotational part of the matrix, leaving the translation intact.
  • setIdentity() creates the identity matrix

◆ setCol()

void MOMENTUM_NAMESPACE::Matrix3x3::setCol ( size_t  col,
const Vec3 vec 
)

◆ setIdentity()

Matrix3x3 MOMENTUM_NAMESPACE::Matrix3x3::setIdentity ( )

◆ setRotate() [1/5]

Matrix3x3 MOMENTUM_NAMESPACE::Matrix3x3::setRotate ( const Quat q)

◆ setRotate() [2/5]

Matrix3x3 MOMENTUM_NAMESPACE::Matrix3x3::setRotate ( const Vec3 from,
const Vec3 to 
)

◆ setRotate() [3/5]

Matrix3x3 MOMENTUM_NAMESPACE::Matrix3x3::setRotate ( double  angle,
const Vec3 axis 
)

◆ setRotate() [4/5]

Matrix3x3 MOMENTUM_NAMESPACE::Matrix3x3::setRotate ( double  angle,
double  x,
double  y,
double  z 
)

◆ setRotate() [5/5]

Matrix3x3 MOMENTUM_NAMESPACE::Matrix3x3::setRotate ( double  angle1,
const Vec3 axis1,
double  angle2,
const Vec3 axis2,
double  angle3,
const Vec3 axis3 
)

◆ setRow()

void MOMENTUM_NAMESPACE::Matrix3x3::setRow ( size_t  row,
const Vec3 vec 
)

Set the row of the matrix,.

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

◆ transpose()

Matrix3x3 MOMENTUM_NAMESPACE::Matrix3x3::transpose ( ) const
Returns
the transpose

◆ valid()

bool MOMENTUM_NAMESPACE::Matrix3x3::valid ( ) const
Returns
true if the matrix does not contain any NaN values