From 030fe7d9eab2046e844e6e4c7835802f5100b49f Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Mon, 31 Oct 2005 16:40:23 +0000 Subject: [PATCH] From Steve Lunsford, "Attached is a copy of TXPNode.cpp with the repaired computeBounds call. I discovered that TXPNodes were being culled out prematurely because the loaded sub-tiles resulted in a computed bounds that was smaller than the extents indicated in the archive. I think this fix should be fine. I can't think of any reason why we would want to use anything other than the archive extents." --- src/osgPlugins/txp/TXPNode.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/osgPlugins/txp/TXPNode.cpp b/src/osgPlugins/txp/TXPNode.cpp index 9d563db09..25afe2160 100644 --- a/src/osgPlugins/txp/TXPNode.cpp +++ b/src/osgPlugins/txp/TXPNode.cpp @@ -104,11 +104,21 @@ void TXPNode::traverse(osg::NodeVisitor& nv) osg::BoundingSphere TXPNode::computeBound() const { +#if 1 + + // Steve Lunsford 10/28/05 : - Had to avoid using the child group nodes for bounds calculation + // because apparently the loader doesn't load all the sub-tiles for this node, resulting in a Group::computeBounds + // call which returns a size smaller than the actual size represented by this node so consequently this node gets culled out. + // note, submission merged and rearranged by Robert Osfield as an #if #else just in case we need to revert. + return osg::BoundingSphere( _extents ); +#else + // original code which uses the extents of the children when one is available. if (getNumChildren() == 0) { return osg::BoundingSphere( _extents ); } return Group::computeBound(); +#endif } void TXPNode::setArchiveName(const std::string& archiveName)