Browse Source

Merge pull request #1294 from Kesshi/master

added Vector2.addInPlace()
David Catuhe 9 năm trước cách đây
mục cha
commit
0b5a7cecd7
1 tập tin đã thay đổi với 7 bổ sung0 xóa
  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);
         }