X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fgeometry%2Fhyperbox.h;h=10c28d5d1f4c20a15937e7b0aa696f3074151aec;hb=c135ff2480f4e2aaf05b0206631bb0e1b5d73fad;hp=6248d6b0920e906f5bad1ee1ce1b9ba6fbb97fc4;hpb=9260eee3126731c1e6b54ce3407be757d0d71716;p=libs%2Fmath.git diff --git a/source/geometry/hyperbox.h b/source/geometry/hyperbox.h index 6248d6b..10c28d5 100644 --- a/source/geometry/hyperbox.h +++ b/source/geometry/hyperbox.h @@ -11,6 +11,10 @@ namespace Msp { namespace Geometry { +/** +A shape bounded by planar faces at right angles to each other. Two- and three- +dimensional cases are Rectangle and Box, respectively. +*/ template class HyperBox: public Shape { @@ -79,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 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