What seems to be happening is that during the entire run time, the animation position is being calculated, then when it is triggered, it begins displaying from the calculated position rather than from the begining frame, even when setCurrentFrame(1); is used.
Previoiusly, my code looked like this:
Code: Select all
if (node)
{
if(distance > 200)
{
node->setAnimationSpeed(0);
}
else if( distance < 200.0f)
{
node->setCurrentFrame(1);
node->setFrameLoop(1,120);
node->setAnimationSpeed(10);
node->setLoopMode(false);
}
}
Niko suggested that the new ITimer class should address this.
Looking in the API, it says
However, so far as I try to use this, it seems to apply to the entire scene, not just the animation.The timer is reference counted, which means everything which calls stop() will also have to call start(), otherwise the timer may not start/stop corretly again.
It only wants to be applied with "device->gettimer()->stop();" which is freezing the entire scene.
Anyone know how to implement the ITimer class to stop and start the time just for the animation?
Or any alternate way of actually getting the animation to start playing at the first frame?
This is really my last hurdle for putting my project together. Oddly enough, I ffigured this would be the easiest.