X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fgeometry%2Fhyperbox.h;h=b9fad33d620d205f1a5043e002cb88556cbc6e32;hb=818f9df5f383adad815f6f3276bfc1fa30c25681;hp=546ad0ec3984c5b338978c23b37f0c8ea5f97533;hpb=7919982691f0b8c69d8bef1bf6471b1e7a312163;p=libs%2Fmath.git diff --git a/source/geometry/hyperbox.h b/source/geometry/hyperbox.h index 546ad0e..b9fad33 100644 --- a/source/geometry/hyperbox.h +++ b/source/geometry/hyperbox.h @@ -112,14 +112,23 @@ inline unsigned HyperBox::get_intersections(const Ray &ray, SurfaceP { if(points) { - points[n].position = p; - points[n].normal = LinAl::Vector(); - points[n].normal[i] = j; - points[n].distance = x; - points[n].entry = (T(j)*ray.get_direction()[i]0 && entry!=points[0].entry) + { + if(entry) + points[1] = points[0]; + else + ++k; + } + if(k(); + points[k].normal[i] = j; + points[k].distance = x; + points[k].entry = (T(j)*ray.get_direction()[i]