Public Member Functions | Friends

GMatrix Class Reference

Search for all occurrences

Detailed Description

This class implements a 4x4 matrix object.

#include <IGameType.h>

Inheritance diagram for GMatrix:
Inheritance graph
[legend]

List of all members.

Public Member Functions

GRow *  GetAddr ()
  Return the Address of the GMatrix. This allows direct access via the [] operator.
const GRow *  GetAddr () const
  Return the Address of the GMatrix. This allows direct access via the [] operator.
IGAMEEXPORT  GMatrix ()
  Default constructor, set Identity matrix.
IGAMEEXPORT  GMatrix (Matrix3)
  Constructor from a Matrix3.
void  ResetMatrix ()
  Set all values to 0.0f.
IGAMEEXPORT BOOL  IsIdentity (float epsilon=1E-5f)
  Determine whether or not the matrix is an Identity matrix.
IGAMEEXPORT void  SetIdentity ()
  Set the Standard Identity Matrix.
IGAMEEXPORT float  Determinant () const
  Return Determinant of matrix.
IGAMEEXPORT GMatrix  Inverse ()
  Return Inverse of matrix.
IGAMEEXPORT Point3  Translation () const
  Return a translation transformation.
IGAMEEXPORT Quat  Rotation () const
  Return a essential rotation transformation.
IGAMEEXPORT Point3  Scaling () const
  Return a scaling transformation.
Quat  ScaleRotation () const
  Return a stretch transformation.
IGAMEEXPORT int  Parity () const
  Return 'parity' sign of the matrix, -1 if negative, 1 otherwise.
IGAMEEXPORT Point4  GetColumn (int i) const
  Access to the matrix column.
IGAMEEXPORT void  SetColumn (int i, Point4 col)
  Set the the matrix column.
Point4  GetRow (int i) const
  Access to the matrix row.
IGAMEEXPORT void  SetRow (int i, Point4 row)
  Set to the matrix row to the desired data.
IGAMEEXPORT Matrix3  ExtractMatrix3 () const
  Extract a Matrix3 from the GMatrix.
Subscript Operator
Point4 operator[] (int i)
  Return a reference to the 'i-th' Point4 of the matrix.
const Point4 operator[] (int i) const
Binary operators
IGAMEEXPORT GMatrix  operator- (const GMatrix &) const
IGAMEEXPORT GMatrix  operator* (const GMatrix &) const
IGAMEEXPORT GMatrix  operator+ (const GMatrix &) const
Assignment operators
IGAMEEXPORT GMatrix operator-= (const GMatrix &M)
IGAMEEXPORT GMatrix operator+= (const GMatrix &M)
IGAMEEXPORT GMatrix operator*= (const GMatrix &M)
IGAMEEXPORT GMatrix operator*= (const float a)
IGAMEEXPORT GMatrix operator= (const Matrix3 &)
  Assignment operator from a Matrix3.
Comparison operators
IGAMEEXPORT BOOL  operator== (const GMatrix &M) const
IGAMEEXPORT BOOL  Equals (const GMatrix &M, float epsilon=1E-5f) const
  Test for equality within the specified tolerance.

Friends

IGAMEEXPORT Point3  operator* (const Point3 &V, const GMatrix &A)
  Multiply a GMatrix with a Point3.

Constructor & Destructor Documentation

IGAMEEXPORT GMatrix ( )

Default constructor, set Identity matrix.

IGAMEEXPORT GMatrix ( Matrix3  )

Constructor from a Matrix3.


Member Function Documentation

Point4& operator[] ( int  i ) [inline]

Return a reference to the 'i-th' Point4 of the matrix.

{ return((Point4&)(*m[i]));}  
const Point4& operator[] ( int  i ) const [inline]
{ return((Point4&)(*m[i])); }
GRow* GetAddr ( ) [inline]

Return the Address of the GMatrix. This allows direct access via the [] operator.

Returns:
The address of the GMatrix
{return (GRow *)(m);}
const GRow* GetAddr ( ) const [inline]

Return the Address of the GMatrix. This allows direct access via the [] operator.

This method is const aware.

Returns:
The address of the GMatrix
{ return (GRow *)(m); }
void ResetMatrix ( )

Set all values to 0.0f.

IGAMEEXPORT BOOL IsIdentity ( float  epsilon = 1E-5f )

Determine whether or not the matrix is an Identity matrix.

within the specified tolerance

Parameters:
epsilon Tolerance defaulted to epsilon = 1E-5f
Returns:
True if the matrix is the Identity matrix
IGAMEEXPORT void SetIdentity ( )

Set the Standard Identity Matrix.

IGAMEEXPORT float Determinant ( ) const

Return Determinant of matrix.

IGAMEEXPORT GMatrix Inverse ( )

Return Inverse of matrix.

IGAMEEXPORT Point3 Translation ( ) const

Return a translation transformation.

IGAMEEXPORT Quat Rotation ( ) const

Return a essential rotation transformation.

IGAMEEXPORT Point3 Scaling ( ) const

Return a scaling transformation.

Quat ScaleRotation ( ) const

Return a stretch transformation.

This is the axis system of the scaling application

IGAMEEXPORT int Parity ( ) const

Return 'parity' sign of the matrix, -1 if negative, 1 otherwise.

IGAMEEXPORT Point4 GetColumn ( int  i ) const

Access to the matrix column.

Parameters:
i The number of the column to retrieve
Returns:
A Point4 containing the column
IGAMEEXPORT void SetColumn ( int  i,
Point4  col 
)

Set the the matrix column.

Point4 GetRow ( int  i ) const [inline]

Access to the matrix row.

{ return (*this)[i]; }  
IGAMEEXPORT void SetRow ( int  i,
Point4  row 
)

Set to the matrix row to the desired data.

IGAMEEXPORT GMatrix operator- ( const GMatrix ) const
IGAMEEXPORT GMatrix operator* ( const GMatrix ) const
IGAMEEXPORT GMatrix operator+ ( const GMatrix ) const
IGAMEEXPORT GMatrix& operator-= ( const GMatrix M )
IGAMEEXPORT GMatrix& operator+= ( const GMatrix M )
IGAMEEXPORT GMatrix& operator*= ( const GMatrix M )
IGAMEEXPORT GMatrix& operator*= ( const float  a )
IGAMEEXPORT GMatrix& operator= ( const Matrix3 )

Assignment operator from a Matrix3.

IGAMEEXPORT BOOL operator== ( const GMatrix M ) const
IGAMEEXPORT BOOL Equals ( const GMatrix M,
float  epsilon = 1E-5f 
) const

Test for equality within the specified tolerance.

IGAMEEXPORT Matrix3 ExtractMatrix3 ( ) const

Extract a Matrix3 from the GMatrix.

This is for backward compatibility. This is only of use if you use 3ds Max as a coordinate system, other wise standard 3ds Max algebra might not be correct for your format.

Returns:
A 3ds Max Matrix3 form of the GMatrix

Friends And Related Function Documentation

IGAMEEXPORT Point3 operator* ( const Point3 V,
const GMatrix A 
) [friend]

Multiply a GMatrix with a Point3.


GMatrix GMatrix GMatrix GMatrix GMatrix GMatrix GMatrix GMatrix GMatrix GMatrix
GMatrix GMatrix GMatrix GMatrix GMatrix GMatrix GMatrix GMatrix GMatrix GMatrix