]> git.tdb.fi Git - libs/math.git/blobdiff - source/geometry/halfspace.h
Implement bounding boxes with a separate class
[libs/math.git] / source / geometry / halfspace.h
index 9ed80ff71b85052e6525bb46fb800f775c04fe3f..60f040350b0f63ac3ac48409701db028cece4353 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef MSP_GEOMETRY_HALFSPACE_H_
 #define MSP_GEOMETRY_HALFSPACE_H_
 
+#include "boundingbox.h"
 #include "shape.h"
 
 namespace Msp {
@@ -24,7 +25,7 @@ public:
 
        const LinAl::Vector<T, D> &get_normal() const { return normal; }
 
-       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 { return 1; }
        virtual unsigned get_intersections(const Ray<T, D> &, SurfacePoint<T, D> *, unsigned) const;
@@ -48,10 +49,10 @@ inline HalfSpace<T, D> *HalfSpace<T, D>::clone() const
 }
 
 template<typename T, unsigned D>
-inline HyperBox<T, D> HalfSpace<T, D>::get_axis_aligned_bounding_box() const
+inline BoundingBox<T, D> HalfSpace<T, D>::get_axis_aligned_bounding_box() const
 {
-       // XXX Implement this properly
-       return HyperBox<T, D>();
+       // XXX If the normal is aligned to an axis, should the bounding box reflect that?
+       return ~BoundingBox<T, D>();
 }
 
 template<typename T, unsigned D>