Menge
Modular Pedestrian Simulation Framework for Research and Development
|
The transformation matrix. More...
#include <XformMatrix.h>
Public Member Functions | |
XformMatrix () | |
Default constructor - identity matrix. | |
void | setTranslation (const Vector3 &vec) |
Set the translation of this node. More... | |
void | addTranslation (const Vector3 &vec) |
Offset the translation of this node. More... | |
void | setScale (const Vector3 &vec) |
Set the scale of this node. More... | |
void | setRotationDeg (const Vector3 &vec) |
Set the orientation of this node. More... | |
void | setRotationRad (const Vector3 &vec) |
Set the orientation of this node. More... | |
void | addRotationDeg (const Vector3 &vec) |
Offsets the orientation of this node. More... | |
void | addRotationRad (const Vector3 &vec) |
Offsets the orientation of this node. More... | |
void | setRotAxisDeg (const Vector3 &vec) |
Set the orientation of this node's rotation axis. More... | |
void | setRotAxisRad (const Vector3 &vec) |
Set the orientation of this node's rotation axis. More... | |
void | translationMatrix (Matrix4x4 &mat) |
Comptues the rotation p. More... | |
void | translationInverseMatrix (Matrix4x4 &mat) |
Computes the translation inverse matrix. More... | |
void | scaleMatrix (Matrix4x4 &mat) |
Computes the scale matrix. More... | |
void | scaleInverseMatrix (Matrix4x4 &mat) |
Computes the inverse scale matrix. More... | |
void | rotationMatrix (Matrix4x4 &mat) |
Computes the rotation matrix. More... | |
void | rotationInverseMatrix (Matrix4x4 &mat) |
Computes the inverse rotation matrix. More... | |
void | getMatrix (Matrix4x4 &mat) |
Computes the transformation matrix. More... | |
void | getInverseMatrix (Matrix4x4 &mat) |
Computes the inverse transformation matrix. More... | |
Protected Types | |
enum | MatrixBit { ROT_MAT = 1, MAT = 2, IMAT = 4 } |
Enumeration of dirty matrices. More... | |
Protected Member Functions | |
void | updateRotAxisMat () |
Update cached rotation axis matrices when component changes. | |
void | setDirty () |
Set all matrices dirty. | |
void | setDirty (int bit) |
Set the matrix corresponding to the given bit dirty. More... | |
void | setDirty (MatrixBit bit) |
Set the matrix corresponding to the given bit dirty. More... | |
bool | isClean (MatrixBit bit) |
Reports if the indicated matrix is clean. More... | |
void | setClean (MatrixBit bit) |
Sets the indicated matrix to be clean. More... | |
void | setClean (int bit) |
Sets the indicated matrix to be clean. More... | |
Protected Attributes | |
Vector3 | _trans |
The translation component of the transformation. | |
Vector3 | _scale |
The scale component of the transformation. | |
Vector3 | _rot |
The rotation component of the transformation. Euler angles in radians. | |
Vector3 | _rotAxis |
The rotation axis component of the transformation. Pre-rotation Euler angles in radians. | |
Matrix4x4 | _rotAxisMat |
Cached rotation axis matrix. | |
Matrix4x4 | _rotAxisIMat |
Cached inverse rotation axis matrix. | |
int | _clean |
An integer mask for determining which cached matrices are clean/dirty. More... | |
Matrix4x4 | _rotMat |
Cached rotation matrix. | |
Matrix4x4 | _mat |
Cached transformation matrix. | |
Matrix4x4 | _iMat |
Cached inverse transformation matrix. | |
Friends | |
class | Transform |
Logger & | operator<< (Logger &out, const XformMatrix &xformMat) |
Print the matrix to the output stream. More... | |
The transformation matrix.
The transform matrix is the concatenation of five transformation matrices SCALE * ROT_AXIS^-1 * ROTATE * ROT_AXIS * TRANSLATE The scale, rotation, and translation matrices are self-explanatory. They account for the changes in size, rotation around the orign, and re-positioning of the node. The transform also defines a "rotation axis". The rotation values can be defined around an arbitrary axis, rather than the node's local space. One can think of the rotation axis as a pre-rotation.
|
protected |
Enumeration of dirty matrices.
Used to intelligently compute matrices as necessary.
|
inline |
Offsets the orientation of this node.
Rotation is performed using Euler angles and the implict evaluation order of x-, then y-, and finally z-axis rotation. In this case, each axis is summed independently. Generally, because these are Euler angles, this will will not lead to linear interpolation of orientation.
vec | The rotations around the x-, y-, and z-axes, respectively in degrees. |
|
inline |
Offsets the orientation of this node.
Rotation is performed using Euler angles and the implict evaluation order of x-, then y-, and finally z-axis rotation. In this case, each axis is summed independently. Generally, because these are Euler angles, this will will not lead to linear interpolation of orientation.
vec | The rotations around the x-, y-, and z-axes, respectively in radians. |
|
inline |
Offset the translation of this node.
vec | The change to position of this node. |
void Menge::SceneGraph::XformMatrix::getInverseMatrix | ( | Matrix4x4 & | mat | ) |
Computes the inverse transformation matrix.
mat | Writes the inverse matrix in the provided matrix. |
void Menge::SceneGraph::XformMatrix::getMatrix | ( | Matrix4x4 & | mat | ) |
Computes the transformation matrix.
mat | Writes the matrix in the provided matrix. |
|
inlineprotected |
Reports if the indicated matrix is clean.
bit | The bit for the specific matrix to set dirty. |
void Menge::SceneGraph::XformMatrix::rotationInverseMatrix | ( | Matrix4x4 & | mat | ) |
Computes the inverse rotation matrix.
mat | Writes the inverse rotation matrix in the provided matrix. |
void Menge::SceneGraph::XformMatrix::rotationMatrix | ( | Matrix4x4 & | mat | ) |
Computes the rotation matrix.
mat | Writes the rotation matrix in the provided matrix. |
void Menge::SceneGraph::XformMatrix::scaleInverseMatrix | ( | Matrix4x4 & | mat | ) |
Computes the inverse scale matrix.
mat | Writes the inverse scale matrix in the provided matrix. |
void Menge::SceneGraph::XformMatrix::scaleMatrix | ( | Matrix4x4 & | mat | ) |
Computes the scale matrix.
mat | Writes the scale matrix in the provided matrix. |
|
inlineprotected |
Sets the indicated matrix to be clean.
bit | The bit for the specific matrix to set clean. |
|
inlineprotected |
Sets the indicated matrix to be clean.
bit | The bit for the specific matrix to set clean. Should be a MatrixBit enumeration value. |
|
inlineprotected |
Set the matrix corresponding to the given bit dirty.
bit | The bit for the specific matrix to set dirty. Should be a MatrixBit enumeration value. |
|
inlineprotected |
Set the matrix corresponding to the given bit dirty.
bit | The bit for the specific matrix to set dirty. |
|
inline |
Set the orientation of this node.
Rotation is performed using Euler angles and the implict evaluation order of x-, then y-, and finally z-axis rotation.
vec | The rotations around the x-, y-, and z-axes, respectively in degrees. |
|
inline |
Set the orientation of this node.
Rotation is performed using Euler angles and the implict evaluation order of x-, then y-, and finally z-axis rotation.
vec | The rotations around the x-, y-, and z-axes, respectively in radians. |
void Menge::SceneGraph::XformMatrix::setRotAxisDeg | ( | const Vector3 & | vec | ) |
Set the orientation of this node's rotation axis.
Rotation is performed using Euler angles and the implict evaluation order of x-, then y-, and finally z-axis rotation.
vec | The orientation of the rotation axis around the x-, y-, and z-axes, respectively in degrees. |
void Menge::SceneGraph::XformMatrix::setRotAxisRad | ( | const Vector3 & | vec | ) |
Set the orientation of this node's rotation axis.
Rotation is performed using Euler angles and the implict evaluation order of x-, then y-, and finally z-axis rotation.
vec | The orientation of the rotation axis around the x-, y-, and z-axes, respectively in radians. |
|
inline |
Set the scale of this node.
vec | The desired scale of this node. |
|
inline |
Set the translation of this node.
vec | The 3D position of the transform. |
void Menge::SceneGraph::XformMatrix::translationInverseMatrix | ( | Matrix4x4 & | mat | ) |
Computes the translation inverse matrix.
mat | Writes the inverse translation matrix in the provided matrix. |
void Menge::SceneGraph::XformMatrix::translationMatrix | ( | Matrix4x4 & | mat | ) |
Comptues the rotation p.
Computes the translation matrix.
mat | Writes the translation matrix in the provided matrix. |
|
friend |
Print the matrix to the output stream.
out | The output stream. |
xformMat | The transformation matrix to print to the output stream. |
|
protected |
An integer mask for determining which cached matrices are clean/dirty.
Works with the MatrixBit enumeration to determine which matrices need to be recomputed.