Update animation looping when setting the same state

actorid
Chris Robinson 12 years ago
parent a510adc572
commit 1399a06c76

@ -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…
Cancel
Save