Closed jl closed 3 years ago
Yes, it sounds reasonable to make it easier to activate other bodies when removing a body.
If you would add a 'stepSimulation', after 'active' and before 'removeBody', the 'activate' will likely propagate, but since you remove the object before stepping the simulation, the other objects will never be activated.
If you make a small patch (no whitespace), I'll review/merge it.
Sometimes it is useful to remove an object from the world, but also wake up things surrounding / touching the object.
I've found some recommendations around the net to simply do the following:
However, if I remove the bottom of some stacked objects, doing
activate()
immediately followed byremoveRigidBody()
does not activate other objects. I have, however, found a working solution: iterate through all pairs in the pair cache and activating the other object in any pair containing the target object to be removed:I'm doing this now from my own code, but it feels kind of hacky to do all this work that reaches into the internals, so proposing an API that might make things easier for other users with the same issue:
If you think this is something that seems reasonable to pursue, I might be able to put together a pull request, at least for concrete
btHashedOverlappingPairCache
andbtDiscreteDynamicsWorld
.For reference, found this forum post where someone had this issue: http://www.bulletphysics.org/Bullet/phpBB3/viewtopic.php?f=9&t=5530