Here's the situation:
I have 80 box2d bodies on the screen, they are simple squares (also tried with circles).
The bodies have categoryBits/maskBits set so they do NOT collide with each other (these are enemies in a shooter, they are supposed to fly over each other).
This all works and everything performs fine when the bodies first appear (30 fps with all 80 on screen). But I have them chasing the mouse, and eventually they start to clump up and overlap.
There is a direct correlation between how much they overlap and how big a performance hit I get. By the time all 80 are on top of each other my frame rate has dropped from a solid 30 to 5.
My question is why and is there anything I can do about it? Considering the bodies are flagged to not interact at all (and indeed they don't interact at all, they don't even generate calls to my b2ContactListener). Weird, right? Would appreciate any advice!
I have 80 box2d bodies on the screen, they are simple squares (also tried with circles).
The bodies have categoryBits/maskBits set so they do NOT collide with each other (these are enemies in a shooter, they are supposed to fly over each other).
This all works and everything performs fine when the bodies first appear (30 fps with all 80 on screen). But I have them chasing the mouse, and eventually they start to clump up and overlap.
There is a direct correlation between how much they overlap and how big a performance hit I get. By the time all 80 are on top of each other my frame rate has dropped from a solid 30 to 5.
My question is why and is there anything I can do about it? Considering the bodies are flagged to not interact at all (and indeed they don't interact at all, they don't even generate calls to my b2ContactListener). Weird, right? Would appreciate any advice!