Remove compound mesh child material limit. (#172)

This commit is contained in:
Erin Catto 2026-09-25 14:56:44 -07:00 • committed by GitHub
commit 5643cd81ff
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 314 additions and 58 deletions

View file

@ -2413,7 +2413,7 @@ uint64_t b3GetShapeUserMaterialId( const b3Shape* shape, int childIndex, int tri
{
const uint8_t* indices = b3GetMeshMaterialIndices( child.mesh.data );
int meshMaterialIndex = indices != NULL ? indices[triangleIndex] : 0;
meshMaterialIndex = b3ClampInt( meshMaterialIndex, 0, B3_MAX_COMPOUND_MESH_MATERIALS - 1 );
B3_ASSERT( 0 <= meshMaterialIndex && meshMaterialIndex < child.materialCount );
materialIndex = child.materialIndices[meshMaterialIndex];
}
else