本文整理汇总了C++中TilePagedLOD::setPriorityOffset方法的典型用法代码示例。如果您正苦于以下问题:C++ TilePagedLOD::setPriorityOffset方法的具体用法?C++ TilePagedLOD::setPriorityOffset怎么用?C++ TilePagedLOD::setPriorityOffset使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TilePagedLOD
的用法示例。
在下文中一共展示了TilePagedLOD::setPriorityOffset方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: lowerLeft
osg::Node*
SingleKeyNodeFactory::createTile(TileModel* model, bool setupChildrenIfNecessary)
{
// compile the model into a node:
TileNode* tileNode = _modelCompiler->compile( model, _frame );
// see if this tile might have children.
bool prepareForChildren =
setupChildrenIfNecessary &&
model->_tileKey.getLOD() < *_options.maxLOD();
osg::Node* result = 0L;
if ( prepareForChildren )
{
//Compute the min range based on the 2D size of the tile
osg::BoundingSphere bs = tileNode->getBound();
GeoExtent extent = model->_tileKey.getExtent();
GeoPoint lowerLeft(extent.getSRS(), extent.xMin(), extent.yMin(), 0.0, ALTMODE_ABSOLUTE);
GeoPoint upperRight(extent.getSRS(), extent.xMax(), extent.yMax(), 0.0, ALTMODE_ABSOLUTE);
osg::Vec3d ll, ur;
lowerLeft.toWorld( ll );
upperRight.toWorld( ur );
double radius = (ur - ll).length() / 2.0;
float minRange = (float)(radius * _options.minTileRangeFactor().value());
TilePagedLOD* plod = new TilePagedLOD( _engineUID, _liveTiles, _deadTiles );
plod->setCenter ( bs.center() );
plod->addChild ( tileNode );
plod->setRange ( 0, minRange, FLT_MAX );
plod->setFileName( 1, Stringify() << tileNode->getKey().str() << "." << _engineUID << ".osgearth_engine_mp_tile" );
plod->setRange ( 1, 0, minRange );
#if 0
plod->setPriorityScale( 1, 1000.0f );
plod->setPriorityOffset( 1, 10000.0f );
#endif
#if USE_FILELOCATIONCALLBACK
osgDB::Options* options = Registry::instance()->cloneOrCreateOptions();
options->setFileLocationCallback( new FileLocationCallback() );
plod->setDatabaseOptions( options );
#endif
result = plod;
// this one rejects back-facing tiles:
if ( _frame.getMapInfo().isGeocentric() && _options.clusterCulling() == true )
{
osg::HeightField* hf =
model->_elevationData.getHeightField();
result->addCullCallback( HeightFieldUtils::createClusterCullingCallback(
hf,
tileNode->getKey().getProfile()->getSRS()->getEllipsoid(),
*_options.verticalScale() ) );
}
}
else
{
result = tileNode;
}
return result;
}