JNGL
Easy to use cross-platform 2D game library
|
Two-dimensional vector. More...
#include <jngl/Vec2.hpp>
Public Member Functions | |
Vec2 () | |
Null vector. | |
Vec2 (double x, double y) | |
Creates a vector {x, y}. | |
bool | isNull () const |
returns true if both x and y are exactly 0 | |
void | rotate (float angle) |
rotates the vector clock-wise by angle (radian) | |
template<class Archive > | |
void | serialize (Archive &ar, const unsigned int) |
Helper function to use with cereal or Boost.Serialization. | |
Public Attributes | |
double | x = 0 |
x component | |
double | y = 0 |
y component | |
Two-dimensional vector.
JNGL doesn't provide any linear algebra functions itself but relies on the excellent Boost.QVM:
Common math operators are overloaded:
|
inline |