Main Page | Class Hierarchy | Class List | File List | Class Members

vuMatrix Class Reference

Taken from vuVolume2. 4x4 matrix class. More...

#include <vuMatrix.h>

List of all members.

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.
vuMatrixoperator= (const vuMatrix &m)
 Assigns a matrix to the instance.
vuMatrixoperator= (double v)
 Assigns a doubleing point value to each entry of the matrix.
vuMatrixoperator= (const double *v)
 Assigns an array of doubleing point values to the matrix.
vuMatrixmakeIdentity (void)
 Makes the matrix an identity matrix and returns a reference.
vuMatrixmakeRotate (const vuVector &axis, double a)
 Makes a rotation matrix for a rotation of a degrees around the axis vector.
vuMatrixmakeRotateX (double a)
 Makes this matrix a rotation matrix for a rotation of a degrees about the x axis.
vuMatrixmakeRotateY (double a)
 Makes this matrix a rotation matrix for a rotation of a degrees about the y axis.
vuMatrixmakeRotateZ (double a)
 Makes this matrix a rotation matrix for a rotation of a degrees about the z axis.
vuMatrixmakeTranslate (double x, double y, double z)
 Makes this matrix a translation matrix corresponding to the given displacement.
vuMatrixmakeScale (double x, double y, double z)
 Makes this matrix a scaling matrix.
vuMatrixmakeShearXY (double s)
 Makes this matrix a shearing matrix in the XY plane.
vuMatrixmakeShearXZ (double s)
 Makes this matrix a shearing matrix in the XZ plane.
vuMatrixmakeShearYX (double s)
 Makes this matrix a shearing matrix in the YX plane.
vuMatrixmakeShearYZ (double s)
 Makes this matrix a shearing matrix in the YZ plane.
vuMatrixmakeShearZX (double s)
 Makes this matrix a shearing matrix in the ZX plane.
vuMatrixmakeShearZY (double s)
 Makes this matrix a shearing matrix in the ZY plane.
vuMatrixmakeReflectX (void)
 Makes this matrix a reflection matrix about the x axis.
vuMatrixmakeReflectY (void)
 Makes this matrix a reflection matrix about the y axis.
vuMatrixmakeReflectZ (void)
 Makes this matrix a reflection matrix about the z axis.
vuMatrixmakePerspective (double d)
 Makes this matrix a perspective matrix for the distance d.
vuMatrixmakePerspectiveKeepZ (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.
vuMatrixoperator+= (const vuMatrix &m)
 Adds a matrix to the instance.
vuMatrixoperator-= (const vuMatrix &m)
 Subtracts a matrix from the instance.
vuMatrixoperator *= (const vuMatrix &m)
 Multiplies the instance by a matrix.
vuMatrixoperator *= (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


Detailed Description

Taken from vuVolume2. 4x4 matrix class.

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 & Destructor Documentation

vuMatrix::vuMatrix const double *  v  ) 
 

Constructor that initializes the vector from a double array.

Parameters:
v An array of 16 floating point values.


Member Function Documentation

double * vuMatrix::getData void   ) 
 

Returns the data pointer.

Same as calling operator[0].

void vuMatrix::invertRotationMatrix  ) 
 

Inverts a rotation matrix.

The inverse of a rotation matrix is simply its transpose, which takes 3 swaps

vuMatrix & vuMatrix::makeRotate const vuVector axis,
double  a
 

Makes a rotation matrix for a rotation of a degrees around the axis vector.

Parameters:
axis The axis of rotation.
a The angle of rotation, in degrees.


The documentation for this class was generated from the following files:
Generated on Thu Apr 13 04:55:57 2006 by  doxygen 1.4.4