David Catuhe il y a 7 ans
Parent
commit
6079ced289

Fichier diff supprimé car celui-ci est trop grand
+ 1262 - 1258
Playground/babylon.d.txt


Fichier diff supprimé car celui-ci est trop grand
+ 1264 - 1260
dist/preview release/babylon.d.ts


Fichier diff supprimé car celui-ci est trop grand
+ 20 - 20
dist/preview release/babylon.js


+ 34 - 17
dist/preview release/babylon.max.js

@@ -19559,10 +19559,6 @@ var BABYLON;
              * Gets or sets a boolean indicating if the mesh can be picked (by scene.pick for instance or through actions). Default is true
              */
             _this.isPickable = true;
-            /**
-             * Gets or sets a boolean indicating if the bounding box must be rendered as well (false by default)
-             */
-            _this.showBoundingBox = false;
             /** Gets or sets a boolean indicating that bounding boxes of subMeshes must be rendered as well (false by default) */
             _this.showSubMeshesBoundingBox = false;
             /** Gets or sets a boolean indicating if the mesh must be considered as a ray blocker for lens flares (false by default)
@@ -73542,6 +73538,11 @@ var BABYLON;
         get: function () {
             if (!this._gamepadManager) {
                 this._gamepadManager = new BABYLON.GamepadManager(this);
+                var component = this._getComponent(BABYLON.SceneComponentConstants.NAME_GAMEPAD);
+                if (!component) {
+                    component = new GamepadSystemSceneComponent(this);
+                    this._addComponent(component);
+                }
             }
             return this._gamepadManager;
         },
@@ -88192,7 +88193,7 @@ var BABYLON;
             var header = new Int32Array(arrayBuffer, 0, headerLengthInt);
             var fourCC, width, height, dataLength = 0, dataOffset;
             var byteArray, mipmapCount, mip;
-            var internalFormat = 0;
+            var internalCompressedFormat = 0;
             var blockBytes = 1;
             if (header[off_magic] !== DDS_MAGIC) {
                 BABYLON.Tools.Error("Invalid magic number in DDS header");
@@ -88214,15 +88215,15 @@ var BABYLON;
                 switch (fourCC) {
                     case FOURCC_DXT1:
                         blockBytes = 8;
-                        internalFormat = ext.COMPRESSED_RGBA_S3TC_DXT1_EXT;
+                        internalCompressedFormat = ext.COMPRESSED_RGBA_S3TC_DXT1_EXT;
                         break;
                     case FOURCC_DXT3:
                         blockBytes = 16;
-                        internalFormat = ext.COMPRESSED_RGBA_S3TC_DXT3_EXT;
+                        internalCompressedFormat = ext.COMPRESSED_RGBA_S3TC_DXT3_EXT;
                         break;
                     case FOURCC_DXT5:
                         blockBytes = 16;
-                        internalFormat = ext.COMPRESSED_RGBA_S3TC_DXT5_EXT;
+                        internalCompressedFormat = ext.COMPRESSED_RGBA_S3TC_DXT5_EXT;
                         break;
                     case FOURCC_D3DFMT_R16G16B16A16F:
                         computeFormats = true;
@@ -88259,7 +88260,7 @@ var BABYLON;
             var bOffset = DDSTools._ExtractLongWordOrder(header[off_BMask]);
             var aOffset = DDSTools._ExtractLongWordOrder(header[off_AMask]);
             if (computeFormats) {
-                internalFormat = engine._getRGBABufferInternalSizedFormat(info.textureType);
+                internalCompressedFormat = engine._getRGBABufferInternalSizedFormat(info.textureType);
             }
             mipmapCount = 1;
             if (header[off_flags] & DDSD_MIPMAPCOUNT && loadMipmaps !== false) {
@@ -88272,8 +88273,8 @@ var BABYLON;
                     if (lodIndex === -1 || lodIndex === mip) {
                         // In case of fixed LOD, if the lod has just been uploaded, early exit.
                         var i = (lodIndex === -1) ? mip : 0;
-                        texture.format = BABYLON.Engine.TEXTUREFORMAT_RGBA;
                         if (!info.isCompressed && info.isFourCC) {
+                            texture.format = BABYLON.Engine.TEXTUREFORMAT_RGBA;
                             dataLength = width * height * 4;
                             var floatArray = null;
                             if (engine._badOS || engine._badDesktopOS || (!engine.getCaps().textureHalfFloat && !engine.getCaps().textureFloat)) { // Required because iOS has many issues with float and half float generation
@@ -88289,25 +88290,25 @@ var BABYLON;
                                         sphericalPolynomialFaces.push(DDSTools._GetHalfFloatAsFloatRGBAArrayBuffer(width, height, dataOffset, dataLength, arrayBuffer, i));
                                     }
                                 }
-                                info.textureType = BABYLON.Engine.TEXTURETYPE_UNSIGNED_INT;
-                                internalFormat = engine._getRGBABufferInternalSizedFormat(info.textureType);
+                                texture.type = BABYLON.Engine.TEXTURETYPE_UNSIGNED_INT;
                             }
                             else {
                                 if (bpp === 128) {
+                                    texture.type = BABYLON.Engine.TEXTURETYPE_FLOAT;
                                     floatArray = DDSTools._GetFloatRGBAArrayBuffer(width, height, dataOffset, dataLength, arrayBuffer, i);
                                     if (sphericalPolynomialFaces && i == 0) {
                                         sphericalPolynomialFaces.push(floatArray);
                                     }
                                 }
                                 else if (bpp === 64 && !engine.getCaps().textureHalfFloat) {
+                                    texture.type = BABYLON.Engine.TEXTURETYPE_FLOAT;
                                     floatArray = DDSTools._GetHalfFloatAsFloatRGBAArrayBuffer(width, height, dataOffset, dataLength, arrayBuffer, i);
                                     if (sphericalPolynomialFaces && i == 0) {
                                         sphericalPolynomialFaces.push(floatArray);
                                     }
-                                    info.textureType = BABYLON.Engine.TEXTURETYPE_FLOAT;
-                                    internalFormat = engine._getRGBABufferInternalSizedFormat(info.textureType);
                                 }
                                 else { // 64
+                                    texture.type = BABYLON.Engine.TEXTURETYPE_HALF_FLOAT;
                                     floatArray = DDSTools._GetHalfFloatRGBAArrayBuffer(width, height, dataOffset, dataLength, arrayBuffer, i);
                                     if (sphericalPolynomialFaces && i == 0) {
                                         sphericalPolynomialFaces.push(DDSTools._GetHalfFloatAsFloatRGBAArrayBuffer(width, height, dataOffset, dataLength, arrayBuffer, i));
@@ -88315,18 +88316,19 @@ var BABYLON;
                                 }
                             }
                             if (floatArray) {
-                                texture.type = info.textureType;
                                 engine._uploadDataToTextureDirectly(texture, width, height, floatArray, face, i);
                             }
                         }
                         else if (info.isRGB) {
-                            texture.format = BABYLON.Engine.TEXTUREFORMAT_RGB;
+                            texture.type = BABYLON.Engine.TEXTURETYPE_UNSIGNED_INT;
                             if (bpp === 24) {
+                                texture.format = BABYLON.Engine.TEXTUREFORMAT_RGB;
                                 dataLength = width * height * 3;
                                 byteArray = DDSTools._GetRGBArrayBuffer(width, height, dataOffset, dataLength, arrayBuffer, rOffset, gOffset, bOffset);
                                 engine._uploadDataToTextureDirectly(texture, width, height, byteArray, face, i);
                             }
                             else { // 32
+                                texture.format = BABYLON.Engine.TEXTUREFORMAT_RGBA;
                                 dataLength = width * height * 4;
                                 byteArray = DDSTools._GetRGBAArrayBuffer(width, height, dataOffset, dataLength, arrayBuffer, rOffset, gOffset, bOffset, aOffset);
                                 engine._uploadDataToTextureDirectly(texture, width, height, byteArray, face, i);
@@ -88345,7 +88347,8 @@ var BABYLON;
                         else {
                             dataLength = Math.max(4, width) / 4 * Math.max(4, height) / 4 * blockBytes;
                             byteArray = new Uint8Array(arrayBuffer, dataOffset, dataLength);
-                            engine._uploadCompressedDataToTextureDirectly(texture, internalFormat, width, height, byteArray, face, i);
+                            texture.type = BABYLON.Engine.TEXTURETYPE_UNSIGNED_INT;
+                            engine._uploadCompressedDataToTextureDirectly(texture, internalCompressedFormat, width, height, byteArray, face, i);
                         }
                     }
                     dataOffset += bpp ? (width * height * (bpp / 8)) : dataLength;
@@ -89224,6 +89227,20 @@ var BABYLON;
         }
         return this._boundingBoxRenderer;
     };
+    Object.defineProperty(BABYLON.AbstractMesh.prototype, "showBoundingBox", {
+        get: function () {
+            return this._showBoundingBox || false;
+        },
+        set: function (value) {
+            this._showBoundingBox = value;
+            // Lazyly creates a BB renderer if needed.
+            if (value) {
+                this.getScene().getBoundingBoxRenderer();
+            }
+        },
+        enumerable: true,
+        configurable: true
+    });
     var BoundingBoxRenderer = /** @class */ (function () {
         function BoundingBoxRenderer(scene) {
             /**

+ 34 - 17
dist/preview release/babylon.no-module.max.js

@@ -19526,10 +19526,6 @@ var BABYLON;
              * Gets or sets a boolean indicating if the mesh can be picked (by scene.pick for instance or through actions). Default is true
              */
             _this.isPickable = true;
-            /**
-             * Gets or sets a boolean indicating if the bounding box must be rendered as well (false by default)
-             */
-            _this.showBoundingBox = false;
             /** Gets or sets a boolean indicating that bounding boxes of subMeshes must be rendered as well (false by default) */
             _this.showSubMeshesBoundingBox = false;
             /** Gets or sets a boolean indicating if the mesh must be considered as a ray blocker for lens flares (false by default)
@@ -73509,6 +73505,11 @@ var BABYLON;
         get: function () {
             if (!this._gamepadManager) {
                 this._gamepadManager = new BABYLON.GamepadManager(this);
+                var component = this._getComponent(BABYLON.SceneComponentConstants.NAME_GAMEPAD);
+                if (!component) {
+                    component = new GamepadSystemSceneComponent(this);
+                    this._addComponent(component);
+                }
             }
             return this._gamepadManager;
         },
@@ -88159,7 +88160,7 @@ var BABYLON;
             var header = new Int32Array(arrayBuffer, 0, headerLengthInt);
             var fourCC, width, height, dataLength = 0, dataOffset;
             var byteArray, mipmapCount, mip;
-            var internalFormat = 0;
+            var internalCompressedFormat = 0;
             var blockBytes = 1;
             if (header[off_magic] !== DDS_MAGIC) {
                 BABYLON.Tools.Error("Invalid magic number in DDS header");
@@ -88181,15 +88182,15 @@ var BABYLON;
                 switch (fourCC) {
                     case FOURCC_DXT1:
                         blockBytes = 8;
-                        internalFormat = ext.COMPRESSED_RGBA_S3TC_DXT1_EXT;
+                        internalCompressedFormat = ext.COMPRESSED_RGBA_S3TC_DXT1_EXT;
                         break;
                     case FOURCC_DXT3:
                         blockBytes = 16;
-                        internalFormat = ext.COMPRESSED_RGBA_S3TC_DXT3_EXT;
+                        internalCompressedFormat = ext.COMPRESSED_RGBA_S3TC_DXT3_EXT;
                         break;
                     case FOURCC_DXT5:
                         blockBytes = 16;
-                        internalFormat = ext.COMPRESSED_RGBA_S3TC_DXT5_EXT;
+                        internalCompressedFormat = ext.COMPRESSED_RGBA_S3TC_DXT5_EXT;
                         break;
                     case FOURCC_D3DFMT_R16G16B16A16F:
                         computeFormats = true;
@@ -88226,7 +88227,7 @@ var BABYLON;
             var bOffset = DDSTools._ExtractLongWordOrder(header[off_BMask]);
             var aOffset = DDSTools._ExtractLongWordOrder(header[off_AMask]);
             if (computeFormats) {
-                internalFormat = engine._getRGBABufferInternalSizedFormat(info.textureType);
+                internalCompressedFormat = engine._getRGBABufferInternalSizedFormat(info.textureType);
             }
             mipmapCount = 1;
             if (header[off_flags] & DDSD_MIPMAPCOUNT && loadMipmaps !== false) {
@@ -88239,8 +88240,8 @@ var BABYLON;
                     if (lodIndex === -1 || lodIndex === mip) {
                         // In case of fixed LOD, if the lod has just been uploaded, early exit.
                         var i = (lodIndex === -1) ? mip : 0;
-                        texture.format = BABYLON.Engine.TEXTUREFORMAT_RGBA;
                         if (!info.isCompressed && info.isFourCC) {
+                            texture.format = BABYLON.Engine.TEXTUREFORMAT_RGBA;
                             dataLength = width * height * 4;
                             var floatArray = null;
                             if (engine._badOS || engine._badDesktopOS || (!engine.getCaps().textureHalfFloat && !engine.getCaps().textureFloat)) { // Required because iOS has many issues with float and half float generation
@@ -88256,25 +88257,25 @@ var BABYLON;
                                         sphericalPolynomialFaces.push(DDSTools._GetHalfFloatAsFloatRGBAArrayBuffer(width, height, dataOffset, dataLength, arrayBuffer, i));
                                     }
                                 }
-                                info.textureType = BABYLON.Engine.TEXTURETYPE_UNSIGNED_INT;
-                                internalFormat = engine._getRGBABufferInternalSizedFormat(info.textureType);
+                                texture.type = BABYLON.Engine.TEXTURETYPE_UNSIGNED_INT;
                             }
                             else {
                                 if (bpp === 128) {
+                                    texture.type = BABYLON.Engine.TEXTURETYPE_FLOAT;
                                     floatArray = DDSTools._GetFloatRGBAArrayBuffer(width, height, dataOffset, dataLength, arrayBuffer, i);
                                     if (sphericalPolynomialFaces && i == 0) {
                                         sphericalPolynomialFaces.push(floatArray);
                                     }
                                 }
                                 else if (bpp === 64 && !engine.getCaps().textureHalfFloat) {
+                                    texture.type = BABYLON.Engine.TEXTURETYPE_FLOAT;
                                     floatArray = DDSTools._GetHalfFloatAsFloatRGBAArrayBuffer(width, height, dataOffset, dataLength, arrayBuffer, i);
                                     if (sphericalPolynomialFaces && i == 0) {
                                         sphericalPolynomialFaces.push(floatArray);
                                     }
-                                    info.textureType = BABYLON.Engine.TEXTURETYPE_FLOAT;
-                                    internalFormat = engine._getRGBABufferInternalSizedFormat(info.textureType);
                                 }
                                 else { // 64
+                                    texture.type = BABYLON.Engine.TEXTURETYPE_HALF_FLOAT;
                                     floatArray = DDSTools._GetHalfFloatRGBAArrayBuffer(width, height, dataOffset, dataLength, arrayBuffer, i);
                                     if (sphericalPolynomialFaces && i == 0) {
                                         sphericalPolynomialFaces.push(DDSTools._GetHalfFloatAsFloatRGBAArrayBuffer(width, height, dataOffset, dataLength, arrayBuffer, i));
@@ -88282,18 +88283,19 @@ var BABYLON;
                                 }
                             }
                             if (floatArray) {
-                                texture.type = info.textureType;
                                 engine._uploadDataToTextureDirectly(texture, width, height, floatArray, face, i);
                             }
                         }
                         else if (info.isRGB) {
-                            texture.format = BABYLON.Engine.TEXTUREFORMAT_RGB;
+                            texture.type = BABYLON.Engine.TEXTURETYPE_UNSIGNED_INT;
                             if (bpp === 24) {
+                                texture.format = BABYLON.Engine.TEXTUREFORMAT_RGB;
                                 dataLength = width * height * 3;
                                 byteArray = DDSTools._GetRGBArrayBuffer(width, height, dataOffset, dataLength, arrayBuffer, rOffset, gOffset, bOffset);
                                 engine._uploadDataToTextureDirectly(texture, width, height, byteArray, face, i);
                             }
                             else { // 32
+                                texture.format = BABYLON.Engine.TEXTUREFORMAT_RGBA;
                                 dataLength = width * height * 4;
                                 byteArray = DDSTools._GetRGBAArrayBuffer(width, height, dataOffset, dataLength, arrayBuffer, rOffset, gOffset, bOffset, aOffset);
                                 engine._uploadDataToTextureDirectly(texture, width, height, byteArray, face, i);
@@ -88312,7 +88314,8 @@ var BABYLON;
                         else {
                             dataLength = Math.max(4, width) / 4 * Math.max(4, height) / 4 * blockBytes;
                             byteArray = new Uint8Array(arrayBuffer, dataOffset, dataLength);
-                            engine._uploadCompressedDataToTextureDirectly(texture, internalFormat, width, height, byteArray, face, i);
+                            texture.type = BABYLON.Engine.TEXTURETYPE_UNSIGNED_INT;
+                            engine._uploadCompressedDataToTextureDirectly(texture, internalCompressedFormat, width, height, byteArray, face, i);
                         }
                     }
                     dataOffset += bpp ? (width * height * (bpp / 8)) : dataLength;
@@ -89191,6 +89194,20 @@ var BABYLON;
         }
         return this._boundingBoxRenderer;
     };
+    Object.defineProperty(BABYLON.AbstractMesh.prototype, "showBoundingBox", {
+        get: function () {
+            return this._showBoundingBox || false;
+        },
+        set: function (value) {
+            this._showBoundingBox = value;
+            // Lazyly creates a BB renderer if needed.
+            if (value) {
+                this.getScene().getBoundingBoxRenderer();
+            }
+        },
+        enumerable: true,
+        configurable: true
+    });
     var BoundingBoxRenderer = /** @class */ (function () {
         function BoundingBoxRenderer(scene) {
             /**

Fichier diff supprimé car celui-ci est trop grand
+ 20 - 20
dist/preview release/babylon.worker.js


+ 34 - 17
dist/preview release/es6.js

@@ -19526,10 +19526,6 @@ var BABYLON;
              * Gets or sets a boolean indicating if the mesh can be picked (by scene.pick for instance or through actions). Default is true
              */
             _this.isPickable = true;
-            /**
-             * Gets or sets a boolean indicating if the bounding box must be rendered as well (false by default)
-             */
-            _this.showBoundingBox = false;
             /** Gets or sets a boolean indicating that bounding boxes of subMeshes must be rendered as well (false by default) */
             _this.showSubMeshesBoundingBox = false;
             /** Gets or sets a boolean indicating if the mesh must be considered as a ray blocker for lens flares (false by default)
@@ -73509,6 +73505,11 @@ var BABYLON;
         get: function () {
             if (!this._gamepadManager) {
                 this._gamepadManager = new BABYLON.GamepadManager(this);
+                var component = this._getComponent(BABYLON.SceneComponentConstants.NAME_GAMEPAD);
+                if (!component) {
+                    component = new GamepadSystemSceneComponent(this);
+                    this._addComponent(component);
+                }
             }
             return this._gamepadManager;
         },
@@ -88159,7 +88160,7 @@ var BABYLON;
             var header = new Int32Array(arrayBuffer, 0, headerLengthInt);
             var fourCC, width, height, dataLength = 0, dataOffset;
             var byteArray, mipmapCount, mip;
-            var internalFormat = 0;
+            var internalCompressedFormat = 0;
             var blockBytes = 1;
             if (header[off_magic] !== DDS_MAGIC) {
                 BABYLON.Tools.Error("Invalid magic number in DDS header");
@@ -88181,15 +88182,15 @@ var BABYLON;
                 switch (fourCC) {
                     case FOURCC_DXT1:
                         blockBytes = 8;
-                        internalFormat = ext.COMPRESSED_RGBA_S3TC_DXT1_EXT;
+                        internalCompressedFormat = ext.COMPRESSED_RGBA_S3TC_DXT1_EXT;
                         break;
                     case FOURCC_DXT3:
                         blockBytes = 16;
-                        internalFormat = ext.COMPRESSED_RGBA_S3TC_DXT3_EXT;
+                        internalCompressedFormat = ext.COMPRESSED_RGBA_S3TC_DXT3_EXT;
                         break;
                     case FOURCC_DXT5:
                         blockBytes = 16;
-                        internalFormat = ext.COMPRESSED_RGBA_S3TC_DXT5_EXT;
+                        internalCompressedFormat = ext.COMPRESSED_RGBA_S3TC_DXT5_EXT;
                         break;
                     case FOURCC_D3DFMT_R16G16B16A16F:
                         computeFormats = true;
@@ -88226,7 +88227,7 @@ var BABYLON;
             var bOffset = DDSTools._ExtractLongWordOrder(header[off_BMask]);
             var aOffset = DDSTools._ExtractLongWordOrder(header[off_AMask]);
             if (computeFormats) {
-                internalFormat = engine._getRGBABufferInternalSizedFormat(info.textureType);
+                internalCompressedFormat = engine._getRGBABufferInternalSizedFormat(info.textureType);
             }
             mipmapCount = 1;
             if (header[off_flags] & DDSD_MIPMAPCOUNT && loadMipmaps !== false) {
@@ -88239,8 +88240,8 @@ var BABYLON;
                     if (lodIndex === -1 || lodIndex === mip) {
                         // In case of fixed LOD, if the lod has just been uploaded, early exit.
                         var i = (lodIndex === -1) ? mip : 0;
-                        texture.format = BABYLON.Engine.TEXTUREFORMAT_RGBA;
                         if (!info.isCompressed && info.isFourCC) {
+                            texture.format = BABYLON.Engine.TEXTUREFORMAT_RGBA;
                             dataLength = width * height * 4;
                             var floatArray = null;
                             if (engine._badOS || engine._badDesktopOS || (!engine.getCaps().textureHalfFloat && !engine.getCaps().textureFloat)) { // Required because iOS has many issues with float and half float generation
@@ -88256,25 +88257,25 @@ var BABYLON;
                                         sphericalPolynomialFaces.push(DDSTools._GetHalfFloatAsFloatRGBAArrayBuffer(width, height, dataOffset, dataLength, arrayBuffer, i));
                                     }
                                 }
-                                info.textureType = BABYLON.Engine.TEXTURETYPE_UNSIGNED_INT;
-                                internalFormat = engine._getRGBABufferInternalSizedFormat(info.textureType);
+                                texture.type = BABYLON.Engine.TEXTURETYPE_UNSIGNED_INT;
                             }
                             else {
                                 if (bpp === 128) {
+                                    texture.type = BABYLON.Engine.TEXTURETYPE_FLOAT;
                                     floatArray = DDSTools._GetFloatRGBAArrayBuffer(width, height, dataOffset, dataLength, arrayBuffer, i);
                                     if (sphericalPolynomialFaces && i == 0) {
                                         sphericalPolynomialFaces.push(floatArray);
                                     }
                                 }
                                 else if (bpp === 64 && !engine.getCaps().textureHalfFloat) {
+                                    texture.type = BABYLON.Engine.TEXTURETYPE_FLOAT;
                                     floatArray = DDSTools._GetHalfFloatAsFloatRGBAArrayBuffer(width, height, dataOffset, dataLength, arrayBuffer, i);
                                     if (sphericalPolynomialFaces && i == 0) {
                                         sphericalPolynomialFaces.push(floatArray);
                                     }
-                                    info.textureType = BABYLON.Engine.TEXTURETYPE_FLOAT;
-                                    internalFormat = engine._getRGBABufferInternalSizedFormat(info.textureType);
                                 }
                                 else { // 64
+                                    texture.type = BABYLON.Engine.TEXTURETYPE_HALF_FLOAT;
                                     floatArray = DDSTools._GetHalfFloatRGBAArrayBuffer(width, height, dataOffset, dataLength, arrayBuffer, i);
                                     if (sphericalPolynomialFaces && i == 0) {
                                         sphericalPolynomialFaces.push(DDSTools._GetHalfFloatAsFloatRGBAArrayBuffer(width, height, dataOffset, dataLength, arrayBuffer, i));
@@ -88282,18 +88283,19 @@ var BABYLON;
                                 }
                             }
                             if (floatArray) {
-                                texture.type = info.textureType;
                                 engine._uploadDataToTextureDirectly(texture, width, height, floatArray, face, i);
                             }
                         }
                         else if (info.isRGB) {
-                            texture.format = BABYLON.Engine.TEXTUREFORMAT_RGB;
+                            texture.type = BABYLON.Engine.TEXTURETYPE_UNSIGNED_INT;
                             if (bpp === 24) {
+                                texture.format = BABYLON.Engine.TEXTUREFORMAT_RGB;
                                 dataLength = width * height * 3;
                                 byteArray = DDSTools._GetRGBArrayBuffer(width, height, dataOffset, dataLength, arrayBuffer, rOffset, gOffset, bOffset);
                                 engine._uploadDataToTextureDirectly(texture, width, height, byteArray, face, i);
                             }
                             else { // 32
+                                texture.format = BABYLON.Engine.TEXTUREFORMAT_RGBA;
                                 dataLength = width * height * 4;
                                 byteArray = DDSTools._GetRGBAArrayBuffer(width, height, dataOffset, dataLength, arrayBuffer, rOffset, gOffset, bOffset, aOffset);
                                 engine._uploadDataToTextureDirectly(texture, width, height, byteArray, face, i);
@@ -88312,7 +88314,8 @@ var BABYLON;
                         else {
                             dataLength = Math.max(4, width) / 4 * Math.max(4, height) / 4 * blockBytes;
                             byteArray = new Uint8Array(arrayBuffer, dataOffset, dataLength);
-                            engine._uploadCompressedDataToTextureDirectly(texture, internalFormat, width, height, byteArray, face, i);
+                            texture.type = BABYLON.Engine.TEXTURETYPE_UNSIGNED_INT;
+                            engine._uploadCompressedDataToTextureDirectly(texture, internalCompressedFormat, width, height, byteArray, face, i);
                         }
                     }
                     dataOffset += bpp ? (width * height * (bpp / 8)) : dataLength;
@@ -89191,6 +89194,20 @@ var BABYLON;
         }
         return this._boundingBoxRenderer;
     };
+    Object.defineProperty(BABYLON.AbstractMesh.prototype, "showBoundingBox", {
+        get: function () {
+            return this._showBoundingBox || false;
+        },
+        set: function (value) {
+            this._showBoundingBox = value;
+            // Lazyly creates a BB renderer if needed.
+            if (value) {
+                this.getScene().getBoundingBoxRenderer();
+            }
+        },
+        enumerable: true,
+        configurable: true
+    });
     var BoundingBoxRenderer = /** @class */ (function () {
         function BoundingBoxRenderer(scene) {
             /**

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

@@ -5344,7 +5344,7 @@ var INSPECTOR;
         function BoundingBox(obj) {
             var _this = _super.call(this) || this;
             _this._obj = obj;
-            _this._elem.classList.add('fa-square-o');
+            _this._elem.classList.add('fa-cube');
             _this._on = _this._obj.isBoxVisible();
             _this._check();
             return _this;

Fichier diff supprimé car celui-ci est trop grand
+ 1 - 1
dist/preview release/inspector/babylon.inspector.min.js


+ 11 - 2
dist/preview release/typedocValidationBaseline.json

@@ -1,7 +1,16 @@
 {
-  "errors": 4224,
+  "errors": 4225,
   "babylon.typedoc.json": {
-    "errors": 4224,
+    "errors": 4225,
+    "AbstractMesh": {
+      "Property": {
+        "showBoundingBox": {
+          "Naming": {
+            "NotPascalCase": true
+          }
+        }
+      }
+    },
     "AbstractScene": {
       "Property": {
         "effectLayers": {

Fichier diff supprimé car celui-ci est trop grand
+ 18 - 18
dist/preview release/viewer/babylon.viewer.js


+ 34 - 17
dist/preview release/viewer/babylon.viewer.max.js

@@ -19647,10 +19647,6 @@ var BABYLON;
              * Gets or sets a boolean indicating if the mesh can be picked (by scene.pick for instance or through actions). Default is true
              */
             _this.isPickable = true;
-            /**
-             * Gets or sets a boolean indicating if the bounding box must be rendered as well (false by default)
-             */
-            _this.showBoundingBox = false;
             /** Gets or sets a boolean indicating that bounding boxes of subMeshes must be rendered as well (false by default) */
             _this.showSubMeshesBoundingBox = false;
             /** Gets or sets a boolean indicating if the mesh must be considered as a ray blocker for lens flares (false by default)
@@ -73630,6 +73626,11 @@ var BABYLON;
         get: function () {
             if (!this._gamepadManager) {
                 this._gamepadManager = new BABYLON.GamepadManager(this);
+                var component = this._getComponent(BABYLON.SceneComponentConstants.NAME_GAMEPAD);
+                if (!component) {
+                    component = new GamepadSystemSceneComponent(this);
+                    this._addComponent(component);
+                }
             }
             return this._gamepadManager;
         },
@@ -88280,7 +88281,7 @@ var BABYLON;
             var header = new Int32Array(arrayBuffer, 0, headerLengthInt);
             var fourCC, width, height, dataLength = 0, dataOffset;
             var byteArray, mipmapCount, mip;
-            var internalFormat = 0;
+            var internalCompressedFormat = 0;
             var blockBytes = 1;
             if (header[off_magic] !== DDS_MAGIC) {
                 BABYLON.Tools.Error("Invalid magic number in DDS header");
@@ -88302,15 +88303,15 @@ var BABYLON;
                 switch (fourCC) {
                     case FOURCC_DXT1:
                         blockBytes = 8;
-                        internalFormat = ext.COMPRESSED_RGBA_S3TC_DXT1_EXT;
+                        internalCompressedFormat = ext.COMPRESSED_RGBA_S3TC_DXT1_EXT;
                         break;
                     case FOURCC_DXT3:
                         blockBytes = 16;
-                        internalFormat = ext.COMPRESSED_RGBA_S3TC_DXT3_EXT;
+                        internalCompressedFormat = ext.COMPRESSED_RGBA_S3TC_DXT3_EXT;
                         break;
                     case FOURCC_DXT5:
                         blockBytes = 16;
-                        internalFormat = ext.COMPRESSED_RGBA_S3TC_DXT5_EXT;
+                        internalCompressedFormat = ext.COMPRESSED_RGBA_S3TC_DXT5_EXT;
                         break;
                     case FOURCC_D3DFMT_R16G16B16A16F:
                         computeFormats = true;
@@ -88347,7 +88348,7 @@ var BABYLON;
             var bOffset = DDSTools._ExtractLongWordOrder(header[off_BMask]);
             var aOffset = DDSTools._ExtractLongWordOrder(header[off_AMask]);
             if (computeFormats) {
-                internalFormat = engine._getRGBABufferInternalSizedFormat(info.textureType);
+                internalCompressedFormat = engine._getRGBABufferInternalSizedFormat(info.textureType);
             }
             mipmapCount = 1;
             if (header[off_flags] & DDSD_MIPMAPCOUNT && loadMipmaps !== false) {
@@ -88360,8 +88361,8 @@ var BABYLON;
                     if (lodIndex === -1 || lodIndex === mip) {
                         // In case of fixed LOD, if the lod has just been uploaded, early exit.
                         var i = (lodIndex === -1) ? mip : 0;
-                        texture.format = BABYLON.Engine.TEXTUREFORMAT_RGBA;
                         if (!info.isCompressed && info.isFourCC) {
+                            texture.format = BABYLON.Engine.TEXTUREFORMAT_RGBA;
                             dataLength = width * height * 4;
                             var floatArray = null;
                             if (engine._badOS || engine._badDesktopOS || (!engine.getCaps().textureHalfFloat && !engine.getCaps().textureFloat)) { // Required because iOS has many issues with float and half float generation
@@ -88377,25 +88378,25 @@ var BABYLON;
                                         sphericalPolynomialFaces.push(DDSTools._GetHalfFloatAsFloatRGBAArrayBuffer(width, height, dataOffset, dataLength, arrayBuffer, i));
                                     }
                                 }
-                                info.textureType = BABYLON.Engine.TEXTURETYPE_UNSIGNED_INT;
-                                internalFormat = engine._getRGBABufferInternalSizedFormat(info.textureType);
+                                texture.type = BABYLON.Engine.TEXTURETYPE_UNSIGNED_INT;
                             }
                             else {
                                 if (bpp === 128) {
+                                    texture.type = BABYLON.Engine.TEXTURETYPE_FLOAT;
                                     floatArray = DDSTools._GetFloatRGBAArrayBuffer(width, height, dataOffset, dataLength, arrayBuffer, i);
                                     if (sphericalPolynomialFaces && i == 0) {
                                         sphericalPolynomialFaces.push(floatArray);
                                     }
                                 }
                                 else if (bpp === 64 && !engine.getCaps().textureHalfFloat) {
+                                    texture.type = BABYLON.Engine.TEXTURETYPE_FLOAT;
                                     floatArray = DDSTools._GetHalfFloatAsFloatRGBAArrayBuffer(width, height, dataOffset, dataLength, arrayBuffer, i);
                                     if (sphericalPolynomialFaces && i == 0) {
                                         sphericalPolynomialFaces.push(floatArray);
                                     }
-                                    info.textureType = BABYLON.Engine.TEXTURETYPE_FLOAT;
-                                    internalFormat = engine._getRGBABufferInternalSizedFormat(info.textureType);
                                 }
                                 else { // 64
+                                    texture.type = BABYLON.Engine.TEXTURETYPE_HALF_FLOAT;
                                     floatArray = DDSTools._GetHalfFloatRGBAArrayBuffer(width, height, dataOffset, dataLength, arrayBuffer, i);
                                     if (sphericalPolynomialFaces && i == 0) {
                                         sphericalPolynomialFaces.push(DDSTools._GetHalfFloatAsFloatRGBAArrayBuffer(width, height, dataOffset, dataLength, arrayBuffer, i));
@@ -88403,18 +88404,19 @@ var BABYLON;
                                 }
                             }
                             if (floatArray) {
-                                texture.type = info.textureType;
                                 engine._uploadDataToTextureDirectly(texture, width, height, floatArray, face, i);
                             }
                         }
                         else if (info.isRGB) {
-                            texture.format = BABYLON.Engine.TEXTUREFORMAT_RGB;
+                            texture.type = BABYLON.Engine.TEXTURETYPE_UNSIGNED_INT;
                             if (bpp === 24) {
+                                texture.format = BABYLON.Engine.TEXTUREFORMAT_RGB;
                                 dataLength = width * height * 3;
                                 byteArray = DDSTools._GetRGBArrayBuffer(width, height, dataOffset, dataLength, arrayBuffer, rOffset, gOffset, bOffset);
                                 engine._uploadDataToTextureDirectly(texture, width, height, byteArray, face, i);
                             }
                             else { // 32
+                                texture.format = BABYLON.Engine.TEXTUREFORMAT_RGBA;
                                 dataLength = width * height * 4;
                                 byteArray = DDSTools._GetRGBAArrayBuffer(width, height, dataOffset, dataLength, arrayBuffer, rOffset, gOffset, bOffset, aOffset);
                                 engine._uploadDataToTextureDirectly(texture, width, height, byteArray, face, i);
@@ -88433,7 +88435,8 @@ var BABYLON;
                         else {
                             dataLength = Math.max(4, width) / 4 * Math.max(4, height) / 4 * blockBytes;
                             byteArray = new Uint8Array(arrayBuffer, dataOffset, dataLength);
-                            engine._uploadCompressedDataToTextureDirectly(texture, internalFormat, width, height, byteArray, face, i);
+                            texture.type = BABYLON.Engine.TEXTURETYPE_UNSIGNED_INT;
+                            engine._uploadCompressedDataToTextureDirectly(texture, internalCompressedFormat, width, height, byteArray, face, i);
                         }
                     }
                     dataOffset += bpp ? (width * height * (bpp / 8)) : dataLength;
@@ -89312,6 +89315,20 @@ var BABYLON;
         }
         return this._boundingBoxRenderer;
     };
+    Object.defineProperty(BABYLON.AbstractMesh.prototype, "showBoundingBox", {
+        get: function () {
+            return this._showBoundingBox || false;
+        },
+        set: function (value) {
+            this._showBoundingBox = value;
+            // Lazyly creates a BB renderer if needed.
+            if (value) {
+                this.getScene().getBoundingBoxRenderer();
+            }
+        },
+        enumerable: true,
+        configurable: true
+    });
     var BoundingBoxRenderer = /** @class */ (function () {
         function BoundingBoxRenderer(scene) {
             /**

+ 1 - 1
inspector/src/treetools/BoundingBox.ts

@@ -17,7 +17,7 @@ module INSPECTOR{
         constructor(obj:IToolBoundingBox) {
             super (); 
             this._obj = obj;
-            this._elem.classList.add('fa-square-o');
+            this._elem.classList.add('fa-cube');
             this._on = this._obj.isBoxVisible();
             this._check();
         }

+ 0 - 5
src/Mesh/babylon.abstractMesh.ts

@@ -269,11 +269,6 @@
          */
         public isPickable = true;
 
-        /**
-         * Gets or sets a boolean indicating if the bounding box must be rendered as well (false by default)
-         */
-        public showBoundingBox = false;
-
         /** Gets or sets a boolean indicating that bounding boxes of subMeshes must be rendered as well (false by default) */
         public showSubMeshesBoundingBox = false;
 

+ 25 - 0
src/Rendering/babylon.boundingBoxRenderer.ts

@@ -42,6 +42,31 @@
         return this._boundingBoxRenderer;
     }
 
+    export interface AbstractMesh {
+        /** @hidden (Backing field) */
+        _showBoundingBox: boolean;
+
+        /**
+         * Gets or sets a boolean indicating if the bounding box must be rendered as well (false by default)
+         */
+        showBoundingBox: boolean;
+    }
+
+    Object.defineProperty(AbstractMesh.prototype, "showBoundingBox", {
+        get: function (this: AbstractMesh) {
+            return this._showBoundingBox || false;
+        },
+        set: function (this: AbstractMesh, value: boolean) {
+            this._showBoundingBox = value;
+            // Lazyly creates a BB renderer if needed.
+            if (value) {
+                this.getScene().getBoundingBoxRenderer();
+            }
+        },
+        enumerable: true,
+        configurable: true
+    });
+
     export class BoundingBoxRenderer implements ISceneComponent {
         /**
          * The component name helpfull to identify the component in the list of scene components.