1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-02-10 12:39:53 +00:00

Keep track of the animation group currently playing

This commit is contained in:
Chris Robinson 2013-01-16 20:44:37 -08:00
parent 4dd01b81c6
commit afbc9f3e41
2 changed files with 9 additions and 4 deletions

View File

@ -41,10 +41,12 @@ CharacterController::CharacterController(const MWWorld::Ptr &ptr, MWRender::Anim
switch(mState)
{
case CharState_Idle:
mAnimation->playGroup("idle", 1, 1);
mCurrentGroup = "idle";
mAnimation->playGroup(mCurrentGroup, 1, 1);
break;
case CharState_Dead:
mAnimation->playGroup("death1", 1, 1);
mCurrentGroup = "death1";
mAnimation->playGroup(mCurrentGroup, 1, 1);
break;
}
}
@ -100,10 +102,12 @@ void CharacterController::setState(CharacterState state)
switch(mState)
{
case CharState_Idle:
mAnimation->playGroup("idle", 1, 1);
mCurrentGroup = "idle";
mAnimation->playGroup(mCurrentGroup, 1, 1);
break;
case CharState_Dead:
mAnimation->playGroup("death1", 1, 1);
mCurrentGroup = "death1";
mAnimation->playGroup(mCurrentGroup, 1, 1);
break;
}
}

View File

@ -21,6 +21,7 @@ class CharacterController
MWWorld::Ptr mPtr;
MWRender::Animation *mAnimation;
std::string mCurrentGroup;
CharacterState mState;
protected: