fast collision detection algorithm