Checking for collisions among bodies