CAffinTransformMatrix Class Reference

`#include <mia/3d/affine_matrix.hh>`

## Public Member Functions

| CAffinTransformMatrix ()
| standard constructor, initializes the transformation with the identity.
| 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)
C3DFVector | rotate (const C3DFVector &x) const
void | rotate (const Quaternion &q, const C3DFVector &center=C3DFVector::_0)
void | rotate_x (float angle, const C3DFVector &center=C3DFVector::_0)
void | rotate_y (float angle, const C3DFVector &center=C3DFVector::_0)
void | rotate_z (float angle, const C3DFVector &center=C3DFVector::_0)
void | scale (const C3DFVector &scale, const C3DFVector &center=C3DFVector::_0)
void | shear (const C3DFVector &shear, const C3DFVector &center=C3DFVector::_0)
void | transform_centered (const C3DFMatrix &m, const C3DFVector &center=C3DFVector::_0)
void | translate (const C3DFVector &shift)

## Detailed Description

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.

## Constructor & Destructor Documentation

## CAffinTransformMatrix() [1/2]

CAffinTransformMatrix::CAffinTransformMatrix | ( |  | ) |

standard constructor, initializes the transformation with the identity.

Referenced by inverse(), and operator*=().

## CAffinTransformMatrix() [2/2]

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].

## Member Function Documentation

## data()

const std::vector< float > & CAffinTransformMatrix::data | ( |  | ) | const

Returns
  the raw matrix element in the apropriate order usable by OpenGL

## identity()

void CAffinTransformMatrix::identity | ( |  | ) |

Reset the matrix to represent the identity matrix

## inverse()

const CAffinTransformMatrix CAffinTransformMatrix::inverse | ( |  | ) | const

Returns
  the inverse of the matrix

References CAffinTransformMatrix().

## operator*()

C3DFVector CAffinTransformMatrix::operator* | ( | const C3DFVector & | x | ) | const

Apply the transformation to row vector x by multiplying it with the matrix

Remarks
  the resulting notation is mentally wrong

Parameters

  x | the vector to be transformed

Returns
  the transformed vector

## operator*=()

CAffinTransformMatrix & CAffinTransformMatrix::operator*= | ( | const CAffinTransformMatrix & | rhs | ) |

Multiply the matrix with another matric from the right side.

Parameters

  rhs | right hand side matrix

Returns
  a reference to the changed matrix

References CAffinTransformMatrix().

## rotate() [1/2]

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.

Remarks
  wrong frasing

Parameters

  x | the input vector

Returns
  the rotated and scaled vector.

## rotate() [2/2]

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

Parameters

  q | quaternion describing rotation axis and angle
  center | rotation center

References T3DVector< float >::_0.

## rotate_x()

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.

Parameters

  angle | rotation angle in radians
  center | rotation center

References T3DVector< float >::_0, and angle().

## rotate_y()

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.

Parameters

  angle | rotation angle in radians
  center | rotation center

References T3DVector< float >::_0, and angle().

## rotate_z()

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.

Parameters

  angle | rotation angle in radians
  center | rotation center

References T3DVector< float >::_0, and angle().

## scale()

void CAffinTransformMatrix::scale | ( | const C3DFVector & | scale,
|  | const C3DFVector & | center = C3DFVector::_0 )

multiply the current matrix by a scaling matrix centered at the given location

Parameters

  scale | saling factors along the three axis
  center | of the scaling

References T3DVector< float >::_0, and scale().

Referenced by scale().

## shear()

void CAffinTransformMatrix::shear | ( | const C3DFVector & | shear,
|  | const C3DFVector & | center = C3DFVector::_0 )

multiply the current matrix by a shearing matrix centered at the given location

Parameters

  shear | sharing factors along the three axis
  center | of the scaling

References T3DVector< float >::_0, and shear().

Referenced by shear().

## transform_centered()

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

Parameters

  m | 3x3 transformation matrix
  center | rotation center

References T3DVector< float >::_0.

## translate()

void CAffinTransformMatrix::translate | ( | const C3DFVector & | shift | ) |

multiply the current matrix by a translation matrix

Parameters

  shift | the translation

The documentation for this class was generated from the following file:

- affine_matrix.hh