瀏覽代碼

*** empty log message ***

David Rose 25 年之前
父節點
當前提交
983c9c3062
共有 1 個文件被更改,包括 11 次插入0 次删除
  1. 11 0
      panda/src/parametrics/curveFitter.cxx

+ 11 - 0
panda/src/parametrics/curveFitter.cxx

@@ -147,6 +147,9 @@ sample(ParametricCurve *curve, int count, bool even) {
   double t, last_t, d;
   double t, last_t, d;
   DataPoint dp;
   DataPoint dp;
 
 
+
+  size_t n = _data.size();
+
   last_t = 0.0;
   last_t = 0.0;
   d = 0.0;
   d = 0.0;
   int i;
   int i;
@@ -164,6 +167,14 @@ sample(ParametricCurve *curve, int count, bool even) {
     _data.push_back(dp);
     _data.push_back(dp);
     last_t = t;
     last_t = t;
   }
   }
+
+  if (even) {
+    double scale = max_t / last_t;
+    while (n < _data.size()) {
+      _data[n]._t *= scale;
+      n++;
+    }
+  }
 }
 }
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////