Hi Robert,
I have changed a couple of the methods in the AnimationPathCallback class to be virtual to allow me to override the animation time calculation method based on the discussion I had with you and Ulrich on the users forum(see below). I have modified the v2.7.1 development version released instead of the svn trunk version because I am having troubles accessing the svn repository from within my companies firewall. I hope this doesn't cause additional issues with merging but the changes are minimal I changed the following methods to virtual methods. virtual void reset(); virtual double getAnimationTime() const; This allowed my to override these in my subclass StepableAnimationPathCallback to implement relative animation time. I can submit this new class also if you think it would be useful to the community? I didn't merge it directly into the AnimationPathCallback class because there are other classes which rely on this class's instance variables. Let me know and I can test my class against the v2.7.1 version instead of the v2.4 version that I am currently working with for my project. Thanks, Alan Dickinson SAIC Intelligent Systems Applications Division Sr. Software Engineer On Wed, Sep 3, 2008 at 7:46 PM, Dickinson, Alan J. <ALAN.J.DICKINSON at saic.com <http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.o rg> > wrote: > I have been creating an animation controller which allows the user to start, > stop and reset the animation being visualized in OSG. I have added speed > control keys which allow the user to speed up or slow down the simulation by > changing the timeMultiplier value in the AnimationPathCallback class. > > When I hit the speed up key it changes the timeMultiplier by a small amount > say 0.05 from the default 1.0 like it should. But each time I hit the speed > up key the position of the object being animated jumps ahead more than the > small amount the speed up should be. When I hit the slow down key which > subtracts 0.05 from the default 1.0, the position of the object jumps > backwards in the path. Then continues from that point on at the slower > speed. > > Is this the correct behavior? > > It does change the speed of the animation either faster or slower but the > position is jumping at the transition. If I hit the slow down key enough I > can go back to the beginning of the path. > > What am I doing wrong? Or is there a different way to control the speed of > an animation ? > > Thanks, > > Alan Dickinson > SAIC Intelligent Systems Applications Division > Sr. Software Engineer > Hi Alan and Robert, Robert Osfield wrote: > The sounds very much like a bug where the pause code is being broken > by changes in the multiplier. Have a look at the > AnimationPathCallback implementation to see if you can spot what might > amiss. I believe this behaviour is due to the way the animation time is calculated. It's not incremental (t += dt * timeMultiplier) which would be continuous when the multipler changes, but absolute (t = (Tlast - Tfirst) * timeMultiplier) which will jump when you change the multiplier. Cheers, /ulrich
AnimationPath
Description: AnimationPath
_______________________________________________ osg-submissions mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
