GL Studio API
|
#include <gls_matrix_affine.h>
Public Member Functions | |
GlsMatrixAffine () | |
GlsMatrixAffine (const Type m[4][4]) | |
GlsMatrixAffine (const Type *m) | |
GlsMatrixAffine (const GlsMatrix< Type, 4 > &m) | |
~GlsMatrixAffine () | |
bool | IsVeryClose (const GlsMatrix< Type, 4 > &b) const |
void | Rotate (Type angle, RotationAxis axis) |
void | Rotate (Type angle, const Vector ¢erOfRotation, RotationAxis axis) |
void | Rotate (Type angle, const Vector ¢erOfRotation, const Vector &axis) |
void | Scale (Type x, Type y, Type z) |
void | Scale (Type x, Type y, Type z, const Vector &anchor) |
void | Translate (Type x, Type y, Type z) |
void | Translate (const Vector &v) |
Vector | operator* (const Vector &v) const |
void | Transform (Vector &v) const |
Public Member Functions inherited from GlsMatrix< Type, 4 > | |
GlsMatrix () | |
GlsMatrix (const CStyleMatrix m) | |
GlsMatrix (const Type *m) | |
GlsMatrix (const GlsMatrix< Type, DIM > &m) | |
virtual | ~GlsMatrix () |
void | Dump () const |
void | Clear () |
Type * | Data () |
const Type * | Data () const |
void | MakeIdentity () |
Type | Determinant () const |
GlsMatrix< Type, DIM > | Inverse () const |
void | Invert () |
GlsMatrix< Type, DIM > | Transposition () const |
void | Transpose () |
bool | IsDiagonal () const |
bool | IsIdentity () const |
bool | IsScalar () const |
bool | IsSingular () const |
bool | IsSymmetric () const |
bool | IsSkewSymmetric () const |
bool | IsLowerTriangular () const |
bool | IsUpperTriangular () const |
Additional Inherited Members | |
Protected Member Functions inherited from GlsMatrix< Type, 4 > | |
void | Initialize () |
int | Pivot (unsigned row) |
bool | closeValues (Type lv, Type rv) const |
Protected Attributes inherited from GlsMatrix< Type, 4 > | |
Type | _data [DIM *DIM] |
Type * | _matrix [DIM] |
Static Protected Attributes inherited from GlsMatrix< Type, 4 > | |
static const double | PRECISION |
The GlsMatrixAffine class provides support for a 4x4 affine transformation matrix of any numeric type. It provides ability to perform rotations, scaling, and translations. Results are cummulative, i.e. every rotate, scale, and translate call transforms the terms that already exist in the matrix. Call MakeIdentity() to start with an identity matrix, or Clear() to clear the matrix with all zeros.
GlsMatrixAffine | ( | ) |
Default constructor. The new matrix will be the identity matrix.
GlsMatrixAffine | ( | const Type | m[4][4] | ) |
Constructor.
m | a row-major, two-dimensional array used to initialize the matrix. |
GlsMatrixAffine | ( | const Type * | m | ) |
Constructor.
m | a column-major, one-dimensional array containing all values to initialize the matrix with. |
GlsMatrixAffine | ( | const GlsMatrix< Type, 4 > & | m | ) |
Copy Constructor.
m | base class matrix to copy. |
~GlsMatrixAffine | ( | ) |
Destructor.
|
inline |
Return a transformed vertex using the specified vertex and the data in the matrix, e.g. w = M * v
void Rotate | ( | Type | angle, |
RotationAxis | axis | ||
) |
Perform a rotation transformation around a major axis around the origin, and combine this transformation with the existing matrix data.
angle | rotation angle in degrees |
axis | major axis of rotation: X_AXIS, Y_AXIS, Z_AXIS |
void Rotate | ( | Type | angle, |
const Vector & | centerOfRotation, | ||
RotationAxis | axis | ||
) |
Perform a rotation transformation around a major axis using a specified center of rotation, and combine this transformation with the existing matrix data.
angle | rotation angle in degrees |
centerOfRotation | point to rotate around |
axis | major axis of rotation: X_AXIS, Y_AXIS, Z_AXIS |
Perform a rotation transformation around an arbitrary axis using a specified center of rotation, and combine this transformation with the existing matrix data.
angle | rotation angle in degrees |
centerOfRotation | point to rotate around |
axis | arbitray axis of rotation |
void Scale | ( | Type | x, |
Type | y, | ||
Type | z | ||
) |
Perform a scaling transformation using the origin as the anchor point, and combine this transformation with the existing matrix data.
x | scaling factor in the x direction. 1 = 100% (no scaling change) |
y | scaling factor in the y direction. 1 = 100% (no scaling change) |
z | scaling factor in the z direction. 1 = 100% (no scaling change) |
void Scale | ( | Type | x, |
Type | y, | ||
Type | z, | ||
const Vector & | anchor | ||
) |
Perform a scaling transformation using an arbitrary anchor point, and combine this transformation with the existing matrix data.
x | scaling factor in the x direction. 1 = 100% (no scaling change) |
y | scaling factor in the y direction. 1 = 100% (no scaling change) |
z | scaling factor in the z direction. 1 = 100% (no scaling change) |
anchor | The anchor point for the scaling |
|
inline |
Transform the specified vertex using the data in the matrix, where the 4th vector component is assumed to be a 1 (position) i.e. v = M * v
|
inline |
Perform a translation, and combine this transformation with the existing matrix data.
x | translation in the x direction |
y | translation in the y direction |
z | translation in the z direction |
|
inline |
Perform a translation, and combine this transformation with the existing matrix data.
v | containing the translate values |