GL Studio C++ Runtime API
GlsMatrixAffine< Type > Class Template Reference

#include <gls_matrix_affine.h>

Inheritance diagram for GlsMatrixAffine< Type >:
GlsMatrix< Type, 4 >

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 &centerOfRotation, RotationAxis axis)
 
void Rotate (Type angle, const Vector &centerOfRotation, 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
 

Detailed Description

template<class Type>
class disti::GlsMatrixAffine< Type >

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.

Constructor & Destructor Documentation

Default constructor. The new matrix will be the identity matrix.

GlsMatrixAffine ( const Type  m[4][4])

Constructor.

Parameters
ma row-major, two-dimensional array used to initialize the matrix.
GlsMatrixAffine ( const Type *  m)

Constructor.

Parameters
ma column-major, one-dimensional array containing all values to initialize the matrix with.
GlsMatrixAffine ( const GlsMatrix< Type, 4 > &  m)

Copy Constructor.

Parameters
mbase class matrix to copy.

Destructor.

Member Function Documentation

bool IsVeryClose ( const GlsMatrix< Type, 4 > &  b) const
inline
Returns
True if the supplied matrix is "very close" to this one.
Vector operator* ( const Vector v) const
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.

Parameters
anglerotation angle in degrees
axismajor 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.

Parameters
anglerotation angle in degrees
centerOfRotationpoint to rotate around
axismajor axis of rotation: X_AXIS, Y_AXIS, Z_AXIS
void Rotate ( Type  angle,
const Vector centerOfRotation,
const Vector axis 
)

Perform a rotation transformation around an arbitrary axis using a specified center of rotation, and combine this transformation with the existing matrix data.

Parameters
anglerotation angle in degrees
centerOfRotationpoint to rotate around
axisarbitray 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.

Parameters
xscaling factor in the x direction. 1 = 100% (no scaling change)
yscaling factor in the y direction. 1 = 100% (no scaling change)
zscaling 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.

Parameters
xscaling factor in the x direction. 1 = 100% (no scaling change)
yscaling factor in the y direction. 1 = 100% (no scaling change)
zscaling factor in the z direction. 1 = 100% (no scaling change)
anchorThe anchor point for the scaling
void Transform ( Vector v) const
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

void Translate ( Type  x,
Type  y,
Type  z 
)
inline

Perform a translation, and combine this transformation with the existing matrix data.

Parameters
xtranslation in the x direction
ytranslation in the y direction
ztranslation in the z direction
void Translate ( const Vector v)
inline

Perform a translation, and combine this transformation with the existing matrix data.

Parameters
vcontaining the translate values

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