X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fgeometry%2Fhypersphere.h;h=6bb4352f4016840ca331ebfd2034f35a7090e7d2;hb=93e3f3af03f911396c678a2356a54dc9885b21f8;hp=e2e3102014a1f73a9cfb9411d9b90638c937f851;hpb=7353dc087872cdb93bd57cbaf2b6f0dcc21f9a03;p=libs%2Fmath.git diff --git a/source/geometry/hypersphere.h b/source/geometry/hypersphere.h index e2e3102..6bb4352 100644 --- a/source/geometry/hypersphere.h +++ b/source/geometry/hypersphere.h @@ -70,7 +70,7 @@ inline unsigned HyperSphere::get_intersections(const Ray &ray, Surfa T mid = -inner_product(ray.get_direction(), ray.get_start()); LinAl::Vector nearest = ray.get_start()+ray.get_direction()*mid; T offset_sq = radius*radius-inner_product(nearest, nearest); - if(offset_sq<0) + if(offset_sq::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;