Merge pull request #714 from dan-t/reset_occlusion_query_test_result
OcclusionQueryNode: reset the test result of the invalid geometry
This commit is contained in:
commit
66a0168353
@ -483,8 +483,15 @@ bool OcclusionQueryNode::getPassed( const Camera* camera, NodeVisitor& nv )
|
||||
return _passed;
|
||||
}
|
||||
|
||||
QueryGeometry* qg = static_cast< QueryGeometry* >( _queryGeode->getDrawable( 0 ) );
|
||||
|
||||
if ( !_validQueryGeometry )
|
||||
{
|
||||
// There're cases that the occlusion test result has been retrieved
|
||||
// after the query geometry has been changed, it's the result of the
|
||||
// geometry before the change.
|
||||
qg->reset();
|
||||
|
||||
// The box of the query geometry is invalid, return false to not traverse
|
||||
// the subgraphs.
|
||||
_passed = false;
|
||||
@ -513,7 +520,6 @@ bool OcclusionQueryNode::getPassed( const Camera* camera, NodeVisitor& nv )
|
||||
_passed = true;
|
||||
return _passed;
|
||||
}
|
||||
QueryGeometry* qg = static_cast< QueryGeometry* >( _queryGeode->getDrawable( 0 ) );
|
||||
|
||||
// Get the near plane for the upcoming distance calculation.
|
||||
osg::Matrix::value_type nearPlane;
|
||||
|
Loading…
Reference in New Issue
Block a user