Vector Class Reference
#include <vector.h>
List of all members.
Detailed Description
Vector class.
Represents either a 3D point in space, a velocity or a force. Provides several convenient operator overloads.
Definition at line 33 of file vector.h.
Constructor & Destructor Documentation
Vector::Vector |
( |
|
) |
[inline] |
Constructor.
Definition at line 39 of file vector.h.
Vector::Vector |
( |
float |
x, |
|
|
float |
y, |
|
|
float |
z = 0.0f | |
|
) |
| | [inline] |
Constructor.
Definition at line 48 of file vector.h.
Vector::Vector |
( |
const Vector & |
v |
) |
[inline] |
Copy constructor.
Definition at line 57 of file vector.h.
Member Function Documentation
Vector Vector::operator* |
( |
float |
c |
) |
const [inline] |
Scale vector operator.
Definition at line 66 of file vector.h.
Vector& Vector::operator*= |
( |
float |
c |
) |
[inline] |
In-place scale vector operator.
Definition at line 76 of file vector.h.
Vector Vector::operator/ |
( |
float |
c |
) |
const [inline] |
Scale vector operator.
Definition at line 87 of file vector.h.
Vector& Vector::operator/= |
( |
float |
c |
) |
[inline] |
In-place scale vector operator.
Definition at line 97 of file vector.h.
Vector Vector::operator+ |
( |
const Vector & |
v |
) |
const [inline] |
Add vector operator.
Definition at line 108 of file vector.h.
In-place add vector operator.
Definition at line 118 of file vector.h.
Vector Vector::operator- |
( |
const Vector & |
v |
) |
const [inline] |
Substract vector operator.
Definition at line 129 of file vector.h.
In-place substract vector operator.
Definition at line 139 of file vector.h.
float Vector::length |
( |
|
) |
const [inline] |
Returns the length of this vector.
This method does a relatively slow square root.
Definition at line 151 of file vector.h.
float Vector::squaredLength |
( |
|
) |
const [inline] |
Returns the squared length of this vector.
Avoids the square root.
Definition at line 159 of file vector.h.
float Vector::manhattanLength |
( |
|
) |
const [inline] |
Returns the manhattan length of this vector.
Definition at line 167 of file vector.h.
Vector Vector::normalized |
( |
|
) |
const [inline] |
Returns a normalized version of this vector.
This is a unit vector running parallel to it.
Definition at line 176 of file vector.h.
Member Data Documentation
The documentation for this class was generated from the following file: