X-Git-Url: http://git.tdb.fi/?p=libs%2Fmath.git;a=blobdiff_plain;f=source%2Fgeometry%2Fhyperbox.h;h=b9fad33d620d205f1a5043e002cb88556cbc6e32;hp=546ad0ec3984c5b338978c23b37f0c8ea5f97533;hb=818f9df5f383adad815f6f3276bfc1fa30c25681;hpb=dcac1b2c9423b2e8bc61093e30d521951575c59d 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]