OcclusionQueryNode: ensure a valid query geometry

If the query geometry is invalid then don't do any occlusion queries and
never traverse the subgraphs.
This commit is contained in:
Daniel Trstenjak 2019-01-29 11:37:28 +01:00 committed by Julien Valentin
parent c64b94da2e
commit 3ef5d2b331

View File

@ -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