#include <gauge3d/3dmath/vector.h>
Public Methods | |
Constructors | |
| GVector (void) | |
| GVector (GCoordinate _x,GCoordinate _y,GCoordinate _z) | |
| GVector (GCoordinate coords[]) | |
Operators | |
These are all standard vector math. | |
| const GVector& | operator+= (const GVector &other) |
| Standard vector add. | |
| const GVector& | operator-= (const GVector &other) |
| Standard vector subtract. | |
| GCoordinate | operator * (const GVector &other)const |
| Dot product. | |
| GVector | X (const GVector &other)const |
| Cross product. | |
| const GVector& | operator *= (GCoordinate other) |
| Scalar multiplication. | |
| GVector | operator/ (GCoordinate div)const |
| Scalar division. | |
| const GVector& | operator/= (GCoordinate other) |
| Scalar division. | |
| GCoordinate& | operator[] (int index) |
| Array-like access to coordinates. | |
| const GCoordinate& | operator[] (int index)const |
| Array-like access to coordinates. | |
| bool | operator== (const GVector &other)const |
| Comparison with error compensation. | |
| bool | operator!= (const GVector &other)const |
| Comparison with error compensation. | |
Advanced Ops | |
| GCoordinate | Magnitude (void)const |
| Find the magnitude (length) of vector. | |
| GCoordinate | SquareMagnitude (void)const |
| Find the magnitude squared (faster to calculate). | |
| void | Normalize (void) |
| Make the vector into a unit vector with the same direction. | |
| void | Slerp (const GVector &v1,const GVector &v2,GCoordinate t) |
| Spherical Linear Interpolation. More... | |
Public Attributes | |
Coordinates | |
| GCoordinate | x |
| GCoordinate | y |
| GCoordinate | z |
Related Functions | |
| (Note that these are not member functions.) | |
| GVector | operator+ (const GVector &vec1,const GVector &vec2) |
| Vector addition. | |
| GVector | operator- (const GVector &vec1,const GVector &vec2) |
| Vector subtraction. | |
| GVector | operator * (const GVector &vec,GCoordinate coord) |
| Vector and scalar multiplication. | |
| GVector | operator * (GCoordinate coord,const GVector &vec) |
| Vector and scalar multiplication. | |
This class represents a vector in three dimentional space. Consult your highschool math books for more information. :)
|
|
Leaves x, y, and z uninitialized. |
|
|
Initialize to given x, y, and z. |
|
|
Initialize from 3-coordinate array containing x, y, and z. |
|
|
Spherical Linear Interpolation. Slerp() replaces the vector with the result of a spherical linear interpolation between v1 and v2. Imagin interpolating between two points on the surface of a sphere. The resulting vector will be a unit vector. |
1.2.4 written by Dimitri van Heesch,
© 1997-2000