Returns true if the ray intersects any object stored in the kd-tree, and information about the closest intersection point is returned in the supplied Intersection object.
This code is largely the same as the simpler intersect(const Ray& ray) function, except that we need to check for the closest intersection. |