diff options
author | Sergeanur <s.anureev@yandex.ua> | 2020-10-18 17:15:49 +0300 |
---|---|---|
committer | Sergeanur <s.anureev@yandex.ua> | 2020-10-18 17:15:49 +0300 |
commit | 0d20f1c364e23ff68c26b77632f0fb80c0e54799 (patch) | |
tree | d22ab7f9ce5c336c3a112aaeff8bcb5a7e2db672 /src/math | |
parent | 1b59b2c9bcabb6048c9bc799542ded5cef065075 (diff) | |
parent | cc0ae516319a028cd1ef1b317a26d58ef17ee6d0 (diff) |
Merge branch 'master' into miami
# Conflicts:
# src/audio/AudioLogic.cpp
# src/control/RoadBlocks.cpp
# src/entities/Entity.h
# src/entities/Physical.cpp
# src/peds/Ped.cpp
# src/render/Renderer.cpp
# src/vehicles/Automobile.cpp
# src/vehicles/CarGen.cpp
# src/weapons/BulletInfo.cpp
# src/weapons/Weapon.cpp
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..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); |