hi,

tim recently noticed the database pager was repeatedly loading and unloading  
the same objects. he also tracked down the problem to missing bounding sphere 
information in osgDB::PagedLOD. this is a simplicistic approach to fix this: 
SGPagedLOD will now remember whatever value it sees for getBound() after 
loading a child. this patch will make database pager run much calmer.

the second patch (for fg) increases the time before invisible geometry (i.e. 
geometry not inside the view frustrum) gets deleted. default was 10 seconds 
which i am increasing to 2 minutes.

thanks tim,

-till

diff --git a/simgear/scene/model/SGPagedLOD.cxx b/simgear/scene/model/SGPagedLOD.cxx
index ee68b49..bdd19c9 100644
--- a/simgear/scene/model/SGPagedLOD.cxx
+++ b/simgear/scene/model/SGPagedLOD.cxx
@@ -47,6 +47,8 @@ bool SGPagedLOD::addChild(osg::Node *child)
     if (!PagedLOD::addChild(child))
         return false;
 
+    setRadius(getBound().radius());
+    setCenter(getBound().center());
     // if the model was an .xml-file it will have UserData set
     osg::ref_ptr<SGModelData> d = dynamic_cast<SGModelData*>(child->getUserData());
     if (d.valid())
diff --git a/src/Scenery/SceneryPager.cxx b/src/Scenery/SceneryPager.cxx
index 6da6d4b..c72ffe4 100644
--- a/src/Scenery/SceneryPager.cxx
+++ b/src/Scenery/SceneryPager.cxx
@@ -29,6 +29,7 @@ SceneryPager::SceneryPager()
 {
     _pagerRequests.reserve(48);
     _deleteRequests.reserve(16);
+    setExpiryDelay(120.0);
 }
 
 SceneryPager::SceneryPager(const SceneryPager& rhs) :
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel

Reply via email to