From a3e3527a3b8f260db285c76dc1044baab8a2f773 Mon Sep 17 00:00:00 2001 From: aap Date: Sun, 4 Aug 2019 00:31:00 +0200 Subject: implemented CHeli --- src/math/Vector2D.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'src/math/Vector2D.h') 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); } -- cgit v1.2.3