collisionPairs method
Get all the collision pairs in the physics world
Implementation
@override
void collisionPairs(World world, List<Body> pairs1, List<Body> pairs2) {
final bodies = world.bodies;
final int n = bodies.length;
Body bi;
Body bj;
// Naive N^2 ftw!
for (int i = 0; i != n; i++) {
for (int j = 0; j != i; j++) {
bi = bodies[i];
bj = bodies[j];
if (!needBroadphaseCollision(bi, bj)) {
continue;
}
intersectionTest(bi, bj, pairs1, pairs2);
}
}
}