diff options
Diffstat (limited to 'src/math/Vector2D.h')
-rw-r--r-- | src/math/Vector2D.h | 23 |
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); } |