Main Page Namespace List Class Hierarchy Compound List File List Namespace Members Compound Members
WPCG::WP_Matrix3D Class Reference
#include <WP_Matrix3D.h>
List of all members.
Detailed Description
this class represents a 3D matrix
-
Author:
-
Copyright (C) 2001 W.P. van Paassen peter@paassen.tmfweb.nl
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; see the file COPYING. If not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
Constructor & Destructor Documentation
WPCG::WP_Matrix3D::WP_Matrix3D |
( |
|
) |
|
|
WPCG::WP_Matrix3D::~WP_Matrix3D |
( |
|
) |
[inline] |
|
|
-
Parameters:
-
type |
the type of the matrix. TRANSLATION_MATRIX for a translation matrix and SCALING_MATRIX for a scaling matrix. Any other value creates the identity matrix |
x |
the x value of the translation or scaling operation |
y |
the y value of the translation or scaling operation |
z |
the z value of the translation or scaling operation |
|
|
-
Parameters:
-
type |
the type of the matrix. TRANSLATION_MATRIX for a translation matrix and SCALING_MATRIX for a scaling matrix. Any other value creates the identity matrix |
v |
a WP_Vector3D object containing the x, y and z values to be used for translation or scaling |
|
WPCG::WP_Matrix3D::WP_Matrix3D |
( |
const byte |
type, |
|
|
scalar |
angle |
|
) |
|
|
|
-
Parameters:
-
type |
the type of the matrix. X_ROTATION_MATRIX, Y_ROTATION_MATRIX and Z_ROTATION_MATRIX are supported. Other type values creates the identity matrix |
angle |
the angle of the rotation around the selected axis |
|
|
this constructor builds a camera transformation matrix by which world coordinates are transformed to camera coordinates. This is the same matrix as the OpenGL call gluLookAt() builds and is usefull if a camera implementation is created without the use of gluLookAt(). See F.S. Hill JR, Computer Graphics using OpenGL page 363-365 -
Parameters:
-
eye |
a WP_Vector3D object containing the camera's eye position |
u |
a WP_Vector3D object representing the direction of the x-axis of the camera's coordinate system |
v |
a WP_Vector3D object representing the direction of the y-axis of the camera's coordinate system |
n |
a WP_Vector3D object representing the direction of the z-axis of the camera's coordinate system |
|
WPCG::WP_Matrix3D::WP_Matrix3D |
( |
scalar |
f[4][4] |
) |
|
|
|
-
Parameters:
-
f |
an array of 4 rows and 4 columns |
|
WPCG::WP_Matrix3D::WP_Matrix3D |
( |
scalar * |
f |
) |
|
|
|
-
Parameters:
-
f |
a pointer to an array of 16 floats. The floats should be ordered per row so indices 0-3 are the indices in the four columns on the first row, just like in OpenGL |
|
Member Function Documentation
void WPCG::WP_Matrix3D::createIdentity |
( |
|
) |
|
|
|
this function creates the identity matrix |
scalar WPCG::WP_Matrix3D::determinant |
( |
|
) |
[inline] |
|
|
this function computes the determinant of this matrix. Currently only inversion of homogenous matrices is supported -
Returns:
-
the determinant. 0.0f in case of non-homogenous matrix
|
bool WPCG::WP_Matrix3D::inverse |
( |
|
) |
|
|
|
this function computes the inverse of this matrix. Currently only inversion of homogenous matrices is supported a boolean indicating if an inverse exist and if the current matrix was inversed succesfully, false if non homogenous matrix |
bool WPCG::WP_Matrix3D::isHomogenous |
( |
|
) |
[inline] |
|
|
this function determines if this matrix is homogenous (lower row is 0 0 0 1) -
Returns:
-
a boolean indicating if this matrix is homogenous
|
bool WPCG::WP_Matrix3D::isIdentity |
( |
|
) |
|
|
|
this function determines if this matrix is the identity matrix -
Returns:
-
a boolean indicating if this matrix is the identity matrix
|
bool WPCG::WP_Matrix3D::isNonSingular |
( |
|
) |
[inline] |
|
|
this function determines if this matrix is non singular -
Returns:
-
a boolean indicating if this matrix is non singular
|
WP_Matrix3D WPCG::WP_Matrix3D::operator * |
( |
scalar |
s |
) |
const [inline] |
|
|
this operator multiplies every matrix cell by a scalar -
Parameters:
-
s |
the scalar by which every matrix cell is multiplied |
-
Returns:
-
a new matrix containing the multiplied cells
|
WP_Matrix3D WPCG::WP_Matrix3D::operator * |
( |
const WP_Matrix3D & |
m |
) |
const [inline] |
|
|
this operator postmultiplies the current matrix by matrix m -
Parameters:
-
m |
the matrix which will be multiplied by the current matrix |
-
Returns:
-
a new matrix containing the multiplication of the current matrix and m
|
WP_Matrix3D& WPCG::WP_Matrix3D::operator *= |
( |
scalar |
s |
) |
[inline] |
|
|
this operator multiplies each matrix cell by a scalar and stores the result in this object -
Parameters:
-
s |
the scalar by which every matrix cell is multiplied |
-
Returns:
-
a reference to this object
|
WP_Matrix3D & WPCG::WP_Matrix3D::operator *= |
( |
const WP_Matrix3D & |
m |
) |
|
|
|
this operator postmultiplies the current matrix by m and stores the result in this object -
Parameters:
-
m |
the matrix which will be multiplied by this matrix |
-
Returns:
-
a reference to this object
|
WP_Matrix3D WPCG::WP_Matrix3D::operator+ |
( |
const WP_Matrix3D & |
m |
) |
const [inline] |
|
|
this operator adds m to the current matrix -
Parameters:
-
m |
the matrix which will be added to the current matrix |
-
Returns:
-
a new matrix containing the addition of the current matrix and m
|
WP_Matrix3D& WPCG::WP_Matrix3D::operator+= |
( |
const WP_Matrix3D & |
m |
) |
[inline] |
|
|
this operator adds m to the current matrix and stores the result in this object -
Parameters:
-
m |
the matrix which will be added to this matrix |
-
Returns:
-
a reference to this object
|
WP_Matrix3D& WPCG::WP_Matrix3D::operator- |
( |
|
) |
[inline] |
|
|
this operator inverts every matrix cell |
WP_Matrix3D WPCG::WP_Matrix3D::operator- |
( |
const WP_Matrix3D & |
m |
) |
const [inline] |
|
|
this operator subtracts m from the current matrix -
Parameters:
-
m |
the matrix which will be subtracted from the current matrix |
-
Returns:
-
a new matrix containing the subtraction of the current matrix and m
|
WP_Matrix3D& WPCG::WP_Matrix3D::operator-= |
( |
const WP_Matrix3D & |
m |
) |
[inline] |
|
|
this operator subtracts m from this matrix and stores the result in this object -
Parameters:
-
m |
the matrix which will be subtracted from this matrix |
-
Returns:
-
a reference to this object
|
WP_Matrix3D WPCG::WP_Matrix3D::operator/ |
( |
scalar |
s |
) |
const [inline] |
|
|
this operator divides every matrix cell by a scalar -
Parameters:
-
s |
the scalar by which every matrix cell is divided |
-
Returns:
-
a new matrix containing the divided cells
|
WP_Matrix3D& WPCG::WP_Matrix3D::operator/= |
( |
scalar |
s |
) |
[inline] |
|
|
this operator divides each matrix cell by a scalar and stores the result in this object -
Parameters:
-
s |
the scalar by which every matrix cell is divided |
-
Returns:
-
a reference to this object
|
WP_Matrix3D& WPCG::WP_Matrix3D::operator= |
( |
const WP_Matrix3D & |
m |
) |
[inline] |
|
|
assignment operator -
Parameters:
-
m |
the matrix containing the to be copied values |
-
Returns:
-
a reference to this matrix containing the copied values
|
void WPCG::WP_Matrix3D::preMultiply |
( |
const WP_Matrix3D & |
m |
) |
|
|
|
this function premultiplies this matrix by m, so the matrix multiplication m * this matrix is computed -
Parameters:
-
m |
the matrix by which this matrix is premultiplied |
|
void WPCG::WP_Matrix3D::print |
( |
|
) |
const |
|
|
this function prints this 3D matrix to stdout |
void WPCG::WP_Matrix3D::transpose |
( |
|
) |
|
|
|
this function transposes this matrix |
Friends And Related Function Documentation
friend class WP_Point3D [friend]
|
|
friend class WP_Vector3D [friend]
|
|
Member Data Documentation
scalar WPCG::WP_Matrix3D::data[16]
|
|
|
an array of 16 floats representing the matrix's cells. The cells are orientated from top to bottom and from left to right, so for example the cell in the fourth column of the first row is located at index 12. This orientation is the same as the matrices in OpenGL |
The documentation for this class was generated from the following files:
Generated on Tue Jan 28 20:26:40 2003 by
1.2.14 written by Dimitri van Heesch,
© 1997-2002