From Laura Cerritelli, "I modified TXPPagedLOD::traverse to prevent the terrain from inappropriately unloading the higher level of detail tiles. It wasn?t updating the frame number of the tile or the range it was traversing, causing PagedLOD::removeExpiredChildren to always consider the range expired."
This commit is contained in:
parent
6ac8b63419
commit
65e49cf9db
@ -30,6 +30,15 @@ void TXPPagedLOD::traverse(osg::NodeVisitor& nv)
|
|||||||
|
|
||||||
double timeStamp = nv.getFrameStamp()?nv.getFrameStamp()->getReferenceTime():0.0;
|
double timeStamp = nv.getFrameStamp()?nv.getFrameStamp()->getReferenceTime():0.0;
|
||||||
bool updateTimeStamp = nv.getVisitorType()==osg::NodeVisitor::CULL_VISITOR;
|
bool updateTimeStamp = nv.getVisitorType()==osg::NodeVisitor::CULL_VISITOR;
|
||||||
|
int frameNumber = nv.getFrameStamp()?nv.getFrameStamp()->getFrameNumber():0;
|
||||||
|
|
||||||
|
// set the frame number of the traversal so that external nodes can find out how active this
|
||||||
|
// node is.
|
||||||
|
if (nv.getFrameStamp() &&
|
||||||
|
nv.getVisitorType()==osg::NodeVisitor::CULL_VISITOR)
|
||||||
|
{
|
||||||
|
setFrameNumberOfLastTraversal(nv.getFrameStamp()->getFrameNumber());
|
||||||
|
}
|
||||||
|
|
||||||
switch(nv.getTraversalMode())
|
switch(nv.getTraversalMode())
|
||||||
{
|
{
|
||||||
@ -55,7 +64,10 @@ void TXPPagedLOD::traverse(osg::NodeVisitor& nv)
|
|||||||
if (i<_children.size())
|
if (i<_children.size())
|
||||||
{
|
{
|
||||||
if (updateTimeStamp)
|
if (updateTimeStamp)
|
||||||
|
{
|
||||||
_perRangeDataList[i]._timeStamp=timeStamp;
|
_perRangeDataList[i]._timeStamp=timeStamp;
|
||||||
|
_perRangeDataList[i]._frameNumber=frameNumber;
|
||||||
|
}
|
||||||
|
|
||||||
_children[i]->accept(nv);
|
_children[i]->accept(nv);
|
||||||
lastChildTraversed = (int)i;
|
lastChildTraversed = (int)i;
|
||||||
|
Loading…
Reference in New Issue
Block a user