From 1ee9b09e064e865bdc2372b5c4575e0ca85b3d52 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Fri, 6 Jun 2008 16:28:27 +0000 Subject: [PATCH] From Glenn Waldron, "I'm using an IntersectionVisitor with a PagedLOD database, employing a ReadCallback to allow the intersector to traverse the paged nodes. I discovered that if the visitor is unable (for any reason) to load a subtile via the ReadCallback, the intersection fails. However, I had the requirement to "fall back" on the lower-resolution parent tile and settle for that intersection. This was easy to implement simply by overriding IntersectionVisitor::apply(PagedLOD). My question is: Are there any opinions on whether this should be the default behavior? If it makes sense, I will submit the change; if not, no worries." --- src/osgUtil/IntersectionVisitor.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/osgUtil/IntersectionVisitor.cpp b/src/osgUtil/IntersectionVisitor.cpp index 1eca31401..c83076bd1 100644 --- a/src/osgUtil/IntersectionVisitor.cpp +++ b/src/osgUtil/IntersectionVisitor.cpp @@ -254,7 +254,8 @@ void IntersectionVisitor::apply(osg::PagedLOD& plod) { highestResChild = _readCallback->readNodeFile( plod.getDatabasePath() + plod.getFileName(plod.getNumFileNames()-1) ); } - else if (plod.getNumChildren()>0) + + if ( !highestResChild.valid() && plod.getNumChildren()>0) { highestResChild = plod.getChild( plod.getNumChildren()-1 ); }