Require frozen CompoundShapes to have at least 2 children;

If you create a StaticCompoundShape with 1 child, Jolt creates a
RotatedTranslatedShape.  It would be a pain to have to branch on that,
so let's just require 2 children.
This commit is contained in:
bjorn 2024-04-04 16:23:20 -07:00
parent 48559ccd0f
commit e842c2b772
1 changed files with 1 additions and 1 deletions

View File

@ -923,7 +923,7 @@ TerrainShape* lovrTerrainShapeCreate(float* vertices, uint32_t n, float scaleXZ,
}
CompoundShape* lovrCompoundShapeCreate(Shape** shapes, vec3 positions, quat orientations, uint32_t count, bool freeze) {
lovrCheck(!freeze || count > 0, "A frozen CompoundShape must contain at least one shape");
lovrCheck(!freeze || count >= 2, "A frozen CompoundShape must contain at least two shapes");
CompoundShape* parent = lovrCalloc(sizeof(CompoundShape));
parent->ref = 1;