summaryrefslogtreecommitdiffstats
path: root/src/math
diff options
context:
space:
mode:
authoreray orçunus <erayorcunus@gmail.com>2019-11-05 00:04:26 +0100
committereray orçunus <erayorcunus@gmail.com>2019-11-05 01:52:06 +0100
commitd5619fb5aedb62b4519a6bdfa4a7ed4bd4265e84 (patch)
treeeed9cf112b4a622aac232242d0381e24db817561 /src/math
parentMerge pull request #265 from erorcun/erorcun (diff)
downloadre3-d5619fb5aedb62b4519a6bdfa4a7ed4bd4265e84.tar
re3-d5619fb5aedb62b4519a6bdfa4a7ed4bd4265e84.tar.gz
re3-d5619fb5aedb62b4519a6bdfa4a7ed4bd4265e84.tar.bz2
re3-d5619fb5aedb62b4519a6bdfa4a7ed4bd4265e84.tar.lz
re3-d5619fb5aedb62b4519a6bdfa4a7ed4bd4265e84.tar.xz
re3-d5619fb5aedb62b4519a6bdfa4a7ed4bd4265e84.tar.zst
re3-d5619fb5aedb62b4519a6bdfa4a7ed4bd4265e84.zip
Diffstat (limited to 'src/math')
-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);
+}