diff --git a/libraries/physics/src/MultiSphereShape.cpp b/libraries/physics/src/MultiSphereShape.cpp index 98fb6dd34d..549c8042d5 100644 --- a/libraries/physics/src/MultiSphereShape.cpp +++ b/libraries/physics/src/MultiSphereShape.cpp @@ -270,9 +270,8 @@ void MultiSphereShape::spheresFromAxes(const std::vector& points, con glm::vec3 axisDir = glm::normalize(axis); for (size_t i = 0; i < points.size(); i++) { float dot = glm::dot(points[i], axisDir); - float distance = glm::length(points[i]); if (dot > 0.0f) { - float distancePow = glm::pow(distance, 2); + float distancePow = glm::distance2(Vectors::ZERO, points[i]); float dotPow = glm::pow(dot, 2); float radius = (dot / maxDistance) * glm::sqrt(distancePow - dotPow); averageRadius += radius;