#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 {
T mid = -inner_product(ray.get_direction(), ray.get_start());
LinAl::Vector<T, D> nearest = ray.get_start()+ray.get_direction()*mid;
T offset_sq = radius*radius-inner_product(nearest, nearest);
- if(offset_sq<0)
+ if(offset_sq<T(0))
return 0;
T offset = sqrt(offset_sq);
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;