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:
parent
4dd01b81c6
commit
afbc9f3e41
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -21,6 +21,7 @@ class CharacterController
|
||||
MWWorld::Ptr mPtr;
|
||||
MWRender::Animation *mAnimation;
|
||||
|
||||
std::string mCurrentGroup;
|
||||
CharacterState mState;
|
||||
|
||||
protected:
|
||||
|
Loading…
x
Reference in New Issue
Block a user