Public Member Functions | Public Attributes | Friends | Related Functions
Matrix4x4 Class Reference

#include <IceMatrix4x4.h>

List of all members.

Public Member Functions

float CoFactor (udword row, udword col) const
 Computes a cofactor. Used for matrix inversion.
inline_ void Copy (const Matrix4x4 &source)
 Copy from a Matrix4x4.
float Determinant () const
 Computes the determinant of the matrix.
inline_ void GetCol (const udword c, HPoint &p) const
 Returns a column.
inline_ void GetCol (const udword c, Point &p) const
 Returns a column.
inline_ void GetRow (const udword r, HPoint &p) const
 Returns a row.
inline_ void GetRow (const udword r, Point &p) const
 Returns a row.
inline_ const HPointGetRow (const udword r) const
 Returns a row.
inline_ HPointGetRow (const udword r)
 Returns a row.
inline_ const HPointGetTrans () const
 Returns the translation part of the matrix.
inline_ void GetTrans (Point &p) const
 Gets the translation part of the matrix.
inline_ void Identity ()
 Sets the identity matrix.
Matrix4x4Invert ()
 Inverts the matrix. Determinant must be different from zero, else matrix can't be inverted.
inline_ bool IsIdentity () const
 Checks for identity.
inline_ BOOL IsValid () const
 Checks matrix validity.
inline_ Matrix4x4 ()
 Empty constructor.
inline_ 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.
inline_ Matrix4x4 (const Matrix4x4 &mat)
 Copy constructor.
inline_ operator Matrix3x3 () const
 Casts a Matrix4x4 to a Matrix3x3.
 operator PR () const
 Casts a Matrix4x4 to a PR.
 operator Quat () const
 Casts a Matrix4x4 to a Quat.
inline_ Matrix4x4 operator* (const Matrix4x4 &mat) const
 Operator for Matrix4x4 Mul = Matrix4x4 * Matrix4x4;.
inline_ HPoint operator* (const HPoint &v) const
 Operator for HPoint Mul = Matrix4x4 * HPoint;.
inline_ Point operator* (const Point &v) const
 Operator for Point Mul = Matrix4x4 * Point;.
inline_ Matrix4x4 operator* (float s) const
 Operator for Matrix4x4 Scale = Matrix4x4 * float;.
Matrix4x4operator*= (const Matrix4x4 &mat)
 Operator for Matrix4x4 *= Matrix4x4;.
inline_ Matrix4x4operator*= (float s)
 Operator for Matrix4x4 *= float;.
inline_ Matrix4x4 operator+ (const Matrix4x4 &mat) const
 Operator for Matrix4x4 Plus = Matrix4x4 + Matrix4x4;.
inline_ Matrix4x4operator+= (const Matrix4x4 &mat)
 Operator for Matrix4x4 += Matrix4x4;.
inline_ Matrix4x4 operator- (const Matrix4x4 &mat) const
 Operator for Matrix4x4 Minus = Matrix4x4 - Matrix4x4;.
inline_ Matrix4x4operator-= (const Matrix4x4 &mat)
 Operator for Matrix4x4 -= Matrix4x4;.
inline_ Matrix4x4 operator/ (float s) const
 Operator for Matrix4x4 Div = Matrix4x4 / float;.
inline_ Matrix4x4operator/= (float s)
 Operator for Matrix4x4 /= float;.
inline_ const HPointoperator[] (int row) const
inline_ HPointoperator[] (int row)
Matrix4x4Rot (float angle, Point &p1, Point &p2)
 Makes a rotation matrix about an arbitrary axis.
void RotX (float angle)
 Sets a rotation matrix around the X axis.
void RotY (float angle)
 Sets a rotation matrix around the Y axis.
void RotZ (float angle)
 Sets a rotation matrix around the Z axis.
void Scale (const Point &p)
 Scales from a Point. Each row is multiplied by a component.
void Scale (float sx, float sy, float sz)
 Scales from floats. Each row is multiplied by a value.
inline_ Matrix4x4Set (float m00, float m01, float m02, float m10, float m11, float m12, float m20, float m21, float m22)
 Assign values (rotation only)
inline_ Matrix4x4Set (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.
inline_ void SetCol (const udword c, const HPoint &p)
 Sets a column.
inline_ void SetCol (const udword c, const Point &p)
 Sets a column.
inline_ void SetRow (const udword r, const HPoint &p)
 Sets a row.
inline_ void SetRow (const udword r, const Point &p)
 Sets a row.
inline_ void SetScale (const Point &p)
 Sets the scale from a Point. The point is put on the diagonal.
inline_ void SetScale (float sx, float sy, float sz)
 Sets the scale from floats. Values are put on the diagonal.
inline_ void SetTrans (const Point &p)
 Sets the translation part of the matrix, from a Point.
inline_ void SetTrans (const HPoint &p)
 Sets the translation part of the matrix, from a HPoint.
inline_ void SetTrans (float tx, float ty, float tz)
 Sets the translation part of the matrix, from floats.
inline_ float Trace () const
 Computes the trace. The trace is the sum of the 4 diagonal components.
inline_ float Trace3x3 () const
 Computes the trace of the upper 3x3 matrix.
void Transpose ()
 Transposes the matrix.
inline_ void Zero ()
 Clears the matrix.
inline_ ~Matrix4x4 ()
 Destructor.

Public Attributes

float m [4][4]

Friends

inline_ friend Matrix4x4 operator* (float s, const Matrix4x4 &mat)
 Operator for Matrix4x4 Scale = float * Matrix4x4;.
inline_ 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

Definition at line 21 of file IceMatrix4x4.h.


Constructor & Destructor Documentation

Empty constructor.

Definition at line 28 of file IceMatrix4x4.h.

inline_ Matrix4x4::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 
) [inline]

Constructor from 16 values.

Definition at line 30 of file IceMatrix4x4.h.

Copy constructor.

Definition at line 41 of file IceMatrix4x4.h.

Destructor.

Definition at line 43 of file IceMatrix4x4.h.


Member Function Documentation

float Matrix4x4::CoFactor ( udword  row,
udword  col 
) const

Computes a cofactor. Used for matrix inversion.

inline_ void Matrix4x4::Copy ( const Matrix4x4 source) [inline]

Copy from a Matrix4x4.

Definition at line 69 of file IceMatrix4x4.h.

float Matrix4x4::Determinant ( ) const

Computes the determinant of the matrix.

inline_ void Matrix4x4::GetCol ( const udword  c,
HPoint p 
) const [inline]

Returns a column.

Definition at line 85 of file IceMatrix4x4.h.

inline_ void Matrix4x4::GetCol ( const udword  c,
Point p 
) const [inline]

Returns a column.

Definition at line 87 of file IceMatrix4x4.h.

inline_ void Matrix4x4::GetRow ( const udword  r,
HPoint p 
) const [inline]

Returns a row.

Definition at line 73 of file IceMatrix4x4.h.

inline_ void Matrix4x4::GetRow ( const udword  r,
Point p 
) const [inline]

Returns a row.

Definition at line 75 of file IceMatrix4x4.h.

Returns a row.

Definition at line 77 of file IceMatrix4x4.h.

Returns a row.

Definition at line 79 of file IceMatrix4x4.h.

inline_ const HPoint& Matrix4x4::GetTrans ( ) const [inline]

Returns the translation part of the matrix.

Definition at line 95 of file IceMatrix4x4.h.

inline_ void Matrix4x4::GetTrans ( Point p) const [inline]

Gets the translation part of the matrix.

Definition at line 97 of file IceMatrix4x4.h.

Sets the identity matrix.

Definition at line 174 of file IceMatrix4x4.h.

Inverts the matrix. Determinant must be different from zero, else matrix can't be inverted.

inline_ bool Matrix4x4::IsIdentity ( ) const [inline]

Checks for identity.

Definition at line 176 of file IceMatrix4x4.h.

inline_ BOOL Matrix4x4::IsValid ( ) const [inline]

Checks matrix validity.

Definition at line 201 of file IceMatrix4x4.h.

inline_ Matrix4x4::operator Matrix3x3 ( ) const [inline]

Casts a Matrix4x4 to a Matrix3x3.

Definition at line 244 of file IceMatrix4x4.h.

Matrix4x4::operator PR ( ) const

Casts a Matrix4x4 to a PR.

Matrix4x4::operator Quat ( ) const

Casts a Matrix4x4 to a Quat.

inline_ Matrix4x4 Matrix4x4::operator* ( const Matrix4x4 mat) const [inline]

Operator for Matrix4x4 Mul = Matrix4x4 * Matrix4x4;.

Definition at line 278 of file IceMatrix4x4.h.

inline_ HPoint Matrix4x4::operator* ( const HPoint v) const [inline]

Operator for HPoint Mul = Matrix4x4 * HPoint;.

Definition at line 303 of file IceMatrix4x4.h.

inline_ Point Matrix4x4::operator* ( const Point v) const [inline]

Operator for Point Mul = Matrix4x4 * Point;.

Definition at line 306 of file IceMatrix4x4.h.

inline_ Matrix4x4 Matrix4x4::operator* ( float  s) const [inline]

Operator for Matrix4x4 Scale = Matrix4x4 * float;.

Definition at line 314 of file IceMatrix4x4.h.

Matrix4x4& Matrix4x4::operator*= ( const Matrix4x4 mat) [inline]

Operator for Matrix4x4 *= Matrix4x4;.

Definition at line 376 of file IceMatrix4x4.h.

inline_ Matrix4x4& Matrix4x4::operator*= ( float  s) [inline]

Operator for Matrix4x4 *= float;.

Definition at line 408 of file IceMatrix4x4.h.

inline_ Matrix4x4 Matrix4x4::operator+ ( const Matrix4x4 mat) const [inline]

Operator for Matrix4x4 Plus = Matrix4x4 + Matrix4x4;.

Definition at line 258 of file IceMatrix4x4.h.

inline_ Matrix4x4& Matrix4x4::operator+= ( const Matrix4x4 mat) [inline]

Operator for Matrix4x4 += Matrix4x4;.

Definition at line 356 of file IceMatrix4x4.h.

inline_ Matrix4x4 Matrix4x4::operator- ( const Matrix4x4 mat) const [inline]

Operator for Matrix4x4 Minus = Matrix4x4 - Matrix4x4;.

Definition at line 268 of file IceMatrix4x4.h.

inline_ Matrix4x4& Matrix4x4::operator-= ( const Matrix4x4 mat) [inline]

Operator for Matrix4x4 -= Matrix4x4;.

Definition at line 366 of file IceMatrix4x4.h.

inline_ Matrix4x4 Matrix4x4::operator/ ( float  s) const [inline]

Operator for Matrix4x4 Div = Matrix4x4 / float;.

Definition at line 334 of file IceMatrix4x4.h.

inline_ Matrix4x4& Matrix4x4::operator/= ( float  s) [inline]

Operator for Matrix4x4 /= float;.

Definition at line 418 of file IceMatrix4x4.h.

inline_ const HPoint& Matrix4x4::operator[] ( int  row) const [inline]

Definition at line 428 of file IceMatrix4x4.h.

inline_ HPoint& Matrix4x4::operator[] ( int  row) [inline]

Definition at line 429 of file IceMatrix4x4.h.

Matrix4x4& Matrix4x4::Rot ( float  angle,
Point p1,
Point p2 
)

Makes a rotation matrix about an arbitrary axis.

void Matrix4x4::RotX ( float  angle) [inline]

Sets a rotation matrix around the X axis.

Definition at line 214 of file IceMatrix4x4.h.

void Matrix4x4::RotY ( float  angle) [inline]

Sets a rotation matrix around the Y axis.

Definition at line 216 of file IceMatrix4x4.h.

void Matrix4x4::RotZ ( float  angle) [inline]

Sets a rotation matrix around the Z axis.

Definition at line 218 of file IceMatrix4x4.h.

void Matrix4x4::Scale ( const Point p) [inline]

Scales from a Point. Each row is multiplied by a component.

Definition at line 111 of file IceMatrix4x4.h.

void Matrix4x4::Scale ( float  sx,
float  sy,
float  sz 
) [inline]

Scales from floats. Each row is multiplied by a value.

Definition at line 118 of file IceMatrix4x4.h.

inline_ Matrix4x4& Matrix4x4::Set ( float  m00,
float  m01,
float  m02,
float  m10,
float  m11,
float  m12,
float  m20,
float  m21,
float  m22 
) [inline]

Assign values (rotation only)

Definition at line 46 of file IceMatrix4x4.h.

inline_ Matrix4x4& 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 
) [inline]

Assign values.

Definition at line 56 of file IceMatrix4x4.h.

inline_ void Matrix4x4::SetCol ( const udword  c,
const HPoint p 
) [inline]

Sets a column.

Definition at line 89 of file IceMatrix4x4.h.

inline_ void Matrix4x4::SetCol ( const udword  c,
const Point p 
) [inline]

Sets a column.

Definition at line 91 of file IceMatrix4x4.h.

inline_ void Matrix4x4::SetRow ( const udword  r,
const HPoint p 
) [inline]

Sets a row.

Definition at line 81 of file IceMatrix4x4.h.

inline_ void Matrix4x4::SetRow ( const udword  r,
const Point p 
) [inline]

Sets a row.

Definition at line 83 of file IceMatrix4x4.h.

Sets the scale from a Point. The point is put on the diagonal.

Definition at line 107 of file IceMatrix4x4.h.

inline_ void Matrix4x4::SetScale ( float  sx,
float  sy,
float  sz 
) [inline]

Sets the scale from floats. Values are put on the diagonal.

Definition at line 109 of file IceMatrix4x4.h.

Sets the translation part of the matrix, from a Point.

Definition at line 99 of file IceMatrix4x4.h.

Sets the translation part of the matrix, from a HPoint.

Definition at line 101 of file IceMatrix4x4.h.

inline_ void Matrix4x4::SetTrans ( float  tx,
float  ty,
float  tz 
) [inline]

Sets the translation part of the matrix, from floats.

Definition at line 103 of file IceMatrix4x4.h.

inline_ float Matrix4x4::Trace ( ) const [inline]

Computes the trace. The trace is the sum of the 4 diagonal components.

Definition at line 168 of file IceMatrix4x4.h.

inline_ float Matrix4x4::Trace3x3 ( ) const [inline]

Computes the trace of the upper 3x3 matrix.

Definition at line 170 of file IceMatrix4x4.h.

void Matrix4x4::Transpose ( ) [inline]

Transposes the matrix.

Definition at line 224 of file IceMatrix4x4.h.

Clears the matrix.

Definition at line 172 of file IceMatrix4x4.h.


Friends And Related Function Documentation

InvertPRMatrix ( Matrix4x4 dest,
const Matrix4x4 src 
) [related]

Inverts a PR matrix. (which only contains a rotation and a translation) This is faster and less subject to FPU errors than the generic inversion code.

Parameters:
dest[out] destination matrix
src[in] source matrix
inline_ friend Matrix4x4 operator* ( float  s,
const Matrix4x4 mat 
) [friend]

Operator for Matrix4x4 Scale = float * Matrix4x4;.

Definition at line 324 of file IceMatrix4x4.h.

inline_ friend Matrix4x4 operator/ ( float  s,
const Matrix4x4 mat 
) [friend]

Operator for Matrix4x4 Div = float / Matrix4x4;.

Definition at line 346 of file IceMatrix4x4.h.


Member Data Documentation

float Matrix4x4::m[4][4]

Definition at line 433 of file IceMatrix4x4.h.


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


openhrp3
Author(s): AIST, General Robotix Inc., Nakamura Lab of Dept. of Mechano Informatics at University of Tokyo
autogenerated on Thu Apr 11 2019 03:30:21