Browse Source

Fixed bug in computation of delta t in make_even function

Mark Mine 23 years ago
parent
commit
ceb45b5f65
1 changed files with 3 additions and 3 deletions
  1. 3 3
      panda/src/parametrics/parametricCurveCollection.cxx

+ 3 - 3
panda/src/parametrics/parametricCurveCollection.cxx

@@ -354,13 +354,13 @@ make_even(float max_t, float segments_per_unit) {
 
   float last_t = 0.0f;
   fitter.add_xyz(0.0f, LVecBase3f(last_t, 0.0f, 0.0f));
-  float val_inc= 1.0f/(num_segments * max_t);
+  float val_inc= 1.0f/num_segments;
   float val=val_inc;
 
   for (int i = 0; i < num_segments; i++,val+=val_inc) {
     float next_t = xyz_curve->find_length(last_t, segment_length);
-    fitter.add_xyz(/*(float)(i + 1)/(num_segments * max_t),*/
-                   val,
+    fitter.add_xyz(/*(float)(i + 1)/num_segments * max_t,*/
+                   val * max_t,
                    LVecBase3f(next_t, 0.0f, 0.0f));
 
     if (parametrics_cat.is_spam()) {