Просмотр исходного кода

Reverted changes made by sgrenier in regards to loopBlendTime

Prevents division by zero when there is only one frame
stratboy61 12 лет назад
Родитель
Сommit
f609b0a56c
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      gameplay/src/Animation.cpp

+ 1 - 1
gameplay/src/Animation.cpp

@@ -254,7 +254,7 @@ void Animation::createClips(Properties* animationProperties, unsigned int frameC
         int begin = pClip->getInt("begin");
         int end = pClip->getInt("end");
 
-        AnimationClip* clip = createClip(pClip->getId(), ((float)begin / (frameCount-1)) * _duration, ((float)end / (frameCount-1)) * _duration);
+        AnimationClip* clip = createClip(pClip->getId(), ((float)begin / frameCount) * _duration, ((float)end / frameCount) * _duration);
 
         const char* repeat = pClip->getString("repeatCount");
         if (repeat)