#include <vuMatrix.h>
Public Member Functions | |
| vuMatrix () | |
| Default constructor that sets all values to 0.0f. | |
| vuMatrix (const vuMatrix &m) | |
| Copy constructor. | |
| vuMatrix (double v) | |
| Constructor that sets all values to v. | |
| vuMatrix (const double *v) | |
| Constructor that initializes the vector from a double array. | |
| ~vuMatrix () | |
| Destructor. | |
| vuMatrix & | operator= (const vuMatrix &m) |
| Assigns a matrix to the instance. | |
| vuMatrix & | operator= (double v) |
| Assigns a doubleing point value to each entry of the matrix. | |
| vuMatrix & | operator= (const double *v) |
| Assigns an array of doubleing point values to the matrix. | |
| vuMatrix & | makeIdentity (void) |
| Makes the matrix an identity matrix and returns a reference. | |
| vuMatrix & | makeRotate (const vuVector &axis, double a) |
| Makes a rotation matrix for a rotation of a degrees around the axis vector. | |
| vuMatrix & | makeRotateX (double a) |
| Makes this matrix a rotation matrix for a rotation of a degrees about the x axis. | |
| vuMatrix & | makeRotateY (double a) |
| Makes this matrix a rotation matrix for a rotation of a degrees about the y axis. | |
| vuMatrix & | makeRotateZ (double a) |
| Makes this matrix a rotation matrix for a rotation of a degrees about the z axis. | |
| vuMatrix & | makeTranslate (double x, double y, double z) |
| Makes this matrix a translation matrix corresponding to the given displacement. | |
| vuMatrix & | makeScale (double x, double y, double z) |
| Makes this matrix a scaling matrix. | |
| vuMatrix & | makeShearXY (double s) |
| Makes this matrix a shearing matrix in the XY plane. | |
| vuMatrix & | makeShearXZ (double s) |
| Makes this matrix a shearing matrix in the XZ plane. | |
| vuMatrix & | makeShearYX (double s) |
| Makes this matrix a shearing matrix in the YX plane. | |
| vuMatrix & | makeShearYZ (double s) |
| Makes this matrix a shearing matrix in the YZ plane. | |
| vuMatrix & | makeShearZX (double s) |
| Makes this matrix a shearing matrix in the ZX plane. | |
| vuMatrix & | makeShearZY (double s) |
| Makes this matrix a shearing matrix in the ZY plane. | |
| vuMatrix & | makeReflectX (void) |
| Makes this matrix a reflection matrix about the x axis. | |
| vuMatrix & | makeReflectY (void) |
| Makes this matrix a reflection matrix about the y axis. | |
| vuMatrix & | makeReflectZ (void) |
| Makes this matrix a reflection matrix about the z axis. | |
| vuMatrix & | makePerspective (double d) |
| Makes this matrix a perspective matrix for the distance d. | |
| vuMatrix & | makePerspectiveKeepZ (double d) |
| Makes this matrix a perspective matrix for the distance d, keeping the z value. | |
| double * | operator[] (unsigned int index) |
| The column access operator. | |
| const double * | operator[] (unsigned int index) const |
| The const column access operator. | |
| double * | getData (void) |
| Returns the data pointer. | |
| double const * | getData (void) const |
| returns const data pointer | |
| vuMatrix | invOrtho () const |
| Returns the transposed 3x3 matrix with negative translation. | |
| vuMatrix | operator+ (const vuMatrix &m) const |
| Returns the addition of the two matrices.. | |
| vuMatrix | operator- (const vuMatrix &m) const |
| Returns the subtraction a matrix from the instance. | |
| vuMatrix | operator * (const vuMatrix &m) const |
| Returns the product of the two matrices. | |
| vuVector | operator * (const vuVector &v) const |
| Returns the product of the instance with a vector. | |
| vuMatrix | operator * (double s) const |
| Returns the product of the instance with a scalar. | |
| vuMatrix & | operator+= (const vuMatrix &m) |
| Adds a matrix to the instance. | |
| vuMatrix & | operator-= (const vuMatrix &m) |
| Subtracts a matrix from the instance. | |
| vuMatrix & | operator *= (const vuMatrix &m) |
| Multiplies the instance by a matrix. | |
| vuMatrix & | operator *= (double s) |
| Multiplies the instance by a scalar. | |
| bool | operator== (const vuMatrix &m) const |
| An equality operator. | |
| bool | operator!= (const vuMatrix &m) const |
| An inequality operator. | |
| vuMatrix | inverse (void) |
| Returns the inverse of the matrix. | |
| void | invertRotationMatrix () |
| Inverts a rotation matrix. | |
Friends | |
| class | vuVector |
| vuMatrix | operator * (double s, const vuMatrix &m) |
| Multiplies a scalar by a matrix. | |
| std::ostream & | operator<< (std::ostream &out, const vuMatrix &m) |
| writes the elements to a stream; separated by whitespaces and newlines | |
| std::istream & | operator>> (std::istream &in, vuMatrix &m) |
| reads a matrix from a stream | |
The vuMatrix class is a 4x4 matrix that works in conjunction with the vuVector class (a 3D homogeneous vector). The elements of the vuMatrix are all single precision floating-point numbers, stored in column-major order to be compatible with OpenGL. Column-major means the first index selects the column, the second index selects the row.
|
|
Constructor that initializes the vector from a double array.
|
|
|
Returns the data pointer. Same as calling operator[0]. |
|
|
Inverts a rotation matrix. The inverse of a rotation matrix is simply its transpose, which takes 3 swaps |
|
||||||||||||
|
Makes a rotation matrix for a rotation of a degrees around the axis vector.
|
1.4.4