As I understood from source code all geometries are tested if they can possibly collide and only then collision filtering is applied.
I try to simulate "ideal gas" with box2d. There are a lot of small bodies that do not collide with each other, but collide with other bodies. And there are not so many of that other bodies. And this check if they can possibly collide is very bad for performance, because there are really lots of them and the number of that checks is square of number of the bodies.
Is there any way to reduce number of that checks? I mean to check only pairs of bodies that would not be filtered out?
I try to simulate "ideal gas" with box2d. There are a lot of small bodies that do not collide with each other, but collide with other bodies. And there are not so many of that other bodies. And this check if they can possibly collide is very bad for performance, because there are really lots of them and the number of that checks is square of number of the bodies.
Is there any way to reduce number of that checks? I mean to check only pairs of bodies that would not be filtered out?