瀏覽代碼

Reverted changes made by sgrenier in regards to loopBlendTime

Prevents division by zero when there is only one frame
stratboy61 12 年之前
父節點
當前提交
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 begin = pClip->getInt("begin");
         int end = pClip->getInt("end");
         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");
         const char* repeat = pClip->getString("repeatCount");
         if (repeat)
         if (repeat)