From 1486f2fda7ac644a1dabc91ff81b13baef9ff789 Mon Sep 17 00:00:00 2001 From: Wenzel Jakob Date: Sat, 10 Aug 2013 20:56:42 +0200 Subject: [PATCH] generic getCorner() and getChild() methods for AABB --- include/mitsuba/core/aabb.h | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/include/mitsuba/core/aabb.h b/include/mitsuba/core/aabb.h index 3e9db7f4..04fd075b 100644 --- a/include/mitsuba/core/aabb.h +++ b/include/mitsuba/core/aabb.h @@ -129,6 +129,32 @@ template struct TAABB { return (max + min) * (Scalar) 0.5; } + /// Return the position of one of the corners (in 0..2^dim-1) + inline PointType getCorner(int index) const { + PointType result; + for (int d=0; d