GL Studio C++ Runtime API
|
#include <gls_matrix_affine.h>
Public Types | |
typedef GlsMatrix< Type, 4 > | _BaseClass |
Deprecated typedef for the base class. | |
typedef GlsMatrix< Type, 4 > | BaseClass |
Typedef for the base class. | |
Public Types inherited from GlsMatrix< Type, 4 > | |
typedef Type | CStyleMatrix[DIM][DIM] |
Typedef for a 4x4 matrix stored as a 2D array. | |
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 |
Vertex | operator* (const Vertex &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 |
Type & | operator() (unsigned row, unsigned col) |
Type | operator() (unsigned row, unsigned col) const |
bool | operator== (const GlsMatrix< Type, DIM > &rhs) const |
bool | operator!= (const GlsMatrix< Type, DIM > &rhs) const |
GlsMatrix< Type, DIM > & | operator= (const GlsMatrix< Type, DIM > &m) |
GlsMatrix< Type, DIM > & | operator= (const CStyleMatrix m) |
GlsMatrix< Type, DIM > | operator+ () const |
GlsMatrix< Type, DIM > | operator+ (const GlsMatrix< Type, DIM > &rhs) const |
GlsMatrix< Type, DIM > | operator- () const |
GlsMatrix< Type, DIM > | operator- (const GlsMatrix< Type, DIM > &rhs) const |
GlsMatrix< Type, DIM > & | operator+= (const GlsMatrix< Type, DIM > &rhs) |
GlsMatrix< Type, DIM > & | operator-= (const GlsMatrix< Type, DIM > &rhs) |
GlsMatrix< Type, DIM > & | operator*= (const GlsMatrix< Type, DIM > &rhs) |
GlsMatrix< Type, DIM > & | operator*= (Type scalar) |
GlsMatrix< double, 4 > & | operator*= (const GlsMatrix< double, 4 > &rhs) |
GlsMatrix< float, 4 > & | operator*= (const GlsMatrix< float, 4 > &rhs) |
GlsMatrix< Type, DIM > & | operator/= (Type scalar) |
GlsMatrix< Type, DIM > | operator* (const GlsMatrix< Type, DIM > &rhs) const |
GlsMatrix< Type, DIM > | operator* (Type scalar) const |
GlsMatrix< double, 4 > | operator* (const GlsMatrix< double, 4 > &rhs) const |
GlsMatrix< float, 4 > | operator* (const GlsMatrix< float, 4 > &rhs) const |
GlsMatrix< Type, DIM > | operator/ (Type scalar) 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.
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. |
Destructor.
|
inline |
b | The matrix to compare. |
v | The vector to transform. |
v | The vertex to transform. |
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 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 |
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 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
v | A modifiable reference to the vector to transform. |
|
inline |
Perform a translation, and combine this transformation with the existing matrix data.
v | containing the translate values |
|
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 |