Rigid bodies inside soft bodies

Post Reply
TriplVing
Posts: 12
Joined: Wed Jul 29, 2009 4:13 pm

Rigid bodies inside soft bodies

Post by TriplVing »

Hello,

I am unsure if this is possible using Bullet, however I am trying to produce a simple simulation whereby some rigid bodies (spheres) are "trapped" inside a soft body.

The closest analogy for this I can think of is a balloon filled with ball bearings.

I have studied the softbody demo in great detail and managed to get to the point where I have a SB ellipsoid (generated using the helper), which nicely deforms and rebounds a rigid body if it hits it on the outside, but any rigid body which initially starts within its bounds (but not contacting) and is then made to contact the outer edge, simply passes through. There appears to be some collision response as the internal RB's trajectory appears affected, and the SB deforms, but given the same SB will repel even a very fast moving sphere of the same size as the one inside it that just passed through, I'm a little stumped.

I did think that perhaps it could be to do with the normals for the ellipsoids nodes facing outwards (as you would reasonably expect) and this caused the collision impulses to either be generated in the wrong direction or not at all, however after creation I tried inverting the soft bodies normals manually (by modifying its m_n array). To my surprise, not only did this not fix the problem, but it didn't actually seem to effect the external spheres impact response. So perhaps I am misunderstanding something (extremely likely!)

I have messed around with all the setup material parameters etc., and while I can alter how the SB deforms when the external RB hits it, the internal RB still just passes through, I have also ensured clustering etc. is enabled and have upped the helpers resolution all the way to 10000 (massive overkill just to see) with no results.

Any help anyone can provide would be very much appreciated.
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA
Contact:

Re: Rigid bodies inside soft bodies

Post by Erwin Coumans »

This hasn't been tested yet, but when you create a softbody shall using tetrahedra (instead of triangle/faces) it should work fine. Have you tried that?

We are working on softbody serialization for the next Bullet version, this should make it easier to share your construction for others to look at.
Thanks,
Erwin
TriplVing
Posts: 12
Joined: Wed Jul 29, 2009 4:13 pm

Re: Rigid bodies inside soft bodies

Post by TriplVing »

Hi Erwin,

I should have reported back on this, but I've been a bit busy.

In actual fact, Bullet is working perfectly, it was my mistake(s) (as usual I imagine!) I had a couple of issues, ranging from a slight ordering problem with my debug rendering transformations through to not quite understanding the collision flag system.

Now, as long as my spheres are larger than a face on the softbody, it is working really well and performing exactly as I hoped it would!
Post Reply