Matrix4x4 Class Reference

List of all members.

Public Methods

__forceinline Matrix4x4 ()
 Empty constructor.

__forceinline Matrix4x4 (float m00, float m01, float m02, float m03, float m10, float m11, float m12, float m13, float m20, float m21, float m22, float m23, float m30, float m31, float m32, float m33)
 Constructor from 16 values.

__forceinline Matrix4x4 (const Matrix4x4 &mat)
 Copy constructor.

__forceinline ~Matrix4x4 ()
 Destructor.

__forceinline Matrix4x4 & Set (float m00, float m01, float m02, float m03, float m10, float m11, float m12, float m13, float m20, float m21, float m22, float m23, float m30, float m31, float m32, float m33)
 Assign values.

__forceinline const HPoint * GetTrans () const
 Returns the translation part of the matrix.

__forceinline const Matrix4x4 & GetTrans (Point &p) const
 Gets the translation part of the matrix.

__forceinline Matrix4x4 & SetTrans (const Point &p)
 Sets the translation part of the matrix, from a Point.

__forceinline Matrix4x4 & SetTrans (const HPoint &p)
 Sets the translation part of the matrix, from a HPoint.

__forceinline Matrix4x4 & SetTrans (float tx, float ty, float tz)
 Sets the translation part of the matrix, from floats.

__forceinline Matrix4x4 & SetScale (const Point &p)
 Sets the scale from a Point. The point is put on the diagonal.

__forceinline Matrix4x4 & SetScale (float sx, float sy, float sz)
 Sets the scale from floats. Values are put on the diagonal.

Matrix4x4 & Scale (const Point &p)
 Scales from a Point. Each row is multiplied by a component.

Matrix4x4 & Scale (float sx, float sy, float sz)
 Scales from floats. Each row is multiplied by a value.

__forceinline Matrix4x4 & Copy (const Matrix4x4 &source)
 Copy from a Matrix4x4.

__forceinline void GetRow (const udword r, HPoint &p) const
 Returns a row.

__forceinline void GetRow (const udword r, Point &p) const
 Returns a row.

__forceinline void SetRow (const udword r, const HPoint &p)
 Sets a row.

__forceinline void SetRow (const udword r, const Point &p)
 Sets a row.

__forceinline void GetCol (const udword c, HPoint &p) const
 Returns a column.

__forceinline void GetCol (const udword c, Point &p) const
 Returns a column.

__forceinline void SetCol (const udword c, const HPoint &p)
 Sets a column.

__forceinline void SetCol (const udword c, const Point &p)
 Sets a column.

__forceinline float Trace () const
 Computes the trace. The trace is the sum of the 4 diagonal components.

__forceinline Matrix4x4 & Zero ()
 Clears the matrix.

__forceinline Matrix4x4 & Identity ()
 Sets the identity matrix.

__forceinline bool IsIdentity () const
 Checks for identity.

Matrix4x4 & RotX (float angle)
 Sets a rotation matrix around the X axis.

Matrix4x4 & RotY (float angle)
 Sets a rotation matrix around the Y axis.

Matrix4x4 & RotZ (float angle)
 Sets a rotation matrix around the Z axis.

Matrix4x4 & Rot (float angle, Point &p1, Point &p2)
 Makes a rotation matrix about an arbitrary angle.

Matrix4x4 & Transpose ()
 Transposes the matrix.

float CoFactor (udword row, udword col) const
 Computes a cofactor. Used for matrix inversion.

float Determinant () const
 Computes the determinant of the matrix.

Matrix4x4 & Invert ()
 Inverts the matrix. Determinant must be different from zero, else matrix can't be inverted.

__forceinline operator Matrix3x3 () const
 Casts a Matrix4x4 to a Matrix3x3.

 operator Quat () const
 Casts a Matrix4x4 to a Quat.

__forceinline Matrix4x4 operator+ (const Matrix4x4 &mat) const
 Operator for Matrix4x4 Plus = Matrix4x4 + Matrix4x4;.

__forceinline Matrix4x4 operator- (const Matrix4x4 &mat) const
 Operator for Matrix4x4 Minus = Matrix4x4 - Matrix4x4;.

__forceinline Matrix4x4 operator * (const Matrix4x4 &mat) const
 Operator for Matrix4x4 Mul = Matrix4x4 * Matrix4x4;.

__forceinline HPoint operator * (const HPoint &v) const
 Operator for HPoint Mul = Matrix4x4 * HPoint;.

__forceinline Point operator * (const Point &v) const
 Operator for Point Mul = Matrix4x4 * Point;.

__forceinline Matrix4x4 operator * (float s) const
 Operator for Matrix4x4 Scale = Matrix4x4 * float;.

__forceinline Matrix4x4 operator/ (float s) const
 Operator for Matrix4x4 Div = Matrix4x4 / float;.

__forceinline Matrix4x4 & operator+= (const Matrix4x4 &mat)
 Operator for Matrix4x4 += Matrix4x4;.

__forceinline Matrix4x4 & operator-= (const Matrix4x4 &mat)
 Operator for Matrix4x4 -= Matrix4x4;.

Matrix4x4 & operator *= (const Matrix4x4 &mat)
 Operator for Matrix4x4 *= Matrix4x4;.

__forceinline Matrix4x4 & operator *= (float s)
 Operator for Matrix4x4 *= float;.

__forceinline Matrix4x4 & operator/= (float s)
 Operator for Matrix4x4 /= float;.


Friends

__forceinline friend Matrix4x4 operator * (float s, const Matrix4x4 &mat)
 Operator for Matrix4x4 Scale = float * Matrix4x4;.

__forceinline friend Matrix4x4 operator/ (float s, const Matrix4x4 &mat)
 Operator for Matrix4x4 Div = float / Matrix4x4;.


Related Functions

(Note that these are not member functions.)

 InvertPRMatrix (Matrix4x4 &dest, const Matrix4x4 &src)

Detailed Description

4x4 matrix. DirectX-compliant, ie row-column order, ie m[Row][Col]. Same as: m11 m12 m13 m14 first row. m21 m22 m23 m24 second row. m31 m32 m33 m34 third row. m41 m42 m43 m44 fourth row. Translation is (m41, m42, m43), (m14, m24, m34, m44) = (0, 0, 0, 1). Stored in memory as m11 m12 m13 m14 m21...

Multiplication rules:

[x'y'z'1] = [xyz1][M]

x' = x*m11 + y*m21 + z*m31 + m41 y' = x*m12 + y*m22 + z*m32 + m42 z' = x*m13 + y*m23 + z*m33 + m43 1' = 0 + 0 + 0 + m44

Author:
Pierre Terdiman
Version:
1.0
Warning:
THIS IS ONLY A VERY LITTLE SUBSET OF THE ORIGINAL ICE CLASS


Friends And Related Function Documentation

InvertPRMatrix Matrix4x4 &    dest,
const Matrix4x4 &    src
[related]
 

A global function to invert a PR matrix. (which only contains a rotation and a translation)

Parameters:
dest  [out] destination matrix
src  [in] source matrix


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


Flat Four Engine
Copyright (C) 2001 by 379, Inc.
This page generated by Doxygen