Bridge vector class to sf::Vector2i/f that provides some common math methods.
More...
|
| Vec2d (double x, double y) |
|
| Vec2d (sf::Vector2f const &sfvect) |
|
| Vec2d (sf::Vector2i const &sfvect) |
|
| Vec2d (Vec2d const &other)=default |
|
Vec2d & | operator= (Vec2d const &other)=default |
|
| operator sf::Vector2f () const |
|
| operator sf::Vector2i () const |
|
j::Value | save () const |
| Save internal representation as JSON value.
|
|
double | lengthSquared () const |
| Computes the length of the vector (squared). More...
|
|
double | length () const |
| Computes the length of the vector. More...
|
|
Vec2d | normalised () const |
| Computes the normalized vector. More...
|
|
Vec2d | normal () const |
| Computes the normal (orthogonal) vector for this vector. More...
|
|
double | angle () const |
| Computes the angle of the vector in polar coordinates. More...
|
|
double | dot (Vec2d const &other) const |
| Computes the dot product between this and another vector. More...
|
|
int | sign (Vec2d const &other) const |
| Compares the angle between another vector and this one. More...
|
|
Vec2d | operator- () const |
| Negation.
|
|
Vec2d | operator- (Vec2d const &b) const |
|
Vec2d | operator+ (Vec2d const &b) const |
|
Vec2d | operator* (double c) const |
|
Vec2d | operator/ (double c) const |
|
Vec2d & | operator-= (Vec2d const &b) |
|
Vec2d & | operator+= (Vec2d const &b) |
|
Vec2d & | operator*= (double c) |
|
Vec2d & | operator/= (double c) |
|
bool | operator== (Vec2d const &b) const |
|
bool | operator!= (Vec2d const &b) const |
|
double | operator[] (int axis) const |
| Accesses the coordinates by dimension, read-only. More...
|
|
double | x () const |
|
double | y () const |
|
Bridge vector class to sf::Vector2i/f that provides some common math methods.
It can be implicitly constructed from a sf::Vector2i or sf::Vector2f and can be converted implicitly to those same types.