From 436c640da2fa807b2e68f146ce96788e0dc17841 Mon Sep 17 00:00:00 2001 From: Bret Curtis Date: Mon, 9 Aug 2021 22:56:04 +0200 Subject: [PATCH] the old switch-a-roo because we shoudl only StopTraversal when the node size is larger than 1 and not the other way around --- components/terrain/quadtreeworld.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/components/terrain/quadtreeworld.cpp b/components/terrain/quadtreeworld.cpp index e9f5805566..e26fc1b617 100644 --- a/components/terrain/quadtreeworld.cpp +++ b/components/terrain/quadtreeworld.cpp @@ -65,8 +65,7 @@ public: { const osg::Vec2f& center = node->getCenter(); bool activeGrid = (center.x() > mActiveGrid.x() && center.y() > mActiveGrid.y() && center.x() < mActiveGrid.z() && center.y() < mActiveGrid.w()); - if (dist > mViewDistance && !activeGrid) // for Scene<->ObjectPaging sync the activegrid must remain loaded - return StopTraversal; + if (node->getSize()>1) { float halfSize = node->getSize()/2; @@ -77,6 +76,9 @@ public: return Deeper; } + if (dist > mViewDistance && !activeGrid) // for Scene<->ObjectPaging sync the activegrid must remain loaded + return StopTraversal; + int nativeLodLevel = Log2(static_cast(node->getSize()/mMinSize)); int lodLevel = Log2(static_cast(dist/(Constants::CellSizeInUnits*mMinSize*mFactor)));