summaryrefslogtreecommitdiffstats
path: root/src/math/Vector2D.h
diff options
context:
space:
mode:
authorNikolay Korolev <nickvnuk@gmail.com>2019-11-09 14:44:36 +0100
committerNikolay Korolev <nickvnuk@gmail.com>2019-11-09 14:44:36 +0100
commit5ef291ddf27aed2c27b39c3c30a9d5d27f7548b9 (patch)
tree710f5904ec705a30d64a568ce5f3ede0e2d91690 /src/math/Vector2D.h
parentscript stubs (diff)
parentFix link to config.h in readme (diff)
downloadre3-5ef291ddf27aed2c27b39c3c30a9d5d27f7548b9.tar
re3-5ef291ddf27aed2c27b39c3c30a9d5d27f7548b9.tar.gz
re3-5ef291ddf27aed2c27b39c3c30a9d5d27f7548b9.tar.bz2
re3-5ef291ddf27aed2c27b39c3c30a9d5d27f7548b9.tar.lz
re3-5ef291ddf27aed2c27b39c3c30a9d5d27f7548b9.tar.xz
re3-5ef291ddf27aed2c27b39c3c30a9d5d27f7548b9.tar.zst
re3-5ef291ddf27aed2c27b39c3c30a9d5d27f7548b9.zip
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);
+}