mirror of https://github.com/bjornbytes/lovr.git
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:
parent
48559ccd0f
commit
e842c2b772
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue