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 2880f1f6bf
commit fd4207a40f
1 changed files with 1 additions and 1 deletions

View File

@ -897,7 +897,7 @@ TerrainShape* lovrTerrainShapeCreate(float* vertices, uint32_t widthSamples, uin
}
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;