Add/remove shapes to/from a CompoundBody?
Add/remove shapes to/from a CompoundBody?
I searched around a bit and it seems that this was potentially possible a few versions ago, but now it looks like I'll have to recreate the CompoundBody in order to modify it. Is that true or is there a more efficient way?
Re: Add/remove shapes to/from a CompoundBody?
It was semi-possible a while back, but it was removed because the implementation was sub-par and added substantial complexity to the involved systems.
For now, yes, you'll need to recreate the compound. You don't necessarily have to recreate the entity itself if you don't want to, though, just its collidable/shape. This can be done by using a MorphableEntity and setting its CollisionInformation property as needed. The EntityConstructionDemo in the BEPUphysicsDemos project (part of the main BEPUphysics source download) shows an example of morphable entities and a lot of other things.
Mutable compound shapes are on the to-do list for v0.17.0/v1.0.0 (whichever it ends up being called).
For now, yes, you'll need to recreate the compound. You don't necessarily have to recreate the entity itself if you don't want to, though, just its collidable/shape. This can be done by using a MorphableEntity and setting its CollisionInformation property as needed. The EntityConstructionDemo in the BEPUphysicsDemos project (part of the main BEPUphysics source download) shows an example of morphable entities and a lot of other things.
Mutable compound shapes are on the to-do list for v0.17.0/v1.0.0 (whichever it ends up being called).
Re: Add/remove shapes to/from a CompoundBody?
Okay, cool. Thanks for the info!