I'm trying to speed up operations when loading in static geometry as the world scrolls -- my world is divided into clear cut cubic sections where the AABB of each section is very easy to determine.
What I noticed is that the more objects are added at once, the longer the next simulation step will lag, sometimes reaching 100+ ms of delay compared to a typical frame.
Disabling m_deferedcollide in the btDbvtBroadphase helps shift some of the insertion time to the moment the insertion occurs, as opposed to the next simulation step, but there's still a noticeable slowdown.
I have two questions:
1. Is it possible to create a dummy tree node that encompasses the volume of one of my sections and then add objects to it (instead of to the root of the tree)? Are there examples of something like this being done out there?
2. Any idea what happens that causes this delay during the next simulation step after static geometry is added? How would I go about doing that work separately so that the simulation step remains more predictable?