Floating objects when removing deactivated bodies

Mathieu Colleaux
Posts: 9
Joined: Thu Mar 26, 2009 6:09 pm
Location: France

Floating objects when removing deactivated bodies

Post by Mathieu Colleaux »

Hi all,

In my application i need to modify the collision filter infos of my rigid bodies during the execution. To do that I remove the rigid body from the simulation and add it back with the modified group and mask. The problem happens when the body's activation state is "ISLAND_SLEEPING". In fact, removing an object from a sleeping island will not activate the other bodies in the island.

To reproduce the issue in the basic demo just create two boxes and wait until they sleep, then, remove the bottom box from the simulation. You should see the top box floating in the air.

I thought about using a custom callback :

Code: Select all

m_broadphase->setOverlappingPairUserCallback(m_customPairCallback);
But it is only possible when using btAxisSweep3 broadphase, furthermore, I think the activation of the island should be automatic when you remove a body.

If anyone have already experienced that and managed to solve it, I would appreciate his help.

Cheers,

M. Colleaux

PS: I'm using Bullet 2.74 ;)
Mathieu Colleaux
Posts: 9
Joined: Thu Mar 26, 2009 6:09 pm
Location: France

Re: Floating objects when removing deactivated bodies

Post by Mathieu Colleaux »

Hi all,

I had a look to "btActivatingAlgorithm" files mentioned in another thread and I saw that all is commented. Anyway, I have uncommented all and it works fine for me.

My question is : is there any reason to keep these file commented ?

Cheers,

M. Colleaux
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: Floating objects when removing deactivated bodies

Post by Erwin Coumans »

Commenting it out prevents large number of stacked objects from sleeping: there are always some pairs of objects added/removed.

We need to improve island management, it is on the todo list, see http://code.google.com/p/bullet/issues/detail?id=128

Thanks!
Erwin