Optimized the collision detection algorithm a bit more so that coordinate transformations are only done if the point is near enough.