optimized gjk collision detection