瀏覽代碼

Merge pull request #1294 from Kesshi/master

added Vector2.addInPlace()
David Catuhe 9 年之前
父節點
當前提交
0b5a7cecd7
共有 1 個文件被更改,包括 7 次插入0 次删除
  1. 7 0
      src/Math/babylon.math.ts

+ 7 - 0
src/Math/babylon.math.ts

@@ -483,6 +483,13 @@
             return this;
         }
 
+        public addInPlace(otherVector: Vector2): Vector2 {
+            this.x += otherVector.x;
+            this.y += otherVector.y;
+
+            return this;
+        }
+
         public addVector3(otherVector: Vector3): Vector2 {
             return new Vector2(this.x + otherVector.x, this.y + otherVector.y);
         }