![]() |
Rune Engine
Version 0.2.7-alpha
Documentation for how to make games using the Rune Engine.
|
1 x 2 vector to be used for math. More...
#include <vec2.h>
Public Member Functions | |
Vec2 (double newX=0, double newY=0) | |
Constructor that sets up a new vector. More... | |
Vec2 | operator- (const Vec2 &right) |
Overload of subtraction operator. More... | |
Vec2 | operator- () |
Overload of negation operator. More... | |
Vec2 | operator+ (const Vec2 &right) |
Overload of addition operator. More... | |
Vec2 | operator* (const Vec2 &right) |
Overload of multiplication operator. More... | |
Vec2 | operator/ (const Vec2 &right) |
Overload of division operator. More... | |
Vec2 | operator/ (double scalar) |
Overload of division operator for a scalar on the right. | |
Vec2 & | operator-= (const Vec2 &right) |
Overload of -= operator. More... | |
Vec2 & | operator+= (const Vec2 &right) |
Overload of += operator. More... | |
Vec2 & | operator*= (const Vec2 &right) |
Overload of *= operator. More... | |
Vec2 & | operator*= (const double right) |
Overload of *= operator for a scalar multiplier. More... | |
Vec2 | operator* (double scalar) |
Overload of * operator for a scalar multiplier. More... | |
bool | operator== (const Vec2 &right) |
Overload of comparator operator. More... | |
bool | operator!= (const Vec2 &right) |
Overload of != operator. More... | |
std::ostream & | operator<< (std::ostream &os, const rune::Vec2 &vector) |
rune::Vec2 | operator* (double scalar, rune::Vec2 const &vec) |
rune::Vec2 | operator/ (double scalar, rune::Vec2 vec) |
rune::Vec2 | operator/ (double scalar) |
Overload of / operator for a scalar. More... | |
double | dotProduct (rune::Vec2 const &v1, rune::Vec2 const &v2) |
rune::Vec2 | findNormal (rune::Vec2 const &axis) |
Find the left handed vector normal to a surface. More... | |
rune::Vec2 | normalize (rune::Vec2 const &vector) |
double | crossProduct (rune::Vec2 const &vec1, rune::Vec2 const &vec2) |
Public Attributes | |
double | x |
X coordinate of the vector. | |
double | y |
Y coordinate of the vector. | |
1 x 2 vector to be used for math.
rune::Vec2::Vec2 | ( | double | newX = 0 , |
double | newY = 0 |
||
) |
Constructor that sets up a new vector.
newX | The initial value for the X component. |
newY | The initial value for the Y component. |
double crossProduct | ( | rune::Vec2 const & | vec1, |
rune::Vec2 const & | vec2 | ||
) |
vec1 | The first vector. |
vec2 | The second vector. |
double dotProduct | ( | rune::Vec2 const & | v1, |
rune::Vec2 const & | v2 | ||
) |
v1 | First vector to be used in the dot product. |
v2 | Seconds vector to be used in the dot product. |
rune::Vec2 findNormal | ( | rune::Vec2 const & | axis | ) |
Find the left handed vector normal to a surface.
axis | The axis that is used to find the normal. |
rune::Vec2 normalize | ( | rune::Vec2 const & | vector | ) |
vector | Vector that should be normalized. |
bool rune::Vec2::operator!= | ( | const Vec2 & | right | ) |
Overload of != operator.
right | The vector to be compared to. |
rune::Vec2 rune::Vec2::operator* | ( | const Vec2 & | right | ) |
Overload of multiplication operator.
right | The vector to multiply by. |
rune::Vec2 rune::Vec2::operator* | ( | double | scalar | ) |
Overload of * operator for a scalar multiplier.
scalar | The scalar to be multiplied with. |
rune::Vec2 operator* | ( | double | scalar, |
rune::Vec2 const & | vec | ||
) |
scalar | The scalar to be multiplied with. |
vec | The vector to be multiplied. |
rune::Vec2 & rune::Vec2::operator*= | ( | const double | right | ) |
Overload of *= operator for a scalar multiplier.
right | The scalar to be multiplied by. |
rune::Vec2 & rune::Vec2::operator*= | ( | const Vec2 & | right | ) |
Overload of *= operator.
right | The vector to be multiplied by. |
rune::Vec2 rune::Vec2::operator+ | ( | const Vec2 & | right | ) |
Overload of addition operator.
right | The vector to be added. |
rune::Vec2 & rune::Vec2::operator+= | ( | const Vec2 & | right | ) |
Overload of += operator.
right | The vector to be added. |
rune::Vec2 rune::Vec2::operator- | ( | ) |
Overload of negation operator.
rune::Vec2 rune::Vec2::operator- | ( | const Vec2 & | right | ) |
Overload of subtraction operator.
right | The vector to be subtracter. |
rune::Vec2 & rune::Vec2::operator-= | ( | const Vec2 & | right | ) |
Overload of -= operator.
right | The vector to be subtracted. |
rune::Vec2 rune::Vec2::operator/ | ( | const Vec2 & | right | ) |
Overload of division operator.
right | The vector to divide by. |
rune::Vec2 operator/ | ( | double | scalar | ) |
Overload of / operator for a scalar.
scalar | The scalar to be divided by. |
rune::Vec2 operator/ | ( | double | scalar, |
rune::Vec2 | vec | ||
) |
scalar | The scalar to be used as a divisor. |
vec | The vector to be element wise divided by. |
std::ostream & operator<< | ( | std::ostream & | os, |
const rune::Vec2 & | vector | ||
) |
os | Output stream that the vector should be printed to. |
vector | Vector to be printed. |
bool rune::Vec2::operator== | ( | const Vec2 & | right | ) |
Overload of comparator operator.
right | The vector to be compared to. |