Skip to content

Commit 3a7fb0f

Browse files
committed
Check valid indices before doing convex decomposition (#677)
Signed-off-by: Ian Chen <[email protected]> (cherry picked from commit 13bded1)
1 parent 8397979 commit 3a7fb0f

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

graphics/src/MeshManager.cc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1674,6 +1674,14 @@ MeshManager::ConvexDecomposition(const SubMesh &_subMesh,
16741674
std::size_t _maxConvexHulls,
16751675
std::size_t _voxelResolution)
16761676
{
1677+
if (!_subMesh.HasValidIndices())
1678+
{
1679+
gzwarn << "Unable to perform convex decomposition on submesh: "
1680+
<< _subMesh.Name() << ". It has invalid indices."
1681+
<< std::endl;
1682+
return {};
1683+
}
1684+
16771685
std::vector<SubMesh> decomposed;
16781686

16791687
auto vertexCount = _subMesh.VertexCount();

0 commit comments

Comments
 (0)