summaryrefslogtreecommitdiffstats
path: root/src/math/Vector2D.h
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/math/Vector2D.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/math/Vector2D.h b/src/math/Vector2D.h
index c8835ec0..76664522 100644
--- a/src/math/Vector2D.h
+++ b/src/math/Vector2D.h
@@ -20,6 +20,29 @@ public:
}else
x = 0.0f;
}
+ const CVector2D &operator+=(CVector2D const &right) {
+ x += right.x;
+ y += right.y;
+ return *this;
+ }
+
+ const CVector2D &operator-=(CVector2D const &right) {
+ x -= right.x;
+ y -= right.y;
+ return *this;
+ }
+
+ const CVector2D &operator*=(float right) {
+ x *= right;
+ y *= right;
+ return *this;
+ }
+
+ const CVector2D &operator/=(float right) {
+ x /= right;
+ y /= right;
+ return *this;
+ }
CVector2D operator-(const CVector2D &rhs) const {
return CVector2D(x-rhs.x, y-rhs.y);
}