瀏覽代碼

Fixed the curve bug for real this time. Last fix to the curve just hid it.
https://bugs.launchpad.net/panda3d/+bug/383969

Happy curving without segfaults!

treeform 16 年之前
父節點
當前提交
fa700bd7c3
共有 2 個文件被更改,包括 3 次插入5 次删除
  1. 0 4
      panda/src/parametrics/parametricCurveCollection.cxx
  2. 3 1
      panda/src/parametrics/piecewiseCurve.cxx

+ 0 - 4
panda/src/parametrics/parametricCurveCollection.cxx

@@ -518,10 +518,6 @@ evaluate(float t, LVecBase3f &xyz, LVecBase3f &hpr) const {
     }
     }
   }
   }
 
 
-  if (default_curve == (ParametricCurve *)NULL) {
-    return false;
-  }
-
   if (xyz_curve == (ParametricCurve *)NULL) {
   if (xyz_curve == (ParametricCurve *)NULL) {
     xyz_curve = default_curve;
     xyz_curve = default_curve;
   }
   }

+ 3 - 1
panda/src/parametrics/piecewiseCurve.cxx

@@ -82,7 +82,9 @@ bool PiecewiseCurve::
 get_point(float t, LVecBase3f &point) const {
 get_point(float t, LVecBase3f &point) const {
   const ParametricCurve *curve;
   const ParametricCurve *curve;
   bool result = find_curve(curve, t);
   bool result = find_curve(curve, t);
-
+  if (curve == NULL){
+    return false;
+  }
   // We use | instead of || so we won't short-circuit this calculation.
   // We use | instead of || so we won't short-circuit this calculation.
   return result | curve->get_point(t, point);
   return result | curve->get_point(t, point);
 }
 }