Home | Namespaces | Hierarchy | Alphabetical List | Class list | Files | Namespace Members | Class members | File members |
2d vector class with lots of operators and methods. More...
#include <Vector2d.h>
Public Member Functions | |
f32 | dotProduct (const vector2d &other) const |
Returns the dot product of this vector with an other. | |
f32 * | get () |
const f32 * | get () const |
f32 | getAngle () const |
f32 | getAngleTrig () const |
f32 | getAngleWith (const vector2d &b) const |
f32 | getDistanceFrom (const vector2d &other) const |
f32 | getDistanceFromSQ (const vector2d &other) const |
f32 | getLength () const |
Returns the length of the vector. | |
f32 | getLengthSQ () const |
void | invert () |
Inverts the vector. | |
vector2d & | normalize () |
normalizes the vector. | |
bool | operator!= (const vector2d &other) const |
vector2d | operator* (const vector2d &other) const |
vector2d | operator* (const f32 v) const |
vector2d & | operator*= (const f32 v) |
vector2d & | operator*= (const vector2d &other) |
vector2d | operator+ (const vector2d &other) const |
vector2d & | operator+= (const vector2d &other) |
vector2d | operator- (const vector2d &other) const |
vector2d | operator- () const |
vector2d & | operator-= (const vector2d &other) |
vector2d | operator/ (const f32 v) const |
vector2d | operator/ (const vector2d &other) const |
vector2d & | operator/= (const f32 v) |
vector2d & | operator/= (const vector2d &other) |
vector2d & | operator= (const vector2d &other) |
bool | operator== (const vector2d &other) const |
void | rotateBy (f32 degrees, const vector2d ¢er) |
rotates the point around a center by an amount of degrees. | |
void | set (const vector2d &other) |
void | set (const f32 &nx, const f32 &ny) |
void | setLength (f32 newLength) |
Sets the length of the vector to a new value. | |
vector2d (f32 nx, f32 ny) | |
vector2d () | |
vector2d (const vector2d &other) | |
Public Attributes | |
f32 | X |
f32 | Y |
Static Public Attributes | |
static const vector2d | ORIGIN_2D = vector2d(0.0f, 0.0f) |
ORIGIN_2D is a const vector2d that defines the 2d origin vector for the 2d space. |
2d vector class with lots of operators and methods.
core::vector2d::vector2d | ( | ) |
Referenced by operator*(), operator+(), operator-(), and operator/().
core::vector2d::vector2d | ( | const vector2d & | other | ) |
f32 * core::vector2d::get | ( | ) |
References X.
Referenced by render::Shader::setParamerter().
f32 core::vector2d::getAngle | ( | ) | const |
Calculates the angle of this vector in grad in the counter trigonometric sense.
References core::atan(), getLength(), core::RADTODEG, core::sqrt(), X, and Y.
f32 core::vector2d::getAngleTrig | ( | ) | const |
Calculates the angle of this vector in grad in the trigonometric sense. This method has been suggested by Pr3t3nd3r.
References core::atan(), core::RADTODEG, X, and Y.
Calculates the angle between this vector and another one in grad.
References core::atan(), core::RADTODEG, core::sqrt(), X, and Y.
Referenced by core::line2d::getAngleWith().
Returns distance from an other point. Here, the vector is interpreted as point in 2 dimensional space.
References core::sqrt(), X, and Y.
Referenced by core::line2d::getLength().
f32 core::vector2d::getLength | ( | ) | const |
Returns the length of the vector.
References core::sqrt(), X, and Y.
Referenced by getAngle(), normalize(), and setLength().
f32 core::vector2d::getLengthSQ | ( | ) | const |
Returns squared length of the vector. This is useful because it is much faster then getLength().
vector2d & core::vector2d::normalize | ( | ) |
normalizes the vector.
References core::EPSILON, getLength(), X, and Y.
bool core::vector2d::operator!= | ( | const vector2d & | other | ) | const |
References core::EPSILON, X, and Y.
References vector2d(), X, and Y.
References vector2d(), X, and Y.
References vector2d(), X, and Y.
References vector2d(), X, and Y.
vector2d core::vector2d::operator- | ( | ) | const |
References vector2d(), X, and Y.
References vector2d(), X, and Y.
References vector2d(), X, and Y.
bool core::vector2d::operator== | ( | const vector2d & | other | ) | const |
References core::EPSILON, X, and Y.
rotates the point around a center by an amount of degrees.
References core::cos(), core::DEGTORAD, core::sin(), X, and Y.
Referenced by core::line2d::set().
void core::vector2d::setLength | ( | f32 | newLength | ) |
Sets the length of the vector to a new value.
References core::EPSILON, getLength(), X, and Y.
const vector2d core::vector2d::ORIGIN_2D = vector2d(0.0f, 0.0f) [static] |
ORIGIN_2D is a const vector2d that defines the 2d origin vector for the 2d space.
Referenced by dotProduct(), get(), getAngle(), getAngleTrig(), getAngleWith(), getDistanceFrom(), getDistanceFromSQ(), getLength(), getLengthSQ(), core::line2d::getUnitVector(), core::line2d::getVector(), invert(), normalize(), operator!=(), operator*(), operator*=(), operator+(), operator+=(), operator-(), operator-=(), operator/(), operator/=(), operator=(), operator==(), rotateBy(), set(), and setLength().
Referenced by dotProduct(), getAngle(), getAngleTrig(), getAngleWith(), getDistanceFrom(), getDistanceFromSQ(), getLength(), getLengthSQ(), core::line2d::getUnitVector(), core::line2d::getVector(), invert(), normalize(), operator!=(), operator*(), operator*=(), operator+(), operator+=(), operator-(), operator-=(), operator/(), operator/=(), operator=(), operator==(), rotateBy(), set(), and setLength().
The KG Game Engine
Documentation © 2006-2011 by Kat'Oun. Generated on Sat Jul 2 2011 00:50:07 by
Doxygen
(1.7.4)
|