Skip to content

Commit 13bded1

Browse files
authored
Check valid indices before doing convex decomposition (#677)
Signed-off-by: Ian Chen <[email protected]>
1 parent 16ff3b8 commit 13bded1

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
@@ -1654,6 +1654,14 @@ MeshManager::ConvexDecomposition(const SubMesh &_subMesh,
16541654
std::size_t _maxConvexHulls,
16551655
std::size_t _voxelResolution)
16561656
{
1657+
if (!_subMesh.HasValidIndices())
1658+
{
1659+
gzwarn << "Unable to perform convex decomposition on submesh: "
1660+
<< _subMesh.Name() << ". It has invalid indices."
1661+
<< std::endl;
1662+
return {};
1663+
}
1664+
16571665
std::vector<SubMesh> decomposed;
16581666

16591667
auto vertexCount = _subMesh.VertexCount();

0 commit comments

Comments
 (0)