Matrix

Detailed Description

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)
 

Function Documentation

◆ MatrixMove()

Matrix MatrixMove ( const Vector t)

Creates a translation matrix.

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

◆ MatrixScale()

Matrix MatrixScale ( const Vector s)

Creates a scaling matrix.

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

◆ MatrixRotX()

Matrix MatrixRotX ( Float  w)

Creates a rotation matrix on the X axis.

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

◆ MatrixRotY()

Matrix MatrixRotY ( Float  w)

Creates a rotation matrix on the Y axis.

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

◆ MatrixRotZ()

Matrix MatrixRotZ ( Float  w)

Creates a rotation matrix on the Z axis.

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

◆ MatrixToHPB()

Vector MatrixToHPB ( const Matrix m,
ROTATIONORDER  rot_order 
)

Calculates Euler angles from a matrix.

Parameters
[in]mThe rotation matrix.
[in]rot_orderThe 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]pThe 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]hpbThe input HPB.
[in]rot_orderThe 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]mThe rotation matrix.
[out]vAssigned the rotation axis.
[out]wAssigned the rotation angle.

◆ RotAxisToMatrix()

Matrix RotAxisToMatrix ( const Vector v,
Float  w 
)

Calculates matrix from rotation axis and angle.

Parameters
[in]vThe rotation axis.
[in]wThe 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]mThe matrix to rebuild.
Returns
The recalculated matrix with the collapsed components fixed and unit length.