Matrix

## Functions

Matrix MatrixMove (const Vector &t)

Matrix MatrixScale (const Vector &s)

Matrix MatrixRotX (Float w)

Matrix MatrixRotY (Float w)

Matrix MatrixRotZ (Float w)

Vector MatrixToHPB (const Matrix &m, ROTATIONORDER rot_order)

Vector VectorToHPB (const Vector &p)

Matrix HPBToMatrix (const Vector &hpb, ROTATIONORDER rot_order)

void MatrixToRotAxis (const Matrix &m, Vector *v, Float *w)

Matrix RotAxisToMatrix (const Vector &v, Float w)

Matrix RebuildMatrix (const Matrix &m)

## ◆ MatrixMove()

 Matrix MatrixMove ( const Vector & t )

Creates a translation matrix.

Parameters
 [in] t The translation vector.
Returns
The translation matrix.

## ◆ MatrixScale()

 Matrix MatrixScale ( const Vector & s )

Creates a scaling matrix.

Parameters
 [in] s The scaling vector for the axes.
Returns
The scaling matrix.

## ◆ MatrixRotX()

 Matrix MatrixRotX ( Float w )

Creates a rotation matrix on the X axis.

Parameters
 [in] w The angle around X.
Returns
The rotation matrix.

## ◆ MatrixRotY()

 Matrix MatrixRotY ( Float w )

Creates a rotation matrix on the Y axis.

Parameters
 [in] w The angle around Y.
Returns
The rotation matrix.

## ◆ MatrixRotZ()

 Matrix MatrixRotZ ( Float w )

Creates a rotation matrix on the Z axis.

Parameters
 [in] w The angle around Z.
Returns
The rotation matrix.

## ◆ MatrixToHPB()

 Vector MatrixToHPB ( const Matrix & m, ROTATIONORDER rot_order )

Calculates Euler angles from a matrix.

Parameters
 [in] m The rotation matrix. [in] rot_order The rotation order.
Returns
The rotation HPB.

## ◆ VectorToHPB()

 Vector VectorToHPB ( const Vector & p )

Calculates Euler angles from a vector.

Note
The bank is always set to 0.0.
Parameters
 [in] p The vector to find the HPB for.
Returns
The rotation HPB.

## ◆ HPBToMatrix()

 Matrix HPBToMatrix ( const Vector & hpb, ROTATIONORDER rot_order )

Constructs a matrix from Euler angles.

Parameters
 [in] hpb The input HPB. [in] rot_order The rotation order.
Returns
The rotation matrix.

## ◆ MatrixToRotAxis()

 void MatrixToRotAxis ( const Matrix & m, Vector * v, Float * w )

Calculates rotation axis and angle from a matrix.

Parameters
 [in] m The rotation matrix. [out] v Assigned the rotation axis. [out] w Assigned the rotation angle.

## ◆ RotAxisToMatrix()

 Matrix RotAxisToMatrix ( const Vector & v, Float w )

Calculates matrix from rotation axis and angle.

Parameters
 [in] v The rotation axis. [in] w The rotation angle.
Returns
The rotation matrix.

## ◆ RebuildMatrix()

 Matrix RebuildMatrix ( const Matrix & m )

Recalculates a matrix making it orthogonal if one or more of its vectors is collapsed (scale 0.0).

Parameters
 [in] m The matrix to rebuild.
Returns
The recalculated matrix with the collapsed components fixed and unit length.