From Morten Hauknes, "I have been using the getLastVisiblePixelCount on pre 3.0 osg. I believe maybe this was a private function that we made public in our side. I use(d) this method to make a simple algorithm to tell how much visible an object was in percent.

So with the 3.0 api change we propose the following change:
- put OSG_EXPORT on the QueryGeometry class so that we get access to the getNumPixels method.
- Create a function called getQueryGeometry that returns a casted _queryGeode->getDrawable(). Or a function called getQueryGeode that returns _queryGeode."
This commit is contained in:
Robert Osfield
2011-09-13 13:38:26 +00:00
parent 6c46956918
commit c1af863f78
2 changed files with 25 additions and 1 deletions

View File

@@ -754,5 +754,25 @@ void OcclusionQueryNode::discardDeletedQueryObjects( unsigned int contextID )
QueryGeometry::discardDeletedQueryObjects( contextID );
}
osg::QueryGeometry* OcclusionQueryNode::getQueryGeometry()
{
if (_queryGeode && _queryGeode->getDrawable( 0 ))
{
QueryGeometry* qg = static_cast< QueryGeometry* >( _queryGeode->getDrawable( 0 ) );
return qg;
}
return 0;
}
const osg::QueryGeometry* OcclusionQueryNode::getQueryGeometry() const
{
if (_queryGeode && _queryGeode->getDrawable( 0 ))
{
QueryGeometry* qg = static_cast< QueryGeometry* >( _queryGeode->getDrawable( 0 ) );
return qg;
}
return 0;
}
}