KD-Tree for collision detection