]> git.mxchange.org Git - simgear.git/commitdiff
spt: Make the range multiplier configurable.
authorMathias Froehlich <Mathias.Froehlich@web.de>
Sun, 24 Feb 2013 12:03:06 +0000 (13:03 +0100)
committerMathias Froehlich <Mathias.Froehlich@web.de>
Mon, 25 Feb 2013 05:42:55 +0000 (06:42 +0100)
simgear/scene/tgdb/ReaderWriterSPT.cxx

index 67977858b3d88baa19ae3610da35096ac9ff790f..3116b2c4838f6c514d8dab00c20475e704c919b5 100644 (file)
@@ -159,6 +159,16 @@ struct ReaderWriterSPT::LocalOptions {
         return ss.str();
     }
 
+    float getRangeMultiplier() const
+    {
+        float rangeMultiplier = 2;
+        if (!_options)
+            return rangeMultiplier;
+        std::stringstream ss(_options->getPluginStringData("SimGear::SPT_RANGE_MULTIPLIER"));
+        ss >> rangeMultiplier;
+        return rangeMultiplier;
+    }
+
     const osgDB::Options* _options;
     std::vector<unsigned> _pageLevels;
 };
@@ -294,7 +304,8 @@ ReaderWriterSPT::createPagedLOD(const BucketBox& bucketBox, const LocalOptions&
     pagedLOD->setDatabaseOptions(localOptions.get());
 
     // The break point for the low level of detail to the high level of detail
-    float range = 2*sphere.getRadius();
+    float rangeMultiplier = options.getRangeMultiplier();
+    float range = rangeMultiplier*sphere.getRadius();
 
     // Look for a low level of detail tile
     std::string lodPath = options.getLodPathForBucketBox(bucketBox);