summaryrefslogtreecommitdiffstats
path: root/src/math
diff options
context:
space:
mode:
authoraap <aap@papnet.eu>2019-08-04 00:31:00 +0200
committeraap <aap@papnet.eu>2019-08-04 00:31:00 +0200
commita3e3527a3b8f260db285c76dc1044baab8a2f773 (patch)
tree17869d4d50729e13497f7769679bdec0fef0a069 /src/math
parentMerge pull request #181 from Nick007J/master (diff)
downloadre3-a3e3527a3b8f260db285c76dc1044baab8a2f773.tar
re3-a3e3527a3b8f260db285c76dc1044baab8a2f773.tar.gz
re3-a3e3527a3b8f260db285c76dc1044baab8a2f773.tar.bz2
re3-a3e3527a3b8f260db285c76dc1044baab8a2f773.tar.lz
re3-a3e3527a3b8f260db285c76dc1044baab8a2f773.tar.xz
re3-a3e3527a3b8f260db285c76dc1044baab8a2f773.tar.zst
re3-a3e3527a3b8f260db285c76dc1044baab8a2f773.zip
Diffstat (limited to 'src/math')
-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);
}