Browse Source

Fix error check + message for max material count on MeshShape (#264)

Jorrit Rouwe 2 years ago
parent
commit
c5db87655e
1 changed files with 2 additions and 2 deletions
  1. 2 2
      Jolt/Physics/Collision/Shape/MeshShape.cpp

+ 2 - 2
Jolt/Physics/Collision/Shape/MeshShape.cpp

@@ -143,9 +143,9 @@ MeshShape::MeshShape(const MeshShapeSettings &inSettings, ShapeResult &outResult
 	if (!mMaterials.empty())
 	{
 		// Validate materials
-		if (mMaterials.size() > FLAGS_MATERIAL_MASK)
+		if (mMaterials.size() > (1 << FLAGS_MATERIAL_BITS))
 		{
-			outResult.SetError(StringFormat("Supporting max %d materials per mesh", FLAGS_ACTIVE_EDGE_MASK + 1));
+			outResult.SetError(StringFormat("Supporting max %d materials per mesh", 1 << FLAGS_MATERIAL_BITS));
 			return;
 		}
 		for (const IndexedTriangle &t : inSettings.mIndexedTriangles)