X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fgeometry%2Fextrudedshape.h;h=a62aa9a311e88bf09dd9fa5d480b425baaf38758;hb=7919982691f0b8c69d8bef1bf6471b1e7a312163;hp=bacea7c3e54e208f6ef246bfa4dd719aa2aeb8ac;hpb=fb9e6b5ff48e10ea2217cf539e0461956abf02cf;p=libs%2Fmath.git diff --git a/source/geometry/extrudedshape.h b/source/geometry/extrudedshape.h index bacea7c..a62aa9a 100644 --- a/source/geometry/extrudedshape.h +++ b/source/geometry/extrudedshape.h @@ -134,8 +134,8 @@ inline unsigned ExtrudedShape::get_intersections(const Ray &ray, Sur SurfacePoint *base_points = 0; if(points) - /* Shamelessly reuse the provided storage. Align to the end of the array - so processing can start from the first (nearest) point. */ + /* Shamelessly reuse the provided storage. Align to the end of the + array so processing can start from the first (nearest) point. */ base_points = reinterpret_cast *>(points+size)-size; unsigned count = base->get_intersections(base_ray, base_points, size); @@ -147,6 +147,7 @@ inline unsigned ExtrudedShape::get_intersections(const Ray &ray, Sur points[n].position = ray_start+ray_direction*x; points[n].normal = compose(base_points[i].normal, T(0)); points[n].distance = x; + points[n].entry = base_points[i].entry; } ++n; @@ -173,6 +174,7 @@ inline unsigned ExtrudedShape::get_intersections(const Ray &ray, Sur points[n].normal = LinAl::Vector(); points[n].normal[D-1] = i; points[n].distance = x; + points[n].entry = (T(i)*ray_direction[D-1]