From: mfranz Date: Fri, 25 Apr 2008 08:41:29 +0000 (+0000) Subject: Till BUSCH: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=daef76ec0bf2254ae2bfa61db81b17ace73c1c7e;p=simgear.git Till BUSCH: "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." --- diff --git a/simgear/scene/model/SGPagedLOD.cxx b/simgear/scene/model/SGPagedLOD.cxx index ee68b499..bdd19c9c 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 d = dynamic_cast(child->getUserData()); if (d.valid())