Dynamic collision detection using space partitioning