Sensor Scol plugin
Multi platform sensors for handled devices
Public Member Functions | Static Public Attributes | Protected Attributes
Matrix4 Class Reference

Public Member Functions

 Matrix4 ()
 
 Matrix4 (double m00, double m01, double m02, double m03, double m10, double m11, double m12, double m13, double m20, double m21, double m22, double m23, double m30, double m31, double m32, double m33)
 
 Matrix4 (double *mat)
 
void convert (double mat[16])
 
double * operator[] (unsigned int iRow)
 
const double * operator[] (unsigned int iRow) const
 
Matrix4 concatenate (const Matrix4 &m2) const
 
Matrix4 operator* (const Matrix4 &m2) const
 
Vector3d operator* (const Vector3d &v) const
 
Matrix4 operator+ (const Matrix4 &m2) const
 
Matrix4 operator- (const Matrix4 &m2) const
 
bool operator== (const Matrix4 &m2) const
 
bool operator!= (const Matrix4 &m2) const
 
Matrix4 transpose (void) const
 
void makeTrans (double tx, double ty, double tz)
 
Matrix4 operator* (double scalar) const
 

Static Public Attributes

static const Matrix4 ZERO
 
static const Matrix4 IDENTITY
 

Protected Attributes

union { 
 
   double   m [4][4] 
 
   double   _m [16] 
 
};  
 The matrix entries, indexed by [row][col].
 

Detailed Description

Definition at line 8 of file Matrix4.h.

Constructor & Destructor Documentation

◆ Matrix4() [1/3]

Matrix4 ( )
inline

Default constructor.

Note
It does NOT initialize the matrix for efficiency.

Definition at line 21 of file Matrix4.h.

◆ Matrix4() [2/3]

Matrix4 ( double  m00,
double  m01,
double  m02,
double  m03,
double  m10,
double  m11,
double  m12,
double  m13,
double  m20,
double  m21,
double  m22,
double  m23,
double  m30,
double  m31,
double  m32,
double  m33 
)
inline

Definition at line 25 of file Matrix4.h.

◆ Matrix4() [3/3]

Matrix4 ( double *  mat)
inline

Definition at line 49 of file Matrix4.h.

Member Function Documentation

◆ concatenate()

Matrix4 concatenate ( const Matrix4 m2) const
inline

Definition at line 101 of file Matrix4.h.

◆ convert()

void convert ( double  mat[16])
inline

Definition at line 69 of file Matrix4.h.

◆ makeTrans()

void makeTrans ( double  tx,
double  ty,
double  tz 
)
inline

Definition at line 248 of file Matrix4.h.

◆ operator!=()

bool operator!= ( const Matrix4 m2) const
inline

Tests 2 matrices for inequality.

Definition at line 229 of file Matrix4.h.

◆ operator*() [1/3]

Matrix4 operator* ( const Matrix4 m2) const
inline

Matrix concatenation using '*'.

Definition at line 129 of file Matrix4.h.

◆ operator*() [2/3]

Vector3d operator* ( const Vector3d v) const
inline

Vector transformation using '*'.

Remarks
Transforms the given 3-D vector by the matrix, projecting the result back into w = 1.
Note
This means that the initial w is considered to be 1.0, and then all the tree elements of the resulting 3-D vector are divided by the resulting w.

Definition at line 143 of file Matrix4.h.

◆ operator*() [3/3]

Matrix4 operator* ( double  scalar) const
inline

Definition at line 259 of file Matrix4.h.

◆ operator+()

Matrix4 operator+ ( const Matrix4 m2) const
inline

Matrix addition.

Definition at line 159 of file Matrix4.h.

◆ operator-()

Matrix4 operator- ( const Matrix4 m2) const
inline

Matrix subtraction.

Definition at line 188 of file Matrix4.h.

◆ operator==()

bool operator== ( const Matrix4 m2) const
inline

Tests 2 matrices for equality.

Definition at line 216 of file Matrix4.h.

◆ operator[]() [1/2]

double * operator[] ( unsigned int  iRow)
inline

Definition at line 89 of file Matrix4.h.

◆ operator[]() [2/2]

const double * operator[] ( unsigned int  iRow) const
inline

Definition at line 95 of file Matrix4.h.

◆ transpose()

Matrix4 transpose ( void  ) const
inline

Definition at line 240 of file Matrix4.h.

Field Documentation

◆ _m

double _m[16]

Definition at line 14 of file Matrix4.h.

◆ IDENTITY

const Matrix4 IDENTITY
static

Definition at line 257 of file Matrix4.h.

◆ m

double m[4][4]

Definition at line 13 of file Matrix4.h.

◆ ZERO

const Matrix4 ZERO
static

Definition at line 256 of file Matrix4.h.


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