本文整理汇总了C++中osg::NodeVisitor::getDistanceFromEyePoint方法的典型用法代码示例。如果您正苦于以下问题:C++ NodeVisitor::getDistanceFromEyePoint方法的具体用法?C++ NodeVisitor::getDistanceFromEyePoint怎么用?C++ NodeVisitor::getDistanceFromEyePoint使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类osg::NodeVisitor
的用法示例。
在下文中一共展示了NodeVisitor::getDistanceFromEyePoint方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getBound
void
TileGroup::traverse(osg::NodeVisitor& nv)
{
if ( nv.getTraversalMode() == nv.TRAVERSE_ACTIVE_CHILDREN )
{
float range = 0.0f;
if ( nv.getVisitorType() == nv.CULL_VISITOR )
{
range = nv.getDistanceFromEyePoint( getBound().center(), true );
}
// if all four subtiles have reported that they are upsampling,
// don't use any of them.
if ( _traverseSubtiles && _numSubtilesUpsampling == 4 )
{
_traverseSubtiles = false;
}
// if we are out of subtile range, or we're in range but the subtiles are
// not all loaded yet, or we are skipping subtiles, draw the current tile.
if ( range > _subtileRange || _numSubtilesLoaded < 4 || !_traverseSubtiles )
{
_tilenode->accept( nv );
}
// if we're in range, traverse the subtiles.
if ( _traverseSubtiles && range <= _subtileRange )
{
for( unsigned q=0; q<4; ++q )
{
getChild(1+q)->accept( nv );
}
// update the TileNode so it knows what frame we're in.
if ( nv.getFrameStamp() )
{
_tilenode->setLastTraversalFrame( nv.getFrameStamp()->getFrameNumber() );
}
}
}
else
{
osg::Group::traverse( nv );
}
}