Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | Related Pages

Matrix Class Reference

#include <nemath.h>

Collaboration diagram for Matrix:

Collaboration graph
[legend]
List of all members.

Detailed Description

4x4 matrix Simple 4x4 matrix class with useful math operations

Author:
Mattias Jansson (mattias@realityrift.com)


Public Member Functions

 Matrix ()
 Matrix (const Matrix &rkMatrix)
 Matrix (const float afComponents[])
 Matrix (const Quaternion &rkQuat)
 Matrix (const Quaternion &rkQuat, const Vector3d &rkTranslation)
 Matrix (const Vector3d &rkVector)
MatrixReset ()
MatrixSet (float afComponents[])
MatrixSet (const Quaternion &rkQuat, const Vector3d &rkTranslation)
MatrixSet (const Vector3d &rkVector)
MatrixSetRotation (const Quaternion &rkQuat)
MatrixSetTranslation (const Vector3d &rkTranslation)
MatrixTranspose ()
MatrixTransposeTo (Matrix *pkMatrix)
Vector3d GetColumn (int iColumn) const
Matrixoperator= (const Matrix &rkMatrix)
Matrixoperator= (const Quaternion &rkQuat)
Matrix operator * (const Matrix &rkMatrix) const
Matrixoperator *= (const Matrix &rkMatrix)
Matrix operator * (float fScale) const
Matrixoperator *= (float fScale)
Matrix operator- (const Matrix &rkMatrix) const
Matrixoperator-= (const Matrix &rkMatrix)
Matrix operator+ (const Matrix &rkMatrix) const
Matrixoperator+= (const Matrix &rkMatrix)
Vector3d operator * (const Vector3d &rkVector) const
bool operator== (const Matrix &rkMatrix) const
bool operator!= (const Matrix &rkMatrix) const
float * operator[] (int iRow)
 operator float * ()
const float * operator[] (int iRow) const
 operator const float * () const
bool operator< (const Matrix &rkMatrix) const

Public Attributes

float m_aafMatrix [4][4]

Static Public Attributes

const NE_STATIC Matrix IDENTITY

Static Private Attributes

const NE_STATIC float g_afIdentityMatrix [16]


Constructor & Destructor Documentation

NEOENGINE_API Matrix  )  [inline]
 

Reset components to identity matrix

NEOENGINE_API Matrix const Matrix rkMatrix  )  [inline]
 

Set components

Parameters:
rkMatrix Matrix to copy values from

NEOENGINE_API Matrix const float  afComponents[]  )  [inline]
 

Set components

Parameters:
afComponents Array of floats to copy components from

NEOENGINE_API Matrix const Quaternion rkQuat  )  [inline]
 

Build rotation matrix from quaternion

Parameters:
rkQuat Quaternion to convert to matrix

NEOENGINE_API Matrix const Quaternion rkQuat,
const Vector3d rkTranslation
[inline]
 

Build transformation matrix from rotation and translation

Parameters:
rkQuat Rotation
rkTranslation Translation

NEOENGINE_API Matrix const Vector3d rkVector  )  [inline]
 

Create a cross-product matrix M from vector, such that M * a = rkVector x a

Parameters:
rkVector Vector


Member Function Documentation

NEOENGINE_API Matrix & Reset  )  [inline]
 

Reset components to identity matrix

Returns:
Resulting Matrix ref (this)

NEOENGINE_API Matrix & Set float  afComponents[]  )  [inline]
 

Set components

Parameters:
afComponents Array of floats to copy components from
Returns:
Resulting Matrix ref (this)

NEOENGINE_API Matrix & Set const Quaternion rkQuat,
const Vector3d rkTranslation
[inline]
 

Build transformation matrix from rotation and translation

Parameters:
rkQuat Rotation
rkTranslation Translation as vector
Returns:
Resulting Matrix ref (this)

NEOENGINE_API Matrix & Set const Vector3d rkVector  )  [inline]
 

Create a cross-product matrix M from vector, such that M * a = rkVector x a

Parameters:
rkVector Vector
Returns:
Resulting const Matrix ref (this)

NEOENGINE_API Matrix & SetRotation const Quaternion rkQuat  )  [inline]
 

Set rotation part of matrix from quaternion (does not touch translation part)

Parameters:
rkQuat Rotation as quaternion
Returns:
Resulting Matrix ref (this)

NEOENGINE_API Matrix & SetTranslation const Vector3d rkTranslation  )  [inline]
 

Set translation part of matrix from vector (does not touch rotation part)

Parameters:
rkTranslation Translation as vector
Returns:
Resulting Matrix ref (this)

NEOENGINE_API Matrix & Transpose  )  [inline]
 

Transpose matrix (modifies this matrix!)

Returns:
Resulting const Matrix ref (this)

NEOENGINE_API Matrix & TransposeTo Matrix pkMatrix  )  [inline]
 

Transpose matrix and store in given matrix (does not store in temporary space, DO NOT pass this as argument)

Parameters:
pkMatrix Matrix receiving transpose of this matrix
Returns:
Resulting matrix (*pkMatrix)

NEOENGINE_API Vector3d GetColumn int  iColumn  )  const [inline]
 

Column access

Parameters:
iColumn Column index
Returns:
Vector (axis)

NEOENGINE_API Matrix & operator= const Matrix rkMatrix  )  [inline]
 

Assignment

Parameters:
rkMatrix Matrix to copy values from
Returns:
Resulting Matrix ref (this)

NEOENGINE_API Matrix & operator= const Quaternion rkQuat  )  [inline]
 

Assignment from quaternion, build rotation matrix (resets translations!)

Parameters:
rkQuat Quaternion to convert to matrix
Returns:
Resulting Matrix

NEOENGINE_API Matrix operator * const Matrix rkMatrix  )  const [inline]
 

Matrix multiplication

Parameters:
rkMatrix Matrix to multiply with, result = this * rkMatrix
Returns:
Result matrix

NEOENGINE_API Matrix & operator *= const Matrix rkMatrix  )  [inline]
 

Matrix multiplication and assignment

Parameters:
rkMatrix Matrix to multiply with, this = this * rkMatrix, result = this
Returns:
Resulting Matrix ref (this)

NEOENGINE_API Matrix operator * float  fScale  )  const [inline]
 

Scale matrix by scalar

Parameters:
fScale Scalar value
Returns:
Resulting Matrix

NEOENGINE_API Matrix & operator *= float  fScale  )  [inline]
 

Scale matrix by scalar

Parameters:
fScale Scalar value
Returns:
Resulting Matrix ref (this)

NEOENGINE_API Matrix operator- const Matrix rkMatrix  )  const [inline]
 

Matrix subtraction

Parameters:
rkMatrix Matrix to subtract from this
Returns:
Resulting Matrix

NEOENGINE_API Matrix & operator-= const Matrix rkMatrix  )  [inline]
 

Matrix subtraction and assignment

Parameters:
rkMatrix Matrix to subtract from this
Returns:
Resulting Matrix ref (this)

NEOENGINE_API Matrix operator+ const Matrix rkMatrix  )  const [inline]
 

Matrix addition

Parameters:
rkMatrix Matrix to add to this
Returns:
Resulting Matrix

NEOENGINE_API Matrix & operator+= const Matrix rkMatrix  )  [inline]
 

Matrix addition and assignment

Parameters:
rkMatrix Matrix to add to this
Returns:
Resulting Matrix ref (this)

NEOENGINE_API Vector3d operator * const Vector3d rkVector  )  const [inline]
 

Multiplication with vector (transform vector)

Parameters:
rkVector Vector to transform
Returns:
Result vector

NEOENGINE_API bool operator== const Matrix rkMatrix  )  const [inline]
 

Compare with epsilon tolerance

Parameters:
rkMatrix Matrix to compare with
Returns:
true if equal (in epsilon zone), false if not

NEOENGINE_API bool operator!= const Matrix rkMatrix  )  const [inline]
 

Compare with epsilon tolerance

Parameters:
rkMatrix Matrix to compare wtih
Returns:
true if not equal, false if equal (in epsilon zone)

NEOENGINE_API float * operator[] int  iRow  )  [inline]
 

Row access

Parameters:
iRow Row to access
Returns:
float pointer to row

operator float *  )  [inline]
 

Conversion to float pointer

NEOENGINE_API const float * operator[] int  iRow  )  const [inline]
 

Row access

Parameters:
iRow Row to access
Returns:
float pointer to row

operator const float *  )  const [inline]
 

Conversion to float pointer

bool operator< const Matrix rkMatrix  )  const [inline]
 

Dummy operator for Win32 std::vector DLL exports


Member Data Documentation

const NE_STATIC float g_afIdentityMatrix[16] [static, private]
 

Identity matrix array

float m_aafMatrix[4][4]
 

Components

const NE_STATIC Matrix IDENTITY [static]
 

Identity matrix


The documentation for this class was generated from the following file:
Generated on Wed Jan 21 14:21:12 2004 for NeoEngine by doxygen 1.3.5