瀏覽代碼

added Curve3 continue() method

jbousquie 10 年之前
父節點
當前提交
9b9831a9c6
共有 1 個文件被更改,包括 10 次插入0 次删除
  1. 10 0
      Babylon/Math/babylon.math.ts

+ 10 - 0
Babylon/Math/babylon.math.ts

@@ -3412,6 +3412,16 @@
         public getPoints() {
             return this._points;
         }
+
+        public continue(curve: Curve3) {
+            var lastPoint = this._points[this._points.length - 1];
+            var continuedPoints = this._points.slice();
+            var curvePoints = curve.getPoints();
+            for (var i = 1; i < curvePoints.length; i++) {
+                continuedPoints.push(curvePoints[i].add(lastPoint));
+            }
+            return new Curve3(continuedPoints);
+        }
     }
 
     // SIMD