X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fgeometry%2Fhyperbox.h;h=845ca346eaffedf3aad1a4899b54c281c9593ff9;hb=24f239e418599c13a9d0bdc4942c188ccf0a8437;hp=7d363f246a8a48e25cbb07762e351f7f4dc58936;hpb=adb812a194961d542dcb0abd61258cbc8723ecd9;p=libs%2Fmath.git diff --git a/source/geometry/hyperbox.h b/source/geometry/hyperbox.h index 7d363f2..845ca34 100644 --- a/source/geometry/hyperbox.h +++ b/source/geometry/hyperbox.h @@ -83,7 +83,6 @@ inline unsigned HyperBox::get_intersections(const Ray &ray, SurfaceP LinAl::Vector half_dim = dimensions/T(2); unsigned n = 0; - T first_depth = T(); for(unsigned i=0; i::get_intersections(const Ray &ray, SurfaceP for(int j=-1; j<=1; j+=2) { T x = (T(j)*half_dim[i]-ray.get_start()[i])/ray.get_direction()[i]; - if(x<0) + if(!ray.check_limits(x)) continue; LinAl::Vector p = ray.get_start()+ray.get_direction()*x; @@ -108,9 +107,9 @@ inline unsigned HyperBox::get_intersections(const Ray &ray, SurfaceP points[n].position = p; points[n].normal = LinAl::Vector(); points[n].normal[i] = j; - if(n==0) - first_depth = x; - else if(n==1 && x