Can btDiscreteDynamicsWorld recreate / expand its own Octree / SpatialHash from all over DynamicsWorld and continue to expand it as I increase the distance of added objects from (0,0,0)? For example, adding a new top level to an octet and therefore using more memory and never compressing it again?
I am using btDiscreteDynamicsWorld containing several btBvhTriangleMeshShape objects for a static collision. Also, some other primitive entities (btBoxes and btCylinders) collide with static triangular grids. I constantly move the "action point" far from the beginning (0,0,0) from DynamicsWorld, deleting old TriangleMeshes and old primitive entities, as well as adding new ones as well. (world generated by procedures) As I keep moving along the x axis, memory usage is constantly increasing. But when I stop at some point and return to where I came, again deleting and adding new shapes, the memory usage remains constant.
After searching for possible memory leaks with adding and removing (also deleting) conflict objects from my heap (e.g. manually deleting MotionStates, etc.), I still encounter this behavior.
The technical documentation for the bullet is not very detailed, and slipping through the source code of the bullet also does not give me any hints. The API does not show something like the recalcOctree () function.
Can I force a complete recount of the internal collision structure without deleting the entire btDynamicsWorld object? Or am I completely mistaken? Has anyone else experienced an increase in memory usage in the pool when adding objects away from (0,0,0) compared to objects near the beginning?
I am using Bullet 2.79
source share