From 432654bde8994c219513603ca75f515a0aec3446 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Fri, 1 Nov 2002 12:11:23 +0000 Subject: [PATCH] Added handled of invlid drawable bounding boxes. --- src/osgUtil/CullVisitor.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/osgUtil/CullVisitor.cpp b/src/osgUtil/CullVisitor.cpp index 5055ce694..974f64049 100644 --- a/src/osgUtil/CullVisitor.cpp +++ b/src/osgUtil/CullVisitor.cpp @@ -276,13 +276,14 @@ void CullVisitor::apply(Geode& node) } - if (_computeNearFar) updateCalculatedNearFar(matrix,*drawable); + if (_computeNearFar && bb.valid()) updateCalculatedNearFar(matrix,*drawable); // push the geoset's state on the geostate stack. StateSet* stateset = drawable->getStateSet(); if (stateset) pushStateSet(stateset); - addDrawableAndDepth(drawable,&matrix,distance(drawable->getBound().center(),matrix)); + if (bb.valid()) addDrawableAndDepth(drawable,&matrix,distance(bb.center(),matrix)); + else addDrawableAndDepth(drawable,&matrix,0.0f); if (stateset) popStateSet();