From 5311d6fb6b1a1840322e12a52d58792193f81e61 Mon Sep 17 00:00:00 2001 From: Julien Valentin Date: Fri, 31 May 2019 15:27:18 +0200 Subject: [PATCH 1/2] add enable check in traverseQuery --- src/osg/OcclusionQueryNode.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/osg/OcclusionQueryNode.cpp b/src/osg/OcclusionQueryNode.cpp index 78ce7f3b5..220237c4b 100644 --- a/src/osg/OcclusionQueryNode.cpp +++ b/src/osg/OcclusionQueryNode.cpp @@ -556,7 +556,7 @@ bool OcclusionQueryNode::getPassed( const Camera* camera, NodeVisitor& nv ) void OcclusionQueryNode::traverseQuery( const Camera* camera, NodeVisitor& nv ) { - if (!_validQueryGeometry) + if (!_validQueryGeometry || ! _enabled) return; bool issueQuery; From cfd190a9faf886f3bf9b5e2c44ef0ceef2631202 Mon Sep 17 00:00:00 2001 From: Julien Valentin Date: Sat, 8 Jun 2019 01:17:21 +0200 Subject: [PATCH 2/2] update traversedebug preventing traversal to disable OQN --- src/osg/OcclusionQueryNode.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/osg/OcclusionQueryNode.cpp b/src/osg/OcclusionQueryNode.cpp index 220237c4b..c005bfc76 100644 --- a/src/osg/OcclusionQueryNode.cpp +++ b/src/osg/OcclusionQueryNode.cpp @@ -575,7 +575,7 @@ void OcclusionQueryNode::traverseQuery( const Camera* camera, NodeVisitor& nv ) void OcclusionQueryNode::traverseDebug( NodeVisitor& nv ) { - if (_debugBB) + if (_debugBB && _enabled) // If requested, display the debug geometry _debugGeode->accept( nv ); }