From e3c28a5dc8b51306e5ea6ea2fe345af2a6848734 Mon Sep 17 00:00:00 2001 From: David Rowe Date: Mon, 6 Sep 2021 16:28:38 +1200 Subject: [PATCH] Alternative crash fix --- libraries/physics/src/MultiSphereShape.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/libraries/physics/src/MultiSphereShape.cpp b/libraries/physics/src/MultiSphereShape.cpp index 1d2525741c..ce00a7c40f 100644 --- a/libraries/physics/src/MultiSphereShape.cpp +++ b/libraries/physics/src/MultiSphereShape.cpp @@ -487,9 +487,6 @@ void MultiSphereShape::calculateDebugLines() { } } } - if (radiuses.size() == 0) { - radiuses.push_back(0.0f); - } calculateChamferBox(_debugLines, radiuses, axes, _midPoint); } else if (_spheres.size() == 8) { std::vector axes; @@ -512,6 +509,11 @@ void MultiSphereShape::connectEdges(std::vector> void MultiSphereShape::calculateChamferBox(std::vector>& outLines, const std::vector& radiuses, const std::vector& axes, const glm::vec3& translation) { std::vector> sphereLines; + + if (radiuses.size() == 0) { + return; + } + calculateSphereLines(sphereLines, glm::vec3(0.0f), radiuses[0]); std::vector regions = {