X-Git-Url: http://git.tdb.fi/?p=libs%2Fmath.git;a=blobdiff_plain;f=source%2Fgeometry%2Fhyperbox.h;h=9a161f35fb0fdbc5ff604735d51eb6e1d060eeaf;hp=42e4d61a75a49ce0824aaf231388013246c1413f;hb=827b227ae53884109b6885ccd1424dda8c0b3725;hpb=68389c29cf88d6522dcfa00b5e2a5166e3947210 diff --git a/source/geometry/hyperbox.h b/source/geometry/hyperbox.h index 42e4d61..9a161f3 100644 --- a/source/geometry/hyperbox.h +++ b/source/geometry/hyperbox.h @@ -88,14 +88,17 @@ inline unsigned HyperBox::get_intersections(const Ray &ray, SurfaceP { using std::abs; + if(size>2) + size = 2; + LinAl::Vector half_dim = dimensions/T(2); unsigned n = 0; - for(unsigned i=0; i::get_intersections(const Ray &ray, SurfaceP for(unsigned k=0; (inside && k::get_intersections(const Ray &ray, SurfaceP } ++n; - if(n==size || n==2) - return n; } } }