X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fgeometry%2Ftransformedshape.h;h=10af1e7588a7c2efb357037113f9e22970fe887f;hb=07a1aaf95d6a9e7e0ade2a10cc4e4b7f91486f98;hp=9a98f3139d85ef56edcd3fcdb1d8ab47116b6fee;hpb=6ff13022b53830d35283905d562c2ef3af198cc1;p=libs%2Fmath.git diff --git a/source/geometry/transformedshape.h b/source/geometry/transformedshape.h index 9a98f31..10af1e7 100644 --- a/source/geometry/transformedshape.h +++ b/source/geometry/transformedshape.h @@ -9,7 +9,7 @@ namespace Msp { namespace Geometry { template -class TransformedShape +class TransformedShape: public Shape { private: Shape *shape; @@ -26,6 +26,7 @@ public: const Shape &get_shape() const { return *shape; } const AffineTransformation &get_transformation() const { return transformation; } + virtual HyperBox get_axis_aligned_bounding_box() const; virtual bool check_intersection(const Ray &) const; }; @@ -61,6 +62,13 @@ inline TransformedShape *TransformedShape::clone() const return new TransformedShape(*this); } +template +inline HyperBox TransformedShape::get_axis_aligned_bounding_box() const +{ + // XXX This is not correct for most shapes + return shape->get_axis_aligned_bounding_box(); +} + template inline bool TransformedShape::check_intersection(const Ray &ray) const {