Bläddra i källkod

Added missing Vector2.copyFromFloats method

Yannick Comte 11 år sedan
förälder
incheckning
78ce7a1aca
2 ändrade filer med 10 tillägg och 0 borttagningar
  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);