Added setLODScale into TileMapper traversal
This commit is contained in:
@@ -56,11 +56,15 @@ void TXPNode::traverse(osg::NodeVisitor& nv)
|
||||
osgUtil::CullVisitor* cv = dynamic_cast<osgUtil::CullVisitor*>(&nv);
|
||||
if (cv)
|
||||
{
|
||||
//const osg::Timer& timer = *osg::Timer::instance();
|
||||
//osg::Timer_t start = timer.tick();
|
||||
//std::cout<<"Doing visible tile search"<<std::endl;
|
||||
//#define PRINT_TILEMAPP_TIMEINFO
|
||||
#ifdef PRINT_TILEMAPP_TIMEINFO
|
||||
const osg::Timer& timer = *osg::Timer::instance();
|
||||
osg::Timer_t start = timer.tick();
|
||||
std::cout<<"Doing visible tile search"<<std::endl;
|
||||
#endif // PRINT_TILEMAPP_TIMEINFO
|
||||
|
||||
osg::ref_ptr<TileMapper> tileMapper = new TileMapper;
|
||||
tileMapper->setLODScale(cv->getLODScale());
|
||||
tileMapper->pushViewport(cv->getViewport());
|
||||
tileMapper->pushProjectionMatrix(&(cv->getProjectionMatrix()));
|
||||
tileMapper->pushModelViewMatrix(&(cv->getModelViewMatrix()));
|
||||
@@ -78,7 +82,9 @@ void TXPNode::traverse(osg::NodeVisitor& nv)
|
||||
|
||||
cv->setUserData(tileMapper.get());
|
||||
|
||||
//std::cout<<"Completed visible tile search in "<<timer.delta_m(start,timer.tick())<<std::endl;
|
||||
#ifdef PRINT_TILEMAPP_TIMEINFO
|
||||
std::cout<<"Completed visible tile search in "<<timer.delta_m(start,timer.tick())<<std::endl;
|
||||
#endif // PRINT_TILEMAPP_TIMEINFO
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -360,7 +360,21 @@ void TileMapper::checkValidityOfAllVisibleTiles()
|
||||
|
||||
} while (!toRemoveList.empty());
|
||||
|
||||
// if (!_blackListedNodeSet.empty()) std::cout<<"********** We have blacked list "<<_blackListedNodeSet.size()<<std::endl;
|
||||
|
||||
#if 0
|
||||
if (!_blackListedNodeSet.empty()) std::cout<<"********** We have blacked list "<<_blackListedNodeSet.size()<<std::endl;
|
||||
|
||||
std::cout<<"TileMap contains "<<_tileMap.size()<<std::endl;
|
||||
for(TileMap::iterator itr=_tileMap.begin();
|
||||
itr!=_tileMap.end();
|
||||
++itr)
|
||||
{
|
||||
std::cout<<" tile="<<itr->first.lod
|
||||
<<" X="<<itr->first.x
|
||||
<<" Y="<<itr->first.y<<std::endl;
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
@@ -379,8 +393,9 @@ bool TileMapper::isTileNeighbourALowerLODLevel(const TileIdentifier& tid, int dx
|
||||
{
|
||||
// not found tile in _tileMap, what should we do??
|
||||
// return true as a fallback right now.
|
||||
std::cout<<"TileMapper::isTileNeighbourALowerLODLevel() Not found tile in map"<<std::endl;
|
||||
return false;
|
||||
std::cout<<"TileMapper::isTileNeighbourALowerLODLevel() Not found tile in map,"<<std::endl;
|
||||
std::cout<<" LOD="<<tid.lod<<" X="<<tid.x<<" Y="<<tid.y<<std::endl;
|
||||
return true;
|
||||
}
|
||||
|
||||
const TileStack& ts = itr->second;
|
||||
|
||||
Reference in New Issue
Block a user