From 4317dbf729a2d673ce4b1a912e05a43b1621567d Mon Sep 17 00:00:00 2001 From: frohlich Date: Sat, 26 May 2007 13:51:23 +0000 Subject: [PATCH] Modified Files: src/Scenery/tileentry.cxx: Jonathan Wagner: Removes black dots by accounting for radius of nodes when calculating visible nodes for traversal without removing the optimization. Confirmed fix with a few people on IRC. --- src/Scenery/tileentry.cxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Scenery/tileentry.cxx b/src/Scenery/tileentry.cxx index 1f2564597..0b7ea455d 100644 --- a/src/Scenery/tileentry.cxx +++ b/src/Scenery/tileentry.cxx @@ -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(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); -- 2.39.5