Vec3 Square distance function

This commit is contained in:
Louvenarde 2021-11-08 17:55:48 +01:00
parent 15a3f0fe04
commit 0c87243519
2 changed files with 8 additions and 0 deletions

View File

@ -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));
}
}

View File

@ -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 <typename T> inline void RotLeft(T& object, size_t bits)
{