A fast 3D collision detection algorithm