here is my code, it s just a md2 animation handling receiver.
so i just want this thing:
when i press 8, sydney, run.
but when i press nothing , sydney stand.
the problem is that when i press 8, it run and if i dont touch anything, it continu running, i always receive the EET_KEY_INPUT_EVENT even if i don t press anything
but if i move the mouse , it goes to the else code and sydney is standing as i want.
class MyEventReceiver : public IEventReceiver
{
public:
virtual bool OnEvent(SEvent event)
{
if (event.EventType == EET_KEY_INPUT_EVENT)
{
switch(event.KeyInput.Key)
{
case KEY_KEY_X:
go=0;
break;
case KEY_NUMPAD8:
if(Sydney->getFrameNr()<=312)
{
Sydney->setMD2Animation("run");
Running=1;
}
break;
return true;
}
}
else
{
if(go==true && Running==1)
{
Running=0;
Sydney->setMD2Animation("stand");
}
}
return false;
}
};
another thing...
it should be cool if we could have a getActiveAnimationName function in IAnimatedMeshSceneNode...because testing which frame is playing is not very confortable.