Hi Alaxandre, You should leave the ReferenceTime alone, it's only SimulationTime that you should alter and calling frame or advance with this time is suffiicient - there is no need for the extra calls setting the time. The ReferenceTime is meant to be real-time value of the frames - something you'd use for doing stats collection etc., while SimulationTime is meant to be the time used when compute animations and physical simulations in the scene.
The _startTick that the event queue uses should be the same one as the ReferenceTime uses and makes sure the ReferenceTime and event times are in sync. It's not typically appropriate to use the SimulationTime when doing event handling, but if you want to then you'll need to use the frames FrameStamp to get the current SimulationTime. Robert. On Wed, Jun 17, 2009 at 10:23 AM, Alexandre Amalric<[email protected]> wrote: > Hi osg-users, > > I'm experiencing some problem with time management and osgViewer. > > I'm under Windows Vista, OSG SVN. > > I'm using a composite viewer and my rendering code is : > > pCompoViewer->advance(MyTime); > pCompoViewer->getFrameStamp()->setReferenceTime(MyTime); > pCompoViewer->getFrameStamp()->setSimulationTime(MyTime); > pCompoViewer->eventTraversal(); > pCompoViewer->updateTraversal(); > pCompoViewer->renderingTraversals(); > > instead of : > > pCompoViewer->frame() > > because I wand to trigger my rendering with a computed time 'MyTime" based > on a FPS I need. > > But my problem is that when I use my manipulator and ea.getTime() I do not > have the same time as "MyTime" when event received is for example > osgGA::GUIEventAdapter::PUSH. > ea.getTime() is equal to MyTime only when receiving > osgGA::GUIEventAdapter::FRAME. > > I tracked down this behaviour, in function > GraphicsWindowWin32::handleNativeWindowingEvent because event time is : > > double eventTime = getEventQueue()->getTime(); > > and getTime is returning : > > osg::Timer::instance()->delta_s(_startTick, osg::Timer::instance()->tick()); > > That's why It doesnt match my rendering time... > > Is there any way I can resolve this problem ? (Except making my own > eventqueue class) > > > -- > Alexandre AMALRIC Ingénieur R&D > =================================== > PIXXIM S.A. 73E, rue Perrin-Solliers 13006 Marseille > http://www.pixxim.fr > > _______________________________________________ > osg-users mailing list > [email protected] > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > > _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

