]> git.tdb.fi Git - libs/math.git/blobdiff - source/geometry/hyperbox.h
Add an entry flag to SharedPoint
[libs/math.git] / source / geometry / hyperbox.h
index da500910e4f100d57f865b644bd719d71a3ee34c..546ad0ec3984c5b338978c23b37f0c8ea5f97533 100644 (file)
@@ -5,10 +5,7 @@
 #include <cmath>
 #include <stdexcept>
 #include <msp/linal/vector.h>
-#include "boundingbox.h"
-#include "ray.h"
 #include "shape.h"
-#include "surfacepoint.h"
 
 namespace Msp {
 namespace Geometry {
@@ -119,6 +116,7 @@ inline unsigned HyperBox<T, D>::get_intersections(const Ray<T, D> &ray, SurfaceP
                                        points[n].normal = LinAl::Vector<T, D>();
                                        points[n].normal[i] = j;
                                        points[n].distance = x;
+                                       points[n].entry = (T(j)*ray.get_direction()[i]<T(0));
 
                                        if(n==1 && x<points[0].distance)
                                                std::swap(points[0], points[1]);