]> git.mxchange.org Git - flightgear.git/blobdiff - src/Scenery/tileentry.cxx
Modified Files:
[flightgear.git] / src / Scenery / tileentry.cxx
index 1f256459781b877821cbbc102c792c2dd14bf187..2d7e44f2e29c37e1d9e05fd7698f03576754b95f 100644 (file)
@@ -66,6 +66,7 @@
 
 SG_USING_STD(string);
 
+// FIXME: investigate what huge update flood is clamped away here ...
 class FGTileUpdateCallback : public osg::NodeCallback {
 public:
   virtual void operator()(osg::Node* node, osg::NodeVisitor* nv)
@@ -74,9 +75,9 @@ public:
     SGUpdateVisitor* updateVisitor = static_cast<SGUpdateVisitor*>(nv);
 
     osg::Vec3 center = node->getBound().center();
-    double dist2 = distSqr(updateVisitor->getGlobalEyePos(),
+    double distance = dist(updateVisitor->getGlobalEyePos(),
                            SGVec3d(center[0], center[1], center[2]));
-    if (updateVisitor->getSqrVisibility() < dist2)
+    if (updateVisitor->getVisibility() + node->getBound().radius() < distance)
       return;
 
     traverse(node, nv);
@@ -301,7 +302,7 @@ FGTileEntry::load( const string_list &path_list, bool is_base )
             string token;
             in >> token;
 
-            if ( token[0] == '#' ) {
+            if ( token.empty() || token[0] == '#' ) {
                in >> ::skipeol;
                continue;
             }