I have looked at this code for quite a while, but I do think this particular code segment is probably fine. Its the code which is calling this method that would need double checking. Either way I'd put a print out of the time value its using to index into the control points data, and then work backwards from this.
Robert.
On 9/7/06, Gerrick Bivins <[EMAIL PROTECTED]> wrote:
Hi all,
We have recently run into an issue where our non-looping
(osg::AnimationPath::NO_LOOPING) animations aren't sync'd across our cluster. We
are using vrjuggler so we are sharing the framestamp information across the
cluster and things work fine with our initial animation that
loops(osg::AnimationPath::LOOP).
However, when we (later in the app) load a file that has a non-looping animation
associated with it, the time in the animationis different on each node in the
cluster. I've tracked it down to the following code in <osg/AnimationPath.cpp>:
switch(_loopMode)
{
case(SWING):
{
double modulated_time = (time - getFirstTime())/(getPeriod()* 2.0);
double fraction_part = modulated_time - floor(modulated_time);
if (fraction_part>0.5) fraction_part = 1.0-fraction_part;
time = getFirstTime()+(fraction_part*2.0) * getPeriod();
break;
}
case(LOOP):
{
double modulated_time = (time - getFirstTime())/getPeriod();
double fraction_part = modulated_time - floor(modulated_time);
time = getFirstTime()+fraction_part * getPeriod();
break;
}
case(NO_LOOPING):
// no need to modulate the time.
break;
}
I think the
NO_LOOPING setting uses the "time" (stored in the animation path)as an absolute
time where as the other modes adjust (or make the time relative) so animations
are sync'd correctly. Before I started looking at a solution I wanted to make
sure I wasn't completely off here.
biv
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/
_______________________________________________ osg-users mailing list [email protected] http://openscenegraph.net/mailman/listinfo/osg-users http://www.openscenegraph.org/
