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:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user