fixed a potential epsilon issue
parent
7760edbe8b
commit
5869939692
|
@ -113,8 +113,8 @@ bool KDTree::rayIntersect(const Ray &ray, Intersection &its) const {
|
||||||
/* Use an adaptive ray epsilon */
|
/* Use an adaptive ray epsilon */
|
||||||
Float rayMinT = ray.mint;
|
Float rayMinT = ray.mint;
|
||||||
if (rayMinT == Epsilon)
|
if (rayMinT == Epsilon)
|
||||||
rayMinT *= std::max(std::max(std::abs(ray.o.x),
|
rayMinT *= std::max(std::max(std::max(std::abs(ray.o.x),
|
||||||
std::abs(ray.o.y)), std::abs(ray.o.z));
|
std::abs(ray.o.y)), std::abs(ray.o.z)), Epsilon);
|
||||||
|
|
||||||
if (rayMinT > mint) mint = rayMinT;
|
if (rayMinT > mint) mint = rayMinT;
|
||||||
if (ray.maxt < maxt) maxt = ray.maxt;
|
if (ray.maxt < maxt) maxt = ray.maxt;
|
||||||
|
|
Loading…
Reference in New Issue