Main Page Namespace List Class Hierarchy Compound List File List Namespace Members Compound Members
WPCG::WP_Vector3D Class Reference
#include <WP_Vector3D.h>
List of all members.
Detailed Description
this class represents a 3D vector
-
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_Vector3D::WP_Vector3D |
( |
|
) |
[inline] |
|
|
-
Parameters:
-
x |
the x component of the vector |
y |
the y component of the vector |
z |
the z component of the vector |
|
WPCG::WP_Vector3D::WP_Vector3D |
( |
scalar * |
s |
) |
[inline] |
|
|
-
Parameters:
-
s |
an array of 3 scalars representing the vector values |
|
WPCG::WP_Vector3D::~WP_Vector3D |
( |
|
) |
[inline] |
|
WPCG::WP_Vector3D::WP_Vector3D |
( |
const WP_Vector3D & |
v |
) |
[inline] |
|
Member Function Documentation
bool WPCG::WP_Vector3D::crossProduct |
( |
const WP_Vector3D & |
v |
) |
[inline] |
|
|
this function computes the crossproduct of two vectors (which is a vector) and assigns it to this vector -
Parameters:
-
v |
a WP_Vector3D object representing the vector, used for computing the crossproduct |
-
Returns:
-
a boolean indicating if the computation of the crossproduct was possible and a success
|
scalar WPCG::WP_Vector3D::getDegreesBetween |
( |
const WP_Vector3D & |
v |
) |
const [inline] |
|
|
this function computes the angle in degrees between two vectors -
Parameters:
-
v |
a WP_Vector3D object representing the second vector for calculating the angle between two vectors |
-
Returns:
-
the angle in degrees
|
scalar WPCG::WP_Vector3D::getRadsBetween |
( |
const WP_Vector3D & |
v |
) |
const [inline] |
|
|
this function computes the angle in radians between two vectors -
Parameters:
-
v |
a WP_Vector3D object representing the second vector for calculating the angle between two vectors |
-
Returns:
-
the angle in radians
|
scalar WPCG::WP_Vector3D::length |
( |
|
) |
const [inline] |
|
|
this function computes the length of the vector -
Returns:
-
the lenght of the vector
|
scalar WPCG::WP_Vector3D::normalize |
( |
|
) |
[inline] |
|
|
this function normalizes the vector -
Returns:
-
the lenght of the vector before normalizing
|
WP_Vector3D WPCG::WP_Vector3D::operator * |
( |
const WP_Matrix3D & |
m |
) |
const [inline] |
|
|
this operator multiplies this vector by a 3D matrix -
Parameters:
-
m |
a WP_Matrix3D object which represents the 3D matrix by which this vector is multiplied |
-
Returns:
-
a WP_Vector3D object containing the new values
|
WP_Vector3D WPCG::WP_Vector3D::operator * |
( |
scalar |
s |
) |
const [inline] |
|
|
this operator scales the vector by multiplying its values by a scalar -
Parameters:
-
s |
the scalar by which this vector is scaled |
-
Returns:
-
a WP_Vector3D object representing the scaled vector
|
scalar WPCG::WP_Vector3D::operator * |
( |
const WP_Vector3D & |
v |
) |
const [inline] |
|
|
this operator computes the dot product of the two 3D vectors -
Parameters:
-
v |
a WP_Vector3D object representing a vector by which this vector is multiplied to get the dot product |
-
Returns:
-
the dot product
|
WP_Vector3D& WPCG::WP_Vector3D::operator *= |
( |
const WP_Matrix3D & |
m |
) |
[inline] |
|
|
this operator multiplies this vector by a 3D matrix -
Parameters:
-
m |
a WP_Matrix3D object which represents the 3D matrix by which this vector is multiplied |
-
Returns:
-
a reference to this WP_Vector3D object containing the new values
|
WP_Vector3D& WPCG::WP_Vector3D::operator *= |
( |
scalar |
s |
) |
[inline] |
|
|
this operator scales this vector by using multiplication -
Parameters:
-
s |
the scalar by which this vector is scaled |
-
Returns:
-
a reference to this WP_Vector3D object containing the new values
|
WP_Vector3D WPCG::WP_Vector3D::operator+ |
( |
const WP_Vector3D & |
v |
) |
const [inline] |
|
|
this operator adds a vector to this vector -
Parameters:
-
v |
a WP_Vector3D object representing the vector which is added to this vector |
-
Returns:
-
a WP_Vector3D object representing the vector after addition
|
WP_Vector3D& WPCG::WP_Vector3D::operator+= |
( |
const WP_Vector3D & |
v |
) |
[inline] |
|
|
this operator adds a vector to this vector and assigns the result to this vector -
Parameters:
-
v |
a WP_Vector3D object representing the vector which is added to this vector |
-
Returns:
-
a reference to this WP_Vector3D object containing the new values
|
WP_Vector3D& WPCG::WP_Vector3D::operator- |
( |
|
) |
[inline] |
|
|
this operator inverts the vector -
Returns:
-
a reference to this WP_Vector3D object containing the inverted values
|
WP_Vector3D WPCG::WP_Vector3D::operator- |
( |
const WP_Vector3D & |
v |
) |
const [inline] |
|
|
this operator subtracts a vector from this vector -
Parameters:
-
v |
a WP_Vector3D object representing the vector which is subtracted from this vector |
-
Returns:
-
a WP_Vector3D object representing the vector after subtraction
|
WP_Vector3D& WPCG::WP_Vector3D::operator-= |
( |
const WP_Vector3D & |
v |
) |
[inline] |
|
|
this operator subtracts a vector from this vector and assigns the result to this vector -
Parameters:
-
v |
a WP_Vector3D object representing the vector which is subtracted from this vector |
-
Returns:
-
a reference to this WP_Vector3D object containing the new values
|
WP_Vector3D WPCG::WP_Vector3D::operator/ |
( |
scalar |
s |
) |
const [inline] |
|
|
this operator scales the vector by dividing its values by a scalar -
Parameters:
-
s |
the scalar by which this vector is scaled |
-
Returns:
-
a WP_Vector3D object representing the scaled vector
|
WP_Vector3D& WPCG::WP_Vector3D::operator/= |
( |
scalar |
s |
) |
[inline] |
|
|
this operator scales this vector by using division -
Parameters:
-
s |
the scalar by which this vector is scaled |
-
Returns:
-
a reference to this WP_Vector3D object containing the new values
|
WP_Vector3D& WPCG::WP_Vector3D::operator= |
( |
const WP_Vector3D & |
v |
) |
[inline] |
|
|
assignment operator -
Parameters:
-
v |
the WP_Vector3D object which is copied to this object |
-
Returns:
-
a reference to this object containing the copied vector values
|
bool WPCG::WP_Vector3D::orthogonal |
( |
const WP_Vector3D & |
v |
) |
const [inline] |
|
|
this function determines if two vectors are orthogonal (dot product is +- 0.0) -
Parameters:
-
v |
a WP_Vector3D object representing the second vector for calculating if the two vectors are orthogonal |
-
Returns:
-
a boolean indicating if the two vectors are orthogonal
|
void WPCG::WP_Vector3D::print |
( |
|
) |
const [inline] |
|
|
this function prints this 3D vector to stdout |
Member Data Documentation
scalar WPCG::WP_Vector3D::data[4]
|
|
|
an array of 4 scalars holding the vector's values. data[0] = x, data[1] = y, data[2] = z, data[3] = 0.0f |
The documentation for this class was generated from the following file:
Generated on Tue Jan 28 20:26:44 2003 by
1.2.14 written by Dimitri van Heesch,
© 1997-2002