diff options
author | Sergeanur <s.anureev@yandex.ua> | 2020-10-17 14:57:12 +0200 |
---|---|---|
committer | Sergeanur <s.anureev@yandex.ua> | 2020-10-17 14:57:12 +0200 |
commit | 63666391d4f63570fe354e695bc32d22d9418ef9 (patch) | |
tree | 1bfcd0dfac62b19b60e1f4433b81ea22939dcc0b /src/math | |
parent | Partial Pickups (diff) | |
download | re3-63666391d4f63570fe354e695bc32d22d9418ef9.tar re3-63666391d4f63570fe354e695bc32d22d9418ef9.tar.gz re3-63666391d4f63570fe354e695bc32d22d9418ef9.tar.bz2 re3-63666391d4f63570fe354e695bc32d22d9418ef9.tar.lz re3-63666391d4f63570fe354e695bc32d22d9418ef9.tar.xz re3-63666391d4f63570fe354e695bc32d22d9418ef9.tar.zst re3-63666391d4f63570fe354e695bc32d22d9418ef9.zip |
Diffstat (limited to '')
-rw-r--r-- | src/math/Vector.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/math/Vector.h b/src/math/Vector.h index 7ee01149..082b296f 100644 --- a/src/math/Vector.h +++ b/src/math/Vector.h @@ -115,6 +115,14 @@ Distance(const CVector &v1, const CVector &v2) return (v2 - v1).Magnitude(); } +inline float +Distance2D(const CVector &v1, const CVector &v2) +{ + float x = v2.x - v1.x; + float y = v2.y - v1.y; + return Sqrt(x*x + y*y); +} + class CMatrix; CVector Multiply3x3(const CMatrix &mat, const CVector &vec); |