From 165b73acb3d3aedbfd65fa033b2686369f6916cd Mon Sep 17 00:00:00 2001 From: Lynix Date: Thu, 15 Dec 2016 14:37:58 +0100 Subject: [PATCH] Math/Sphere: Fix SquaredDistance weirdness.. Fixes light selection --- include/Nazara/Math/Sphere.inl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/Nazara/Math/Sphere.inl b/include/Nazara/Math/Sphere.inl index 0a8d1adae..5252dbdbb 100644 --- a/include/Nazara/Math/Sphere.inl +++ b/include/Nazara/Math/Sphere.inl @@ -485,7 +485,7 @@ namespace Nz template T Sphere::SquaredDistance(const Vector3& point) const { - return Vector3f::SquaredDistance(point, GetPosition() + (point - GetPosition()).Normalize() * radius); + return Vector3f::SquaredDistance(GetPosition(), point) - radius * radius; } /*!