Skip to content

Commit f1ae4f1

Browse files
committed
gltfpack: Avoid rare division by zero
Meshes with empty (but valid) bounds may produce false positive warnings.
1 parent 34421c1 commit f1ae4f1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

gltf/stream.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ QuantizationPosition prepareQuantizationPosition(const std::vector<Mesh>& meshes
122122
float max_rel_error = 0;
123123

124124
for (size_t i = 0; i < meshes.size(); ++i)
125-
if (bounds[i].isValid())
125+
if (bounds[i].isValid() && bounds[i].getExtent() > 1e-2f)
126126
max_rel_error = std::max(max_rel_error, error / bounds[i].getExtent());
127127

128128
if (max_rel_error > 5e-2f)

0 commit comments

Comments
 (0)