PR adds support for a mutable compound shape. In contrast with the static compound shape, this shape allows to add/remove/modify its children shapes after creation.
entity.addComponent('body', {
shape: SHAPE_MUTABLE_COMPOUND
});
// can add new shapes to it
const shapeIndex = app.physics.createShape({ shape: SHAPE_SPHERE });
entity.body.addShape(shapeIndex, localPosition, localRotation);
// remove a child shape
entity.body.removeShape(childIndex);
// modify a child shape
entity.body.modifyShape(childIndex, localPosition, localRotation);
PR adds support for a mutable compound shape. In contrast with the static compound shape, this shape allows to add/remove/modify its children shapes after creation.