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

minor : use functions

Julien Barrois 7 éve
szülő
commit
4ae349e272
1 módosított fájl, 3 hozzáadás és 20 törlés
  1. 3 20
      src/Tools/babylon.tools.ts

+ 3 - 20
src/Tools/babylon.tools.ts

@@ -588,7 +588,7 @@ module BABYLON {
         public static BuildArray = <T, P extends any[]>(size: number, konstructor: new (...p: P) => T, ...kparams: P): Array<T> => {
             const a: T[] = [];
             for (let i = 0; i < size; ++i) {
-                a.push(new konstructor(...kparams));
+                a.push(new konstructor(...kparams));
             }
             return a;
         }
@@ -1096,25 +1096,8 @@ module BABYLON {
          * @param max defines the maximum range
          */
         public static CheckExtends(v: Vector3, min: Vector3, max: Vector3): void {
-            if (v.x < min.x) {
-                min.x = v.x;
-            }
-            if (v.y < min.y) {
-                min.y = v.y;
-            }
-            if (v.z < min.z) {
-                min.z = v.z;
-            }
-
-            if (v.x > max.x) {
-                max.x = v.x;
-            }
-            if (v.y > max.y) {
-                max.y = v.y;
-            }
-            if (v.z > max.z) {
-                max.z = v.z;
-            }
+            min.minimizeInPlace(v);
+            max.maximizeInPlace(v);
         }
 
         /**