Files Class List
Matrix34f Class Reference

Detailed Description

3x4 Matrix class with float type elements

+ Inheritance diagram for Matrix34f:

Public Member Functions

Unary and Binary Operators
Matrix34 operator* (const float &value) const
 
Matrix34 operator* (const Matrix34 &right) const
 
Matrix34 operator* (const Matrix3< float > &right) const
 
Point3< float > operator* (const Point3< float > &p) const
 
Point4< float > operator* (const Point4< float > &p) const
 
Matrix34 operator- () const
 
Matrix34 operator- (const Matrix34 &right) const
 
Matrix34 operator/ (const float &value) const
 
Matrix34 operator+ (const Matrix34 &right) const
 
Set & Get Methods
void Zero ()
 
bool IsZero () const
 
void Get (float *values)
 
void Set (const float *values)
 
void Set (const Point3< float > &x, const Point3< float > &y, const Point3< float > &z, const Point3< float > &pos)
 
void Set (const Point3< float > &pos, const Point3< float > &normal, const Point3< float > &dir)
 
void SetIdentity ()
 
void SetScaledIdentity (float v)
 
Affine transformations
void SetScale (const float &uniformScale)
 
void SetScale (const float &scaleX, const float &scaleY, const float &scaleZ)
 
void SetScale (const Point3< float > &scale)
 
void SetNoScale ()
 
void SetRotationX (float angle)
 
void SetRotationX (float sinAngle, float cosAngle)
 
void SetRotationY (float angle)
 
void SetRotationY (float sinAngle, float cosAngle)
 
void SetRotationZ (float angle)
 
void SetRotationZ (float sinAngle, float cosAngle)
 
void SetRotationXYZ (float angleX, float angleY, float angleZ)
 
void SetRotationZYX (float angleX, float angleY, float angleZ)
 
void SetRotation (const Point3< float > &axis, float angle)
 
void SetRotation (const Point3< float > &axis, float sinAngle, float cosAngle)
 
void SetRotation (const Point3< float > &from, const Point3< float > &to)
 
void SetTrans (const Point3< float > &move)
 
void AddTrans (const Point3< float > &move)
 
void SetTransComponent (const Point3< float > &move)
 
void SetView (const Point3< float > &pos, const Point3< float > &target, const Point3< float > &up)
 
void SetNormal (const Point3< float > &normal, const Point3< float > &dir)
 
Set Row, Column, or Diagonal
void SetRow (int row, float x, float y, float z, float w)
 
void SetColumn (int column, float x, float y, float z)
 
void SetDiagonal (const float &xx, const float &yy, const float &zz)
 
void SetDiagonal (const Point3< float > &p)
 
void SetDiagonal (const float *values)
 
Get Row, Column, or Diagonal
Point4< float > GetRow (int row) const
 
void GetRow (int row, Point4< float > &p) const
 
void GetRow (int row, float *values) const
 
Point3< float > GetColumn (int col) const
 
void GetColumn (int col, Point3< float > &p) const
 
void GetColumn (int col, float *values) const
 
Point3< float > GetDiagonal () const
 
void GetDiagonal (Point3< float > &p) const
 
void GetDiagonal (float *values) const
 
Get Sub-matrix data
void GetSubMatrix (Matrix3< float > &m) const
 
void GetSubMatrix (Matrix2< float > &m) const
 
Matrix3< float > GetSubMatrix3 () const
 
void GetSubMatrix3 (Matrix3< float > &m) const
 
void GetSubMatrix3 (float *mdata) const
 
Matrix2< float > GetSubMatrix2 () const
 
void GetSubMatrix2 (Matrix2< float > &m) const
 
void GetSubMatrix2 (float *mdata) const
 
Point3< float > GetTrans () const
 
void GetTrans (Point3< float > &p) const
 
void GetTrans (float *trans) const
 
Comparison Operators

Returns the translation component of the matrix

bool operator== (const Matrix34 &right) const
 
bool operator!= (const Matrix34 &right) const
 
Access Operators
float & operator() (int row, int column)
 
const float & operator() (int row, int column) const
 
float & operator[] (int i)
 
const float & operator[] (int i) const
 
Assignment Operators
const Matrix34operator+= (const Matrix34 &right)
 
const Matrix34operator-= (const Matrix34 &right)
 
const Matrix34operator*= (const Matrix34 &right)
 
const Matrix34operator*= (const Matrix3< float > &right)
 
const Matrix34operator*= (const float &value)
 
const Matrix34operator/= (const float &value)
 
Other Methods
void Transpose ()
 
void GetTranspose (Matrix34 &m) const
 
Matrix34 GetTranspose () const
 
Point4< float > TransposeMult (const Point3< float > &p) const
 
Point4< float > TransposeMult (const Point4< float > &p) const
 
float GetDeterminant () const
 
void Invert ()
 
void GetInverse (Matrix34 &inverse) const
 
Matrix34 GetInverse () const
 
void OrthogonalizeX ()
 
void OrthogonalizeY ()
 
void OrthogonalizeZ ()
 
bool IsIdentity (float tollerance=float(0.001)) const
 
bool IsSymmetric (float tollerance=float(0.001)) const
 

Static Public Member Functions

Static Methods
static Matrix34 MatrixIdentity ()
 
static Matrix34 MatrixNormal (const Point3< float > &normal, Point3< float > &dir)
 
static Matrix34 MatrixRotationX (float angle)
 
static Matrix34 MatrixRotationY (float angle)
 
static Matrix34 MatrixRotationZ (float angle)
 
static Matrix34 MatrixRotationXYZ (float angleX, float angleY, float angleZ)
 
static Matrix34 MatrixRotationZYX (float angleX, float angleY, float angleZ)
 
static Matrix34 MatrixRotation (const Point3< float > &axis, float angle)
 
static Matrix34 MatrixRotation (const Point3< float > &from, const Point3< float > &to)
 
static Matrix34 MatrixScale (const float &uniformScale)
 
static Matrix34 MatrixScale (const float &scaleX, const float &scaleY, const float &scaleZ)
 
static Matrix34 MatrixScale (const Point3< float > &scale)
 
static Matrix34 MatrixTrans (const Point3< float > &move)
 

Public Attributes

float data [12]
 

Member Function Documentation

§ operator*() [1/5]

Matrix34 operator* ( const float &  value) const
inherited

multiply matrix by a value

§ operator*() [2/5]

Matrix34 operator* ( const Matrix34< float > &  right) const
inherited

< multiply a matrix with another

§ operator*() [3/5]

Matrix34 operator* ( const Matrix3< float > &  right) const
inherited

< multiply a matrix with another

§ operator*() [4/5]

Point3<float > operator* ( const Point3< float > &  p) const
inherited

negative matrix

§ operator*() [5/5]

Point4<float > operator* ( const Point4< float > &  p) const
inherited

negative matrix

§ Zero()

void Zero ( )
inherited

Set all the values as zero.

§ IsZero()

bool IsZero ( ) const
inherited

Returns true if the matrix is exactly zero.

§ Get()

void Get ( float *  values)
inherited

Copies the matrix data to the given values array of size 12.

§ Set() [1/3]

void Set ( const float *  values)
inherited

Set Matrix using an array of 12 values.

§ Set() [2/3]

void Set ( const Point3< float > &  x,
const Point3< float > &  y,
const Point3< float > &  z,
const Point3< float > &  pos 
)
inherited

Set matrix using x,y,z vectors and coordinate center.

§ Set() [3/3]

void Set ( const Point3< float > &  pos,
const Point3< float > &  normal,
const Point3< float > &  dir 
)
inherited

Set matrix using position, normal, and approximate x direction.

§ SetIdentity()

void SetIdentity ( )
inherited

Converts the matrix to an identity matrix.

§ SetScaledIdentity()

void SetScaledIdentity ( float  v)
inherited

Converts the matrix to an identity matrix scaled by a scalar.

§ SetScale() [1/3]

void SetScale ( const float &  uniformScale)
inherited

Sets a uniform scale matrix.

§ SetScale() [2/3]

void SetScale ( const float &  scaleX,
const float &  scaleY,
const float &  scaleZ 
)
inherited

Sets a scale matrix.

§ SetScale() [3/3]

void SetScale ( const Point3< float > &  scale)
inherited

Sets a scale matrix.

§ SetNoScale()

void SetNoScale ( )
inherited

Removes the scale component of the matrix.

§ SetRotationX() [1/2]

void SetRotationX ( float  angle)
inherited

Set as rotation matrix around x axis.

§ SetRotationX() [2/2]

void SetRotationX ( float  sinAngle,
float  cosAngle 
)
inherited

Set as rotation matrix around x axis by cos and sin of angle.

§ SetRotationY() [1/2]

void SetRotationY ( float  angle)
inherited

Set as rotation matrix around y axis.

§ SetRotationY() [2/2]

void SetRotationY ( float  sinAngle,
float  cosAngle 
)
inherited

Set as rotation matrix around y axis by cos and sin of angle.

§ SetRotationZ() [1/2]

void SetRotationZ ( float  angle)
inherited

Set as rotation matrix around z axis.

§ SetRotationZ() [2/2]

void SetRotationZ ( float  sinAngle,
float  cosAngle 
)
inherited

Set as rotation matrix around z axis by cos and sin of angle.

§ SetRotationXYZ()

void SetRotationXYZ ( float  angleX,
float  angleY,
float  angleZ 
)
inherited

Set as rotation matrix around x, y, and then z axes ( Rz * Ry * Rx )

§ SetRotationZYX()

void SetRotationZYX ( float  angleX,
float  angleY,
float  angleZ 
)
inherited

Set as rotation matrix around z, y, and then x axes ( Rx * Ry * Rz )

§ SetRotation() [1/3]

void SetRotation ( const Point3< float > &  axis,
float  angle 
)
inherited

Set a rotation matrix about the given axis by angle.

§ SetRotation() [2/3]

void SetRotation ( const Point3< float > &  axis,
float  sinAngle,
float  cosAngle 
)
inherited

Set a rotation matrix about the given axis by cos and sin of angle.

§ SetRotation() [3/3]

void SetRotation ( const Point3< float > &  from,
const Point3< float > &  to 
)
inherited

Set a rotation matrix that sets [from] unit vector to [to] unit vector.

§ SetTrans()

void SetTrans ( const Point3< float > &  move)
inherited

Sets a translation matrix with no rotation or scale.

§ AddTrans()

void AddTrans ( const Point3< float > &  move)
inherited

Adds a translation to the matrix.

§ SetTransComponent()

void SetTransComponent ( const Point3< float > &  move)
inherited

Sets the translation component of the matrix.

§ SetView()

void SetView ( const Point3< float > &  pos,
const Point3< float > &  target,
const Point3< float > &  up 
)
inherited

Set view matrix using position, target and approximate up vector.

§ SetNormal()

void SetNormal ( const Point3< float > &  normal,
const Point3< float > &  dir 
)
inherited

Set matrix using normal and approximate x direction.

§ SetRow()

void SetRow ( int  row,
float  x,
float  y,
float  z,
float  w 
)
inherited

Sets a row of the matrix.

§ SetColumn()

void SetColumn ( int  column,
float  x,
float  y,
float  z 
)
inherited

Sets a column of the matrix.

§ SetDiagonal() [1/3]

void SetDiagonal ( const float &  xx,
const float &  yy,
const float &  zz 
)
inherited

Sets the diagonal values of the matrix.

§ SetDiagonal() [2/3]

void SetDiagonal ( const Point3< float > &  p)
inherited

Sets the diagonal values of the matrix.

§ SetDiagonal() [3/3]

void SetDiagonal ( const float *  values)
inherited

Sets the diagonal values of the matrix.

§ GetRow() [1/3]

Point4<float > GetRow ( int  row) const
inherited

Returns a row of the matrix.

§ GetRow() [2/3]

void GetRow ( int  row,
Point4< float > &  p 
) const
inherited

Returns a row of the matrix.

§ GetRow() [3/3]

void GetRow ( int  row,
float *  values 
) const
inherited

Returns a row of the matrix.

§ GetColumn() [1/3]

Point3<float > GetColumn ( int  col) const
inherited

Returns a column of the matrix.

§ GetColumn() [2/3]

void GetColumn ( int  col,
Point3< float > &  p 
) const
inherited

Returns a column of the matrix.

§ GetColumn() [3/3]

void GetColumn ( int  col,
float *  values 
) const
inherited

Returns a column of the matrix.

§ GetDiagonal() [1/3]

Point3<float > GetDiagonal ( ) const
inherited

Returns the diagonal of the matrix.

§ GetDiagonal() [2/3]

void GetDiagonal ( Point3< float > &  p) const
inherited

Returns the diagonal of the matrix.

§ GetDiagonal() [3/3]

void GetDiagonal ( float *  values) const
inherited

Returns the diagonal of the matrix.

§ GetSubMatrix() [1/2]

void GetSubMatrix ( Matrix3< float > &  m) const
inherited

Returns the 3x3 portion of the matrix.

§ GetSubMatrix() [2/2]

void GetSubMatrix ( Matrix2< float > &  m) const
inherited

Returns the 2x2 portion of the matrix.

§ GetSubMatrix3() [1/3]

Matrix3<float > GetSubMatrix3 ( ) const
inherited

Returns the 3x3 portion of the matrix.

§ GetSubMatrix3() [2/3]

void GetSubMatrix3 ( Matrix3< float > &  m) const
inherited

Returns the 3x3 portion of the matrix.

§ GetSubMatrix3() [3/3]

void GetSubMatrix3 ( float *  mdata) const
inherited

Returns the 3x3 portion of the matrix.

§ GetSubMatrix2() [1/3]

Matrix2<float > GetSubMatrix2 ( ) const
inherited

Returns the 2x2 portion of the matrix.

§ GetSubMatrix2() [2/3]

void GetSubMatrix2 ( Matrix2< float > &  m) const
inherited

Returns the 2x2 portion of the matrix.

§ GetSubMatrix2() [3/3]

void GetSubMatrix2 ( float *  mdata) const
inherited

Returns the 2x2 portion of the matrix.

§ GetTrans() [1/3]

Point3<float > GetTrans ( ) const
inherited

Returns the 3x3 portion of the matrix.

§ GetTrans() [2/3]

void GetTrans ( Point3< float > &  p) const
inherited

Returns the translation component of the matrix.

§ GetTrans() [3/3]

void GetTrans ( float *  trans) const
inherited

Returns the translation component of the matrix.

§ operator==()

bool operator== ( const Matrix34< float > &  right) const
inherited

compare equal

§ operator!=()

bool operator!= ( const Matrix34< float > &  right) const
inherited

compare not equal

§ operator()() [1/2]

float & operator() ( int  row,
int  column 
)
inherited

subscript operator

§ operator()() [2/2]

const float & operator() ( int  row,
int  column 
) const
inherited

constant subscript operator

§ operator[]() [1/2]

float & operator[] ( int  i)
inherited

subscript operator

§ operator[]() [2/2]

const float & operator[] ( int  i) const
inherited

constant subscript operator

§ operator-() [1/2]

Matrix34 operator- ( ) const
inherited

negative matrix

§ operator-() [2/2]

Matrix34 operator- ( const Matrix34< float > &  right) const
inherited

subtract one Matrix4 from another

§ operator/()

Matrix34 operator/ ( const float &  value) const
inherited

divide matrix by a value;

§ operator+()

Matrix34 operator+ ( const Matrix34< float > &  right) const
inherited

add two Matrices

§ operator+=()

const Matrix34& operator+= ( const Matrix34< float > &  right)
inherited

add two Matrices modify this

§ operator-=()

const Matrix34& operator-= ( const Matrix34< float > &  right)
inherited

subtract one Matrix4 from another matrix and modify this matrix

§ operator*=() [1/3]

const Matrix34& operator*= ( const Matrix34< float > &  right)
inherited

multiply a matrix with another matrix and modify this matrix

§ operator*=() [2/3]

const Matrix34& operator*= ( const Matrix3< float > &  right)
inherited

multiply a matrix with another matrix and modify this matrix

§ operator*=() [3/3]

const Matrix34& operator*= ( const float &  value)
inherited

multiply a matrix with a value modify this matrix

§ operator/=()

const Matrix34& operator/= ( const float &  value)
inherited

divide the matrix by a value modify the this matrix

§ Transpose()

void Transpose ( )
inherited

Transpose this matrix.

§ GetTranspose() [1/2]

void GetTranspose ( Matrix34< float > &  m) const
inherited

return Transpose of this matrix

§ GetTranspose() [2/2]

Matrix34 GetTranspose ( ) const
inherited

return Transpose of this matrix

§ TransposeMult() [1/2]

Point4<float > TransposeMult ( const Point3< float > &  p) const
inherited

Multiply the give vector with the transpose of the matrix.

§ TransposeMult() [2/2]

Point4<float > TransposeMult ( const Point4< float > &  p) const
inherited

Multiply the give vector with the transpose of the matrix.

§ GetDeterminant()

float GetDeterminant ( ) const
inherited

< Get the determinant of this matrix

§ Invert()

void Invert ( )
inherited

Invert this matrix.

§ GetInverse() [1/2]

void GetInverse ( Matrix34< float > &  inverse) const
inherited

< Get the inverse of this matrix

§ GetInverse() [2/2]

Matrix34 GetInverse ( ) const
inherited

Get the inverse of this matrix.

§ OrthogonalizeX()

void OrthogonalizeX ( )
inherited

Orthogonalizes the matrix and removes the scale component, preserving the x direction.

§ OrthogonalizeY()

void OrthogonalizeY ( )
inherited

Orthogonalizes the matrix and removes the scale component, preserving the y direction.

§ OrthogonalizeZ()

void OrthogonalizeZ ( )
inherited

Orthogonalizes the matrix and removes the scale component, preserving the z direction.

§ IsIdentity()

bool IsIdentity ( float  tollerance = TYPE(0.001)) const
inherited

Returns if the matrix is identity within the given error tollerance.

§ IsSymmetric()

bool IsSymmetric ( float  tollerance = TYPE(0.001)) const
inherited

Returns if the matrix is symmetric within the given error tollerance.

§ MatrixIdentity()

static Matrix34 MatrixIdentity ( )
staticinherited

Returns an identity matrix.

§ MatrixNormal()

static Matrix34 MatrixNormal ( const Point3< float > &  normal,
Point3< float > &  dir 
)
staticinherited

Returns a matrix using normal, and approximate x direction.

§ MatrixRotationX()

static Matrix34 MatrixRotationX ( float  angle)
staticinherited

Returns a rotation matrix around x axis by angle in radians.

§ MatrixRotationY()

static Matrix34 MatrixRotationY ( float  angle)
staticinherited

Returns a rotation matrix around y axis by angle in radians.

§ MatrixRotationZ()

static Matrix34 MatrixRotationZ ( float  angle)
staticinherited

Returns a rotation matrix around z axis by angle in radians.

§ MatrixRotationXYZ()

static Matrix34 MatrixRotationXYZ ( float  angleX,
float  angleY,
float  angleZ 
)
staticinherited

Returns a rotation matrix around x, y, and then z axes by angle in radians (Rz * Ry * Rx)

§ MatrixRotationZYX()

static Matrix34 MatrixRotationZYX ( float  angleX,
float  angleY,
float  angleZ 
)
staticinherited

Returns a rotation matrix around z, y, and then x axes by angle in radians (Rx * Ry * Rz)

§ MatrixRotation() [1/2]

static Matrix34 MatrixRotation ( const Point3< float > &  axis,
float  angle 
)
staticinherited

Returns a rotation matrix about the given axis by angle in radians.

§ MatrixRotation() [2/2]

static Matrix34 MatrixRotation ( const Point3< float > &  from,
const Point3< float > &  to 
)
staticinherited

Returns a rotation matrix that sets [from] unit vector to [to] unit vector.

§ MatrixScale() [1/3]

static Matrix34 MatrixScale ( const float &  uniformScale)
staticinherited

Returns a uniform scale matrix.

§ MatrixScale() [2/3]

static Matrix34 MatrixScale ( const float &  scaleX,
const float &  scaleY,
const float &  scaleZ 
)
staticinherited

Returns a scale matrix.

§ MatrixScale() [3/3]

static Matrix34 MatrixScale ( const Point3< float > &  scale)
staticinherited

Returns a scale matrix.

§ MatrixTrans()

static Matrix34 MatrixTrans ( const Point3< float > &  move)
staticinherited

Returns a translation matrix with no rotation or scale.

Member Data Documentation

§ data

float data[12]
inherited

Elements of the matrix are column-major:
| 0 3 6 9 |
| 1 4 7 10 |
| 2 5 8 11 |
.