diff --git a/libraries/model-serializers/src/GLTFSerializer.cpp b/libraries/model-serializers/src/GLTFSerializer.cpp index c3bb3022b7..2304440a9f 100755 --- a/libraries/model-serializers/src/GLTFSerializer.cpp +++ b/libraries/model-serializers/src/GLTFSerializer.cpp @@ -1572,7 +1572,8 @@ bool GLTFSerializer::buildGeometry(HFMModel& hfmModel, const hifi::VariantHash& glm::vec3 globalMeshScale = extractScale(globalTransforms[nodeIndex]); const glm::mat4 meshToJoint = glm::scale(glm::mat4(), globalMeshScale) * jointInverseBindTransforms[clusterIndex]; - const float EXPANSION_WEIGHT_THRESHOLD = 0.25f; + // TODO: The entire clustering is probably broken and detailed collision shapes fail to generate due to it. + const uint16_t EXPANSION_WEIGHT_THRESHOLD = UINT16_MAX/4; // Equivalent of 0.25f? if (mesh.clusterWeights[j] >= EXPANSION_WEIGHT_THRESHOLD) { // TODO: fix transformed vertices being pushed back auto& vertex = mesh.vertices[i]; diff --git a/libraries/physics/src/MultiSphereShape.cpp b/libraries/physics/src/MultiSphereShape.cpp index 71702ac62b..42de501eef 100644 --- a/libraries/physics/src/MultiSphereShape.cpp +++ b/libraries/physics/src/MultiSphereShape.cpp @@ -210,6 +210,7 @@ MultiSphereShape::CollapsingMode MultiSphereShape::computeSpheres(ExtractionMode auto& diff = data._diff; auto& epsilon = data._epsilon; auto& dimensions = data._dimensions; + const float DIMENSIONS_EPSILON = 0.000001f; if (_mode == ExtractionMode::Automatic) { if (diff.xy < 0.5f * epsilon.xy && diff.xz < 0.5f * epsilon.xz && diff.yz < 0.5f * epsilon.yz) { @@ -243,8 +244,12 @@ MultiSphereShape::CollapsingMode MultiSphereShape::computeSpheres(ExtractionMode break; case ExtractionMode::SphereCollapse: sphere._radius = 0.5f * glm::min(glm::min(dimensions.x, dimensions.y), dimensions.z); - sphere._position = glm::vec3(0.0f); - _spheres.push_back(sphere); + if (sphere._radius > DIMENSIONS_EPSILON) { + sphere._position = glm::vec3(0.0f); + _spheres.push_back(sphere); + } else { + qDebug() << "MultiSphereShape::computeSpheres in mode ExtractionMode::SphereCollapse generated sphere with zero radius"; + } break; case ExtractionMode::SpheresX: axis = 0.5f* dimensions.x * Vectors::UNIT_NEG_X;