소스 검색

Merge pull request #439 from jbousquie/feature.Curve3Continue

added Curve3 continue() method
David Catuhe 10 년 전
부모
커밋
0ad16f5f1a
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