From 3d124f6903553a9fc54341aba1b6f565c6d442f2 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Thu, 23 May 2013 12:01:07 +0300 Subject: [PATCH] Some bounding box logic fixes --- source/geometry/boundingbox.h | 11 ++++++----- source/geometry/transformedshape.h | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) 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