From 4362ebc8621d8641f6558f7e7849509a52de70e7 Mon Sep 17 00:00:00 2001 From: David Rose Date: Mon, 4 Jun 2007 22:34:41 +0000 Subject: [PATCH] whoops, incorrect bounding volume --- panda/src/pgui/pgItem.cxx | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/panda/src/pgui/pgItem.cxx b/panda/src/pgui/pgItem.cxx index e63703d119..1e9cae5aa4 100644 --- a/panda/src/pgui/pgItem.cxx +++ b/panda/src/pgui/pgItem.cxx @@ -32,6 +32,8 @@ #include "clipPlaneAttrib.h" #include "dcast.h" #include "boundingSphere.h" +#include "boundingBox.h" +#include "config_mathutil.h" #ifdef HAVE_AUDIO #include "audioSound.h" @@ -301,7 +303,13 @@ compute_internal_bounds(PandaNode::BoundsData *bdata, int pipeline_stage, int num_vertices = 0; // First, get ourselves a fresh, empty bounding volume. - PT(BoundingVolume) bound = new BoundingSphere; + PT(BoundingVolume) bound; + + if (bounds_type == BoundingVolume::BT_sphere) { + bound = new BoundingSphere; + } else { + bound = new BoundingBox; + } // Now actually compute the bounding volume by putting it around all // of our states' bounding volumes. @@ -322,6 +330,8 @@ compute_internal_bounds(PandaNode::BoundsData *bdata, int pipeline_stage, const BoundingVolume **child_begin = &child_volumes[0]; const BoundingVolume **child_end = child_begin + child_volumes.size(); + bound->around(child_begin, child_end); + bdata->_internal_bounds = bound; bdata->_internal_vertices = num_vertices; bdata->_internal_bounds_stale = false;