forked from teamnwah/openmw-tes3coop
Use a SpecialIdle state for PlayGroup/LoopGroup invoked animations
Note that actors will *not* automatically resume a normal idle state afterward. Their AI will need to control what to do when the special idle is finished.
This commit is contained in:
parent
a527cb8349
commit
40f8e75763
2 changed files with 4 additions and 0 deletions
|
@ -138,6 +138,7 @@ void CharacterController::playGroup(const std::string &groupname, int mode, int
|
|||
while(count-- > 0)
|
||||
mAnimQueue.push_back(groupname);
|
||||
mCurrentGroup = groupname;
|
||||
mState = CharState_SpecialIdle;
|
||||
mAnimation->setAccumulation(Ogre::Vector3::ZERO);
|
||||
mAnimation->play(mCurrentGroup, ((mode==2) ? "loop start" : "start"));
|
||||
}
|
||||
|
@ -165,6 +166,8 @@ void CharacterController::setState(CharacterState state)
|
|||
mAnimQueue.clear();
|
||||
switch(mState)
|
||||
{
|
||||
case CharState_SpecialIdle:
|
||||
break;
|
||||
case CharState_Idle:
|
||||
mCurrentGroup = "idle";
|
||||
mAnimation->setAccumulation(Ogre::Vector3::ZERO);
|
||||
|
|
|
@ -12,6 +12,7 @@ namespace MWMechanics
|
|||
{
|
||||
|
||||
enum CharacterState {
|
||||
CharState_SpecialIdle, /* When running a PlayGroup/LoopGroup animation. */
|
||||
CharState_Idle,
|
||||
CharState_Dead
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue