Math/Sphere: Fix SquaredDistance weirdness..
Fixes light selection
This commit is contained in:
parent
ff5b72b469
commit
165b73acb3
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue