#include <artec/sdk/base/Matrix.h>

Public Types

enum  {
  Identity = 0x0001,
  General = 0x0002
}
 
typedef Type value_type
 

Public Member Functions

 Matrix4x4 ()
 
 Matrix4x4 (Type _00, Type _01, Type _02, Type _03, Type _10, Type _11, Type _12, Type _13, Type _20, Type _21, Type _22, Type _23, Type _30, Type _31, Type _32, Type _33)
 
template<typename Type2 , std::size_t sizeOfArray>
 Matrix4x4 (const Type2(&values)[sizeOfArray])
 
template<typename Type2 >
 Matrix4x4 (const Type2 *values, int rows2, int cols2)
 
 Matrix4x4 (const Matrix4x4 &second)
 Copying constructor. More...
 
template<int rows2, int cols2, typename Type2 >
 Matrix4x4 (const GenericMatrix< rows2, cols2, Type2 > &second)
 Copying constructor with size_ conversion. More...
 
template<typename Type2 >
 Matrix4x4 (const Matrix4x4< Type2 > &second)
 Copying constructor with type conversion. More...
 
void fill (const Type value)
 Fill matrix with value. More...
 
template<typename Type2 >
Point4< Type2 > operator* (const Point4< Type2 > &point) const
 Matrix - point multiplication. More...
 
Matrix4x4 operator* (const Type &val) const
 
template<typename Type2 >
Point3< Type2 > operator* (const Point3< Type2 > &point) const
 Special case of matrix-point multiplication: geometric transformation. More...
 
Matrix4x4 operator- () const
 Unary minus. More...
 
bool operator== (const Matrix4x4 &m) const
 check matrices are equal More...
 
bool operator!= (const Matrix4x4 &m) const
 check matrices are not equal More...
 
Type & operator() (int row, int col)
 
const Type & operator() (int row, int col) const
 
void setToIdentity ()
 Make current matrix to identity. More...
 
bool isIdentity () const
 Check if matrix is an identity matrix. More...
 
Matrix4x4 transposed () const
 Return transposed matrix copy. More...
 
Matrix4x4< Type > inverted (bool *invertible=0) const
 Inversion. More...
 
Point3< Type > project (const Point3< Type > &point) const
 
int size () const
 
template<int rows2, int cols2, typename Type2 >
Matrix4x4 operator= (const GenericMatrix< rows2, cols2, Type2 > &second)
 
Matrix4x4operator= (const Matrix4x4 &second)
 
template<int rows, int cols>
GenericMatrix< rows, cols, Type > toGenericMatrix () const
 
template<int rows, int cols, typename Type2 >
GenericMatrix< rows, cols, Type2 > toGenericMatrix () const
 
Matrix4x4operator+= (const Matrix4x4 &mat)
 
Matrix4x4operator-= (const Matrix4x4 &mat)
 
Matrix4x4operator*= (const Matrix4x4 &other)
 
Matrix4x4 operator+ (const Matrix4x4 &mat) const
 
Matrix4x4 operator- (const Matrix4x4 &mat) const
 
Matrix4x4 operator* (const Matrix4x4 &mat) const
 
template<int cols2>
GenericMatrix< 4, cols2, Type > operator* (const GenericMatrix< 4, cols2, Type > &mat) const
 
Matrix4x4operator+= (const Type &val)
 
Matrix4x4operator-= (const Type &val)
 
Matrix4x4operator*= (const Type &val)
 
Matrix4x4operator/= (const Type &val)
 
Matrix4x4 operator+ (const Type &val) const
 
Matrix4x4 operator- (const Type &val) const
 
Matrix4x4 operator/ (const Type &val) const
 
 operator Type * ()
 
 operator const Type * () const
 

Static Public Member Functions

static Matrix4x4 identity ()
 Identity matrix. More...
 
static Matrix4x4 rotation (Type angle, const Point3< Type > &direction)
 ! Important ! Direction is a unit vector, don't forget to normalize it !!! More...
 
static Matrix4x4 rotation (Type angle, const Point3< Type > &direction, const Point3< Type > &center)
 ! Important ! Direction is a unit vector, don't forget to normalize it !!! More...
 
static Matrix4x4 translation (const Point3< Type > &direction)
 Translations. More...
 
static Matrix4x4 inverseMotion (const Matrix4x4 &matrix)
 Inverse transformation matrix. More...
 
static Matrix4x4 perspective (Type left, Type right, Type bottom, Type top, Type nearVal, Type farVal)
 Get perspective projection matrix. More...
 
static Matrix4x4 perspectiveFov (float fovy, float aspect, float zNear, float zFar)
 Get perspective projection matrix. More...
 
static Matrix4x4 ortho (Type left, Type right, Type bottom, Type top, Type nearVal, Type farVal)
 Get orthogonal matrix. More...
 
static Matrix4x4 rotationX (Type angle)
 
static Matrix4x4 rotationY (Type angle)
 
static Matrix4x4 rotationZ (Type angle)
 
static Matrix4x4 rotationX (Type angle, const Point3< Type > &center)
 
static Matrix4x4 rotationY (Type angle, const Point3< Type > &center)
 
static Matrix4x4 rotationZ (Type angle, const Point3< Type > &center)
 
static Matrix4x4 scale (Type factor)
 
static Matrix4x4 scale (Type factor, const Point3< Type > &center)
 

Public Attributes

union {
   struct {
      Type   m [4][4]
 
   } 
 
   Type   data [4 *4]
 
}; 
 matrix data More...
 
int flagBits
 

Static Protected Attributes

static int const rows_ = 4
 
static int const cols_ = 4
 
static int const size_ = 4 * 4
 

Detailed Description

template<typename Type = double>
class artec::sdk::base::Matrix4x4< Type >

Definition at line 21 of file Matrix.h.

Member Typedef Documentation

template<typename Type = double>
typedef Type artec::sdk::base::Matrix4x4< Type >::value_type

Definition at line 24 of file Matrix.h.

Member Enumeration Documentation

template<typename Type = double>
anonymous enum
Enumerator
Identity 
General 

Definition at line 674 of file Matrix.h.

Constructor & Destructor Documentation

template<typename Type = double>
artec::sdk::base::Matrix4x4< Type >::Matrix4x4 ( )
inline

Definition at line 26 of file Matrix.h.

template<typename Type = double>
artec::sdk::base::Matrix4x4< Type >::Matrix4x4 ( Type  _00,
Type  _01,
Type  _02,
Type  _03,
Type  _10,
Type  _11,
Type  _12,
Type  _13,
Type  _20,
Type  _21,
Type  _22,
Type  _23,
Type  _30,
Type  _31,
Type  _32,
Type  _33 
)
inline

Definition at line 28 of file Matrix.h.

template<typename Type = double>
template<typename Type2 , std::size_t sizeOfArray>
artec::sdk::base::Matrix4x4< Type >::Matrix4x4 ( const Type2(&)  values[sizeOfArray])
inlineexplicit

Definition at line 42 of file Matrix.h.

template<typename Type = double>
template<typename Type2 >
artec::sdk::base::Matrix4x4< Type >::Matrix4x4 ( const Type2 *  values,
int  rows2,
int  cols2 
)
inline

Definition at line 52 of file Matrix.h.

template<typename Type = double>
artec::sdk::base::Matrix4x4< Type >::Matrix4x4 ( const Matrix4x4< Type > &  second)
inline

Copying constructor.

Definition at line 68 of file Matrix.h.

template<typename Type = double>
template<int rows2, int cols2, typename Type2 >
artec::sdk::base::Matrix4x4< Type >::Matrix4x4 ( const GenericMatrix< rows2, cols2, Type2 > &  second)
inlineexplicit

Copying constructor with size_ conversion.

Definition at line 72 of file Matrix.h.

template<typename Type = double>
template<typename Type2 >
artec::sdk::base::Matrix4x4< Type >::Matrix4x4 ( const Matrix4x4< Type2 > &  second)
inlineexplicit

Copying constructor with type conversion.

Definition at line 76 of file Matrix.h.

Member Function Documentation

template<typename Type = double>
void artec::sdk::base::Matrix4x4< Type >::fill ( const Type  value)
inline

Fill matrix with value.

Definition at line 136 of file Matrix.h.

template<typename Type = double>
static Matrix4x4 artec::sdk::base::Matrix4x4< Type >::identity ( )
inlinestatic

Identity matrix.

Definition at line 361 of file Matrix.h.

template<typename Type = double>
static Matrix4x4 artec::sdk::base::Matrix4x4< Type >::inverseMotion ( const Matrix4x4< Type > &  matrix)
inlinestatic

Inverse transformation matrix.

get rotation and translation components of motion

inverse rotation

assemble inverse motion matrix

Definition at line 577 of file Matrix.h.

template<typename Type >
Matrix4x4< Type > artec::sdk::base::Matrix4x4< Type >::inverted ( bool *  invertible = 0) const

Inversion.

Inversion

Returns
false if matrix is singular and can't be inverted, otherwise true

Definition at line 708 of file Matrix.h.

template<typename Type = double>
bool artec::sdk::base::Matrix4x4< Type >::isIdentity ( ) const
inline

Check if matrix is an identity matrix.

Definition at line 379 of file Matrix.h.

template<typename Type = double>
artec::sdk::base::Matrix4x4< Type >::operator const Type * ( ) const
inline

Conversion to plain data pointer operator

Definition at line 656 of file Matrix.h.

template<typename Type = double>
artec::sdk::base::Matrix4x4< Type >::operator Type * ( )
inline

Conversion to plain data pointer operator

Definition at line 655 of file Matrix.h.

template<typename Type = double>
bool artec::sdk::base::Matrix4x4< Type >::operator!= ( const Matrix4x4< Type > &  m) const
inline

check matrices are not equal

Definition at line 344 of file Matrix.h.

template<typename Type = double>
Type& artec::sdk::base::Matrix4x4< Type >::operator() ( int  row,
int  col 
)
inline

Definition at line 349 of file Matrix.h.

template<typename Type = double>
const Type& artec::sdk::base::Matrix4x4< Type >::operator() ( int  row,
int  col 
) const
inline

Definition at line 355 of file Matrix.h.

template<typename Type = double>
Matrix4x4 artec::sdk::base::Matrix4x4< Type >::operator* ( const Matrix4x4< Type > &  mat) const
inline

Matrix - matrix multiplication

Definition at line 190 of file Matrix.h.

template<typename Type = double>
template<int cols2>
GenericMatrix< 4, cols2, Type > artec::sdk::base::Matrix4x4< Type >::operator* ( const GenericMatrix< 4, cols2, Type > &  mat) const
inline

Matrix - matrix multiplication

Definition at line 211 of file Matrix.h.

template<typename Type = double>
template<typename Type2 >
Point4< Type2 > artec::sdk::base::Matrix4x4< Type >::operator* ( const Point4< Type2 > &  point) const
inline

Matrix - point multiplication.

Definition at line 229 of file Matrix.h.

template<typename Type = double>
Matrix4x4 artec::sdk::base::Matrix4x4< Type >::operator* ( const Type &  val) const
inline

Definition at line 247 of file Matrix.h.

template<typename Type = double>
template<typename Type2 >
Point3< Type2 > artec::sdk::base::Matrix4x4< Type >::operator* ( const Point3< Type2 > &  point) const
inline

Special case of matrix-point multiplication: geometric transformation.

Definition at line 256 of file Matrix.h.

template<typename Type = double>
Matrix4x4& artec::sdk::base::Matrix4x4< Type >::operator*= ( const Matrix4x4< Type > &  other)
inline

Arithmetical operations Matrix - Matrix (element-wise)

Definition at line 158 of file Matrix.h.

template<typename Type = double>
Matrix4x4& artec::sdk::base::Matrix4x4< Type >::operator*= ( const Type &  val)
inline

Matrix - Scalar

Definition at line 289 of file Matrix.h.

template<typename Type = double>
Matrix4x4 artec::sdk::base::Matrix4x4< Type >::operator+ ( const Matrix4x4< Type > &  mat) const
inline

Arithmetical operations Matrix - Matrix (element-wise)

Definition at line 171 of file Matrix.h.

template<typename Type = double>
Matrix4x4 artec::sdk::base::Matrix4x4< Type >::operator+ ( const Type &  val) const
inline

Matrix - Scalar

Definition at line 302 of file Matrix.h.

template<typename Type = double>
Matrix4x4& artec::sdk::base::Matrix4x4< Type >::operator+= ( const Matrix4x4< Type > &  mat)
inline

Arithmetical operations Matrix - Matrix (element-wise)

Definition at line 146 of file Matrix.h.

template<typename Type = double>
Matrix4x4& artec::sdk::base::Matrix4x4< Type >::operator+= ( const Type &  val)
inline

Matrix - Scalar

Definition at line 277 of file Matrix.h.

template<typename Type = double>
Matrix4x4 artec::sdk::base::Matrix4x4< Type >::operator- ( const Matrix4x4< Type > &  mat) const
inline

Arithmetical operations Matrix - Matrix (element-wise)

Definition at line 179 of file Matrix.h.

template<typename Type = double>
Matrix4x4 artec::sdk::base::Matrix4x4< Type >::operator- ( const Type &  val) const
inline

Matrix - Scalar

Definition at line 309 of file Matrix.h.

template<typename Type = double>
Matrix4x4 artec::sdk::base::Matrix4x4< Type >::operator- ( ) const
inline

Unary minus.

Definition at line 326 of file Matrix.h.

template<typename Type = double>
Matrix4x4& artec::sdk::base::Matrix4x4< Type >::operator-= ( const Matrix4x4< Type > &  mat)
inline

Arithmetical operations Matrix - Matrix (element-wise)

Definition at line 152 of file Matrix.h.

template<typename Type = double>
Matrix4x4& artec::sdk::base::Matrix4x4< Type >::operator-= ( const Type &  val)
inline

Matrix - Scalar

Definition at line 283 of file Matrix.h.

template<typename Type = double>
Matrix4x4 artec::sdk::base::Matrix4x4< Type >::operator/ ( const Type &  val) const
inline

Matrix - Scalar

Definition at line 316 of file Matrix.h.

template<typename Type = double>
Matrix4x4& artec::sdk::base::Matrix4x4< Type >::operator/= ( const Type &  val)
inline

Matrix - Scalar

Definition at line 295 of file Matrix.h.

template<typename Type = double>
template<int rows2, int cols2, typename Type2 >
Matrix4x4 artec::sdk::base::Matrix4x4< Type >::operator= ( const GenericMatrix< rows2, cols2, Type2 > &  second)
inline

Assignment operators

Definition at line 85 of file Matrix.h.

template<typename Type = double>
Matrix4x4& artec::sdk::base::Matrix4x4< Type >::operator= ( const Matrix4x4< Type > &  second)
inline

Assignment operators

Definition at line 101 of file Matrix.h.

template<typename Type = double>
bool artec::sdk::base::Matrix4x4< Type >::operator== ( const Matrix4x4< Type > &  m) const
inline

check matrices are equal

Definition at line 335 of file Matrix.h.

template<typename Type = double>
static Matrix4x4 artec::sdk::base::Matrix4x4< Type >::ortho ( Type  left,
Type  right,
Type  bottom,
Type  top,
Type  nearVal,
Type  farVal 
)
inlinestatic

Get orthogonal matrix.

Definition at line 631 of file Matrix.h.

template<typename Type = double>
static Matrix4x4 artec::sdk::base::Matrix4x4< Type >::perspective ( Type  left,
Type  right,
Type  bottom,
Type  top,
Type  nearVal,
Type  farVal 
)
inlinestatic

Get perspective projection matrix.

Definition at line 597 of file Matrix.h.

template<typename Type = double>
static Matrix4x4 artec::sdk::base::Matrix4x4< Type >::perspectiveFov ( float  fovy,
float  aspect,
float  zNear,
float  zFar 
)
inlinestatic

Get perspective projection matrix.

Definition at line 620 of file Matrix.h.

template<typename Type = double>
Point3<Type> artec::sdk::base::Matrix4x4< Type >::project ( const Point3< Type > &  point) const
inline

Definition at line 415 of file Matrix.h.

template<typename Type = double>
static Matrix4x4 artec::sdk::base::Matrix4x4< Type >::rotation ( Type  angle,
const Point3< Type > &  direction 
)
inlinestatic

! Important ! Direction is a unit vector, don't forget to normalize it !!!

Definition at line 505 of file Matrix.h.

template<typename Type = double>
static Matrix4x4 artec::sdk::base::Matrix4x4< Type >::rotation ( Type  angle,
const Point3< Type > &  direction,
const Point3< Type > &  center 
)
inlinestatic

! Important ! Direction is a unit vector, don't forget to normalize it !!!

Definition at line 531 of file Matrix.h.

template<typename Type = double>
static Matrix4x4 artec::sdk::base::Matrix4x4< Type >::rotationX ( Type  angle)
inlinestatic

Rotations (* - all angles in radians)

Definition at line 432 of file Matrix.h.

template<typename Type = double>
static Matrix4x4 artec::sdk::base::Matrix4x4< Type >::rotationX ( Type  angle,
const Point3< Type > &  center 
)
inlinestatic

Rotations (* - all angles in radians)

Definition at line 475 of file Matrix.h.

template<typename Type = double>
static Matrix4x4 artec::sdk::base::Matrix4x4< Type >::rotationY ( Type  angle)
inlinestatic

Rotations (* - all angles in radians)

Definition at line 446 of file Matrix.h.

template<typename Type = double>
static Matrix4x4 artec::sdk::base::Matrix4x4< Type >::rotationY ( Type  angle,
const Point3< Type > &  center 
)
inlinestatic

Rotations (* - all angles in radians)

Definition at line 484 of file Matrix.h.

template<typename Type = double>
static Matrix4x4 artec::sdk::base::Matrix4x4< Type >::rotationZ ( Type  angle)
inlinestatic

Rotations (* - all angles in radians)

Definition at line 460 of file Matrix.h.

template<typename Type = double>
static Matrix4x4 artec::sdk::base::Matrix4x4< Type >::rotationZ ( Type  angle,
const Point3< Type > &  center 
)
inlinestatic

Rotations (* - all angles in radians)

Definition at line 493 of file Matrix.h.

template<typename Type = double>
static Matrix4x4 artec::sdk::base::Matrix4x4< Type >::scale ( Type  factor)
inlinestatic

Scale

Definition at line 555 of file Matrix.h.

template<typename Type = double>
static Matrix4x4 artec::sdk::base::Matrix4x4< Type >::scale ( Type  factor,
const Point3< Type > &  center 
)
inlinestatic

Scale

Definition at line 565 of file Matrix.h.

template<typename Type = double>
void artec::sdk::base::Matrix4x4< Type >::setToIdentity ( )
inline

Make current matrix to identity.

Definition at line 368 of file Matrix.h.

template<typename Type = double>
int artec::sdk::base::Matrix4x4< Type >::size ( ) const
inline

Returns the number of elements in the matrix

Definition at line 659 of file Matrix.h.

template<typename Type = double>
template<int rows, int cols>
GenericMatrix<rows, cols, Type> artec::sdk::base::Matrix4x4< Type >::toGenericMatrix ( ) const
inline

Convert matrix4x4 to generic matrix

Definition at line 112 of file Matrix.h.

template<typename Type = double>
template<int rows, int cols, typename Type2 >
GenericMatrix<rows, cols, Type2> artec::sdk::base::Matrix4x4< Type >::toGenericMatrix ( ) const
inline

Convert matrix4x4 to generic matrix

Definition at line 118 of file Matrix.h.

template<typename Type = double>
static Matrix4x4 artec::sdk::base::Matrix4x4< Type >::translation ( const Point3< Type > &  direction)
inlinestatic

Translations.

Definition at line 542 of file Matrix.h.

template<typename Type = double>
Matrix4x4 artec::sdk::base::Matrix4x4< Type >::transposed ( ) const
inline

Return transposed matrix copy.

Definition at line 401 of file Matrix.h.

Member Data Documentation

union { ... }

matrix data

template<typename Type = double>
int const artec::sdk::base::Matrix4x4< Type >::cols_ = 4
staticprotected

Definition at line 682 of file Matrix.h.

template<typename Type = double>
Type artec::sdk::base::Matrix4x4< Type >::data[4 *4]

Definition at line 669 of file Matrix.h.

template<typename Type = double>
int artec::sdk::base::Matrix4x4< Type >::flagBits
mutable

Definition at line 672 of file Matrix.h.

template<typename Type = double>
Type artec::sdk::base::Matrix4x4< Type >::m[4][4]

Definition at line 666 of file Matrix.h.

template<typename Type = double>
int const artec::sdk::base::Matrix4x4< Type >::rows_ = 4
staticprotected

Definition at line 681 of file Matrix.h.

template<typename Type = double>
int const artec::sdk::base::Matrix4x4< Type >::size_ = 4 * 4
staticprotected

Definition at line 683 of file Matrix.h.


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