summaryrefslogtreecommitdiff
path: root/src/math/Vector2D.h
diff options
context:
space:
mode:
authoreray orçunus <erayorcunus@gmail.com>2019-11-05 02:04:26 +0300
committereray orçunus <erayorcunus@gmail.com>2019-11-05 03:52:06 +0300
commitd5619fb5aedb62b4519a6bdfa4a7ed4bd4265e84 (patch)
treeeed9cf112b4a622aac232242d0381e24db817561 /src/math/Vector2D.h
parent11d071a0322d3755148848b7a321b2f7c43fc768 (diff)
Peds & a few fixes
Diffstat (limited to 'src/math/Vector2D.h')
-rw-r--r--src/math/Vector2D.h13
1 files changed, 10 insertions, 3 deletions
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);
+}