Hi,
I am experiencing some buggy behavior relating to loaded openflight files
containing sequences, and I would appreciate any suggestions. When such a
file is loaded after the viewer has been running for a bit, the animation
runs at the wrong speed. Here's some sample code that illustrates the
problem:

      osg::ref_ptr<osg::Group> rootNode = new osg::Group;

      osg::ref_ptr<osgViewer::Viewer> viewer = new osgViewer::Viewer;
      viewer->setUpViewOnSingleScreen(0);
      viewer->setSceneData(rootNode.get());
      viewer->setCameraManipulator(new osgGA::TrackballManipulator());

      viewer->realize();

      while(!viewer->done() && viewer->getFrameStamp()->getFrameNumber() <
500)
      {
         viewer->frame();
      }

      osg::ref_ptr<osg::Node> modelNode =
osgDB::readNodeFile("some_animation.flt");
      rootNode->addChild(modelNode.get());

      while(!viewer->done())
      {
         viewer->frame();
      }

When the animation gets loaded in the above code, it runs much faster than
it ought to for around 5 seconds, and then runs at the normal rate. It
appears to be "catching up" with the frame time. Sending a visitor down
every loaded flt file and setting sync to true on all sequences seems to fix
the problem, but it seems like this should not be necessary.

Thanks,
Max Bandazian
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to