From: Mikko Rasa Date: Thu, 23 May 2013 09:01:07 +0000 (+0300) Subject: Some bounding box logic fixes X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=3d124f6903553a9fc54341aba1b6f565c6d442f2;p=libs%2Fmath.git Some bounding box logic fixes --- diff --git a/source/geometry/boundingbox.h b/source/geometry/boundingbox.h index 120eedb..ac384ec 100644 --- a/source/geometry/boundingbox.h +++ b/source/geometry/boundingbox.h @@ -27,7 +27,8 @@ public: T get_minimum_coordinate(unsigned i) const { return min_pt[i]; } const LinAl::Vector &get_maximum_point() const { return max_pt; } T get_maximum_coordinate(unsigned i) const { return max_pt[i]; } - bool is_empty() const { return empty; } + bool is_empty() const { return empty && !negated; } + bool is_space() const { return empty && negated; } bool is_negated() const { return negated; } }; @@ -100,8 +101,8 @@ inline BoundingBox operator&(const BoundingBox &bb1, const BoundingB { for(unsigned i=0; iresult_max[i]) return BoundingBox(); } @@ -127,8 +128,8 @@ inline BoundingBox operator|(const BoundingBox &bb1, const BoundingB LinAl::Vector result_max; for(unsigned i=0; i(result_min, result_max); diff --git a/source/geometry/transformedshape.h b/source/geometry/transformedshape.h index 74912aa..84e182c 100644 --- a/source/geometry/transformedshape.h +++ b/source/geometry/transformedshape.h @@ -91,7 +91,7 @@ inline BoundingBox TransformedShape::get_axis_aligned_bounding_box() for(unsigned j=0; j