]> git.tdb.fi Git - libs/math.git/blobdiff - source/geometry/negation.h
Put the common #includes in shape.h
[libs/math.git] / source / geometry / negation.h
index 0fc01964b869efd4d841f2bee439da3feffb24d8..c01763d1c8eed6fa399090c27210e51c54553a20 100644 (file)
@@ -23,9 +23,8 @@ public:
 
        const Shape<T, D> &get_shape() const { return *shape; }
 
-       virtual HyperBox<T, D> get_axis_aligned_bounding_box() const;
+       virtual BoundingBox<T, D> get_axis_aligned_bounding_box() const;
        virtual bool contains(const LinAl::Vector<T, D> &) const;
-       virtual bool check_intersection(const Ray<T, D> &) const;
        virtual unsigned get_max_ray_intersections() const { return shape->get_max_ray_intersections(); }
        virtual unsigned get_intersections(const Ray<T, D> &, SurfacePoint<T, D> *, unsigned) const;
 };
@@ -42,10 +41,9 @@ inline Negation<T, D> *Negation<T, D>::clone() const
 }
 
 template<typename T, unsigned D>
-inline HyperBox<T, D> Negation<T, D>::get_axis_aligned_bounding_box() const
+inline BoundingBox<T, D> Negation<T, D>::get_axis_aligned_bounding_box() const
 {
-       // XXX How do we handle this correctly?  In particular negation of a negation?
-       return HyperBox<T, D>();
+       return ~shape->get_axis_aligned_bounding_box();
 }
 
 template<typename T, unsigned D>
@@ -54,12 +52,6 @@ inline bool Negation<T, D>::contains(const LinAl::Vector<T, D> &point) const
        return !shape->contains(point);
 }
 
-template<typename T, unsigned D>
-inline bool Negation<T, D>::check_intersection(const Ray<T, D> &ray) const
-{
-       return get_intersections(ray, 0, 1);
-}
-
 template<typename T, unsigned D>
 inline unsigned Negation<T, D>::get_intersections(const Ray<T, D> &ray, SurfacePoint<T, D> *points, unsigned size) const
 {