aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/geo_alignedbox.cpp
diff options
context:
space:
mode:
authorGravatar Sven Strothoff <anonymous@invalid.net>2013-07-28 23:59:37 +0200
committerGravatar Sven Strothoff <anonymous@invalid.net>2013-07-28 23:59:37 +0200
commit5f11db695b74db219e0d06682728c9eda90cac5c (patch)
tree34d951d666db1ced8b420f512e668f5729fdc1fd /test/geo_alignedbox.cpp
parent2437215221db4e67a158ab316dc2ab231ab2361d (diff)
bug #502: add bool intersects() methods to AlignedBox
Diffstat (limited to 'test/geo_alignedbox.cpp')
-rw-r--r--test/geo_alignedbox.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/geo_alignedbox.cpp b/test/geo_alignedbox.cpp
index 8e36adbe3..e2792ed18 100644
--- a/test/geo_alignedbox.cpp
+++ b/test/geo_alignedbox.cpp
@@ -54,6 +54,13 @@ template<typename BoxType> void alignedbox(const BoxType& _box)
VERIFY(b2.contains(b1));
VERIFY_IS_APPROX(b2.clamp(b0), b0);
+ // intersection
+ BoxType box1(VectorType::Random(dim));
+ box1.extend(VectorType::Random(dim));
+ BoxType box2(VectorType::Random(dim));
+ box2.extend(VectorType::Random(dim));
+
+ VERIFY(box1.intersects(box2) == !box1.intersection(box2).isEmpty());
// alignment -- make sure there is no memory alignment assertion
BoxType *bp0 = new BoxType(dim);