David Catuhe пре 7 година
родитељ
комит
2358937fe0

Разлика између датотеке није приказан због своје велике величине
+ 6907 - 6867
Playground/babylon.d.txt


Разлика између датотеке није приказан због своје велике величине
+ 6967 - 6927
dist/preview release/babylon.d.ts


Разлика између датотеке није приказан због своје велике величине
+ 17 - 17
dist/preview release/babylon.js


+ 64 - 11
dist/preview release/babylon.max.js

@@ -11210,6 +11210,10 @@ var BABYLON;
              **/
             this.enableOfflineSupport = false;
             /**
+             * Gets or sets a boolean to enable/disable checking manifest if IndexedDB support is enabled (Babylon.js will always consider the database is up to date)
+             **/
+            this.disableManifestCheck = false;
+            /**
              * Gets the list of created scenes
              */
             this.scenes = new Array();
@@ -67194,7 +67198,8 @@ var BABYLON;
                 return plugin;
             }
             if (rootUrl.indexOf("file:") === -1) {
-                var canUseOfflineSupport = scene.getEngine().enableOfflineSupport;
+                var engine = scene.getEngine();
+                var canUseOfflineSupport = engine.enableOfflineSupport;
                 if (canUseOfflineSupport) {
                     // Also check for exceptions
                     var exceptionFound = false;
@@ -67209,7 +67214,7 @@ var BABYLON;
                 }
                 if (canUseOfflineSupport) {
                     // Checking if a manifest file has been set for this scene and if offline mode has been requested
-                    database = new BABYLON.Database(rootUrl + sceneFilename, manifestChecked);
+                    database = new BABYLON.Database(rootUrl + sceneFilename, manifestChecked, engine.disableManifestCheck);
                 }
                 else {
                     manifestChecked();
@@ -68903,12 +68908,24 @@ var BABYLON;
 
 var BABYLON;
 (function (BABYLON) {
+    /**
+     * Class used to enable access to IndexedDB
+     * @see @https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API
+     */
     var Database = /** @class */ (function () {
-        function Database(urlToScene, callbackManifestChecked) {
+        /**
+         * Creates a new Database
+         * @param urlToScene defines the url to load the scene
+         * @param callbackManifestChecked defines the callback to use when manifest is checked
+         * @param disableManifestCheck defines a boolean indicating that we want to skip the manifest validation (it will be considered validated and up to date)
+         */
+        function Database(urlToScene, callbackManifestChecked, disableManifestCheck) {
+            if (disableManifestCheck === void 0) { disableManifestCheck = false; }
+            var _this = this;
             // Handling various flavors of prefixed version of IndexedDB
             this.idbFactory = (window.indexedDB || window.mozIndexedDB || window.webkitIndexedDB || window.msIndexedDB);
             this.callbackManifestChecked = callbackManifestChecked;
-            this.currentSceneUrl = Database.ReturnFullUrlLocation(urlToScene);
+            this.currentSceneUrl = Database._ReturnFullUrlLocation(urlToScene);
             this.db = null;
             this._enableSceneOffline = false;
             this._enableTexturesOffline = false;
@@ -68919,10 +68936,23 @@ var BABYLON;
                 this.callbackManifestChecked(true);
             }
             else {
-                this.checkManifestFile();
+                if (disableManifestCheck) {
+                    this._enableSceneOffline = true;
+                    this._enableTexturesOffline = true;
+                    this.manifestVersionFound = 1;
+                    BABYLON.Tools.SetImmediate(function () {
+                        _this.callbackManifestChecked(true);
+                    });
+                }
+                else {
+                    this._checkManifestFile();
+                }
             }
         }
         Object.defineProperty(Database.prototype, "enableSceneOffline", {
+            /**
+             * Gets a boolean indicating if scene must be saved in the database
+             */
             get: function () {
                 return this._enableSceneOffline;
             },
@@ -68930,13 +68960,16 @@ var BABYLON;
             configurable: true
         });
         Object.defineProperty(Database.prototype, "enableTexturesOffline", {
+            /**
+             * Gets a boolean indicating if textures must be saved in the database
+             */
             get: function () {
                 return this._enableTexturesOffline;
             },
             enumerable: true,
             configurable: true
         });
-        Database.prototype.checkManifestFile = function () {
+        Database.prototype._checkManifestFile = function () {
             var _this = this;
             var noManifestFile = function () {
                 _this._enableSceneOffline = false;
@@ -68994,6 +69027,11 @@ var BABYLON;
                 this.callbackManifestChecked(false);
             }
         };
+        /**
+         * Open the database and make it available
+         * @param successCallback defines the callback to call on success
+         * @param errorCallback defines the callback to call on error
+         */
         Database.prototype.openAsync = function (successCallback, errorCallback) {
             var _this = this;
             var handleError = function () {
@@ -69050,9 +69088,14 @@ var BABYLON;
                 }
             }
         };
+        /**
+         * Loads an image from the database
+         * @param url defines the url to load from
+         * @param image defines the target DOM image
+         */
         Database.prototype.loadImageFromDB = function (url, image) {
             var _this = this;
-            var completeURL = Database.ReturnFullUrlLocation(url);
+            var completeURL = Database._ReturnFullUrlLocation(url);
             var saveAndLoadImage = function () {
                 if (!_this.hasReachedQuota && _this.db !== null) {
                     // the texture is not yet in the DB, let's try to save it
@@ -69281,9 +69324,17 @@ var BABYLON;
                 callback(-1);
             }
         };
+        /**
+         * Loads a file from database
+         * @param url defines the URL to load from
+         * @param sceneLoaded defines a callback to call on success
+         * @param progressCallBack defines a callback to call when progress changed
+         * @param errorCallback defines a callback to call on error
+         * @param useArrayBuffer defines a boolean to use array buffer instead of text string
+         */
         Database.prototype.loadFileFromDB = function (url, sceneLoaded, progressCallBack, errorCallback, useArrayBuffer) {
             var _this = this;
-            var completeUrl = Database.ReturnFullUrlLocation(url);
+            var completeUrl = Database._ReturnFullUrlLocation(url);
             var saveAndLoadFile = function () {
                 // the scene is not yet in the DB, let's try to save it
                 _this._saveFileIntoDBAsync(completeUrl, sceneLoaded, progressCallBack);
@@ -69423,9 +69474,11 @@ var BABYLON;
                 callback();
             }
         };
+        /** Gets a boolean indicating if the user agent supports blob storage (this value will be updated after creating the first Database object) */
         Database.IsUASupportingBlobStorage = true;
+        /** Gets a boolean indicating if Database storate is enabled */
         Database.IDBStorageEnabled = true;
-        Database.parseURL = function (url) {
+        Database._ParseURL = function (url) {
             var a = document.createElement('a');
             a.href = url;
             var urlWithoutHash = url.substring(0, url.lastIndexOf("#"));
@@ -69433,9 +69486,9 @@ var BABYLON;
             var absLocation = url.substring(0, url.indexOf(fileName, 0));
             return absLocation;
         };
-        Database.ReturnFullUrlLocation = function (url) {
+        Database._ReturnFullUrlLocation = function (url) {
             if (url.indexOf("http:/") === -1 && url.indexOf("https:/") === -1) {
-                return (Database.parseURL(window.location.href) + url);
+                return (Database._ParseURL(window.location.href) + url);
             }
             else {
                 return url;

+ 64 - 11
dist/preview release/babylon.no-module.max.js

@@ -11177,6 +11177,10 @@ var BABYLON;
              **/
             this.enableOfflineSupport = false;
             /**
+             * Gets or sets a boolean to enable/disable checking manifest if IndexedDB support is enabled (Babylon.js will always consider the database is up to date)
+             **/
+            this.disableManifestCheck = false;
+            /**
              * Gets the list of created scenes
              */
             this.scenes = new Array();
@@ -67161,7 +67165,8 @@ var BABYLON;
                 return plugin;
             }
             if (rootUrl.indexOf("file:") === -1) {
-                var canUseOfflineSupport = scene.getEngine().enableOfflineSupport;
+                var engine = scene.getEngine();
+                var canUseOfflineSupport = engine.enableOfflineSupport;
                 if (canUseOfflineSupport) {
                     // Also check for exceptions
                     var exceptionFound = false;
@@ -67176,7 +67181,7 @@ var BABYLON;
                 }
                 if (canUseOfflineSupport) {
                     // Checking if a manifest file has been set for this scene and if offline mode has been requested
-                    database = new BABYLON.Database(rootUrl + sceneFilename, manifestChecked);
+                    database = new BABYLON.Database(rootUrl + sceneFilename, manifestChecked, engine.disableManifestCheck);
                 }
                 else {
                     manifestChecked();
@@ -68870,12 +68875,24 @@ var BABYLON;
 
 var BABYLON;
 (function (BABYLON) {
+    /**
+     * Class used to enable access to IndexedDB
+     * @see @https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API
+     */
     var Database = /** @class */ (function () {
-        function Database(urlToScene, callbackManifestChecked) {
+        /**
+         * Creates a new Database
+         * @param urlToScene defines the url to load the scene
+         * @param callbackManifestChecked defines the callback to use when manifest is checked
+         * @param disableManifestCheck defines a boolean indicating that we want to skip the manifest validation (it will be considered validated and up to date)
+         */
+        function Database(urlToScene, callbackManifestChecked, disableManifestCheck) {
+            if (disableManifestCheck === void 0) { disableManifestCheck = false; }
+            var _this = this;
             // Handling various flavors of prefixed version of IndexedDB
             this.idbFactory = (window.indexedDB || window.mozIndexedDB || window.webkitIndexedDB || window.msIndexedDB);
             this.callbackManifestChecked = callbackManifestChecked;
-            this.currentSceneUrl = Database.ReturnFullUrlLocation(urlToScene);
+            this.currentSceneUrl = Database._ReturnFullUrlLocation(urlToScene);
             this.db = null;
             this._enableSceneOffline = false;
             this._enableTexturesOffline = false;
@@ -68886,10 +68903,23 @@ var BABYLON;
                 this.callbackManifestChecked(true);
             }
             else {
-                this.checkManifestFile();
+                if (disableManifestCheck) {
+                    this._enableSceneOffline = true;
+                    this._enableTexturesOffline = true;
+                    this.manifestVersionFound = 1;
+                    BABYLON.Tools.SetImmediate(function () {
+                        _this.callbackManifestChecked(true);
+                    });
+                }
+                else {
+                    this._checkManifestFile();
+                }
             }
         }
         Object.defineProperty(Database.prototype, "enableSceneOffline", {
+            /**
+             * Gets a boolean indicating if scene must be saved in the database
+             */
             get: function () {
                 return this._enableSceneOffline;
             },
@@ -68897,13 +68927,16 @@ var BABYLON;
             configurable: true
         });
         Object.defineProperty(Database.prototype, "enableTexturesOffline", {
+            /**
+             * Gets a boolean indicating if textures must be saved in the database
+             */
             get: function () {
                 return this._enableTexturesOffline;
             },
             enumerable: true,
             configurable: true
         });
-        Database.prototype.checkManifestFile = function () {
+        Database.prototype._checkManifestFile = function () {
             var _this = this;
             var noManifestFile = function () {
                 _this._enableSceneOffline = false;
@@ -68961,6 +68994,11 @@ var BABYLON;
                 this.callbackManifestChecked(false);
             }
         };
+        /**
+         * Open the database and make it available
+         * @param successCallback defines the callback to call on success
+         * @param errorCallback defines the callback to call on error
+         */
         Database.prototype.openAsync = function (successCallback, errorCallback) {
             var _this = this;
             var handleError = function () {
@@ -69017,9 +69055,14 @@ var BABYLON;
                 }
             }
         };
+        /**
+         * Loads an image from the database
+         * @param url defines the url to load from
+         * @param image defines the target DOM image
+         */
         Database.prototype.loadImageFromDB = function (url, image) {
             var _this = this;
-            var completeURL = Database.ReturnFullUrlLocation(url);
+            var completeURL = Database._ReturnFullUrlLocation(url);
             var saveAndLoadImage = function () {
                 if (!_this.hasReachedQuota && _this.db !== null) {
                     // the texture is not yet in the DB, let's try to save it
@@ -69248,9 +69291,17 @@ var BABYLON;
                 callback(-1);
             }
         };
+        /**
+         * Loads a file from database
+         * @param url defines the URL to load from
+         * @param sceneLoaded defines a callback to call on success
+         * @param progressCallBack defines a callback to call when progress changed
+         * @param errorCallback defines a callback to call on error
+         * @param useArrayBuffer defines a boolean to use array buffer instead of text string
+         */
         Database.prototype.loadFileFromDB = function (url, sceneLoaded, progressCallBack, errorCallback, useArrayBuffer) {
             var _this = this;
-            var completeUrl = Database.ReturnFullUrlLocation(url);
+            var completeUrl = Database._ReturnFullUrlLocation(url);
             var saveAndLoadFile = function () {
                 // the scene is not yet in the DB, let's try to save it
                 _this._saveFileIntoDBAsync(completeUrl, sceneLoaded, progressCallBack);
@@ -69390,9 +69441,11 @@ var BABYLON;
                 callback();
             }
         };
+        /** Gets a boolean indicating if the user agent supports blob storage (this value will be updated after creating the first Database object) */
         Database.IsUASupportingBlobStorage = true;
+        /** Gets a boolean indicating if Database storate is enabled */
         Database.IDBStorageEnabled = true;
-        Database.parseURL = function (url) {
+        Database._ParseURL = function (url) {
             var a = document.createElement('a');
             a.href = url;
             var urlWithoutHash = url.substring(0, url.lastIndexOf("#"));
@@ -69400,9 +69453,9 @@ var BABYLON;
             var absLocation = url.substring(0, url.indexOf(fileName, 0));
             return absLocation;
         };
-        Database.ReturnFullUrlLocation = function (url) {
+        Database._ReturnFullUrlLocation = function (url) {
             if (url.indexOf("http:/") === -1 && url.indexOf("https:/") === -1) {
-                return (Database.parseURL(window.location.href) + url);
+                return (Database._ParseURL(window.location.href) + url);
             }
             else {
                 return url;

Разлика између датотеке није приказан због своје велике величине
+ 17 - 17
dist/preview release/babylon.worker.js


+ 64 - 11
dist/preview release/es6.js

@@ -11177,6 +11177,10 @@ var BABYLON;
              **/
             this.enableOfflineSupport = false;
             /**
+             * Gets or sets a boolean to enable/disable checking manifest if IndexedDB support is enabled (Babylon.js will always consider the database is up to date)
+             **/
+            this.disableManifestCheck = false;
+            /**
              * Gets the list of created scenes
              */
             this.scenes = new Array();
@@ -67161,7 +67165,8 @@ var BABYLON;
                 return plugin;
             }
             if (rootUrl.indexOf("file:") === -1) {
-                var canUseOfflineSupport = scene.getEngine().enableOfflineSupport;
+                var engine = scene.getEngine();
+                var canUseOfflineSupport = engine.enableOfflineSupport;
                 if (canUseOfflineSupport) {
                     // Also check for exceptions
                     var exceptionFound = false;
@@ -67176,7 +67181,7 @@ var BABYLON;
                 }
                 if (canUseOfflineSupport) {
                     // Checking if a manifest file has been set for this scene and if offline mode has been requested
-                    database = new BABYLON.Database(rootUrl + sceneFilename, manifestChecked);
+                    database = new BABYLON.Database(rootUrl + sceneFilename, manifestChecked, engine.disableManifestCheck);
                 }
                 else {
                     manifestChecked();
@@ -68870,12 +68875,24 @@ var BABYLON;
 
 var BABYLON;
 (function (BABYLON) {
+    /**
+     * Class used to enable access to IndexedDB
+     * @see @https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API
+     */
     var Database = /** @class */ (function () {
-        function Database(urlToScene, callbackManifestChecked) {
+        /**
+         * Creates a new Database
+         * @param urlToScene defines the url to load the scene
+         * @param callbackManifestChecked defines the callback to use when manifest is checked
+         * @param disableManifestCheck defines a boolean indicating that we want to skip the manifest validation (it will be considered validated and up to date)
+         */
+        function Database(urlToScene, callbackManifestChecked, disableManifestCheck) {
+            if (disableManifestCheck === void 0) { disableManifestCheck = false; }
+            var _this = this;
             // Handling various flavors of prefixed version of IndexedDB
             this.idbFactory = (window.indexedDB || window.mozIndexedDB || window.webkitIndexedDB || window.msIndexedDB);
             this.callbackManifestChecked = callbackManifestChecked;
-            this.currentSceneUrl = Database.ReturnFullUrlLocation(urlToScene);
+            this.currentSceneUrl = Database._ReturnFullUrlLocation(urlToScene);
             this.db = null;
             this._enableSceneOffline = false;
             this._enableTexturesOffline = false;
@@ -68886,10 +68903,23 @@ var BABYLON;
                 this.callbackManifestChecked(true);
             }
             else {
-                this.checkManifestFile();
+                if (disableManifestCheck) {
+                    this._enableSceneOffline = true;
+                    this._enableTexturesOffline = true;
+                    this.manifestVersionFound = 1;
+                    BABYLON.Tools.SetImmediate(function () {
+                        _this.callbackManifestChecked(true);
+                    });
+                }
+                else {
+                    this._checkManifestFile();
+                }
             }
         }
         Object.defineProperty(Database.prototype, "enableSceneOffline", {
+            /**
+             * Gets a boolean indicating if scene must be saved in the database
+             */
             get: function () {
                 return this._enableSceneOffline;
             },
@@ -68897,13 +68927,16 @@ var BABYLON;
             configurable: true
         });
         Object.defineProperty(Database.prototype, "enableTexturesOffline", {
+            /**
+             * Gets a boolean indicating if textures must be saved in the database
+             */
             get: function () {
                 return this._enableTexturesOffline;
             },
             enumerable: true,
             configurable: true
         });
-        Database.prototype.checkManifestFile = function () {
+        Database.prototype._checkManifestFile = function () {
             var _this = this;
             var noManifestFile = function () {
                 _this._enableSceneOffline = false;
@@ -68961,6 +68994,11 @@ var BABYLON;
                 this.callbackManifestChecked(false);
             }
         };
+        /**
+         * Open the database and make it available
+         * @param successCallback defines the callback to call on success
+         * @param errorCallback defines the callback to call on error
+         */
         Database.prototype.openAsync = function (successCallback, errorCallback) {
             var _this = this;
             var handleError = function () {
@@ -69017,9 +69055,14 @@ var BABYLON;
                 }
             }
         };
+        /**
+         * Loads an image from the database
+         * @param url defines the url to load from
+         * @param image defines the target DOM image
+         */
         Database.prototype.loadImageFromDB = function (url, image) {
             var _this = this;
-            var completeURL = Database.ReturnFullUrlLocation(url);
+            var completeURL = Database._ReturnFullUrlLocation(url);
             var saveAndLoadImage = function () {
                 if (!_this.hasReachedQuota && _this.db !== null) {
                     // the texture is not yet in the DB, let's try to save it
@@ -69248,9 +69291,17 @@ var BABYLON;
                 callback(-1);
             }
         };
+        /**
+         * Loads a file from database
+         * @param url defines the URL to load from
+         * @param sceneLoaded defines a callback to call on success
+         * @param progressCallBack defines a callback to call when progress changed
+         * @param errorCallback defines a callback to call on error
+         * @param useArrayBuffer defines a boolean to use array buffer instead of text string
+         */
         Database.prototype.loadFileFromDB = function (url, sceneLoaded, progressCallBack, errorCallback, useArrayBuffer) {
             var _this = this;
-            var completeUrl = Database.ReturnFullUrlLocation(url);
+            var completeUrl = Database._ReturnFullUrlLocation(url);
             var saveAndLoadFile = function () {
                 // the scene is not yet in the DB, let's try to save it
                 _this._saveFileIntoDBAsync(completeUrl, sceneLoaded, progressCallBack);
@@ -69390,9 +69441,11 @@ var BABYLON;
                 callback();
             }
         };
+        /** Gets a boolean indicating if the user agent supports blob storage (this value will be updated after creating the first Database object) */
         Database.IsUASupportingBlobStorage = true;
+        /** Gets a boolean indicating if Database storate is enabled */
         Database.IDBStorageEnabled = true;
-        Database.parseURL = function (url) {
+        Database._ParseURL = function (url) {
             var a = document.createElement('a');
             a.href = url;
             var urlWithoutHash = url.substring(0, url.lastIndexOf("#"));
@@ -69400,9 +69453,9 @@ var BABYLON;
             var absLocation = url.substring(0, url.indexOf(fileName, 0));
             return absLocation;
         };
-        Database.ReturnFullUrlLocation = function (url) {
+        Database._ReturnFullUrlLocation = function (url) {
             if (url.indexOf("http:/") === -1 && url.indexOf("https:/") === -1) {
-                return (Database.parseURL(window.location.href) + url);
+                return (Database._ParseURL(window.location.href) + url);
             }
             else {
                 return url;

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

@@ -1,7 +1,7 @@
 {
-  "errors": 4354,
+  "errors": 4330,
   "babylon.typedoc.json": {
-    "errors": 4354,
+    "errors": 4330,
     "Animatable": {
       "Class": {
         "Comments": {
@@ -4926,140 +4926,6 @@
         }
       }
     },
-    "Database": {
-      "Class": {
-        "Comments": {
-          "MissingText": true
-        }
-      },
-      "Constructor": {
-        "new Database": {
-          "Comments": {
-            "MissingText": true
-          },
-          "Parameter": {
-            "urlToScene": {
-              "Comments": {
-                "MissingText": true
-              }
-            },
-            "callbackManifestChecked": {
-              "Comments": {
-                "MissingText": true
-              }
-            }
-          }
-        }
-      },
-      "Property": {
-        "enableSceneOffline": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "enableTexturesOffline": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "IDBStorageEnabled": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "IsUASupportingBlobStorage": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "ReturnFullUrlLocation": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "parseURL": {
-          "Naming": {
-            "NotPascalCase": true
-          },
-          "Comments": {
-            "MissingText": true
-          }
-        }
-      },
-      "Method": {
-        "checkManifestFile": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "loadFileFromDB": {
-          "Comments": {
-            "MissingText": true
-          },
-          "Parameter": {
-            "url": {
-              "Comments": {
-                "MissingText": true
-              }
-            },
-            "sceneLoaded": {
-              "Comments": {
-                "MissingText": true
-              }
-            },
-            "progressCallBack": {
-              "Comments": {
-                "MissingText": true
-              }
-            },
-            "errorCallback": {
-              "Comments": {
-                "MissingText": true
-              }
-            },
-            "useArrayBuffer": {
-              "Comments": {
-                "MissingText": true
-              }
-            }
-          }
-        },
-        "loadImageFromDB": {
-          "Comments": {
-            "MissingText": true
-          },
-          "Parameter": {
-            "url": {
-              "Comments": {
-                "MissingText": true
-              }
-            },
-            "image": {
-              "Comments": {
-                "MissingText": true
-              }
-            }
-          }
-        },
-        "openAsync": {
-          "Comments": {
-            "MissingText": true
-          },
-          "Parameter": {
-            "successCallback": {
-              "Comments": {
-                "MissingText": true
-              }
-            },
-            "errorCallback": {
-              "Comments": {
-                "MissingText": true
-              }
-            }
-          }
-        }
-      }
-    },
     "DebugLayer": {
       "Class": {
         "Comments": {

Разлика између датотеке није приказан због своје велике величине
+ 24 - 24
dist/preview release/viewer/babylon.viewer.js


+ 114 - 47
dist/preview release/viewer/babylon.viewer.max.js

@@ -11298,6 +11298,10 @@ var BABYLON;
              **/
             this.enableOfflineSupport = false;
             /**
+             * Gets or sets a boolean to enable/disable checking manifest if IndexedDB support is enabled (Babylon.js will always consider the database is up to date)
+             **/
+            this.disableManifestCheck = false;
+            /**
              * Gets the list of created scenes
              */
             this.scenes = new Array();
@@ -67282,7 +67286,8 @@ var BABYLON;
                 return plugin;
             }
             if (rootUrl.indexOf("file:") === -1) {
-                var canUseOfflineSupport = scene.getEngine().enableOfflineSupport;
+                var engine = scene.getEngine();
+                var canUseOfflineSupport = engine.enableOfflineSupport;
                 if (canUseOfflineSupport) {
                     // Also check for exceptions
                     var exceptionFound = false;
@@ -67297,7 +67302,7 @@ var BABYLON;
                 }
                 if (canUseOfflineSupport) {
                     // Checking if a manifest file has been set for this scene and if offline mode has been requested
-                    database = new BABYLON.Database(rootUrl + sceneFilename, manifestChecked);
+                    database = new BABYLON.Database(rootUrl + sceneFilename, manifestChecked, engine.disableManifestCheck);
                 }
                 else {
                     manifestChecked();
@@ -68991,12 +68996,24 @@ var BABYLON;
 
 var BABYLON;
 (function (BABYLON) {
+    /**
+     * Class used to enable access to IndexedDB
+     * @see @https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API
+     */
     var Database = /** @class */ (function () {
-        function Database(urlToScene, callbackManifestChecked) {
+        /**
+         * Creates a new Database
+         * @param urlToScene defines the url to load the scene
+         * @param callbackManifestChecked defines the callback to use when manifest is checked
+         * @param disableManifestCheck defines a boolean indicating that we want to skip the manifest validation (it will be considered validated and up to date)
+         */
+        function Database(urlToScene, callbackManifestChecked, disableManifestCheck) {
+            if (disableManifestCheck === void 0) { disableManifestCheck = false; }
+            var _this = this;
             // Handling various flavors of prefixed version of IndexedDB
             this.idbFactory = (window.indexedDB || window.mozIndexedDB || window.webkitIndexedDB || window.msIndexedDB);
             this.callbackManifestChecked = callbackManifestChecked;
-            this.currentSceneUrl = Database.ReturnFullUrlLocation(urlToScene);
+            this.currentSceneUrl = Database._ReturnFullUrlLocation(urlToScene);
             this.db = null;
             this._enableSceneOffline = false;
             this._enableTexturesOffline = false;
@@ -69007,10 +69024,23 @@ var BABYLON;
                 this.callbackManifestChecked(true);
             }
             else {
-                this.checkManifestFile();
+                if (disableManifestCheck) {
+                    this._enableSceneOffline = true;
+                    this._enableTexturesOffline = true;
+                    this.manifestVersionFound = 1;
+                    BABYLON.Tools.SetImmediate(function () {
+                        _this.callbackManifestChecked(true);
+                    });
+                }
+                else {
+                    this._checkManifestFile();
+                }
             }
         }
         Object.defineProperty(Database.prototype, "enableSceneOffline", {
+            /**
+             * Gets a boolean indicating if scene must be saved in the database
+             */
             get: function () {
                 return this._enableSceneOffline;
             },
@@ -69018,13 +69048,16 @@ var BABYLON;
             configurable: true
         });
         Object.defineProperty(Database.prototype, "enableTexturesOffline", {
+            /**
+             * Gets a boolean indicating if textures must be saved in the database
+             */
             get: function () {
                 return this._enableTexturesOffline;
             },
             enumerable: true,
             configurable: true
         });
-        Database.prototype.checkManifestFile = function () {
+        Database.prototype._checkManifestFile = function () {
             var _this = this;
             var noManifestFile = function () {
                 _this._enableSceneOffline = false;
@@ -69082,6 +69115,11 @@ var BABYLON;
                 this.callbackManifestChecked(false);
             }
         };
+        /**
+         * Open the database and make it available
+         * @param successCallback defines the callback to call on success
+         * @param errorCallback defines the callback to call on error
+         */
         Database.prototype.openAsync = function (successCallback, errorCallback) {
             var _this = this;
             var handleError = function () {
@@ -69138,9 +69176,14 @@ var BABYLON;
                 }
             }
         };
+        /**
+         * Loads an image from the database
+         * @param url defines the url to load from
+         * @param image defines the target DOM image
+         */
         Database.prototype.loadImageFromDB = function (url, image) {
             var _this = this;
-            var completeURL = Database.ReturnFullUrlLocation(url);
+            var completeURL = Database._ReturnFullUrlLocation(url);
             var saveAndLoadImage = function () {
                 if (!_this.hasReachedQuota && _this.db !== null) {
                     // the texture is not yet in the DB, let's try to save it
@@ -69369,9 +69412,17 @@ var BABYLON;
                 callback(-1);
             }
         };
+        /**
+         * Loads a file from database
+         * @param url defines the URL to load from
+         * @param sceneLoaded defines a callback to call on success
+         * @param progressCallBack defines a callback to call when progress changed
+         * @param errorCallback defines a callback to call on error
+         * @param useArrayBuffer defines a boolean to use array buffer instead of text string
+         */
         Database.prototype.loadFileFromDB = function (url, sceneLoaded, progressCallBack, errorCallback, useArrayBuffer) {
             var _this = this;
-            var completeUrl = Database.ReturnFullUrlLocation(url);
+            var completeUrl = Database._ReturnFullUrlLocation(url);
             var saveAndLoadFile = function () {
                 // the scene is not yet in the DB, let's try to save it
                 _this._saveFileIntoDBAsync(completeUrl, sceneLoaded, progressCallBack);
@@ -69511,9 +69562,11 @@ var BABYLON;
                 callback();
             }
         };
+        /** Gets a boolean indicating if the user agent supports blob storage (this value will be updated after creating the first Database object) */
         Database.IsUASupportingBlobStorage = true;
+        /** Gets a boolean indicating if Database storate is enabled */
         Database.IDBStorageEnabled = true;
-        Database.parseURL = function (url) {
+        Database._ParseURL = function (url) {
             var a = document.createElement('a');
             a.href = url;
             var urlWithoutHash = url.substring(0, url.lastIndexOf("#"));
@@ -69521,9 +69574,9 @@ var BABYLON;
             var absLocation = url.substring(0, url.indexOf(fileName, 0));
             return absLocation;
         };
-        Database.ReturnFullUrlLocation = function (url) {
+        Database._ReturnFullUrlLocation = function (url) {
             if (url.indexOf("http:/") === -1 && url.indexOf("https:/") === -1) {
-                return (Database.parseURL(window.location.href) + url);
+                return (Database._ParseURL(window.location.href) + url);
             }
             else {
                 return url;
@@ -102803,6 +102856,10 @@ var BABYLON;
              */
             this.compileShadowGenerators = false;
             /**
+             * Function called before loading a url referenced by the asset.
+             */
+            this.preprocessUrlAsync = function (url) { return Promise.resolve(url); };
+            /**
              * Observable raised when the loader creates a mesh after parsing the glTF properties of the mesh.
              */
             this.onMeshLoadedObservable = new BABYLON.Observable();
@@ -102981,6 +103038,7 @@ var BABYLON;
                 this._loader.dispose();
                 this._loader = null;
             }
+            this.preprocessUrlAsync = function (url) { return Promise.resolve(url); };
             this.onMeshLoadedObservable.clear();
             this.onTextureLoadedObservable.clear();
             this.onMaterialLoadedObservable.clear();
@@ -103108,6 +103166,7 @@ var BABYLON;
             loader.compileMaterials = this.compileMaterials;
             loader.useClipPlane = this.useClipPlane;
             loader.compileShadowGenerators = this.compileShadowGenerators;
+            loader.preprocessUrlAsync = this.preprocessUrlAsync;
             loader.onMeshLoadedObservable.add(function (mesh) { return _this.onMeshLoadedObservable.notifyObservers(mesh); });
             loader.onTextureLoadedObservable.add(function (texture) { return _this.onTextureLoadedObservable.notifyObservers(texture); });
             loader.onMaterialLoadedObservable.add(function (material) { return _this.onMaterialLoadedObservable.notifyObservers(material); });
@@ -104687,16 +104746,14 @@ var BABYLON;
                 this.compileMaterials = false;
                 this.useClipPlane = false;
                 this.compileShadowGenerators = false;
-                this.onDisposeObservable = new BABYLON.Observable();
+                this.preprocessUrlAsync = function (url) { return Promise.resolve(url); };
                 this.onMeshLoadedObservable = new BABYLON.Observable();
                 this.onTextureLoadedObservable = new BABYLON.Observable();
                 this.onMaterialLoadedObservable = new BABYLON.Observable();
                 this.onCameraLoadedObservable = new BABYLON.Observable();
                 this.onCompleteObservable = new BABYLON.Observable();
+                this.onDisposeObservable = new BABYLON.Observable();
                 this.onExtensionLoadedObservable = new BABYLON.Observable();
-                /**
-                * State of the loader
-                */
                 this.state = null;
             }
             GLTFLoader.RegisterExtension = function (extension) {
@@ -105565,6 +105622,10 @@ var BABYLON;
                  */
                 this.compileShadowGenerators = false;
                 /**
+                 * Function called before loading a url referenced by the asset.
+                 */
+                this.preprocessUrlAsync = function (url) { return Promise.resolve(url); };
+                /**
                  * Observable raised when the loader creates a mesh after parsing the glTF properties of the mesh.
                  */
                 this.onMeshLoadedObservable = new BABYLON.Observable();
@@ -105598,13 +105659,13 @@ var BABYLON;
             }
             /** @hidden */
             GLTFLoader._Register = function (name, factory) {
-                if (GLTFLoader._Factories[name]) {
+                if (GLTFLoader._ExtensionFactories[name]) {
                     BABYLON.Tools.Error("Extension with the name '" + name + "' already exists");
                     return;
                 }
-                GLTFLoader._Factories[name] = factory;
+                GLTFLoader._ExtensionFactories[name] = factory;
                 // Keep the order of registration so that extensions registered first are called first.
-                GLTFLoader._Names.push(name);
+                GLTFLoader._ExtensionNames.push(name);
             };
             Object.defineProperty(GLTFLoader.prototype, "state", {
                 /**
@@ -105727,15 +105788,17 @@ var BABYLON;
                     });
                     return resultPromise;
                 }).catch(function (error) {
-                    BABYLON.Tools.Error("glTF Loader: " + error.message);
-                    _this._clear();
-                    throw error;
+                    if (!_this._disposed) {
+                        BABYLON.Tools.Error("glTF Loader: " + error.message);
+                        _this._clear();
+                        throw error;
+                    }
                 });
             };
             GLTFLoader.prototype._loadExtensions = function () {
-                for (var _i = 0, _a = GLTFLoader._Names; _i < _a.length; _i++) {
+                for (var _i = 0, _a = GLTFLoader._ExtensionNames; _i < _a.length; _i++) {
                     var name_1 = _a[_i];
-                    var extension = GLTFLoader._Factories[name_1](this);
+                    var extension = GLTFLoader._ExtensionFactories[name_1](this);
                     this._extensions[name_1] = extension;
                     this.onExtensionLoadedObservable.notifyObservers(extension);
                 }
@@ -106814,31 +106877,35 @@ var BABYLON;
                 if (BABYLON.Tools.IsBase64(uri)) {
                     return Promise.resolve(new Uint8Array(BABYLON.Tools.DecodeBase64(uri)));
                 }
-                return new Promise(function (resolve, reject) {
-                    var request = BABYLON.Tools.LoadFile(_this._rootUrl + uri, function (data) {
-                        if (!_this._disposed) {
-                            resolve(new Uint8Array(data));
-                        }
-                    }, function (event) {
+                return this.preprocessUrlAsync(this._rootUrl + uri).then(function (url) {
+                    return new Promise(function (resolve, reject) {
                         if (!_this._disposed) {
-                            try {
-                                if (request && _this._state === BABYLON.GLTFLoaderState.LOADING) {
-                                    request._lengthComputable = event.lengthComputable;
-                                    request._loaded = event.loaded;
-                                    request._total = event.total;
-                                    _this._onProgress();
+                            var request_1 = BABYLON.Tools.LoadFile(url, function (data) {
+                                if (!_this._disposed) {
+                                    resolve(new Uint8Array(data));
                                 }
-                            }
-                            catch (e) {
-                                reject(e);
-                            }
-                        }
-                    }, _this._babylonScene.database, true, function (request, exception) {
-                        if (!_this._disposed) {
-                            reject(new BABYLON.LoadFileError(context + ": Failed to load '" + uri + "'" + (request ? ": " + request.status + " " + request.statusText : ""), request));
+                            }, function (event) {
+                                if (!_this._disposed) {
+                                    try {
+                                        if (request_1 && _this._state === BABYLON.GLTFLoaderState.LOADING) {
+                                            request_1._lengthComputable = event.lengthComputable;
+                                            request_1._loaded = event.loaded;
+                                            request_1._total = event.total;
+                                            _this._onProgress();
+                                        }
+                                    }
+                                    catch (e) {
+                                        reject(e);
+                                    }
+                                }
+                            }, _this._babylonScene.database, true, function (request, exception) {
+                                if (!_this._disposed) {
+                                    reject(new BABYLON.LoadFileError(context + ": Failed to load '" + uri + "'" + (request ? ": " + request.status + " " + request.statusText : ""), request));
+                                }
+                            });
+                            _this._requests.push(request_1);
                         }
                     });
-                    _this._requests.push(request);
                 });
             };
             GLTFLoader.prototype._onProgress = function () {
@@ -107029,7 +107096,7 @@ var BABYLON;
             };
             /** @hidden */
             GLTFLoader.prototype._applyExtensions = function (actionAsync) {
-                for (var _i = 0, _a = GLTFLoader._Names; _i < _a.length; _i++) {
+                for (var _i = 0, _a = GLTFLoader._ExtensionNames; _i < _a.length; _i++) {
                     var name_5 = _a[_i];
                     var extension = this._extensions[name_5];
                     if (extension.enabled) {
@@ -107041,8 +107108,8 @@ var BABYLON;
                 }
                 return null;
             };
-            GLTFLoader._Names = new Array();
-            GLTFLoader._Factories = {};
+            GLTFLoader._ExtensionNames = new Array();
+            GLTFLoader._ExtensionFactories = {};
             return GLTFLoader;
         }());
         GLTF2.GLTFLoader = GLTFLoader;

+ 5 - 0
src/Engine/babylon.engine.ts

@@ -782,6 +782,11 @@
          **/
         public enableOfflineSupport = false;
 
+        /** 
+         * Gets or sets a boolean to enable/disable checking manifest if IndexedDB support is enabled (Babylon.js will always consider the database is up to date)
+         **/
+        public disableManifestCheck = false;        
+
         /**
          * Gets the list of created scenes
          */

+ 3 - 2
src/Loading/babylon.sceneLoader.ts

@@ -309,7 +309,8 @@
             }
 
             if (rootUrl.indexOf("file:") === -1) {
-                let canUseOfflineSupport = scene.getEngine().enableOfflineSupport;
+                let engine = scene.getEngine();
+                let canUseOfflineSupport = engine.enableOfflineSupport;
                 if (canUseOfflineSupport) {
                     // Also check for exceptions
                     let exceptionFound = false;
@@ -325,7 +326,7 @@
 
                 if (canUseOfflineSupport) {
                     // Checking if a manifest file has been set for this scene and if offline mode has been requested
-                    database = new Database(rootUrl + sceneFilename, manifestChecked);
+                    database = new Database(rootUrl + sceneFilename, manifestChecked, engine.disableManifestCheck);
                 }
                 else {
                     manifestChecked();

+ 56 - 9
src/Tools/babylon.database.ts

@@ -1,4 +1,8 @@
 module BABYLON {
+    /**
+     * Class used to enable access to IndexedDB
+     * @see @https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API
+     */
     export class Database {
         private callbackManifestChecked: (check: boolean) => any;
         private currentSceneUrl: string;
@@ -13,20 +17,35 @@ module BABYLON {
         // Handling various flavors of prefixed version of IndexedDB
         private idbFactory = <IDBFactory>(window.indexedDB || window.mozIndexedDB || window.webkitIndexedDB || window.msIndexedDB);
 
+        /** Gets a boolean indicating if the user agent supports blob storage (this value will be updated after creating the first Database object) */
         static IsUASupportingBlobStorage = true;
+
+        /** Gets a boolean indicating if Database storate is enabled */
         static IDBStorageEnabled = true;
 
+        /**
+         * Gets a boolean indicating if scene must be saved in the database
+         */
         public get enableSceneOffline(): boolean {
             return this._enableSceneOffline;
         }
 
+        /**
+         * Gets a boolean indicating if textures must be saved in the database
+         */
         public get enableTexturesOffline(): boolean {
             return this._enableTexturesOffline;
         }
 
-        constructor(urlToScene: string, callbackManifestChecked: (checked: boolean) => any) {
+        /**
+         * Creates a new Database
+         * @param urlToScene defines the url to load the scene
+         * @param callbackManifestChecked defines the callback to use when manifest is checked
+         * @param disableManifestCheck defines a boolean indicating that we want to skip the manifest validation (it will be considered validated and up to date)
+         */
+        constructor(urlToScene: string, callbackManifestChecked: (checked: boolean) => any, disableManifestCheck = false) {
             this.callbackManifestChecked = callbackManifestChecked;
-            this.currentSceneUrl = Database.ReturnFullUrlLocation(urlToScene);
+            this.currentSceneUrl = Database._ReturnFullUrlLocation(urlToScene);
             this.db = null;
             this._enableSceneOffline = false;
             this._enableTexturesOffline = false;
@@ -37,11 +56,21 @@ module BABYLON {
             if (!Database.IDBStorageEnabled) {
                 this.callbackManifestChecked(true);
             } else {
-                this.checkManifestFile();
+                if (disableManifestCheck) {
+                    this._enableSceneOffline = true;
+                    this._enableTexturesOffline = true;
+                    this.manifestVersionFound = 1;
+                    Tools.SetImmediate(() => {
+                        this.callbackManifestChecked(true);
+                    });
+                }
+                else {
+                    this._checkManifestFile();
+                }
             }
         }
 
-        static parseURL = (url: string) => {
+        private static _ParseURL = (url: string) => {
             var a = document.createElement('a');
             a.href = url;
             var urlWithoutHash = url.substring(0, url.lastIndexOf("#"));
@@ -50,16 +79,16 @@ module BABYLON {
             return absLocation;
         }
 
-        static ReturnFullUrlLocation = (url: string): string => {
+        private static _ReturnFullUrlLocation = (url: string): string => {
             if (url.indexOf("http:/") === -1 && url.indexOf("https:/") === -1) {
-                return (Database.parseURL(window.location.href) + url);
+                return (Database._ParseURL(window.location.href) + url);
             }
             else {
                 return url;
             }
         }
 
-        public checkManifestFile() {
+        private _checkManifestFile() {
             var noManifestFile = () => {
                 this._enableSceneOffline = false;
                 this._enableTexturesOffline = false;
@@ -123,6 +152,11 @@ module BABYLON {
             }
         }
 
+        /**
+         * Open the database and make it available
+         * @param successCallback defines the callback to call on success
+         * @param errorCallback defines the callback to call on error
+         */
         public openAsync(successCallback: () => void, errorCallback: () => void) {
             let handleError = () => {
                 this.isSupported = false;
@@ -182,8 +216,13 @@ module BABYLON {
             }
         }
 
+        /**
+         * Loads an image from the database
+         * @param url defines the url to load from
+         * @param image defines the target DOM image
+         */
         public loadImageFromDB(url: string, image: HTMLImageElement) {
-            var completeURL = Database.ReturnFullUrlLocation(url);
+            var completeURL = Database._ReturnFullUrlLocation(url);
 
             var saveAndLoadImage = () => {
                 if (!this.hasReachedQuota && this.db !== null) {
@@ -442,8 +481,16 @@ module BABYLON {
             }
         }
 
+        /**
+         * Loads a file from database
+         * @param url defines the URL to load from
+         * @param sceneLoaded defines a callback to call on success
+         * @param progressCallBack defines a callback to call when progress changed
+         * @param errorCallback defines a callback to call on error
+         * @param useArrayBuffer defines a boolean to use array buffer instead of text string
+         */
         public loadFileFromDB(url: string, sceneLoaded: (data: any) => void, progressCallBack?: (data: any) => void, errorCallback?: () => void, useArrayBuffer?: boolean) {
-            var completeUrl = Database.ReturnFullUrlLocation(url);
+            var completeUrl = Database._ReturnFullUrlLocation(url);
 
             var saveAndLoadFile = () => {
                 // the scene is not yet in the DB, let's try to save it