diff --git a/src/Utils/Utils.cpp b/src/Utils/Utils.cpp index 3a16ee58..299bfa6c 100644 --- a/src/Utils/Utils.cpp +++ b/src/Utils/Utils.cpp @@ -149,4 +149,11 @@ namespace Utils { return !(base1 + len1 <= base2 || base2 + len2 <= base1); } + + float Vec3SqrDistance(float(*v1)[3], float(*v2)[3]) + { + return (std::pow((*v2)[0] - (*v1)[0], 2) + std::pow((*v2)[1] - (*v1)[1], 2) + std::pow((*v2)[2] - (*v1)[2], 2)); + } + + } diff --git a/src/Utils/Utils.hpp b/src/Utils/Utils.hpp index f296f0e1..257ec5bf 100644 --- a/src/Utils/Utils.hpp +++ b/src/Utils/Utils.hpp @@ -24,6 +24,7 @@ namespace Utils void OpenUrl(const std::string& url); bool HasIntercection(unsigned int base1, unsigned int len1, unsigned int base2, unsigned int len2); + float Vec3SqrDistance(float (*v1)[3], float (*v2)[3]); template inline void RotLeft(T& object, size_t bits) {