CompoundBody Class, Nesting

Discuss any questions about BEPUphysics or problems encountered.
Post Reply
astro
Posts: 4
Joined: Mon Nov 15, 2010 2:21 am

CompoundBody Class, Nesting

Post by astro »

Hello All

Does anyone know if you can nest a CompoundBody Enitity within another CompoundBody, and if so how many levels you can go , that is not already a part of another Compoundbody of course.

Also what is the performance hit to just creating a compoundBody and just adding one sub enitity, in case I need to add extra entities, later in run time?

Thanks for your time and help.
Danthekilla
Posts: 136
Joined: Sun Jan 17, 2010 11:35 am

Re: CompoundBody Class, Nesting

Post by Danthekilla »

As far as i know you can go as deep as you want.

Performance of compund bodys seems good but i have had some massive stabilty issues with them where they can penitrate the static tri mesh and then teleport randomly...
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: CompoundBody Class, Nesting

Post by Norbo »

Yes, in v0.14 and before you can nest as much as you want. The compound's collision tree is handled independently from its construction, so extremely deep organizations should not be worse performance-wise than having all the shapes as direct children.

However, in v0.15.0 it MAY change such that compound bodies will be composed only of convex shapes. In this case, no nesting would be supported. It would be my preference to include any shape in the compound body (convexes, compounds, and even meshes as children), but I'm not sure if it will make it into v0.15.0. Another thing to be aware of is that the compounds in v0.15.0 are not composed of Entities, but rather collision shapes. Some extra work would need to be done when splitting a compound into two separate dynamic objects. It's still pretty easy, involving a few extra lines of code.
Also what is the performance hit to just creating a compoundBody and just adding one sub enitity, in case I need to add extra entities, later in run time?
It should go pretty quick. The cost of adding new bodies is proportional to the number of bodies already in the compound body (since it has to do some reinitialization), but for reasonable numbers I don't see any problem doing it at runtime.
i have had some massive stabilty issues with them where they can penitrate the static tri mesh and then teleport randomly...
Could that have been related to the one shot manifolds issue? They use the same sort of collision systems as other shapes for individual subbody pairs. One issue might be if they get pushed through the ground (crushed or going real fast). Once part of a compound body is through the ground, the part above the ground will fight to pull it up, and the part below will fight to pull it down, which can cause some pretty severe oscillations. Upcoming versions will support one-way meshes which make this a non-issue as well.
astro
Posts: 4
Joined: Mon Nov 15, 2010 2:21 am

Re: CompoundBody Class, Nesting

Post by astro »

Ok that is great, Thanks for the fast time around on these questions

Well let you know if there is any problems

Thanks
Post Reply