]> git.mxchange.org Git - simgear.git/commitdiff
Make expiry time for paged models settable from props
authorTorsten Dreyer <torsten@ŧ3r.de>
Wed, 19 Nov 2014 16:23:29 +0000 (17:23 +0100)
committerTorsten Dreyer <torsten@ŧ3r.de>
Wed, 19 Nov 2014 16:23:29 +0000 (17:23 +0100)
Our paged models used the default minimumExpiryTime of zero seconds
which caused frequent stutter with AI traffic loaded.
This patch sets the minimumExpiryTime to 180 seconds, more than enough
to hold the models in memory during a full standard rate turn.

The property to set the expiry time is
/sim/rendering/plod-minimum-expiry-time-secs

simgear/scene/model/modellib.cxx

index efbcd1361b2fb7af5f32fb308cfb742c2a7b0349..4b3ae1d691ba1131eddb9458c1b3f23ef2300bc2 100644 (file)
@@ -160,6 +160,7 @@ SGModelLib::loadPagedModel(const string &path, SGPropertyNode *prop_root,
     plod->setName("Paged LOD for \"" + path + "\"");
     plod->setFileName(0, path);
     plod->setRange(0, 0.0, 50.0*SG_NM_TO_METER);
+    plod->setMinimumExpiryTime( 0, prop_root->getDoubleValue("/sim/rendering/plod-minimum-expiry-time-secs", 180.0 ) );
 
     osg::ref_ptr<SGReaderWriterOptions> opt;
     opt = SGReaderWriterOptions::copyOrCreate(osgDB::Registry::instance()->getOptions());