forked from mirror/openmw-tes3mp
Update animation looping when setting the same state
This commit is contained in:
parent
a510adc572
commit
1399a06c76
3 changed files with 11 additions and 0 deletions
|
@ -260,7 +260,11 @@ void CharacterController::skipAnim()
|
|||
void CharacterController::setState(CharacterState state, bool loop)
|
||||
{
|
||||
if(mState == state)
|
||||
{
|
||||
if(mAnimation)
|
||||
mAnimation->setLooping(loop);
|
||||
return;
|
||||
}
|
||||
mState = state;
|
||||
|
||||
if(!mAnimation)
|
||||
|
|
|
@ -169,6 +169,11 @@ void Animation::setSpeed(float speed)
|
|||
mAnimSpeedMult = speed / mAnimVelocity;
|
||||
}
|
||||
|
||||
void Animation::setLooping(bool loop)
|
||||
{
|
||||
mLooping = loop;
|
||||
}
|
||||
|
||||
|
||||
void Animation::applyAnimation(const Ogre::Animation *anim, float time, Ogre::SkeletonInstance *skel)
|
||||
{
|
||||
|
|
|
@ -76,6 +76,8 @@ public:
|
|||
|
||||
void setSpeed(float speed);
|
||||
|
||||
void setLooping(bool loop);
|
||||
|
||||
void play(const std::string &groupname, const std::string &start, bool loop);
|
||||
virtual Ogre::Vector3 runAnimation(float timepassed);
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue