From 756ec7117b4d6b8362ac22415c2e57ddc59c3e80 Mon Sep 17 00:00:00 2001 From: Bret Curtis Date: Thu, 23 Apr 2020 17:40:10 +0200 Subject: [PATCH] make mGrid (and friends) private again, create accessor method to return bool of mGrid.empty() --- components/terrain/quadtreeworld.cpp | 2 +- components/terrain/terraingrid.hpp | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/components/terrain/quadtreeworld.cpp b/components/terrain/quadtreeworld.cpp index ae3656fd2..0140ade49 100644 --- a/components/terrain/quadtreeworld.cpp +++ b/components/terrain/quadtreeworld.cpp @@ -442,7 +442,7 @@ void QuadTreeWorld::accept(osg::NodeVisitor &nv) } if (isCullVisitor) - updateWaterCullingView(mHeightCullCallback, vd, static_cast(&nv), mStorage->getCellWorldSize(), !mGrid.empty()); + updateWaterCullingView(mHeightCullCallback, vd, static_cast(&nv), mStorage->getCellWorldSize(), !isGridEmpty()); if (!isCullVisitor) vd->clear(); // we can't reuse intersection views in the next frame because they only contain what is touched by the intersection ray. diff --git a/components/terrain/terraingrid.hpp b/components/terrain/terraingrid.hpp index e633a258f..cb37ca296 100644 --- a/components/terrain/terraingrid.hpp +++ b/components/terrain/terraingrid.hpp @@ -28,6 +28,9 @@ namespace Terrain View* createView(); protected: + bool isGridEmpty() { return mGrid.empty(); } + + private: osg::ref_ptr buildTerrain (osg::Group* parent, float chunkSize, const osg::Vec2f& chunkCenter); void updateWaterCulling();