Here's what's happening:
I have a scene loaded, and have a .X object looping an 'idle' animation. If I press a key, it sets the setLoopMode to false, so that I can use the IAnimationEndCallBack from another animation.
Everything up to this point is fine, my class gets called (Call back receiver). Inside my class I change setLoopMode back to true, but nothing happens. The idle animation never starts again, and if I press a key to get my other animation to start again, it doesn't do anything either.
I currently have a bool value that gets set to true when the key is pressed, and back to false when my Class gets it's call from IAnimationEndCallBack, which is being changed from true (key pressed) to false (end animation).
If I press the key again, it sets my value to True, but it never goes back to False because the animation won't run.
Setting and resetting setLoopMode causes no problems when animating the Faerie from the tutorials. I can change the loop as many times as I want, and it does what it's told.
I've tried to do the .X animations as .MS3D also, with the same problems.
Possible bug? Or did I code something wrong?
*EDIT* My code works with B3D files. .X and MS3D files just won't work for some reason.
setLoopMode not working properly? (.X mesh)
-
xtheagonyscenex
- Posts: 131
- Joined: Fri Jun 03, 2005 7:26 pm
im not sure cuz i have these problems too but i think it may not start again because you have to set it true and tell irllicht which frame to loop
->setFrameLoop(0,0); every time you start or stop. also it might have to do with the main loop.
->setFrameLoop(0,0); every time you start or stop. also it might have to do with the main loop.
"Held in Your arms but too far from my heart." "These thoughts will carry me through the darkest nights...while your eyes rest in mine."
"How quickly I forget that this is meaningless."
"How quickly I forget that this is meaningless."
i'm using a .x file for my weapon.
at creation i set the loop mode to false, set animation speed to 0 and set the current frame to 0.
at LMB click, the animation speed is set to 25.
at the end animation callback, the animation speed is set to 0 and current frame is set to 0.
After all this, it still doesn't work. When i click the mouse button, the weapon animates once and then if i click again, nothing happens.
Does anyone knpw how to fix this?
at creation i set the loop mode to false, set animation speed to 0 and set the current frame to 0.
at LMB click, the animation speed is set to 25.
at the end animation callback, the animation speed is set to 0 and current frame is set to 0.
After all this, it still doesn't work. When i click the mouse button, the weapon animates once and then if i click again, nothing happens.
Does anyone knpw how to fix this?
Did you try anything like this?
This works flawlessly with my MS3D models, but I haven't tried it with any X models. It should repeat the animation once every time it is called.
Code: Select all
node->setFrameLoop(startframe, endframe);
node->setAnimationSpeed(fps);
node->setLoopMode(false);