Grid subdivision for collision tests