瀏覽代碼

Merge pull request #220 from blackberry-gaming/next-dgough

Next dgough
Steve Grenier 13 年之前
父節點
當前提交
233458b220
共有 1 個文件被更改,包括 14 次插入12 次删除
  1. 14 12
      gameplay-encoder/src/MeshSkin.cpp

+ 14 - 12
gameplay-encoder/src/MeshSkin.cpp

@@ -313,26 +313,28 @@ void MeshSkin::computeBounds()
         if (duration > maxDuration)
         if (duration > maxDuration)
             maxDuration = duration;
             maxDuration = duration;
 
 
-        // Set curve points
-        float* keyValuesPtr = keyValues;
-        for (unsigned int j = 0; j < keyCount; ++j)
+        if (duration > 0.0f)
         {
         {
-            // Store time normalized, between 0-1
-            float t = (keyTimes[j] - startTime) / duration;
+            // Set curve points
+            float* keyValuesPtr = keyValues;
+            for (unsigned int j = 0; j < keyCount; ++j)
+            {
+                // Store time normalized, between 0-1
+                float t = (keyTimes[j] - startTime) / duration;
 
 
-            // Set the curve point
-            // TODO: Handle other interpolation types
-            curve->setPoint(j, t, keyValuesPtr, gameplay::Curve::LINEAR);
+                // Set the curve point
+                // TODO: Handle other interpolation types
+                curve->setPoint(j, t, keyValuesPtr, gameplay::Curve::LINEAR);
 
 
-            // Move to the next point on the curve
-            keyValuesPtr += curve->getComponentCount();
+                // Move to the next point on the curve
+                keyValuesPtr += curve->getComponentCount();
+            }
+            curves.push_back(curve);
         }
         }
 
 
         delete[] keyValues;
         delete[] keyValues;
         keyValues = NULL;
         keyValues = NULL;
 
 
-        curves.push_back(curve);
-
         DEBUGPRINT_VARG("> %d%%\r", (int)((float)(i+1) / (float)channelCount * 100.0f));
         DEBUGPRINT_VARG("> %d%%\r", (int)((float)(i+1) / (float)channelCount * 100.0f));
     }
     }
     DEBUGPRINT("\n");
     DEBUGPRINT("\n");