Forráskód Böngészése

Merge branch 'master' of https://github.com/BabylonJS/Babylon.js

David Catuhe 11 éve
szülő
commit
548d3bd893
1 módosított fájl, 27 hozzáadás és 0 törlés
  1. 27 0
      Babylon/Math/babylon.math.ts

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

@@ -303,6 +303,33 @@
             return otherVector && this.x === otherVector.x && this.y === otherVector.y;
         }
 
+        public multiplyInPlace(otherVector: Vector2): void {
+            this.x *= otherVector.x;
+            this.y *= otherVector.y;
+        }
+
+        public multiply(otherVector: Vector2): Vector2 {
+            return new Vector2(this.x * otherVector.x, this.y * otherVector.y);
+        }
+
+        public multiplyToRef(otherVector: Vector2, result: Vector2): void {
+            result.x = this.x * otherVector.x;
+            result.y = this.y * otherVector.y;
+        }
+
+        public multiplyByFloats(x: number, y: number): Vector2 {
+            return new Vector2(this.x * x, this.y * y);
+        }
+
+        public divide(otherVector: Vector2): Vector2 {
+            return new Vector2(this.x / otherVector.x, this.y / otherVector.y);
+        }
+
+        public divideToRef(otherVector: Vector2, result: Vector2): void {
+            result.x = this.x / otherVector.x;
+            result.y = this.y / otherVector.y;
+        }
+		
         // Properties
         public length(): number {
             return Math.sqrt(this.x * this.x + this.y * this.y);