diff options
author | Sergeanur <s.anureev@yandex.ua> | 2020-10-17 12:48:08 +0200 |
---|---|---|
committer | Sergeanur <s.anureev@yandex.ua> | 2020-10-17 12:48:08 +0200 |
commit | 1f36b78c205202b605797e6e29ba045124066705 (patch) | |
tree | ccc41513de1253e20379ea8f319d514bd2f59400 /src/math | |
parent | Merge pull request #767 from theR4K/master (diff) | |
download | re3-1f36b78c205202b605797e6e29ba045124066705.tar re3-1f36b78c205202b605797e6e29ba045124066705.tar.gz re3-1f36b78c205202b605797e6e29ba045124066705.tar.bz2 re3-1f36b78c205202b605797e6e29ba045124066705.tar.lz re3-1f36b78c205202b605797e6e29ba045124066705.tar.xz re3-1f36b78c205202b605797e6e29ba045124066705.tar.zst re3-1f36b78c205202b605797e6e29ba045124066705.zip |
Diffstat (limited to 'src/math')
-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..badc40e3 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(sq(x) + sq(y)); +} + class CMatrix; CVector Multiply3x3(const CMatrix &mat, const CVector &vec); |