From d5619fb5aedb62b4519a6bdfa4a7ed4bd4265e84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?eray=20or=C3=A7unus?= Date: Tue, 5 Nov 2019 02:04:26 +0300 Subject: Peds & a few fixes --- src/math/Vector2D.h | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'src/math/Vector2D.h') diff --git a/src/math/Vector2D.h b/src/math/Vector2D.h index a090155c..1e4d698f 100644 --- a/src/math/Vector2D.h +++ b/src/math/Vector2D.h @@ -49,9 +49,6 @@ public: CVector2D operator+(const CVector2D &rhs) const { return CVector2D(x+rhs.x, y+rhs.y); } - CVector2D operator*(float t) const { - return CVector2D(x*t, y*t); - } CVector2D operator/(float t) const { return CVector2D(x/t, y/t); } @@ -91,3 +88,13 @@ NormalizeXY(float &x, float &y) }else x = 1.0f; } + +inline CVector2D operator*(const CVector2D &left, float right) +{ + return CVector2D(left.x * right, left.y * right); +} + +inline CVector2D operator*(float left, const CVector2D &right) +{ + return CVector2D(left * right.x, left * right.y); +} -- cgit v1.2.3