Math/Sphere: Fix SquaredDistance weirdness..

Fixes light selection
This commit is contained in:
Lynix 2016-12-15 14:37:58 +01:00
parent ff5b72b469
commit 165b73acb3
1 changed files with 1 additions and 1 deletions

View File

@ -485,7 +485,7 @@ namespace Nz
template<typename T> template<typename T>
T Sphere<T>::SquaredDistance(const Vector3<T>& point) const T Sphere<T>::SquaredDistance(const Vector3<T>& point) const
{ {
return Vector3f::SquaredDistance(point, GetPosition() + (point - GetPosition()).Normalize() * radius); return Vector3f::SquaredDistance(GetPosition(), point) - radius * radius;
} }
/*! /*!