Vec3 Square distance function
This commit is contained in:
parent
15a3f0fe04
commit
0c87243519
@ -149,4 +149,11 @@ namespace Utils
|
|||||||
{
|
{
|
||||||
return !(base1 + len1 <= base2 || base2 + len2 <= base1);
|
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));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -24,6 +24,7 @@ namespace Utils
|
|||||||
void OpenUrl(const std::string& url);
|
void OpenUrl(const std::string& url);
|
||||||
|
|
||||||
bool HasIntercection(unsigned int base1, unsigned int len1, unsigned int base2, unsigned int len2);
|
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)
|
template <typename T> inline void RotLeft(T& object, size_t bits)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user