So, I'm trying to finish the gameplay code of my game and I see that I have to use too much b2World::Query everywhere. Profiler proves that. I've checked the code and I don't see anything to optimize except those tiny things like float to uint16 conversion etc. So maybe someone can give me some advice on how to use the Query function more optimally? I use it to find the static bodies near a character. So maybe I could just store those static bodies and find the nearest ones between them? If I can do that, are there any variables stored in those bodies that might help me speed up the searching?
Additional info:
I use a lot of huge static bodies.
I use a lot of bodies that usually don't collide with anything (ragdoll parts) - maybe there's a way to disable them somehow?
I can't simply delete / recreate ragdoll part bodies because I use them also as hitboxes (my game is a shooter).
My copy of box2d source has version 2.0.1, it has some modifications in settings. Also I've made body and shape variables public to make serialization of bodies easier.
Additional info:
I use a lot of huge static bodies.
I use a lot of bodies that usually don't collide with anything (ragdoll parts) - maybe there's a way to disable them somehow?
I can't simply delete / recreate ragdoll part bodies because I use them also as hitboxes (my game is a shooter).
My copy of box2d source has version 2.0.1, it has some modifications in settings. Also I've made body and shape variables public to make serialization of bodies easier.