CompositeViewer::checkNeedToDoFrame() does the following:
Code:
if (_requestRedraw) return true;
if (_requestContinousUpdate) return true;
for(RefViews::iterator itr = _views.begin();
itr != _views.end();
++itr)
{
osgViewer::View* view = itr->get();
if (view)
{
// If the database pager is going to update the scene the render
flag is
// set so that the updates show up
if (view->getDatabasePager()->requiresUpdateSceneGraph() ||
view->getDatabasePager()->getRequestsInProgress()) return true;
}
}
// now do a eventTraversal to see if any events might require a new frame.
eventTraversal();
if (_requestRedraw) return true;
if (_requestContinousUpdate) return true;
return false;
and Viewer::checkNeedToDoFrame() does:
Code:
if (_requestRedraw) return true;
if (_requestContinousUpdate) return true;
// If the database pager is going to update the scene the render flag is
// set so that the updates show up
if(getDatabasePager()->requiresUpdateSceneGraph() ||
getDatabasePager()->getRequestsInProgress()) return true;
// if there update callbacks then we need to do frame.
if (_camera->getUpdateCallback()) return true;
if (getSceneData()!=0 &&
getSceneData()->getNumChildrenRequiringUpdateTraversal()>0) return true;
// now do a eventTraversal to see if any events might require a new frame.
eventTraversal();
// now check if any of the event handles have prompted a redraw.
if (_requestRedraw) return true;
if (_requestContinousUpdate) return true;
return false;
CompositeViewer works great in my case and calls frame() only when needed. When
I make the few changes required to use Viewer, it will always call frame(). In
my case, Viewer returns true because getNumChildrenRequiringUpdateTraversal()
== 2 and it never goes to 0. If I manually set it to 0, everything works just
fine. Am I doing something wrong? It seems odd that the methods do not quite do
the same thing. Should these two methods be more consistent?[/code]
------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=43645#43645
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org