summaryrefslogtreecommitdiff
path: root/src/helpers/Vector2D.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/helpers/Vector2D.hpp')
-rw-r--r--src/helpers/Vector2D.hpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/helpers/Vector2D.hpp b/src/helpers/Vector2D.hpp
index 3c5d4a2c..6112b8e4 100644
--- a/src/helpers/Vector2D.hpp
+++ b/src/helpers/Vector2D.hpp
@@ -22,6 +22,9 @@ class Vector2D {
Vector2D operator-(const Vector2D& a) const {
return Vector2D(this->x - a.x, this->y - a.y);
}
+ Vector2D operator-() const {
+ return Vector2D(-this->x, -this->y);
+ }
Vector2D operator*(const float& a) const {
return Vector2D(this->x * a, this->y * a);
}