Priorities during forced model loads won't work unless using current framestamps...
using namespace simgear;
-CheckSceneryVisitor::CheckSceneryVisitor(osgDB::DatabasePager* dbp, const osg::Vec3 &position, double range)
+CheckSceneryVisitor::CheckSceneryVisitor(osgDB::DatabasePager* dbp, const osg::Vec3 &position, double range,
+ osg::FrameStamp* framestamp)
:osg::NodeVisitor(osg::NodeVisitor::NODE_VISITOR,
osg::NodeVisitor::TRAVERSE_ACTIVE_CHILDREN),
-_position(position), _range(range), _loaded(true), _dbp(dbp)
+_position(position), _range(range), _loaded(true), _dbp(dbp), _framestamp(framestamp)
{
_viewMatrices.push_back(osg::Matrix::identity());
}
// if the DatabasePager would load LODs while the splashscreen
// is there, we could just wait for the models to be loaded
// by only setting setLoaded(false) here
- sgplod->forceLoad(_dbp);
+ sgplod->forceLoad(_dbp,_framestamp);
setLoaded(false);
}
}
class CheckSceneryVisitor : public osg::NodeVisitor
{
public:
- CheckSceneryVisitor(osgDB::DatabasePager* dbp, const osg::Vec3 &position, double range);
+ CheckSceneryVisitor(osgDB::DatabasePager* dbp, const osg::Vec3 &position, double range, osg::FrameStamp* framestamp);
virtual void apply(osg::Node& node);
virtual void apply(osg::PagedLOD& node);
double _range;
bool _loaded;
osgDB::DatabasePager* _dbp;
+ osg::FrameStamp* _framestamp;
osg::fast_back_stack<osg::Matrix> _viewMatrices;
};
return true;
}
-void SGPagedLOD::forceLoad(osgDB::DatabasePager *dbp)
+void SGPagedLOD::forceLoad(osgDB::DatabasePager *dbp, osg::FrameStamp* framestamp)
{
//SG_LOG(SG_GENERAL, SG_ALERT, "SGPagedLOD::forceLoad(" <<
//getFileName(getNumChildren()) << ")");
unsigned childNum = getNumChildren();
setTimeStamp(childNum, 0);
double priority=1.0;
- dbp->requestNodeFile(getFileName(childNum),this,priority,0,
+ dbp->requestNodeFile(getFileName(childNum),this,priority,framestamp,
getDatabaseRequest(childNum),
_readerWriterOptions.get());
}
META_Node(simgear, SGPagedLOD);
// virtual void traverse(osg::NodeVisitor& nv);
- virtual void forceLoad(osgDB::DatabasePager* dbp);
+ virtual void forceLoad(osgDB::DatabasePager* dbp, osg::FrameStamp* framestamp);
// reimplemented to notify the loading through ModelData
bool addChild(osg::Node *child);