CAffinTransformMatrix Class Reference

#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
 
CAffinTransformMatrixoperator*= (const CAffinTransformMatrix &rhs)
 
void rotate (const Quaternion &q, const C3DFVector &center=C3DFVector::_0)
 
C3DFVector rotate (const C3DFVector &x) const
 
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.

◆ 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

◆ 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
xthe 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
rhsright hand side matrix
Returns
a reference to the changed matrix

◆ rotate() [1/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
qquaternion describing rotation axis and angle
centerrotation center

◆ rotate() [2/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
xthe input vector
Returns
the rotated and scaled vector.

◆ 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
anglerotation angle in radians
centerrotation center

◆ 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
anglerotation angle in radians
centerrotation center

◆ 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
anglerotation angle in radians
centerrotation center

◆ 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
scalesaling factors along the three axis
centerof the scaling

◆ 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
shearsharing factors along the three axis
centerof the scaling

◆ 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
m3x3 transformation matrix
centerrotation center

◆ translate()

void CAffinTransformMatrix::translate ( const C3DFVector shift)

multiply the current matrix by a translation matrix

Parameters
shiftthe translation

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