In Ogre its quite simple, since ogre has got an animationState object attached to the entity which contains the mesh. What you do in Ogre is something like this, though you have to stop the animation, then set it, and then start it again (it just continues where you stopped it).
Code: Select all
pseudocode:
while(running) {
... (lots of code)
// key handling
if(leftPressed)
node.setAnimation("Walk");
} else {
node.setAnimation("Stand");
}
}
(I could make a state enumeration and wrap a animatedscenenode into a new object; keep track of which is the current state and then i could have a setState function where i could check in which state im currently at and then if needed switch states and animations, but are there alternatives?)