mirror of
https://github.com/OpenMW/openmw.git
synced 2025-02-02 08:45:34 +00:00
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)
|
while(count-- > 0)
|
||||||
mAnimQueue.push_back(groupname);
|
mAnimQueue.push_back(groupname);
|
||||||
mCurrentGroup = groupname;
|
mCurrentGroup = groupname;
|
||||||
|
mState = CharState_SpecialIdle;
|
||||||
mAnimation->setAccumulation(Ogre::Vector3::ZERO);
|
mAnimation->setAccumulation(Ogre::Vector3::ZERO);
|
||||||
mAnimation->play(mCurrentGroup, ((mode==2) ? "loop start" : "start"));
|
mAnimation->play(mCurrentGroup, ((mode==2) ? "loop start" : "start"));
|
||||||
}
|
}
|
||||||
|
@ -165,6 +166,8 @@ void CharacterController::setState(CharacterState state)
|
||||||
mAnimQueue.clear();
|
mAnimQueue.clear();
|
||||||
switch(mState)
|
switch(mState)
|
||||||
{
|
{
|
||||||
|
case CharState_SpecialIdle:
|
||||||
|
break;
|
||||||
case CharState_Idle:
|
case CharState_Idle:
|
||||||
mCurrentGroup = "idle";
|
mCurrentGroup = "idle";
|
||||||
mAnimation->setAccumulation(Ogre::Vector3::ZERO);
|
mAnimation->setAccumulation(Ogre::Vector3::ZERO);
|
||||||
|
|
|
@ -12,6 +12,7 @@ namespace MWMechanics
|
||||||
{
|
{
|
||||||
|
|
||||||
enum CharacterState {
|
enum CharacterState {
|
||||||
|
CharState_SpecialIdle, /* When running a PlayGroup/LoopGroup animation. */
|
||||||
CharState_Idle,
|
CharState_Idle,
|
||||||
CharState_Dead
|
CharState_Dead
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue