Hello everyone!
Last days I've been taking a look at how Bullet implement simulation islands, since I am implementing a similar scheme in my engine. I saw that bullet runs a broad phase with AABBs and then collect the islands based on it (the AABBs are increased a bit to account for 'contact thresholds'). The interesting thing is that if the simulation islands change from one frame to another, Bullet does not do any special handling. Therefore, there are two scenarios that came to my attention:
1 - If you have a sleeping stack of objects and you programmatically remove the bottom-most object of the stack, the other objects will remain floating. This is because their activating state are ISLAND_SLEEPING and the fact that the bottom object is gone is ignored/not tracked by the engine.
2 - If you have a sleeping stack of objects and you artificially add a big tangential linear velocity to the bottom-most object of the stack, if your velocity is big enough, the other objects will remain floating. The reasons are the same here... your velocity just needs to be big enough that the broad phase will miss the collision in the very next frame.
Of course, both issues can be circumvented by programmatically activating the other objects.
Nevertheless, I think that this problem could be solved if Bullet would keep track of the simulation islands created in the last frame and simply check if all objects are the same. If the objects contained in an islands are different, that island goes back to active state.
I wonder why this scheme (or something like that) is not implemented in Bullet. Performance reasons maybe?
Thank you in advance.
Simulation Islands: Corner-case issues
-
- Posts: 10
- Joined: Tue Jan 18, 2022 10:29 am
- Location: Guangzhou, China
Re: Simulation Islands: Corner-case issues
Hello felipekersting,
)
I, too, encountered the first question as a bug presented by the team's designer. it's solved by activating all connected rigidbodies upon removing the bottom one in RemoveRigidBody Function. It works fine for me.1 - If you have a sleeping stack of objects and you programmatically remove the bottom-most object of the stack, the other objects will remain floating. This is because their activating state are ISLAND_SLEEPING and the fact that the bottom object is gone is ignored/not tracked by the engine.
I think the cost of checking island differences are higher than programmatically activating the connected objects. (I have not tried the method you said, maybe it's worth a tryNevertheless, I think that this problem could be solved if Bullet would keep track of the simulation islands created in the last frame and simply check if all objects are the same. If the objects contained in an islands are different, that island goes back to active state.
![Laughing :lol:](./images/smilies/icon_lol.gif)
-
- Posts: 4
- Joined: Sat Jan 08, 2022 9:08 pm
Re: Simulation Islands: Corner-case issues
Yes, I also think checking the differences would be too costly. I asked the question originally to confirm if this was the reason. Manually activating the objects seems to be the only solution in this case.
Anyway, in the end I ended up implementing the same scheme in my engine. Maybe in the future I will take a deeper look at the problem.
Anyway, in the end I ended up implementing the same scheme in my engine. Maybe in the future I will take a deeper look at the problem.