]> git.tdb.fi Git - libs/math.git/blobdiff - source/geometry/extrudedshape.h
Use the coverage function to calculate tighter bounding boxes
[libs/math.git] / source / geometry / extrudedshape.h
index e702f90a7a0f844d93f417b53d38a8c6aea2359a..fd4597b9b1a5c935f50a3eb3a6e02296cd3f3a9f 100644 (file)
@@ -31,7 +31,7 @@ public:
        const Shape<T, D-1> &get_base() const { return *base; }
        T get_length() const { return length; }
 
-       virtual BoundingBox<T, D> get_axis_aligned_bounding_box() const;
+       virtual BoundingBox<T, D> get_axis_aligned_bounding_box(unsigned = 0) const;
        virtual bool contains(const LinAl::Vector<T, D> &) const;
        virtual unsigned get_max_ray_intersections() const;
        virtual unsigned get_intersections(const Ray<T, D> &, SurfacePoint<T, D> *, unsigned) const;
@@ -75,9 +75,9 @@ inline ExtrudedShape<T, D> *ExtrudedShape<T, D>::clone() const
 }
 
 template<typename T, unsigned D>
-inline BoundingBox<T, D> ExtrudedShape<T, D>::get_axis_aligned_bounding_box() const
+inline BoundingBox<T, D> ExtrudedShape<T, D>::get_axis_aligned_bounding_box(unsigned detail) const
 {
-       BoundingBox<T, D-1> base_bbox = base->get_axis_aligned_bounding_box();
+       BoundingBox<T, D-1> base_bbox = base->get_axis_aligned_bounding_box(detail);
        T half_length = length/T(2);
        return BoundingBox<T, D>(compose(base_bbox.get_minimum_point(), -half_length),
                compose(base_bbox.get_maximum_point(), half_length));