浏览代码

Added missing Vector2.copyFromFloats method

Yannick Comte 11 年之前
父节点
当前提交
78ce7a1aca
共有 2 个文件被更改,包括 10 次插入0 次删除
  1. 5 0
      Babylon/Math/babylon.math.js
  2. 5 0
      Babylon/Math/babylon.math.ts

+ 5 - 0
Babylon/Math/babylon.math.js

@@ -266,6 +266,11 @@
             this.x = source.x;
             this.y = source.y;
         };
+		
+		Vector2.prototype.copyFromFloats = function (x, y) {
+            this.x = x;
+            this.y = y;
+        };
 
         Vector2.prototype.add = function (otherVector) {
             return new Vector2(this.x + otherVector.x, this.y + otherVector.y);

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

@@ -233,6 +233,11 @@
             this.x = source.x;
             this.y = source.y;
         }
+		
+		public copyFromFloats(x: number, y: number): void {
+			this.x = x;
+			this.y = y;
+		}
 
         public add(otherVector: Vector2): Vector2 {
             return new Vector2(this.x + otherVector.x, this.y + otherVector.y);