David Catuhe 7 tahun lalu
induk
melakukan
79ab1e4c9f

File diff ditekan karena terlalu besar
+ 11143 - 11127
Playground/babylon.d.txt


File diff ditekan karena terlalu besar
+ 8653 - 8636
dist/preview release/babylon.d.ts


File diff ditekan karena terlalu besar
+ 28 - 28
dist/preview release/babylon.js


File diff ditekan karena terlalu besar
+ 37 - 6
dist/preview release/babylon.max.js


File diff ditekan karena terlalu besar
+ 29 - 29
dist/preview release/babylon.worker.js


File diff ditekan karena terlalu besar
+ 16054 - 16037
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.d.ts


File diff ditekan karena terlalu besar
+ 13 - 13
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.js


+ 25 - 5
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.max.js

@@ -5416,15 +5416,29 @@ var BABYLON;
             Matrix.FromValuesToRef(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, x, y, z, 1.0, result);
         };
         /**
-         * Returns a new Matrix whose values are the interpolated values for "gradien" (float) between the ones of the matrices "startValue" and "endValue".
+         * Returns a new Matrix whose values are the interpolated values for "gradient" (float) between the ones of the matrices "startValue" and "endValue".
+         * @param startValue defines the start value
+         * @param endValue defines the end value
+         * @param gradient defines the gradient factor
+         * @returns the new matrix
          */
         Matrix.Lerp = function (startValue, endValue, gradient) {
             var result = Matrix.Zero();
+            Matrix.LerpToRef(startValue, endValue, gradient, result);
+            return result;
+        };
+        /**
+         * Set the passed matrix "result" as the interpolated values for "gradient" (float) between the ones of the matrices "startValue" and "endValue".
+         * @param startValue defines the start value
+         * @param endValue defines the end value
+         * @param gradient defines the gradient factor
+         * @param result defines the Matrix object where to store data
+         */
+        Matrix.LerpToRef = function (startValue, endValue, gradient, result) {
             for (var index = 0; index < 16; index++) {
                 result.m[index] = startValue.m[index] * (1.0 - gradient) + endValue.m[index] * gradient;
             }
             result._markAsUpdated();
-            return result;
         };
         /**
          * Returns a new Matrix whose values are computed by :
@@ -56404,6 +56418,9 @@ var BABYLON;
             };
         };
         DracoCompression._GetDefaultDecoderUrl = function () {
+            if (!BABYLON.Tools.IsWindowObjectExist) {
+                return null;
+            }
             for (var i = 0; i < document.scripts.length; i++) {
                 if (document.scripts[i].type === "text/x-draco-decoder") {
                     return document.scripts[i].src;
@@ -77991,9 +78008,12 @@ var BABYLON;
             for (y = y_start; y !== y_end; y += y_step) {
                 for (x = x_start; x !== x_end; x += x_step, i += 2) {
                     color = image[i + 0] + (image[i + 1] << 8); // Inversed ?
-                    imageData[(x + width * y) * 4 + 0] = (color & 0x7C00) >> 7;
-                    imageData[(x + width * y) * 4 + 1] = (color & 0x03E0) >> 2;
-                    imageData[(x + width * y) * 4 + 2] = (color & 0x001F) >> 3;
+                    var r = (((color & 0x7C00) >> 10) * 255) / 0x1F | 0;
+                    var g = (((color & 0x03E0) >> 5) * 255) / 0x1F | 0;
+                    var b = ((color & 0x001F) * 255) / 0x1F | 0;
+                    imageData[(x + width * y) * 4 + 0] = r;
+                    imageData[(x + width * y) * 4 + 1] = g;
+                    imageData[(x + width * y) * 4 + 2] = b;
                     imageData[(x + width * y) * 4 + 3] = (color & 0x8000) ? 0 : 255;
                 }
             }

+ 25 - 5
dist/preview release/customConfigurations/minimalGLTFViewer/es6.js

@@ -5389,15 +5389,29 @@ var BABYLON;
             Matrix.FromValuesToRef(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, x, y, z, 1.0, result);
         };
         /**
-         * Returns a new Matrix whose values are the interpolated values for "gradien" (float) between the ones of the matrices "startValue" and "endValue".
+         * Returns a new Matrix whose values are the interpolated values for "gradient" (float) between the ones of the matrices "startValue" and "endValue".
+         * @param startValue defines the start value
+         * @param endValue defines the end value
+         * @param gradient defines the gradient factor
+         * @returns the new matrix
          */
         Matrix.Lerp = function (startValue, endValue, gradient) {
             var result = Matrix.Zero();
+            Matrix.LerpToRef(startValue, endValue, gradient, result);
+            return result;
+        };
+        /**
+         * Set the passed matrix "result" as the interpolated values for "gradient" (float) between the ones of the matrices "startValue" and "endValue".
+         * @param startValue defines the start value
+         * @param endValue defines the end value
+         * @param gradient defines the gradient factor
+         * @param result defines the Matrix object where to store data
+         */
+        Matrix.LerpToRef = function (startValue, endValue, gradient, result) {
             for (var index = 0; index < 16; index++) {
                 result.m[index] = startValue.m[index] * (1.0 - gradient) + endValue.m[index] * gradient;
             }
             result._markAsUpdated();
-            return result;
         };
         /**
          * Returns a new Matrix whose values are computed by :
@@ -56377,6 +56391,9 @@ var BABYLON;
             };
         };
         DracoCompression._GetDefaultDecoderUrl = function () {
+            if (!BABYLON.Tools.IsWindowObjectExist) {
+                return null;
+            }
             for (var i = 0; i < document.scripts.length; i++) {
                 if (document.scripts[i].type === "text/x-draco-decoder") {
                     return document.scripts[i].src;
@@ -77964,9 +77981,12 @@ var BABYLON;
             for (y = y_start; y !== y_end; y += y_step) {
                 for (x = x_start; x !== x_end; x += x_step, i += 2) {
                     color = image[i + 0] + (image[i + 1] << 8); // Inversed ?
-                    imageData[(x + width * y) * 4 + 0] = (color & 0x7C00) >> 7;
-                    imageData[(x + width * y) * 4 + 1] = (color & 0x03E0) >> 2;
-                    imageData[(x + width * y) * 4 + 2] = (color & 0x001F) >> 3;
+                    var r = (((color & 0x7C00) >> 10) * 255) / 0x1F | 0;
+                    var g = (((color & 0x03E0) >> 5) * 255) / 0x1F | 0;
+                    var b = ((color & 0x001F) * 255) / 0x1F | 0;
+                    imageData[(x + width * y) * 4 + 0] = r;
+                    imageData[(x + width * y) * 4 + 1] = g;
+                    imageData[(x + width * y) * 4 + 2] = b;
                     imageData[(x + width * y) * 4 + 3] = (color & 0x8000) ? 0 : 255;
                 }
             }

File diff ditekan karena terlalu besar
+ 37 - 6
dist/preview release/es6.js


File diff ditekan karena terlalu besar
+ 21 - 21
dist/preview release/viewer/babylon.viewer.js


File diff ditekan karena terlalu besar
+ 370 - 62
dist/preview release/viewer/babylon.viewer.max.js


+ 2 - 3
src/Math/babylon.math.ts

@@ -4375,6 +4375,7 @@
          * @param startValue defines the start value
          * @param endValue defines the end value
          * @param gradient defines the gradient factor
+         * @returns the new matrix
          */
         public static Lerp(startValue: Matrix, endValue: Matrix, gradient: number): Matrix {
             var result = Matrix.Zero();
@@ -4389,13 +4390,11 @@
          * @param gradient defines the gradient factor
          * @param result defines the Matrix object where to store data
          */
-        public static LerpToRef(startValue: Matrix, endValue: Matrix, gradient: number, result: Matrix): Matrix {
-            var result = Matrix.Zero();
+        public static LerpToRef(startValue: Matrix, endValue: Matrix, gradient: number, result: Matrix): void {
             for (var index = 0; index < 16; index++) {
                 result.m[index] = startValue.m[index] * (1.0 - gradient) + endValue.m[index] * gradient;
             }
             result._markAsUpdated();
-            return result;
         }        
 
         /**