#include <mia/3d/affine_matrix.hh>
Public Member Functions | |
CAffinTransformMatrix () | |
standard constructor, initializes the transformation with the identity. More... | |
CAffinTransformMatrix (float a11, float a12, float a13, float a14, float a21, float a22, float a23, float a24, float a31, float a32, float a33, float a34) | |
const std::vector< float > & | data () const |
void | identity () |
const CAffinTransformMatrix | inverse () const |
C3DFVector | operator* (const C3DFVector &x) const |
CAffinTransformMatrix & | operator*= (const CAffinTransformMatrix &rhs) |
void | rotate (const Quaternion &q, const C3DFVector ¢er=C3DFVector::_0) |
C3DFVector | rotate (const C3DFVector &x) const |
void | rotate_x (float angle, const C3DFVector ¢er=C3DFVector::_0) |
void | rotate_y (float angle, const C3DFVector ¢er=C3DFVector::_0) |
void | rotate_z (float angle, const C3DFVector ¢er=C3DFVector::_0) |
void | scale (const C3DFVector &scale, const C3DFVector ¢er=C3DFVector::_0) |
void | shear (const C3DFVector &shear, const C3DFVector ¢er=C3DFVector::_0) |
void | transform_centered (const C3DFMatrix &m, const C3DFVector ¢er=C3DFVector::_0) |
void | translate (const C3DFVector &shift) |
This class implements an affine 3D transformation as is is used with OpenGL.
This class implements affine 3D transformations. The storage layout is compatible with OpenGL.
Definition at line 35 of file affine_matrix.hh.
CAffinTransformMatrix::CAffinTransformMatrix | ( | ) |
standard constructor, initializes the transformation with the identity.
CAffinTransformMatrix::CAffinTransformMatrix | ( | float | a11, |
float | a12, | ||
float | a13, | ||
float | a14, | ||
float | a21, | ||
float | a22, | ||
float | a23, | ||
float | a24, | ||
float | a31, | ||
float | a32, | ||
float | a33, | ||
float | a34 | ||
) |
A constructor to set all matrix values. Note, that in the numbering of the parameters corresponds to (column, row) and that the last column is always [0,0,0,1].
const std::vector<float>& CAffinTransformMatrix::data | ( | ) | const |
void CAffinTransformMatrix::identity | ( | ) |
Reset the matrix to represent the identity matrix
const CAffinTransformMatrix CAffinTransformMatrix::inverse | ( | ) | const |
C3DFVector CAffinTransformMatrix::operator* | ( | const C3DFVector & | x | ) | const |
Apply the transformation to row vector x by multiplying it with the matrix
x | the vector to be transformed |
CAffinTransformMatrix& CAffinTransformMatrix::operator*= | ( | const CAffinTransformMatrix & | rhs | ) |
Multiply the matrix with another matric from the right side.
rhs | right hand side matrix |
void CAffinTransformMatrix::rotate | ( | const Quaternion & | q, |
const C3DFVector & | center = C3DFVector::_0 |
||
) |
multiply the current matrix by a rotation as defined by the given quaternion centered at the given location
q | quaternion describing rotation axis and angle |
center | rotation center |
C3DFVector CAffinTransformMatrix::rotate | ( | const C3DFVector & | x | ) | const |
Apply only the rotation and scaling part of the transform. This is useful to transform the rotation axis to the coordinate system the matrix is currently aligned to.
x | the input vector |
void CAffinTransformMatrix::rotate_x | ( | float | angle, |
const C3DFVector & | center = C3DFVector::_0 |
||
) |
multiply the current matrix by a rotation around the x axis centered at the given location and with the given angle.
angle | rotation angle in radians |
center | rotation center |
void CAffinTransformMatrix::rotate_y | ( | float | angle, |
const C3DFVector & | center = C3DFVector::_0 |
||
) |
multiply the current matrix by a rotation around the y axis centered at the given location and with the given angle.
angle | rotation angle in radians |
center | rotation center |
void CAffinTransformMatrix::rotate_z | ( | float | angle, |
const C3DFVector & | center = C3DFVector::_0 |
||
) |
multiply the current matrix by a rotation around the z axis centered at the given location and with the given angle.
angle | rotation angle in radians |
center | rotation center |
void CAffinTransformMatrix::scale | ( | const C3DFVector & | scale, |
const C3DFVector & | center = C3DFVector::_0 |
||
) |
multiply the current matrix by a scaling matrix centered at the given location
scale | saling factors along the three axis |
center | of the scaling |
void CAffinTransformMatrix::shear | ( | const C3DFVector & | shear, |
const C3DFVector & | center = C3DFVector::_0 |
||
) |
multiply the current matrix by a shearing matrix centered at the given location
shear | sharing factors along the three axis |
center | of the scaling |
void CAffinTransformMatrix::transform_centered | ( | const C3DFMatrix & | m, |
const C3DFVector & | center = C3DFVector::_0 |
||
) |
multiply the current matrix by a 3x3 transformation matrix centered at the given location
m | 3x3 transformation matrix |
center | rotation center |
void CAffinTransformMatrix::translate | ( | const C3DFVector & | shift | ) |
multiply the current matrix by a translation matrix
shift | the translation |