GCS::GMatrix44 Class Reference

Provides a 4x4 matrix and various mathematical matrix operations. More...

#include <GMatrix44.h>

Collaboration diagram for GCS::GMatrix44:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 GMatrix44 ()
 GMatrix44 (double _m11, double _m12, double _m13, double _m14, double _m21, double _m22, double _m23, double _m24, double _m31, double _m32, double _m33, double _m34, double _m41, double _m42, double _m43, double _m44)
 GMatrix44 (const GMatrix44 &original)
 operator double * ()
GMatrix44loadIdentity ()
GMatrix44 multiply (double scalar) const
GMatrix44 multiply (const GMatrix44 &m) const
GVector3 transform (const GVector3 &v) const
GMatrix44 operator+ (const GMatrix44 &m) const
GMatrix44 operator- (const GMatrix44 &m) const
GMatrix44 operator * (const GMatrix44 &m) const
GMatrix44 operator * (const double scalar) const
bool operator== (const GMatrix44 &m) const
bool operator!= (const GMatrix44 &m) const

Static Public Member Functions

static GMatrix44 createIdentityMatrix ()
static GMatrix44 createScaleMatrix (double scalar)
static GMatrix44 createScaleMatrix (const GVector3 &v)
static GMatrix44 createTranslationMatrix (const GVector3 &v)
static GMatrix44 createRotationAroundX (double angle_rad)
static GMatrix44 createRotationAroundY (double angle_rad)
static GMatrix44 createRotationAroundZ (double angle_rad)
static GMatrix44 createRotationAroundAxis (const GVector3 &v, double angle_rad)
static GMatrix44 createFromOpenGL (float *values)

Public Attributes

union {
   struct {
      double   m11
      double   m12
      double   m13
      double   m14
      double   m21
      double   m22
      double   m23
      double   m24
      double   m31
      double   m32
      double   m33
      double   m34
      double   m41
      double   m42
      double   m43
      double   m44
   } 
   double   m [4][4]
   double   n [16]
}; 

Detailed Description

Provides a 4x4 matrix and various mathematical matrix operations.

Author:
Raphael Langerhorst

Gerald Degeneve


Constructor & Destructor Documentation

GCS::GMatrix44::GMatrix44 (  ) 

Default constructor initializes the matrix with an identity matrix.

GCS::GMatrix44::GMatrix44 ( double  _m11,
double  _m12,
double  _m13,
double  _m14,
double  _m21,
double  _m22,
double  _m23,
double  _m24,
double  _m31,
double  _m32,
double  _m33,
double  _m34,
double  _m41,
double  _m42,
double  _m43,
double  _m44 
)

Constructor initializing with given elements.

GCS::GMatrix44::GMatrix44 ( const GMatrix44 original  ) 

Copy constructor.


Member Function Documentation

GMatrix44 GCS::GMatrix44::createFromOpenGL ( float *  values  )  [static]

Creates a GMatrix44 object from given float array, interpreted as [col][row] The array must be at least have 16 elements.

GMatrix44 GCS::GMatrix44::createIdentityMatrix (  )  [static]

Returns:
an identity matrix.

GMatrix44 GCS::GMatrix44::createRotationAroundAxis ( const GVector3 v,
double  angle_rad 
) [static]

Returns:
a rotation matrix that turns for given angle around given axis.
Parameters:
angle_rad angle to rotate in radians (2*pi for a full turn)

GMatrix44 GCS::GMatrix44::createRotationAroundX ( double  angle_rad  )  [static]

Parameters:
angle_rad angle in radians.
Returns:
a rotation matrix, turning for given angle around x axis.

GMatrix44 GCS::GMatrix44::createRotationAroundY ( double  angle_rad  )  [static]

Same as above but for the Y axis.

GMatrix44 GCS::GMatrix44::createRotationAroundZ ( double  angle_rad  )  [static]

Same as above but for the Y axis.

GMatrix44 GCS::GMatrix44::createScaleMatrix ( const GVector3 v  )  [static]

Returns:
a scale matrix with different scaling for x, y and z.

GMatrix44 GCS::GMatrix44::createScaleMatrix ( double  scalar  )  [static]

Returns:
a scale matrix with equal scaling for x, y and z.

GMatrix44 GCS::GMatrix44::createTranslationMatrix ( const GVector3 v  )  [static]

Returns:
a translation matrix for given vector.

GMatrix44 & GCS::GMatrix44::loadIdentity (  ) 

Converts this matrix into an identity matrix and returns this matrix.

GMatrix44 GCS::GMatrix44::multiply ( const GMatrix44 m  )  const

Multiplies (transforms) this matrix with given matrix, stores the result in a new matrix and returns it.

GMatrix44 GCS::GMatrix44::multiply ( double  scalar  )  const

Multiplies (scales) this matrix with given scalar, stores the result in a new matrix and returns it.

GMatrix44 GCS::GMatrix44::operator * ( const double  scalar  )  const

Multiplies (scales) this matrix with given scalar, stores the result in a new matrix and returns it.

GMatrix44 GCS::GMatrix44::operator * ( const GMatrix44 m  )  const

Multiplies (transforms) this matrix with given matrix, stores the result in a new matrix and returns it.

GCS::GMatrix44::operator double * (  ) 

Casting Operator.

bool GCS::GMatrix44::operator!= ( const GMatrix44 m  )  const [inline]

Compares a this Matrix with another.

Returns:
true when matrices are different.

GMatrix44 GCS::GMatrix44::operator+ ( const GMatrix44 m  )  const

Adds a matrix to the given matrix and return a new Matrix.

GMatrix44 GCS::GMatrix44::operator- ( const GMatrix44 m  )  const

Subtracts a matrix from the given matrix and return a new Matrix.

bool GCS::GMatrix44::operator== ( const GMatrix44 m  )  const [inline]

Compares a this Matrix with another.

Returns:
true when matrices are equal.

GVector3 GCS::GMatrix44::transform ( const GVector3 v  )  const

Transforms given vector with this matrix and return a new transformed vector.


Member Data Documentation

union { ... }

This union represents all elements of the matrix in three variations.

double GCS::GMatrix44::m[4][4]

The field that represents all elements of the matrix interpreted as [rows][columns].

double GCS::GMatrix44::n[16]

The field that represents all elements of the matrix interpreted as [row*4+column].


The documentation for this class was generated from the following files:
Generated on Thu Nov 16 07:49:35 2006 for G System by  doxygen 1.4.7