瀏覽代碼

Fix isPicking for GUI

David Catuhe 8 年之前
父節點
當前提交
73240a23d1

文件差異過大導致無法顯示
+ 2265 - 2265
dist/preview release/babylon.d.ts


文件差異過大導致無法顯示
+ 27 - 27
dist/preview release/babylon.js


+ 42 - 0
dist/preview release/babylon.max.js

@@ -371,6 +371,10 @@ var __extends = (this && this.__extends) || (function () {
          * Creates a new Color4 object from the passed float values ( < 1) : red, green, blue, alpha.
          */
         function Color4(r, g, b, a) {
+            if (r === void 0) { r = 0; }
+            if (g === void 0) { g = 0; }
+            if (b === void 0) { b = 0; }
+            if (a === void 0) { a = 0; }
             this.r = r;
             this.g = g;
             this.b = b;
@@ -538,6 +542,44 @@ var __extends = (this && this.__extends) || (function () {
             var intA = (this.a * 255) | 0;
             return "#" + MathTools.ToHex(intR) + MathTools.ToHex(intG) + MathTools.ToHex(intB) + MathTools.ToHex(intA);
         };
+        /**
+         * Returns a new Color4 converted to linear space.
+         */
+        Color4.prototype.toLinearSpace = function () {
+            var convertedColor = new Color4();
+            this.toLinearSpaceToRef(convertedColor);
+            return convertedColor;
+        };
+        /**
+         * Converts the Color4 values to linear space and stores the result in "convertedColor".
+         * Returns the unmodified Color4.
+         */
+        Color4.prototype.toLinearSpaceToRef = function (convertedColor) {
+            convertedColor.r = Math.pow(this.r, BABYLON.ToLinearSpace);
+            convertedColor.g = Math.pow(this.g, BABYLON.ToLinearSpace);
+            convertedColor.b = Math.pow(this.b, BABYLON.ToLinearSpace);
+            convertedColor.a = this.a;
+            return this;
+        };
+        /**
+         * Returns a new Color4 converted to gamma space.
+         */
+        Color4.prototype.toGammaSpace = function () {
+            var convertedColor = new Color4();
+            this.toGammaSpaceToRef(convertedColor);
+            return convertedColor;
+        };
+        /**
+         * Converts the Color4 values to gamma space and stores the result in "convertedColor".
+         * Returns the unmodified Color4.
+         */
+        Color4.prototype.toGammaSpaceToRef = function (convertedColor) {
+            convertedColor.r = Math.pow(this.r, BABYLON.ToGammaSpace);
+            convertedColor.g = Math.pow(this.g, BABYLON.ToGammaSpace);
+            convertedColor.b = Math.pow(this.b, BABYLON.ToGammaSpace);
+            convertedColor.a = this.a;
+            return this;
+        };
         // Statics
         /**
          * Creates a new Color4 from the valid hexadecimal value contained in the passed string.

文件差異過大導致無法顯示
+ 2265 - 2265
dist/preview release/babylon.module.d.ts


文件差異過大導致無法顯示
+ 28 - 28
dist/preview release/babylon.worker.js


文件差異過大導致無法顯示
+ 2610 - 2592
dist/preview release/customConfigurations/minimalViewer/babylon.d.ts


文件差異過大導致無法顯示
+ 27 - 27
dist/preview release/customConfigurations/minimalViewer/babylon.js


+ 42 - 0
dist/preview release/customConfigurations/minimalViewer/babylon.max.js

@@ -371,6 +371,10 @@ var __extends = (this && this.__extends) || (function () {
          * Creates a new Color4 object from the passed float values ( < 1) : red, green, blue, alpha.
          */
         function Color4(r, g, b, a) {
+            if (r === void 0) { r = 0; }
+            if (g === void 0) { g = 0; }
+            if (b === void 0) { b = 0; }
+            if (a === void 0) { a = 0; }
             this.r = r;
             this.g = g;
             this.b = b;
@@ -538,6 +542,44 @@ var __extends = (this && this.__extends) || (function () {
             var intA = (this.a * 255) | 0;
             return "#" + MathTools.ToHex(intR) + MathTools.ToHex(intG) + MathTools.ToHex(intB) + MathTools.ToHex(intA);
         };
+        /**
+         * Returns a new Color4 converted to linear space.
+         */
+        Color4.prototype.toLinearSpace = function () {
+            var convertedColor = new Color4();
+            this.toLinearSpaceToRef(convertedColor);
+            return convertedColor;
+        };
+        /**
+         * Converts the Color4 values to linear space and stores the result in "convertedColor".
+         * Returns the unmodified Color4.
+         */
+        Color4.prototype.toLinearSpaceToRef = function (convertedColor) {
+            convertedColor.r = Math.pow(this.r, BABYLON.ToLinearSpace);
+            convertedColor.g = Math.pow(this.g, BABYLON.ToLinearSpace);
+            convertedColor.b = Math.pow(this.b, BABYLON.ToLinearSpace);
+            convertedColor.a = this.a;
+            return this;
+        };
+        /**
+         * Returns a new Color4 converted to gamma space.
+         */
+        Color4.prototype.toGammaSpace = function () {
+            var convertedColor = new Color4();
+            this.toGammaSpaceToRef(convertedColor);
+            return convertedColor;
+        };
+        /**
+         * Converts the Color4 values to gamma space and stores the result in "convertedColor".
+         * Returns the unmodified Color4.
+         */
+        Color4.prototype.toGammaSpaceToRef = function (convertedColor) {
+            convertedColor.r = Math.pow(this.r, BABYLON.ToGammaSpace);
+            convertedColor.g = Math.pow(this.g, BABYLON.ToGammaSpace);
+            convertedColor.b = Math.pow(this.b, BABYLON.ToGammaSpace);
+            convertedColor.a = this.a;
+            return this;
+        };
         // Statics
         /**
          * Creates a new Color4 from the valid hexadecimal value contained in the passed string.

文件差異過大導致無法顯示
+ 2610 - 2592
dist/preview release/customConfigurations/minimalViewer/babylon.module.d.ts


+ 1 - 1
dist/preview release/gui/babylon.gui.js

@@ -3150,7 +3150,7 @@ var BABYLON;
             };
             // While being a container, the button behaves like a control.
             Button.prototype._processPicking = function (x, y, type) {
-                if (!this.contains(x, y)) {
+                if (!this.isHitTestVisible || !this.isVisible) {
                     return false;
                 }
                 this._processObservables(type, x, y);

文件差異過大導致無法顯示
+ 2 - 2
dist/preview release/gui/babylon.gui.min.js


+ 5 - 0
dist/preview release/loaders/babylon.glTF2FileLoader.js

@@ -1250,6 +1250,8 @@ var BABYLON;
                 }
             };
             GLTFUtils.GetTextureWrapMode = function (mode) {
+                // Set defaults if undefined
+                mode = mode === undefined ? GLTF2.ETextureWrapMode.REPEAT : mode;
                 switch (mode) {
                     case GLTF2.ETextureWrapMode.CLAMP_TO_EDGE: BABYLON.Texture.CLAMP_ADDRESSMODE;
                     case GLTF2.ETextureWrapMode.MIRRORED_REPEAT: return BABYLON.Texture.MIRROR_ADDRESSMODE;
@@ -1277,6 +1279,9 @@ var BABYLON;
                 }
             };
             GLTFUtils.GetTextureSamplingMode = function (magFilter, minFilter) {
+                // Set defaults if undefined
+                magFilter = magFilter === undefined ? GLTF2.ETextureMagFilter.LINEAR : magFilter;
+                minFilter = minFilter === undefined ? GLTF2.ETextureMinFilter.LINEAR_MIPMAP_NEAREST : minFilter;
                 if (magFilter === GLTF2.ETextureMagFilter.LINEAR) {
                     switch (minFilter) {
                         case GLTF2.ETextureMinFilter.NEAREST: return BABYLON.Texture.LINEAR_NEAREST;

文件差異過大導致無法顯示
+ 1 - 1
dist/preview release/loaders/babylon.glTF2FileLoader.min.js


+ 5 - 0
dist/preview release/loaders/babylon.glTFFileLoader.js

@@ -3403,6 +3403,8 @@ var BABYLON;
                 }
             };
             GLTFUtils.GetTextureWrapMode = function (mode) {
+                // Set defaults if undefined
+                mode = mode === undefined ? GLTF2.ETextureWrapMode.REPEAT : mode;
                 switch (mode) {
                     case GLTF2.ETextureWrapMode.CLAMP_TO_EDGE: BABYLON.Texture.CLAMP_ADDRESSMODE;
                     case GLTF2.ETextureWrapMode.MIRRORED_REPEAT: return BABYLON.Texture.MIRROR_ADDRESSMODE;
@@ -3430,6 +3432,9 @@ var BABYLON;
                 }
             };
             GLTFUtils.GetTextureSamplingMode = function (magFilter, minFilter) {
+                // Set defaults if undefined
+                magFilter = magFilter === undefined ? GLTF2.ETextureMagFilter.LINEAR : magFilter;
+                minFilter = minFilter === undefined ? GLTF2.ETextureMinFilter.LINEAR_MIPMAP_NEAREST : minFilter;
                 if (magFilter === GLTF2.ETextureMagFilter.LINEAR) {
                     switch (minFilter) {
                         case GLTF2.ETextureMinFilter.NEAREST: return BABYLON.Texture.LINEAR_NEAREST;

文件差異過大導致無法顯示
+ 2 - 2
dist/preview release/loaders/babylon.glTFFileLoader.min.js


+ 1 - 1
gui/src/controls/button.ts

@@ -38,7 +38,7 @@ module BABYLON.GUI {
 
         // While being a container, the button behaves like a control.
         public _processPicking(x: number, y: number, type: number): boolean {
-            if (!this.contains(x, y)) {
+            if (!this.isHitTestVisible || !this.isVisible) {
                 return false;
             }