Denting and plasticity in bullet

Petwoip
Posts: 5
Joined: Sun Jan 15, 2012 10:53 pm

Denting and plasticity in bullet

Post by Petwoip »

Hi, I am trying to simulate denting/plasticity in bullet. Here is a good reference for what I mean by denting: http://vimeo.com/20760525 at the 50-55 second mark.

Here are some basic ideas that I have:
1) Treat the object as a soft body during impact and after a couple frames turn it back into a rigid body.
2) Calculate the dents myself (outside of bullet) using impulses and collision points between the two objects.

Obviously approach #1 gives more control to bullet which might mean greater efficiency. However, I'm wondering if Bullet's soft body feature is customizable enough to create the desired effect.
Before I delve into programming I'm wondering what other people think. What features of bullet will come in handy for doing denting/plasticity?
CookieMonster
Posts: 49
Joined: Sun Jan 29, 2012 10:01 pm

Re: Denting and plasticity in bullet

Post by CookieMonster »

I would implement my own triangle mesh on top of btConcaveShape and store one vertex buffer for each rigid body.
Then I would make a trigger for each rigid body that listen for impacts that might create a visible dent and move the nearby vertices.
After modifying the shape, the old collision data must be cleared for it's rigid body http://bulletphysics.org/Bullet/phpBB3/ ... f=9&t=7988.
Try to use the same data structure for both physics and rendering to avoid moving a lot of data.
Petwoip
Posts: 5
Joined: Sun Jan 15, 2012 10:53 pm

Re: Denting and plasticity in bullet

Post by Petwoip »

Thanks for the reply! I now have some really basic denting happening. My next issue is if I drop something like a cube on a dentable floor, it only detects two or three collisions (but there should be four - one for each corner on the bottom face of the cube). Is there a way to tune the bullet collision algorithms to make them more sensitive? One way would be to allow the objects to go through the floor more than usual, but that might introduce inaccurate collisions. These are the parameters I'm currently using:

this->dynamicsWorld->getSolverInfo().m_splitImpulse = true;
this->dynamicsWorld->getSolverInfo().m_numIterations = 20;
this->dynamicsWorld->getDispatchInfo().m_useContinuous = true;