From: Mathias Froehlich Date: Tue, 22 Jan 2013 05:13:10 +0000 (+0100) Subject: spt: Introduce a third layer of paged nodes. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=3a668232c8c335b671426a705ad4eb58ff35d919;p=simgear.git spt: Introduce a third layer of paged nodes. --- diff --git a/simgear/scene/tgdb/ReaderWriterSPT.cxx b/simgear/scene/tgdb/ReaderWriterSPT.cxx index 2c0faba7..96fbd709 100644 --- a/simgear/scene/tgdb/ReaderWriterSPT.cxx +++ b/simgear/scene/tgdb/ReaderWriterSPT.cxx @@ -190,9 +190,20 @@ osg::ref_ptr ReaderWriterSPT::createTree(const BucketBox& bucketBox, const osgDB::Options* options, bool topLevel) const { if (bucketBox.getIsBucketSize()) { + std::string fileName; + fileName = bucketBox.getBucket().gen_index_str() + std::string(".stg"); + return osgDB::readRefNodeFile(fileName, options); + } else if (!topLevel && bucketBox.getStartLevel() == 3) { + // We want an other level of indirection for paging + // Here we get about 12x12 deg tiles + return createPagedLOD(bucketBox, options); + } else if (!topLevel && bucketBox.getStartLevel() == 5) { + // We want an other level of indirection for paging + // Here we get about 2x2 deg tiles return createPagedLOD(bucketBox, options); - } else if (!topLevel && bucketBox.getStartLevel() == 4) { + } else if (!topLevel && bucketBox.getStartLevel() == 7) { // We want an other level of indirection for paging + // Here we get about 0.5x0.5 deg tiles return createPagedLOD(bucketBox, options); } else { BucketBox bucketBoxList[100]; @@ -238,11 +249,7 @@ ReaderWriterSPT::createPagedLOD(const BucketBox& bucketBox, const osgDB::Options localOptions->setPluginStringData("SimGear::PARTICLESYSTEM", "OFF"); pagedLOD->setDatabaseOptions(localOptions.get()); - float range; - if (bucketBox.getIsBucketSize()) - range = 200e3; - else - range = 1e6; + float range = 3*sphere.getRadius(); // Add the static sea level textured shell osg::ref_ptr tile = createSeaLevelTile(bucketBox, options);