From ffa52dfe7c3f2a9fa9a05b14dc174c4ec4e387e1 Mon Sep 17 00:00:00 2001 From: Alexei Kotov Date: Fri, 19 Jan 2024 11:55:37 +0300 Subject: [PATCH] Don't use height cull callback when there's no terrain --- components/terrain/world.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/terrain/world.cpp b/components/terrain/world.cpp index 93a9c563af..9c409b3bc2 100644 --- a/components/terrain/world.cpp +++ b/components/terrain/world.cpp @@ -145,7 +145,7 @@ namespace Terrain osg::Callback* World::getHeightCullCallback(float highz, unsigned int mask) { - if (!mHeightCullCallback) + if (!mHeightCullCallback || mTerrainRoot->getNumChildren() == 0) return nullptr; mHeightCullCallback->setHighZ(highz);