Move the call to the manipulators before the scene app traversal to that

any changes to the scene graph, such as adding an app callback can be
seen by during the same frame.
This commit is contained in:
Robert Osfield 2001-11-15 11:59:52 +00:00
parent 4b3c45acc7
commit 3ff4fb6b50

View File

@ -332,10 +332,6 @@ float Viewer::app(unsigned int viewport)
{ {
osg::Timer_t beforeApp = _timer.tick(); osg::Timer_t beforeApp = _timer.tick();
// do app traversal.
getViewportSceneView(viewport)->setFrameStamp(_frameStamp.get());
getViewportSceneView(viewport)->app();
// update the camera manipulator. // update the camera manipulator.
osg::ref_ptr<GLUTEventAdapter> ea = new GLUTEventAdapter; osg::ref_ptr<GLUTEventAdapter> ea = new GLUTEventAdapter;
@ -346,6 +342,11 @@ float Viewer::app(unsigned int viewport)
// osg::notify(osg::INFO) << "Handled update frame"<<endl; // osg::notify(osg::INFO) << "Handled update frame"<<endl;
} }
// do app traversal.
getViewportSceneView(viewport)->setFrameStamp(_frameStamp.get());
getViewportSceneView(viewport)->app();
osg::Timer_t beforeCull = _timer.tick(); osg::Timer_t beforeCull = _timer.tick();
return _timer.delta_m(beforeApp,beforeCull); return _timer.delta_m(beforeApp,beforeCull);