diff --git a/src/osgPlugins/txp/TXPPagedLOD.cpp b/src/osgPlugins/txp/TXPPagedLOD.cpp index 2eb1d1aae..e15a0f012 100644 --- a/src/osgPlugins/txp/TXPPagedLOD.cpp +++ b/src/osgPlugins/txp/TXPPagedLOD.cpp @@ -100,3 +100,18 @@ void TXPPagedLOD::traverse(osg::NodeVisitor& nv) } } +osg::BoundingSphere TXPPagedLOD::computeBound() const +{ + // Force calculation of entire bounding sphere; this will include any + // externally-referenced models which are attached to the tile. + // If this is not done, then externally referenced models will disappear + // when the tile they are attached to leaves the view volume. + osg::BoundingSphere result = osg::Group::computeBound(); + + if (_centerMode==USER_DEFINED_CENTER && _radius>=0.0f) + { + float tempRadius = std::max( _radius, result.radius() ); + result = osg::BoundingSphere(_userDefinedCenter,tempRadius); + } + return result; +} diff --git a/src/osgPlugins/txp/TXPPagedLOD.h b/src/osgPlugins/txp/TXPPagedLOD.h index 3440f5c43..031700641 100644 --- a/src/osgPlugins/txp/TXPPagedLOD.h +++ b/src/osgPlugins/txp/TXPPagedLOD.h @@ -58,6 +58,7 @@ namespace txp TileIdentifier _tileIdentifier; + virtual osg::BoundingSphere computeBound() const; protected: virtual ~TXPPagedLOD();