Hey Robert,
I'm haven't got to the bottom of this yet, but I have found a few things
that seem puzzling eg using the next bit of code in a standard viewer
event loop has the effect that none of the animationpath callbacks are
advancing (they are being called, but the frameStamp they are seeing ,
but the AnimationPathManipulator does.
// record the timer tick at the start of rendering.
unsigned int frameNum = 0;
start_tick = osg::Timer::instance()->tick();
while( !viewer.done() )
{
// wait for all cull and draw threads to complete.
viewer.sync();
osg::ref_ptr<osg::FrameStamp> frameStamp = new osg::FrameStamp;
frameStamp->setReferenceTime(osg::Timer::instance()->delta_s(start_tick,osg::Timer::instance()->tick()));
frameStamp->setFrameNumber(frameNum++);
viewer.setFrameStamp(frameStamp.get());
// ...
I also tried setting frameStamp->setReferenceTime(0.0) in the above loop
which has the same behaviour, ie the animation path still continues, so
it seems that viewer.setFrameStamp() has no useful effect at all.
-Drew
Robert Osfield wrote:
Hi Drew,
On 12/19/06, Drew Whitehouse <[EMAIL PROTECTED]> wrote:
I'm using osgGA::AnimationPathManipulator to animate a camera in my
scene, and I have a bunch of AnimationPathCallback's attached to
various nodes in the scene. For some reason the viewer's
AnimationPathManipulator seems to have a different concept of time to
what's being seen by my animation path callbacks. Hitting the spacebar
in the viewer window as soon as it appears on the screen *nearly* gets
things synchronized so it seems that there is two different notions of
time in the system. I've waded through some of the code involved, but
it's a bit convoluted and I'm hoping someone can point me in the right
direction ?
All the manipulators and animation path callbacks will be using the
osg::FrameStamp that the viewer sets each frame for controlling their
own timing, but.. each of them could have their has their local time
offsets and scales, if all of these are set the same then everything
should go like clockwork. Pressing the space bar will reset the
offset in the AnimationPathManipulator, but not the reset the rest of
the callbacks.
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/