diff options
author | erorcun <erayorcunus@gmail.com> | 2019-11-05 13:05:47 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-11-05 13:05:47 +0100 |
commit | 996bc0293f9ae35f28dbf88b9fabdb33dda3d411 (patch) | |
tree | eed9cf112b4a622aac232242d0381e24db817561 /src/math | |
parent | Merge pull request #265 from erorcun/erorcun (diff) | |
parent | Peds & a few fixes (diff) | |
download | re3-996bc0293f9ae35f28dbf88b9fabdb33dda3d411.tar re3-996bc0293f9ae35f28dbf88b9fabdb33dda3d411.tar.gz re3-996bc0293f9ae35f28dbf88b9fabdb33dda3d411.tar.bz2 re3-996bc0293f9ae35f28dbf88b9fabdb33dda3d411.tar.lz re3-996bc0293f9ae35f28dbf88b9fabdb33dda3d411.tar.xz re3-996bc0293f9ae35f28dbf88b9fabdb33dda3d411.tar.zst re3-996bc0293f9ae35f28dbf88b9fabdb33dda3d411.zip |
Diffstat (limited to 'src/math')
-rw-r--r-- | src/math/Vector2D.h | 13 |
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); +} |