2D vector class with lots of operators and a few useful functions. More...
#include <gelVector.h>
Public Member Functions | |
Gel2dVec () | |
Default constructor. | |
Gel2dVec (const Gel2dVec &vec) | |
Copy constructor. | |
Gel2dVec (float n) | |
Single value constructor. | |
Gel2dVec (float _x, float _y) | |
Gel2dVec constructor. | |
float | getLength () const |
Gets the length of the vector. | |
float | getSqrLength () const |
Gets the square length of the vector. | |
float | getDistanceTo (const Gel2dVec &vec) const |
Gets the distance from this vector to another Gel2dVec. | |
float | getDot (const Gel2dVec &vec) const |
Gets the dot product of this vector with another Gel2dVec. | |
void | normalize () |
Normalizes the vector. | |
Gel2dVec | operator+ (const Gel2dVec &v) const |
Gel2dVec | operator- (const Gel2dVec &v) const |
Gel2dVec | operator* (const Gel2dVec &v) const |
Gel2dVec | operator/ (const Gel2dVec &v) const |
Gel2dVec | operator= (const Gel2dVec &v) |
Gel2dVec | operator+= (const Gel2dVec &v) |
Gel2dVec | operator-= (const Gel2dVec &v) |
Gel2dVec | operator*= (const Gel2dVec &v) |
Gel2dVec | operator/= (const Gel2dVec &v) |
bool | operator== (const Gel2dVec &v) const |
bool | operator!= (const Gel2dVec &v) const |
bool | operator< (const Gel2dVec &v) const |
bool | operator> (const Gel2dVec &v) const |
bool | operator<= (const Gel2dVec &v) const |
bool | operator>= (const Gel2dVec &v) const |
Public Attributes | |
float | x |
x coordinate. | |
float | y |
y coordinate. |
2D vector class with lots of operators and a few useful functions.
This class can be used as a direction vector, or for positioning in 2D space. It is already extensively used internally by Gel2D as a means of forwarding spatial coordinates.
gel::Gel2dVec::Gel2dVec | ( | ) | [inline] |
Default constructor.
gel::Gel2dVec::Gel2dVec | ( | const Gel2dVec & | vec | ) | [inline] |
Copy constructor.
vec | : The Gel2dVec to copy. |
gel::Gel2dVec::Gel2dVec | ( | float | n | ) | [inline] |
Single value constructor.
n | : Value to use for the vector's x and y coordinates. |
gel::Gel2dVec::Gel2dVec | ( | float | _x, |
float | _y | ||
) | [inline] |
Gel2dVec constructor.
_x | : The vector's x coordinate. |
_y | : The vector's y coordinate. |
float gel::Gel2dVec::getLength | ( | ) | const [inline] |
Gets the length of the vector.
float gel::Gel2dVec::getSqrLength | ( | ) | const [inline] |
Gets the square length of the vector.
float gel::Gel2dVec::getDistanceTo | ( | const Gel2dVec & | vec | ) | const [inline] |
float gel::Gel2dVec::getDot | ( | const Gel2dVec & | vec | ) | const [inline] |
void gel::Gel2dVec::normalize | ( | ) | [inline] |
Normalizes the vector.
bool gel::Gel2dVec::operator== | ( | const Gel2dVec & | v | ) | const [inline] |
bool gel::Gel2dVec::operator!= | ( | const Gel2dVec & | v | ) | const [inline] |
bool gel::Gel2dVec::operator< | ( | const Gel2dVec & | v | ) | const [inline] |
bool gel::Gel2dVec::operator> | ( | const Gel2dVec & | v | ) | const [inline] |
bool gel::Gel2dVec::operator<= | ( | const Gel2dVec & | v | ) | const [inline] |
bool gel::Gel2dVec::operator>= | ( | const Gel2dVec & | v | ) | const [inline] |
float gel::Gel2dVec::x |
x coordinate.
float gel::Gel2dVec::y |
y coordinate.
API Documentation by Mark D. Procarione | Generated by |