From bc6c7fcecec31cb9453f3bdf3de485b3b87a029f Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Thu, 17 Jan 2008 17:10:12 +0000 Subject: [PATCH] Added call to ClusterCullingCallback to determine if the Terrain node is culled by cluster culling. --- src/osgTerrain/Terrain.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/osgTerrain/Terrain.cpp b/src/osgTerrain/Terrain.cpp index 574ef7cfd..835c009eb 100644 --- a/src/osgTerrain/Terrain.cpp +++ b/src/osgTerrain/Terrain.cpp @@ -12,6 +12,7 @@ */ #include +#include using namespace osg; using namespace osgTerrain; @@ -42,6 +43,15 @@ Terrain::~Terrain() void Terrain::traverse(osg::NodeVisitor& nv) { + if (nv.getVisitorType()==osg::NodeVisitor::CULL_VISITOR) + { + osg::ClusterCullingCallback* ccc = dynamic_cast(getCullCallback()); + if (ccc) + { + if (ccc->cull(&nv,0,static_cast(0))) return; + } + } + if (_terrainTechnique.valid()) { _terrainTechnique->traverse(nv);