X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;ds=sidebyside;f=source%2Fgeometry%2Fnegation.h;h=c01763d1c8eed6fa399090c27210e51c54553a20;hb=de53838941cc8ccf00aeffa77c28d915317879bd;hp=0fc01964b869efd4d841f2bee439da3feffb24d8;hpb=68389c29cf88d6522dcfa00b5e2a5166e3947210;p=libs%2Fmath.git diff --git a/source/geometry/negation.h b/source/geometry/negation.h index 0fc0196..c01763d 100644 --- a/source/geometry/negation.h +++ b/source/geometry/negation.h @@ -23,9 +23,8 @@ public: const Shape &get_shape() const { return *shape; } - virtual HyperBox get_axis_aligned_bounding_box() const; + virtual BoundingBox get_axis_aligned_bounding_box() const; virtual bool contains(const LinAl::Vector &) const; - virtual bool check_intersection(const Ray &) const; virtual unsigned get_max_ray_intersections() const { return shape->get_max_ray_intersections(); } virtual unsigned get_intersections(const Ray &, SurfacePoint *, unsigned) const; }; @@ -42,10 +41,9 @@ inline Negation *Negation::clone() const } template -inline HyperBox Negation::get_axis_aligned_bounding_box() const +inline BoundingBox Negation::get_axis_aligned_bounding_box() const { - // XXX How do we handle this correctly? In particular negation of a negation? - return HyperBox(); + return ~shape->get_axis_aligned_bounding_box(); } template @@ -54,12 +52,6 @@ inline bool Negation::contains(const LinAl::Vector &point) const return !shape->contains(point); } -template -inline bool Negation::check_intersection(const Ray &ray) const -{ - return get_intersections(ray, 0, 1); -} - template inline unsigned Negation::get_intersections(const Ray &ray, SurfacePoint *points, unsigned size) const {