]> git.tdb.fi Git - libs/math.git/blobdiff - source/geometry/compositeshape.h
Implement bounding boxes with a separate class
[libs/math.git] / source / geometry / compositeshape.h
index 50075d923b70c3c38f6671ae6ed585fe75f95ec1..4c640be22f4c5045076b9659ce7734d517f1127c 100644 (file)
@@ -3,6 +3,7 @@
 
 #include <stdexcept>
 #include <vector>
+#include "boundingbox.h"
 #include "shape.h"
 
 namespace Msp {
@@ -29,7 +30,7 @@ protected:
 public:
        virtual ~CompositeShape();
 
-       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 unsigned get_max_ray_intersections() const;
        virtual unsigned get_intersections(const Ray<T, D> &, SurfacePoint<T, D> *, unsigned) const;
@@ -70,9 +71,9 @@ inline CompositeShape<T, D, O>::~CompositeShape()
 }
 
 template<typename T, unsigned D, typename O>
-inline HyperBox<T, D> CompositeShape<T, D, O>::get_axis_aligned_bounding_box() const
+inline BoundingBox<T, D> CompositeShape<T, D, O>::get_axis_aligned_bounding_box() const
 {
-       HyperBox<T, D> aabb;
+       BoundingBox<T, D> aabb;
        for(typename ShapeArray::const_iterator i=shapes.begin(); i!=shapes.end(); ++i)
        {
                if(i==shapes.begin())