Add/remove shapes to/from a CompoundBody?

Discuss any questions about BEPUphysics or problems encountered.
Post Reply
et1337
Posts: 6
Joined: Sat Jul 02, 2011 4:45 pm

Add/remove shapes to/from a CompoundBody?

Post by et1337 »

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?
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: Add/remove shapes to/from a CompoundBody?

Post by Norbo »

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).
et1337
Posts: 6
Joined: Sat Jul 02, 2011 4:45 pm

Re: Add/remove shapes to/from a CompoundBody?

Post by et1337 »

Okay, cool. Thanks for the info!
Post Reply