Use a vector to store convex volumes rather than fixed-size array

This commit is contained in:
Graham Pentheny
2025-08-25 00:44:50 -04:00
parent 2d859216a4
commit 30d459ca73
6 changed files with 82 additions and 103 deletions

View File

@@ -1013,16 +1013,15 @@ unsigned char* Sample_TileMesh::buildTileMesh(
}
// (Optional) Mark areas.
const ConvexVolume* convexVolumes = inputGeometry->convexVolumes;
for (int i = 0; i < inputGeometry->convexVolumeCount; ++i)
for (ConvexVolume& vol : inputGeometry->convexVolumes)
{
rcMarkConvexPolyArea(
buildContext,
convexVolumes[i].verts,
convexVolumes[i].nverts,
convexVolumes[i].hmin,
convexVolumes[i].hmax,
static_cast<unsigned char>(convexVolumes[i].area),
vol.verts,
vol.nverts,
vol.hmin,
vol.hmax,
static_cast<unsigned char>(vol.area),
*compactHeightfield);
}