Main Page   Groups   Namespaces  

mini3d::matrix4d Class Reference
[Core]

matrix4d - A 4x4 double matrix class, derived from matrix<double, 4, 4> More...

Inheritance diagram for mini3d::matrix4d:

mini3d::matrix< double, 4, 4 > List of all members.

Public Member Functions

 matrix4d ()
 A default constructor.
 matrix4d (const matrix<double, 4, 4>& src)
 A copy constructor from base class.
 matrix4d (const matrix4d& src)
 A copy constructor.
 matrix4d (double m[16])
 A constructor.
 matrix4d (double m[4][4])
 A constructor.
 matrix4d (double m0, double m1, double m2, double m3, double m4, double m5, double m6, double m7, double m8, double m9, double m10, double m11, double m12, double m13, double m14, double m15)
 A constructor.
virtual ~matrix4d ()
 A destructor.
array16d data () const
 Get the data as a double array (row major).
array16d dataGL () const
 Get the data as a double array (column major, for OpenGL rendering).
matrix4d operator* (const matrix4d& m) const
 Multiply the matrix with a matrix and return the new matrix.
point3d operator* (const point3d& pt) const
 Multiply the matrix with a point and return the new point.
point4d operator* (const point4d& pt) const
 Multiply the matrix with a point and return the new point.
vector3d operator* (const vector3d& v) const
 Multiply the matrix with a vector and return the new vector.
matrix4doperator= (const matrix<double, 4, 4>& src)
 Copy from the base class.
void makeRotate (const quat4d& q)
 Make a transformation for rotation.
void makeRotate (const matrix3d& m)
 Make a transformation for rotation.
void makeRotate (double rad, const vector3d& axis)
 Make a transformation for rotation.
void makeTranslate (const point3d& v)
 Make a transformation for translation.
void makeTranslate (const vector3d& v)
 Make a transformation for translation.
void makeTranslate (const array3d& v)
 Make a transformation for translation.
void makeTranslate (double x, double y, double z)
 Make a transformation for translation.
void makeScale (const vector3d& s)
 Make a transformation for scaling.
void makeScale (double x, double y, double z)
 Make a transformation for scaling.
void getRotate (matrix3d& m) const
 Get the 3x3 rotation matrix.
void getRotate (quat4d& q) const
 Get the quaternion.
void getRotateYZX (vector3d& e) const
 Get the Euler angles in YZX order (body frame).
void getRotateXYZ (vector3d& e) const
 Get the Euler angles in XYZ order (body frame).
void getRotateXYZf (vector3d& e) const
 Get the Euler angles in XYZ order (fixed frame).
void getTranslate (point3d& p) const
 Get the translation (Assuming that m(3,3) = 1).
void getTranslate (vector3d& v) const
 Get the translation (Assuming that m(3,3) = 1).
void getTranslate (double& x, double& y, double& z) const
 Get the translation (Assuming that m(3,3) = 1).
void getScale (vector3d& s) const
 Get the scaling (Assuming that m(3,3) = 1).
void getScale (double& x, double& y, double& z) const
 Get the scaling (Assuming that m(3,3) = 1).
bool invert ()
 Invert itself.
bool inverse (matrix4d& inv) const
 Return the inverse of this matrix.
matrix4d transpose () const
 Get a transpose of this matrix.

Static Public Attributes

static const matrix4d _identity_matrix
static const matrix4d _zero_matrix

Detailed Description

matrix4d - A 4x4 double matrix class, derived from matrix<double, 4, 4>

The matrix is row major

[ m0, m1, m2, m3 ]
[ m4, m5, m6, m7 ]
[ m8, m9, m10, m11 ]
[ m12, m13, m14, m15 ]

{ m0, m1, m2, m3, ... , m12, m13, m14, m15 }


Constructor & Destructor Documentation

mini3d::matrix4d::matrix4d (  ) 
 

A default constructor.

The matrix will set as a zero matrix.

mini3d::matrix4d::matrix4d ( const matrix<double, 4, 4>&  src  ) 
 

A copy constructor from base class.

Parameters:
src the source matrix to copy from.

mini3d::matrix4d::matrix4d ( const matrix4d src  ) 
 

A copy constructor.

Parameters:
src the source matrix to copy from.

mini3d::matrix4d::matrix4d ( double  m[16]  ) 
 

A constructor.

The matrix will set as
[m[0] m[1] m[2] m[3]
m[4] m[5] m[6] m[7]
m[8] m[9] m[10] m[11]
m[12] m[13] m[14] m[15]].

Parameters:
m a floating point array

mini3d::matrix4d::matrix4d ( double  m[4][4]  ) 
 

A constructor.

The matrix will set as
[m[0] m[1] m[2] m[3]
m[4] m[5] m[6] m[7]
m[8] m[9] m[10] m[11]
m[12] m[13] m[14] m[15]].

Parameters:
m a floating point array

mini3d::matrix4d::matrix4d ( double  m0,
double  m1,
double  m2,
double  m3,
double  m4,
double  m5,
double  m6,
double  m7,
double  m8,
double  m9,
double  m10,
double  m11,
double  m12,
double  m13,
double  m14,
double  m15
 

A constructor.

The matrix will set as
[m0 m1 m2 m3
m4 m5 m6 m7
m8 m9 m10 m11
m12 m13 m14 m15].

virtual mini3d::matrix4d::~matrix4d (  )  [virtual]
 

A destructor.


Member Function Documentation

array16d mini3d::matrix4d::data (  )  const
 

Get the data as a double array (row major).

Returns:
a double array16d

array16d mini3d::matrix4d::dataGL (  )  const
 

Get the data as a double array (column major, for OpenGL rendering).

Returns:
a double array16d

void mini3d::matrix4d::getRotate ( quat4d q  )  const
 

Get the quaternion.

Parameters:
q the quaternion

void mini3d::matrix4d::getRotate ( matrix3d m  )  const
 

Get the 3x3 rotation matrix.

Parameters:
m the 3x3 rotation matrix

void mini3d::matrix4d::getRotateXYZ ( vector3d e  )  const
 

Get the Euler angles in XYZ order (body frame).

Parameters:
e the Euler angles

void mini3d::matrix4d::getRotateXYZf ( vector3d e  )  const
 

Get the Euler angles in XYZ order (fixed frame).

Parameters:
e the Euler angles

void mini3d::matrix4d::getRotateYZX ( vector3d e  )  const
 

Get the Euler angles in YZX order (body frame).

Parameters:
e the Euler angles

void mini3d::matrix4d::getScale ( double&  x,
double&  y,
double&  z
const
 

Get the scaling (Assuming that m(3,3) = 1).

Parameters:
x the x component of the scaling
y the y component of the scaling
z the z component of the scaling

void mini3d::matrix4d::getScale ( vector3d s  )  const
 

Get the scaling (Assuming that m(3,3) = 1).

Parameters:
s the scaling

void mini3d::matrix4d::getTranslate ( double&  x,
double&  y,
double&  z
const
 

Get the translation (Assuming that m(3,3) = 1).

Parameters:
x the x component of the translation
y the y component of the translation
z the z component of the translation

void mini3d::matrix4d::getTranslate ( vector3d v  )  const
 

Get the translation (Assuming that m(3,3) = 1).

Parameters:
v the translation

void mini3d::matrix4d::getTranslate ( point3d p  )  const
 

Get the translation (Assuming that m(3,3) = 1).

Parameters:
p the translation

bool mini3d::matrix4d::inverse ( matrix4d inv  )  const
 

Return the inverse of this matrix.

Parameters:
inv the inverse of this matrix.
Returns:
true if success, false otherwise

bool mini3d::matrix4d::invert (  ) 
 

Invert itself.

Returns:
true success, false if singular

void mini3d::matrix4d::makeRotate ( double  rad,
const vector3d axis
 

Make a transformation for rotation.

Parameters:
rad the opAngle of rotation
axis the axis of rotation

void mini3d::matrix4d::makeRotate ( const matrix3d m  ) 
 

Make a transformation for rotation.

Parameters:
m the 3x3 rotation matrix

void mini3d::matrix4d::makeRotate ( const quat4d q  ) 
 

Make a transformation for rotation.

Parameters:
q the quaternion which represent a rotation

void mini3d::matrix4d::makeScale ( double  x,
double  y,
double  z
 

Make a transformation for scaling.

Parameters:
x the x component of the scaling
y the y component of the scaling
z the z component of the scaling

void mini3d::matrix4d::makeScale ( const vector3d s  ) 
 

Make a transformation for scaling.

Parameters:
v the vector which represent a scaling

void mini3d::matrix4d::makeTranslate ( double  x,
double  y,
double  z
 

Make a transformation for translation.

Parameters:
x the x component of the translation
y the y component of the translation
z the z component of the translation

void mini3d::matrix4d::makeTranslate ( const array3d v  ) 
 

Make a transformation for translation.

Parameters:
v the vector which represent a translation

void mini3d::matrix4d::makeTranslate ( const vector3d v  ) 
 

Make a transformation for translation.

Parameters:
v the vector which represent a translation

void mini3d::matrix4d::makeTranslate ( const point3d v  ) 
 

Make a transformation for translation.

Parameters:
v the vector which represent a translation

vector3d mini3d::matrix4d::operator* ( const vector3d v  )  const
 

Multiply the matrix with a vector and return the new vector.

result = (*this) * v;

Parameters:
v the vector to multiply with.
Returns:
a new vector.

point4d mini3d::matrix4d::operator* ( const point4d pt  )  const
 

Multiply the matrix with a point and return the new point.

result = (*this) * pt;

Parameters:
pt the point to multiply with.
Returns:
a new point.

point3d mini3d::matrix4d::operator* ( const point3d pt  )  const
 

Multiply the matrix with a point and return the new point.

result = (*this) * pt;

Parameters:
pt the point to multiply with.
Returns:
a new point.

matrix4d mini3d::matrix4d::operator* ( const matrix4d m  )  const
 

Multiply the matrix with a matrix and return the new matrix.

result = (*this) * m;

Parameters:
m the matrix to multiply with.
Returns:
a new matrix.

matrix4d& mini3d::matrix4d::operator= ( const matrix<double, 4, 4>&  src  ) 
 

Copy from the base class.

Parameters:
src the matrix to copy from
Returns:
itself

matrix4d mini3d::matrix4d::transpose (  )  const [inline]
 

Get a transpose of this matrix.

Returns:
transpose of this matrix

Reimplemented from mini3d::matrix<double, 4, 4>.


Member Data Documentation

const matrix4d mini3d::matrix4d::_identity_matrix [static]
 

const matrix4d mini3d::matrix4d::_zero_matrix [static]
 


The documentation for this class was generated from the following file:
Generated for libmini3d by Doxygen 1.4.4 © 1997-2001