From 3ef5d2b3313fd9f8cb60a3f6230bf38687a6ccc5 Mon Sep 17 00:00:00 2001 From: Daniel Trstenjak Date: Tue, 29 Jan 2019 11:37:28 +0100 Subject: [PATCH] OcclusionQueryNode: ensure a valid query geometry If the query geometry is invalid then don't do any occlusion queries and never traverse the subgraphs. --- src/osg/OcclusionQueryNode.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/osg/OcclusionQueryNode.cpp b/src/osg/OcclusionQueryNode.cpp index 915dcdb82..8acf40084 100644 --- a/src/osg/OcclusionQueryNode.cpp +++ b/src/osg/OcclusionQueryNode.cpp @@ -483,6 +483,14 @@ bool OcclusionQueryNode::getPassed( const Camera* camera, NodeVisitor& nv ) return _passed; } + if ( !_validQueryGeometry ) + { + // The box of the query geometry is invalid, return false to not traverse + // the subgraphs. + _passed = false; + return _passed; + } + { // Two situations where we want to simply do a regular traversal: // 1) it's the first frame for this camera