From 324750fded8cc28f158c5cf6aa00481fd795c2ed Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Tue, 10 Nov 2020 15:26:21 +0000 Subject: [PATCH] Changed to using Node::accept() to handled children of Geode/Billboard to enable scene graphs with non drawables as children --- src/osgUtil/IntersectionVisitor.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/osgUtil/IntersectionVisitor.cpp b/src/osgUtil/IntersectionVisitor.cpp index 946fa15c8..a287180a4 100644 --- a/src/osgUtil/IntersectionVisitor.cpp +++ b/src/osgUtil/IntersectionVisitor.cpp @@ -234,9 +234,9 @@ void IntersectionVisitor::apply(osg::Geode& geode) // OSG_NOTICE<<"inside apply(Geode&)"<accept(*this); } leave(); @@ -250,7 +250,7 @@ void IntersectionVisitor::apply(osg::Billboard& billboard) // IntersectVisitor doesn't have getEyeLocal(), can we use NodeVisitor::getEyePoint()? osg::Vec3 eye_local = getEyePoint(); - for(unsigned int i = 0; i < billboard.getNumDrawables(); i++ ) + for(unsigned int i = 0; i < billboard.getNumChildren(); i++ ) { const osg::Vec3& pos = billboard.getPosition(i); osg::ref_ptr billboard_matrix = new osg::RefMatrix; @@ -269,7 +269,7 @@ void IntersectionVisitor::apply(osg::Billboard& billboard) // now push an new intersector clone transform to the new local coordinates push_clone(); - intersect( billboard.getDrawable(i) ); + billboard.getChild(i)->accept(*this); // now push an new intersector clone transform to the new local coordinates pop_clone();