Square matrix for 3-dimensional transformations. More...
#include <gelMatrix.h>
Public Member Functions | |
Gel4x4Matrix () | |
Default constructor. | |
Gel4x4Matrix (const float matrix[16]) | |
Convenience constructor. | |
void | loadNull () |
Sets all matrix entries to zero. | |
void | loadIdentity () |
Resets the matrix to its identity. | |
void | translate (Gel3dVec pos) |
Translates the matrix. | |
void | rotateX (float rot) |
Rotates the matrix around the X axis. | |
void | rotateY (float rot) |
Rotates the matrix around the Y axis. | |
void | rotateZ (float rot) |
Rotates the matrix around the Z axis. | |
void | scale (Gel3dVec scl) |
Scales the matrix. | |
void | shear (Gel2dVec shx, Gel2dVec shy, Gel2dVec shz) |
Shears the matrix. | |
bool | isIdentity () const |
Determines whether or not this is an identity matrix. | |
bool | isTranslation () const |
Determines whether or not this is a pure translation matrix. | |
bool | isRotation () const |
Determines whether or not this is a pure rotation matrix. | |
bool | isScaling () const |
Determines whether or not this is a pure scaling matrix. | |
bool | isShearing () const |
Determines whether or not this is a pure shearing matrix. | |
void | toOGLMatrix (float matrix[16]) const |
Converts the matrix to an OpenGL-style matrix. | |
void | dump () const |
Writes the matrix's elements to the standard output (stdout). | |
Gel4x4Matrix | operator+ (const Gel4x4Matrix &m) const |
Gel4x4Matrix | operator- (const Gel4x4Matrix &m) const |
Gel4x4Matrix | operator* (const Gel4x4Matrix &m) const |
Gel4x4Matrix | operator= (const Gel4x4Matrix &m) |
Gel4x4Matrix | operator+= (const Gel4x4Matrix &m) |
Gel4x4Matrix | operator-= (const Gel4x4Matrix &m) |
Gel4x4Matrix | operator*= (const Gel4x4Matrix &m) |
bool | operator== (const Gel4x4Matrix &m) const |
bool | operator!= (const Gel4x4Matrix &m) const |
Gel3dVec | operator* (const Gel3dVec &v) const |
Transforms a vector by this matrix. | |
Public Attributes | |
union { | |
float m [4][4] | |
float ms [16] | |
struct { | |
float m11 | |
float m12 | |
float m13 | |
float m14 | |
float m21 | |
float m22 | |
float m23 | |
float m24 | |
float m31 | |
float m32 | |
float m33 | |
float m34 | |
float m41 | |
float m42 | |
float m43 | |
float m44 | |
} | |
}; |
Square matrix for 3-dimensional transformations.
Although this class is fully functional, it has not been specifically optimized in any way. OpenGL's matrix multiplication is probably much faster than this.
This class exists solely for possible future needs. It currently has no applicable purposes in a 2D environment, at least as far as I can tell.
gel::Gel4x4Matrix::Gel4x4Matrix | ( | ) |
Default constructor.
Sets the matrix to its identity.
gel::Gel4x4Matrix::Gel4x4Matrix | ( | const float | matrix[16] | ) |
Convenience constructor.
Loads an OpenGL-style matrix.
void gel::Gel4x4Matrix::loadNull | ( | ) |
Sets all matrix entries to zero.
void gel::Gel4x4Matrix::loadIdentity | ( | ) |
Resets the matrix to its identity.
void gel::Gel4x4Matrix::translate | ( | Gel3dVec | pos | ) |
Translates the matrix.
pos | : The vector to translate the matrix by. |
void gel::Gel4x4Matrix::rotateX | ( | float | rot | ) |
Rotates the matrix around the X axis.
rot | : The number of degrees to rotate the matrix. |
void gel::Gel4x4Matrix::rotateY | ( | float | rot | ) |
Rotates the matrix around the Y axis.
rot | : The number of degrees to rotate the matrix. |
void gel::Gel4x4Matrix::rotateZ | ( | float | rot | ) |
Rotates the matrix around the Z axis.
rot | : The number of degrees to rotate the matrix. |
void gel::Gel4x4Matrix::scale | ( | Gel3dVec | scl | ) |
Scales the matrix.
scl | : The vector to scale the matrix by. |
Shears the matrix.
shx | : Shears X by Y and Z. |
shy | : Shears Y by X and Z. |
shz | : Shears Z by X and Y. |
bool gel::Gel4x4Matrix::isIdentity | ( | ) | const |
Determines whether or not this is an identity matrix.
bool gel::Gel4x4Matrix::isTranslation | ( | ) | const |
Determines whether or not this is a pure translation matrix.
bool gel::Gel4x4Matrix::isRotation | ( | ) | const |
Determines whether or not this is a pure rotation matrix.
bool gel::Gel4x4Matrix::isScaling | ( | ) | const |
Determines whether or not this is a pure scaling matrix.
bool gel::Gel4x4Matrix::isShearing | ( | ) | const |
Determines whether or not this is a pure shearing matrix.
void gel::Gel4x4Matrix::toOGLMatrix | ( | float | matrix[16] | ) | const |
Converts the matrix to an OpenGL-style matrix.
matrix | : An array of 16 floats. |
void gel::Gel4x4Matrix::dump | ( | ) | const |
Writes the matrix's elements to the standard output (stdout).
Gel4x4Matrix gel::Gel4x4Matrix::operator+ | ( | const Gel4x4Matrix & | m | ) | const |
Gel4x4Matrix gel::Gel4x4Matrix::operator- | ( | const Gel4x4Matrix & | m | ) | const |
Gel4x4Matrix gel::Gel4x4Matrix::operator* | ( | const Gel4x4Matrix & | m | ) | const |
Gel4x4Matrix gel::Gel4x4Matrix::operator= | ( | const Gel4x4Matrix & | m | ) |
Gel4x4Matrix gel::Gel4x4Matrix::operator+= | ( | const Gel4x4Matrix & | m | ) |
Gel4x4Matrix gel::Gel4x4Matrix::operator-= | ( | const Gel4x4Matrix & | m | ) |
Gel4x4Matrix gel::Gel4x4Matrix::operator*= | ( | const Gel4x4Matrix & | m | ) |
bool gel::Gel4x4Matrix::operator== | ( | const Gel4x4Matrix & | m | ) | const |
bool gel::Gel4x4Matrix::operator!= | ( | const Gel4x4Matrix & | m | ) | const |
Transforms a vector by this matrix.
float gel::Gel4x4Matrix::m[4][4] |
float gel::Gel4x4Matrix::ms[16] |
float gel::Gel4x4Matrix::m11 |
float gel::Gel4x4Matrix::m12 |
float gel::Gel4x4Matrix::m13 |
float gel::Gel4x4Matrix::m14 |
float gel::Gel4x4Matrix::m21 |
float gel::Gel4x4Matrix::m22 |
float gel::Gel4x4Matrix::m23 |
float gel::Gel4x4Matrix::m24 |
float gel::Gel4x4Matrix::m31 |
float gel::Gel4x4Matrix::m32 |
float gel::Gel4x4Matrix::m33 |
float gel::Gel4x4Matrix::m34 |
float gel::Gel4x4Matrix::m41 |
float gel::Gel4x4Matrix::m42 |
float gel::Gel4x4Matrix::m43 |
float gel::Gel4x4Matrix::m44 |
union { ... } |
API Documentation by Mark D. Procarione | Generated by |