From: Mikko Rasa Date: Sat, 2 Jul 2016 15:06:27 +0000 (+0300) Subject: Add an entry flag to SharedPoint X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=7919982691f0b8c69d8bef1bf6471b1e7a312163;p=libs%2Fmath.git Add an entry flag to SharedPoint --- diff --git a/source/geometry/extrudedshape.h b/source/geometry/extrudedshape.h index 84addc4..a62aa9a 100644 --- a/source/geometry/extrudedshape.h +++ b/source/geometry/extrudedshape.h @@ -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]::get_intersections(const Ray &ray, Surface points[0].position = ray.get_start()+ray.get_direction()*x; points[0].normal = normal; points[0].distance = x; + points[0].entry = (c::get_intersections(const Ray &ray, SurfaceP points[n].normal = LinAl::Vector(); points[n].normal[i] = j; points[n].distance = x; + points[n].entry = (T(j)*ray.get_direction()[i]::get_intersections(const Ray &ray, Surfa points[n].position = ray.get_start()+ray.get_direction()*x; points[n].normal = normalize(points[n].position); points[n].distance = x; + points[n].entry = (i<0); } ++n; diff --git a/source/geometry/negation.h b/source/geometry/negation.h index ce2f787..8e2b3f4 100644 --- a/source/geometry/negation.h +++ b/source/geometry/negation.h @@ -79,7 +79,10 @@ inline unsigned Negation::get_intersections(const Ray &ray, SurfaceP { unsigned count = shape->get_intersections(ray, points, size); for(unsigned i=0; i position; LinAl::Vector normal; T distance; + bool entry; }; template