David Catuhe 7 年之前
父節點
當前提交
ff1aadf0ae

文件差異過大導致無法顯示
+ 6527 - 5959
Playground/babylon.d.txt


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


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


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


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


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


+ 452 - 49
dist/preview release/customConfigurations/minimalGLTFViewer/es6.js

@@ -66303,9 +66303,9 @@ var BABYLON;
          * @param scene The scene the texture will be used in
          * @param size The cubemap desired size (the more it increases the longer the generation will be) If the size is omitted this implies you are using a preprocessed cubemap.
          * @param noMipmap Forces to not generate the mipmap if true
-         * @param generateHarmonics Specifies wether you want to extract the polynomial harmonics during the generation process
+         * @param generateHarmonics Specifies whether you want to extract the polynomial harmonics during the generation process
          * @param useInGammaSpace Specifies if the texture will be use in gamma or linear space (the PBR material requires those texture in linear space, but the standard material would require them in Gamma space)
-         * @param usePMREMGenerator Specifies wether or not to generate the CubeMap through CubeMapGen to avoid seams issue at run time.
+         * @param usePMREMGenerator Specifies whether or not to generate the CubeMap through CubeMapGen to avoid seams issue at run time.
          */
         function HDRCubeTexture(url, scene, size, noMipmap, generateHarmonics, useInGammaSpace, usePMREMGenerator, onLoad, onError) {
             if (noMipmap === void 0) { noMipmap = false; }
@@ -78003,34 +78003,114 @@ var BABYLON;
 
 var BABYLON;
 (function (BABYLON) {
+    /**
+     * Defines the list of states available for a task inside a {BABYLON.AssetsManager}
+     */
     var AssetTaskState;
     (function (AssetTaskState) {
+        /**
+         * Initialization
+         */
         AssetTaskState[AssetTaskState["INIT"] = 0] = "INIT";
+        /**
+         * Running
+         */
         AssetTaskState[AssetTaskState["RUNNING"] = 1] = "RUNNING";
+        /**
+         * Done
+         */
         AssetTaskState[AssetTaskState["DONE"] = 2] = "DONE";
+        /**
+         * Error
+         */
         AssetTaskState[AssetTaskState["ERROR"] = 3] = "ERROR";
     })(AssetTaskState = BABYLON.AssetTaskState || (BABYLON.AssetTaskState = {}));
+    /**
+     * Define an abstract asset task used with a {BABYLON.AssetsManager} class to load assets into a scene
+     */
     var AbstractAssetTask = /** @class */ (function () {
-        function AbstractAssetTask(name) {
+        /**
+         * Creates a new {BABYLON.AssetsManager}
+         * @param name defines the name of the task
+         */
+        function AbstractAssetTask(
+            /**
+             * Task name
+             */ name) {
             this.name = name;
-            this.isCompleted = false;
-            this.taskState = AssetTaskState.INIT;
+            this._isCompleted = false;
+            this._taskState = AssetTaskState.INIT;
         }
+        Object.defineProperty(AbstractAssetTask.prototype, "isCompleted", {
+            /**
+             * Get if the task is completed
+             */
+            get: function () {
+                return this._isCompleted;
+            },
+            enumerable: true,
+            configurable: true
+        });
+        Object.defineProperty(AbstractAssetTask.prototype, "taskState", {
+            /**
+             * Gets the current state of the task
+             */
+            get: function () {
+                return this._taskState;
+            },
+            enumerable: true,
+            configurable: true
+        });
+        Object.defineProperty(AbstractAssetTask.prototype, "errorObject", {
+            /**
+             * Gets the current error object (if task is in error)
+             */
+            get: function () {
+                return this._errorObject;
+            },
+            enumerable: true,
+            configurable: true
+        });
+        /**
+         * Internal only
+         * @ignore
+         */
+        AbstractAssetTask.prototype._setErrorObject = function (message, exception) {
+            if (this._errorObject) {
+                return;
+            }
+            this._errorObject = {
+                message: message,
+                exception: exception
+            };
+        };
+        /**
+         * Execute the current task
+         * @param scene defines the scene where you want your assets to be loaded
+         * @param onSuccess is a callback called when the task is successfully executed
+         * @param onError is a callback called if an error occurs
+         */
         AbstractAssetTask.prototype.run = function (scene, onSuccess, onError) {
             var _this = this;
-            this.taskState = AssetTaskState.RUNNING;
+            this._taskState = AssetTaskState.RUNNING;
             this.runTask(scene, function () {
                 _this.onDoneCallback(onSuccess, onError);
             }, function (msg, exception) {
                 _this.onErrorCallback(onError, msg, exception);
             });
         };
+        /**
+         * Execute the current task
+         * @param scene defines the scene where you want your assets to be loaded
+         * @param onSuccess is a callback called when the task is successfully executed
+         * @param onError is a callback called if an error occurs
+         */
         AbstractAssetTask.prototype.runTask = function (scene, onSuccess, onError) {
             throw new Error("runTask is not implemented");
         };
         AbstractAssetTask.prototype.onErrorCallback = function (onError, message, exception) {
-            this.taskState = AssetTaskState.ERROR;
-            this.errorObject = {
+            this._taskState = AssetTaskState.ERROR;
+            this._errorObject = {
                 message: message,
                 exception: exception
             };
@@ -78041,8 +78121,8 @@ var BABYLON;
         };
         AbstractAssetTask.prototype.onDoneCallback = function (onSuccess, onError) {
             try {
-                this.taskState = AssetTaskState.DONE;
-                this.isCompleted = true;
+                this._taskState = AssetTaskState.DONE;
+                this._isCompleted = true;
                 if (this.onSuccess) {
                     this.onSuccess(this);
                 }
@@ -78055,7 +78135,16 @@ var BABYLON;
         return AbstractAssetTask;
     }());
     BABYLON.AbstractAssetTask = AbstractAssetTask;
+    /**
+     * Class used to share progress information about assets loading
+     */
     var AssetsProgressEvent = /** @class */ (function () {
+        /**
+         * Creates a {BABYLON.AssetsProgressEvent}
+         * @param remainingCount defines the number of remaining tasks to process
+         * @param totalCount defines the total number of tasks
+         * @param task defines the task that was just processed
+         */
         function AssetsProgressEvent(remainingCount, totalCount, task) {
             this.remainingCount = remainingCount;
             this.totalCount = totalCount;
@@ -78064,9 +78153,35 @@ var BABYLON;
         return AssetsProgressEvent;
     }());
     BABYLON.AssetsProgressEvent = AssetsProgressEvent;
+    /**
+     * Define a task used by {BABYLON.AssetsManager} to load meshes
+     */
     var MeshAssetTask = /** @class */ (function (_super) {
         __extends(MeshAssetTask, _super);
-        function MeshAssetTask(name, meshesNames, rootUrl, sceneFilename) {
+        /**
+         * Creates a new {BABYLON.MeshAssetTask}
+         * @param name defines the name of the task
+         * @param meshesNames defines the list of mesh's names you want to load
+         * @param rootUrl defines the root url to use as a base to load your meshes and associated resources
+         * @param sceneFilename defines the filename of the scene to load from
+         */
+        function MeshAssetTask(
+            /**
+             * Defines the name of the task
+             */
+            name, 
+            /**
+             * Defines the list of mesh's names you want to load
+             */
+            meshesNames, 
+            /**
+             * Defines the root url to use as a base to load your meshes and associated resources
+             */
+            rootUrl, 
+            /**
+             * Defines the filename of the scene to load from
+             */
+            sceneFilename) {
             var _this = _super.call(this, name) || this;
             _this.name = name;
             _this.meshesNames = meshesNames;
@@ -78074,6 +78189,12 @@ var BABYLON;
             _this.sceneFilename = sceneFilename;
             return _this;
         }
+        /**
+         * Execute the current task
+         * @param scene defines the scene where you want your assets to be loaded
+         * @param onSuccess is a callback called when the task is successfully executed
+         * @param onError is a callback called if an error occurs
+         */
         MeshAssetTask.prototype.runTask = function (scene, onSuccess, onError) {
             var _this = this;
             BABYLON.SceneLoader.ImportMesh(this.meshesNames, this.rootUrl, this.sceneFilename, scene, function (meshes, particleSystems, skeletons) {
@@ -78088,14 +78209,36 @@ var BABYLON;
         return MeshAssetTask;
     }(AbstractAssetTask));
     BABYLON.MeshAssetTask = MeshAssetTask;
+    /**
+     * Define a task used by {BABYLON.AssetsManager} to load text content
+     */
     var TextFileAssetTask = /** @class */ (function (_super) {
         __extends(TextFileAssetTask, _super);
-        function TextFileAssetTask(name, url) {
+        /**
+         * Creates a new TextFileAssetTask object
+         * @param name defines the name of the task
+         * @param url defines the location of the file to load
+         */
+        function TextFileAssetTask(
+            /**
+             * Defines the name of the task
+             */
+            name, 
+            /**
+             * Defines the location of the file to load
+             */
+            url) {
             var _this = _super.call(this, name) || this;
             _this.name = name;
             _this.url = url;
             return _this;
         }
+        /**
+         * Execute the current task
+         * @param scene defines the scene where you want your assets to be loaded
+         * @param onSuccess is a callback called when the task is successfully executed
+         * @param onError is a callback called if an error occurs
+         */
         TextFileAssetTask.prototype.runTask = function (scene, onSuccess, onError) {
             var _this = this;
             scene._loadFile(this.url, function (data) {
@@ -78110,14 +78253,36 @@ var BABYLON;
         return TextFileAssetTask;
     }(AbstractAssetTask));
     BABYLON.TextFileAssetTask = TextFileAssetTask;
+    /**
+     * Define a task used by {BABYLON.AssetsManager} to load binary data
+     */
     var BinaryFileAssetTask = /** @class */ (function (_super) {
         __extends(BinaryFileAssetTask, _super);
-        function BinaryFileAssetTask(name, url) {
+        /**
+         * Creates a new BinaryFileAssetTask object
+         * @param name defines the name of the new task
+         * @param url defines the location of the file to load
+         */
+        function BinaryFileAssetTask(
+            /**
+             * Defines the name of the task
+             */
+            name, 
+            /**
+             * Defines the location of the file to load
+             */
+            url) {
             var _this = _super.call(this, name) || this;
             _this.name = name;
             _this.url = url;
             return _this;
         }
+        /**
+         * Execute the current task
+         * @param scene defines the scene where you want your assets to be loaded
+         * @param onSuccess is a callback called when the task is successfully executed
+         * @param onError is a callback called if an error occurs
+         */
         BinaryFileAssetTask.prototype.runTask = function (scene, onSuccess, onError) {
             var _this = this;
             scene._loadFile(this.url, function (data) {
@@ -78132,14 +78297,36 @@ var BABYLON;
         return BinaryFileAssetTask;
     }(AbstractAssetTask));
     BABYLON.BinaryFileAssetTask = BinaryFileAssetTask;
+    /**
+     * Define a task used by {BABYLON.AssetsManager} to load images
+     */
     var ImageAssetTask = /** @class */ (function (_super) {
         __extends(ImageAssetTask, _super);
-        function ImageAssetTask(name, url) {
+        /**
+         * Creates a new ImageAssetTask
+         * @param name defines the name of the task
+         * @param url defines the location of the image to load
+         */
+        function ImageAssetTask(
+            /**
+             * Defines the name of the task
+             */
+            name, 
+            /**
+             * Defines the location of the image to load
+             */
+            url) {
             var _this = _super.call(this, name) || this;
             _this.name = name;
             _this.url = url;
             return _this;
         }
+        /**
+         * Execute the current task
+         * @param scene defines the scene where you want your assets to be loaded
+         * @param onSuccess is a callback called when the task is successfully executed
+         * @param onError is a callback called if an error occurs
+         */
         ImageAssetTask.prototype.runTask = function (scene, onSuccess, onError) {
             var _this = this;
             var img = new Image();
@@ -78156,9 +78343,40 @@ var BABYLON;
         return ImageAssetTask;
     }(AbstractAssetTask));
     BABYLON.ImageAssetTask = ImageAssetTask;
+    /**
+     * Define a task used by {BABYLON.AssetsManager} to load 2D textures
+     */
     var TextureAssetTask = /** @class */ (function (_super) {
         __extends(TextureAssetTask, _super);
-        function TextureAssetTask(name, url, noMipmap, invertY, samplingMode) {
+        /**
+         * Creates a new TextureAssetTask object
+         * @param name defines the name of the task
+         * @param url defines the location of the file to load
+         * @param noMipmap defines if mipmap should not be generated (default is false)
+         * @param invertY defines if texture must be inverted on Y axis (default is false)
+         * @param samplingMode defines the sampling mode to use (default is BABYLON.Texture.TRILINEAR_SAMPLINGMODE)
+         */
+        function TextureAssetTask(
+            /**
+             * Defines the name of the task
+             */
+            name, 
+            /**
+             * Defines the location of the file to load
+             */
+            url, 
+            /**
+             * Defines if mipmap should not be generated (default is false)
+             */
+            noMipmap, 
+            /**
+             * Defines if texture must be inverted on Y axis (default is false)
+             */
+            invertY, 
+            /**
+             * Defines the sampling mode to use (default is BABYLON.Texture.TRILINEAR_SAMPLINGMODE)
+             */
+            samplingMode) {
             if (samplingMode === void 0) { samplingMode = BABYLON.Texture.TRILINEAR_SAMPLINGMODE; }
             var _this = _super.call(this, name) || this;
             _this.name = name;
@@ -78168,6 +78386,12 @@ var BABYLON;
             _this.samplingMode = samplingMode;
             return _this;
         }
+        /**
+         * Execute the current task
+         * @param scene defines the scene where you want your assets to be loaded
+         * @param onSuccess is a callback called when the task is successfully executed
+         * @param onError is a callback called if an error occurs
+         */
         TextureAssetTask.prototype.runTask = function (scene, onSuccess, onError) {
             var onload = function () {
                 onSuccess();
@@ -78180,9 +78404,40 @@ var BABYLON;
         return TextureAssetTask;
     }(AbstractAssetTask));
     BABYLON.TextureAssetTask = TextureAssetTask;
+    /**
+     * Define a task used by {BABYLON.AssetsManager} to load cube textures
+     */
     var CubeTextureAssetTask = /** @class */ (function (_super) {
         __extends(CubeTextureAssetTask, _super);
-        function CubeTextureAssetTask(name, url, extensions, noMipmap, files) {
+        /**
+         * Creates a new CubeTextureAssetTask
+         * @param name defines the name of the task
+         * @param url defines the location of the files to load (You have to specify the folder where the files are + filename with no extension)
+         * @param extensions defines the extensions to use to load files (["_px", "_py", "_pz", "_nx", "_ny", "_nz"] by default)
+         * @param noMipmap defines if mipmaps should not be generated (default is false)
+         * @param files defines the explicit list of files (undefined by default)
+         */
+        function CubeTextureAssetTask(
+            /**
+             * Defines the name of the task
+             */
+            name, 
+            /**
+             * Defines the location of the files to load (You have to specify the folder where the files are + filename with no extension)
+             */
+            url, 
+            /**
+             * Defines the extensions to use to load files (["_px", "_py", "_pz", "_nx", "_ny", "_nz"] by default)
+             */
+            extensions, 
+            /**
+             * Defines if mipmaps should not be generated (default is false)
+             */
+            noMipmap, 
+            /**
+             * Defines the explicit list of files (undefined by default)
+             */
+            files) {
             var _this = _super.call(this, name) || this;
             _this.name = name;
             _this.url = url;
@@ -78191,6 +78446,12 @@ var BABYLON;
             _this.files = files;
             return _this;
         }
+        /**
+         * Execute the current task
+         * @param scene defines the scene where you want your assets to be loaded
+         * @param onSuccess is a callback called when the task is successfully executed
+         * @param onError is a callback called if an error occurs
+         */
         CubeTextureAssetTask.prototype.runTask = function (scene, onSuccess, onError) {
             var onload = function () {
                 onSuccess();
@@ -78203,9 +78464,50 @@ var BABYLON;
         return CubeTextureAssetTask;
     }(AbstractAssetTask));
     BABYLON.CubeTextureAssetTask = CubeTextureAssetTask;
+    /**
+     * Define a task used by {BABYLON.AssetsManager} to load HDR cube textures
+     */
     var HDRCubeTextureAssetTask = /** @class */ (function (_super) {
         __extends(HDRCubeTextureAssetTask, _super);
-        function HDRCubeTextureAssetTask(name, url, size, noMipmap, generateHarmonics, useInGammaSpace, usePMREMGenerator) {
+        /**
+         * Creates a new HDRCubeTextureAssetTask object
+         * @param name defines the name of the task
+         * @param url defines the location of the file to load
+         * @param size defines the desired size (the more it increases the longer the generation will be) If the size is omitted this implies you are using a preprocessed cubemap.
+         * @param noMipmap defines if mipmaps should not be generated (default is false)
+         * @param generateHarmonics specifies whether you want to extract the polynomial harmonics during the generation process (default is true)
+         * @param useInGammaSpace specifies if the texture will be use in gamma or linear space (the PBR material requires those texture in linear space, but the standard material would require them in Gamma space) (default is false)
+         * @param usePMREMGenerator specifies whether or not to generate the CubeMap through CubeMapGen to avoid seams issue at run time (default is false)
+         */
+        function HDRCubeTextureAssetTask(
+            /**
+             * Defines the name of the task
+             */
+            name, 
+            /**
+             * Defines the location of the file to load
+             */
+            url, 
+            /**
+             * Defines the desired size (the more it increases the longer the generation will be) If the size is omitted this implies you are using a preprocessed cubemap.
+             */
+            size, 
+            /**
+             * Defines if mipmaps should not be generated (default is false)
+             */
+            noMipmap, 
+            /**
+             * Specifies whether you want to extract the polynomial harmonics during the generation process (default is true)
+             */
+            generateHarmonics, 
+            /**
+             * Specifies if the texture will be use in gamma or linear space (the PBR material requires those texture in linear space, but the standard material would require them in Gamma space) (default is false)
+             */
+            useInGammaSpace, 
+            /**
+             * Specifies whether or not to generate the CubeMap through CubeMapGen to avoid seams issue at run time (default is false)
+             */
+            usePMREMGenerator) {
             if (noMipmap === void 0) { noMipmap = false; }
             if (generateHarmonics === void 0) { generateHarmonics = true; }
             if (useInGammaSpace === void 0) { useInGammaSpace = false; }
@@ -78220,6 +78522,12 @@ var BABYLON;
             _this.usePMREMGenerator = usePMREMGenerator;
             return _this;
         }
+        /**
+         * Execute the current task
+         * @param scene defines the scene where you want your assets to be loaded
+         * @param onSuccess is a callback called when the task is successfully executed
+         * @param onError is a callback called if an error occurs
+         */
         HDRCubeTextureAssetTask.prototype.run = function (scene, onSuccess, onError) {
             var onload = function () {
                 onSuccess();
@@ -78232,77 +78540,167 @@ var BABYLON;
         return HDRCubeTextureAssetTask;
     }(AbstractAssetTask));
     BABYLON.HDRCubeTextureAssetTask = HDRCubeTextureAssetTask;
+    /**
+     * This class can be used to easily import assets into a scene
+     * @see http://doc.babylonjs.com/how_to/how_to_use_assetsmanager
+     */
     var AssetsManager = /** @class */ (function () {
+        /**
+         * Creates a new AssetsManager
+         * @param scene defines the scene to work on
+         */
         function AssetsManager(scene) {
             this._isLoading = false;
-            this.tasks = new Array();
-            this.waitingTasksCount = 0;
-            //Observables
+            this._tasks = new Array();
+            this._waitingTasksCount = 0;
+            this._totalTasksCount = 0;
+            /**
+             * Observable called when all tasks are processed
+             */
             this.onTaskSuccessObservable = new BABYLON.Observable();
+            /**
+             * Observable called when a task had an error
+             */
             this.onTaskErrorObservable = new BABYLON.Observable();
+            /**
+             * Observable called when a task is successful
+             */
             this.onTasksDoneObservable = new BABYLON.Observable();
+            /**
+             * Observable called when a task is done (whatever the result is)
+             */
             this.onProgressObservable = new BABYLON.Observable();
+            /**
+             * Gets or sets a boolean defining if the {BABYLON.AssetsManager} should use the default loading screen
+             * @see http://doc.babylonjs.com/how_to/creating_a_custom_loading_screen
+             */
             this.useDefaultLoadingScreen = true;
             this._scene = scene;
         }
+        /**
+         * Add a {BABYLON.MeshAssetTask} to the list of active tasks
+         * @param taskName defines the name of the new task
+         * @param meshesNames defines the name of meshes to load
+         * @param rootUrl defines the root url to use to locate files
+         * @param sceneFilename defines the filename of the scene file
+         * @returns a new {BABYLON.MeshAssetTask} object
+         */
         AssetsManager.prototype.addMeshTask = function (taskName, meshesNames, rootUrl, sceneFilename) {
             var task = new MeshAssetTask(taskName, meshesNames, rootUrl, sceneFilename);
-            this.tasks.push(task);
+            this._tasks.push(task);
             return task;
         };
+        /**
+         * Add a {BABYLON.TextFileAssetTask} to the list of active tasks
+         * @param taskName defines the name of the new task
+         * @param url defines the url of the file to load
+         * @returns a new {BABYLON.TextFileAssetTask} object
+         */
         AssetsManager.prototype.addTextFileTask = function (taskName, url) {
             var task = new TextFileAssetTask(taskName, url);
-            this.tasks.push(task);
+            this._tasks.push(task);
             return task;
         };
+        /**
+         * Add a {BABYLON.BinaryFileAssetTask} to the list of active tasks
+         * @param taskName defines the name of the new task
+         * @param url defines the url of the file to load
+         * @returns a new {BABYLON.BinaryFileAssetTask} object
+         */
         AssetsManager.prototype.addBinaryFileTask = function (taskName, url) {
             var task = new BinaryFileAssetTask(taskName, url);
-            this.tasks.push(task);
+            this._tasks.push(task);
             return task;
         };
+        /**
+         * Add a {BABYLON.ImageAssetTask} to the list of active tasks
+         * @param taskName defines the name of the new task
+         * @param url defines the url of the file to load
+         * @returns a new {BABYLON.ImageAssetTask} object
+         */
         AssetsManager.prototype.addImageTask = function (taskName, url) {
             var task = new ImageAssetTask(taskName, url);
-            this.tasks.push(task);
+            this._tasks.push(task);
             return task;
         };
+        /**
+         * Add a {BABYLON.TextureAssetTask} to the list of active tasks
+         * @param taskName defines the name of the new task
+         * @param url defines the url of the file to load
+         * @param noMipmap defines if the texture must not receive mipmaps (false by default)
+         * @param invertY defines if you want to invert Y axis of the loaded texture (false by default)
+         * @param samplingMode defines the sampling mode to use (BABYLON.Texture.TRILINEAR_SAMPLINGMODE by default)
+         * @returns a new {BABYLON.TextureAssetTask} object
+         */
         AssetsManager.prototype.addTextureTask = function (taskName, url, noMipmap, invertY, samplingMode) {
             if (samplingMode === void 0) { samplingMode = BABYLON.Texture.TRILINEAR_SAMPLINGMODE; }
             var task = new TextureAssetTask(taskName, url, noMipmap, invertY, samplingMode);
-            this.tasks.push(task);
+            this._tasks.push(task);
             return task;
         };
-        AssetsManager.prototype.addCubeTextureTask = function (name, url, extensions, noMipmap, files) {
-            var task = new CubeTextureAssetTask(name, url, extensions, noMipmap, files);
-            this.tasks.push(task);
+        /**
+         * Add a {BABYLON.CubeTextureAssetTask} to the list of active tasks
+         * @param taskName defines the name of the new task
+         * @param url defines the url of the file to load
+         * @param extensions defines the extension to use to load the cube map (can be null)
+         * @param noMipmap defines if the texture must not receive mipmaps (false by default)
+         * @param files defines the list of files to load (can be null)
+         * @returns a new {BABYLON.CubeTextureAssetTask} object
+         */
+        AssetsManager.prototype.addCubeTextureTask = function (taskName, url, extensions, noMipmap, files) {
+            var task = new CubeTextureAssetTask(taskName, url, extensions, noMipmap, files);
+            this._tasks.push(task);
             return task;
         };
-        AssetsManager.prototype.addHDRCubeTextureTask = function (name, url, size, noMipmap, generateHarmonics, useInGammaSpace, usePMREMGenerator) {
+        /**
+         *
+         * Add a {BABYLON.HDRCubeTextureAssetTask} to the list of active tasks
+         * @param taskName defines the name of the new task
+         * @param url defines the url of the file to load
+         * @param size defines the size you want for the cubemap (can be null)
+         * @param noMipmap defines if the texture must not receive mipmaps (false by default)
+         * @param generateHarmonics defines if you want to automatically generate (true by default)
+         * @param useInGammaSpace defines if the texture must be considered in gamma space (false by default)
+         * @param usePMREMGenerator is a reserved parameter and must be set to false or ignored
+         * @returns a new {BABYLON.HDRCubeTextureAssetTask} object
+         */
+        AssetsManager.prototype.addHDRCubeTextureTask = function (taskName, url, size, noMipmap, generateHarmonics, useInGammaSpace, usePMREMGenerator) {
             if (noMipmap === void 0) { noMipmap = false; }
             if (generateHarmonics === void 0) { generateHarmonics = true; }
             if (useInGammaSpace === void 0) { useInGammaSpace = false; }
             if (usePMREMGenerator === void 0) { usePMREMGenerator = false; }
-            var task = new HDRCubeTextureAssetTask(name, url, size, noMipmap, generateHarmonics, useInGammaSpace, usePMREMGenerator);
-            this.tasks.push(task);
+            var task = new HDRCubeTextureAssetTask(taskName, url, size, noMipmap, generateHarmonics, useInGammaSpace, usePMREMGenerator);
+            this._tasks.push(task);
             return task;
         };
         AssetsManager.prototype._decreaseWaitingTasksCount = function (task) {
-            this.waitingTasksCount--;
+            var _this = this;
+            this._waitingTasksCount--;
             try {
+                if (task.taskState === AssetTaskState.DONE) {
+                    // Let's remove successfull tasks
+                    BABYLON.Tools.SetImmediate(function () {
+                        var index = _this._tasks.indexOf(task);
+                        if (index > -1) {
+                            _this._tasks.splice(index, 1);
+                        }
+                    });
+                }
                 if (this.onProgress) {
-                    this.onProgress(this.waitingTasksCount, this.tasks.length, task);
+                    this.onProgress(this._waitingTasksCount, this._totalTasksCount, task);
                 }
-                this.onProgressObservable.notifyObservers(new AssetsProgressEvent(this.waitingTasksCount, this.tasks.length, task));
+                this.onProgressObservable.notifyObservers(new AssetsProgressEvent(this._waitingTasksCount, this._totalTasksCount, task));
             }
             catch (e) {
                 BABYLON.Tools.Error("Error running progress callbacks.");
                 console.log(e);
             }
-            if (this.waitingTasksCount === 0) {
+            if (this._waitingTasksCount === 0) {
                 try {
                     if (this.onFinish) {
-                        this.onFinish(this.tasks);
+                        this.onFinish(this._tasks);
                     }
-                    this.onTasksDoneObservable.notifyObservers(this.tasks);
+                    this.onTasksDoneObservable.notifyObservers(this._tasks);
                 }
                 catch (e) {
                     BABYLON.Tools.Error("Error running tasks-done callbacks.");
@@ -78327,10 +78725,7 @@ var BABYLON;
                 }
             };
             var error = function (message, exception) {
-                task.errorObject = task.errorObject || {
-                    message: message,
-                    exception: exception
-                };
+                task._setErrorObject(message, exception);
                 if (_this.onTaskError) {
                     _this.onTaskError(task);
                 }
@@ -78339,30 +78734,38 @@ var BABYLON;
             };
             task.run(this._scene, done, error);
         };
+        /**
+         * Reset the {BABYLON.AssetsManager} and remove all tasks
+         * @return the current instance of the {BABYLON.AssetsManager}
+         */
         AssetsManager.prototype.reset = function () {
             this._isLoading = false;
-            this.tasks = new Array();
+            this._tasks = new Array();
             return this;
         };
+        /**
+         * Start the loading process
+         * @return the current instance of the {BABYLON.AssetsManager}
+         */
         AssetsManager.prototype.load = function () {
             if (this._isLoading) {
                 return this;
             }
             this._isLoading = true;
-            this.waitingTasksCount = this.tasks.length;
-            if (this.waitingTasksCount === 0) {
+            this._waitingTasksCount = this._tasks.length;
+            this._totalTasksCount = this._tasks.length;
+            if (this._waitingTasksCount === 0) {
                 if (this.onFinish) {
-                    this.onFinish(this.tasks);
+                    this.onFinish(this._tasks);
                 }
-                this.onTasksDoneObservable.notifyObservers(this.tasks);
-                this._isLoading = false;
+                this.onTasksDoneObservable.notifyObservers(this._tasks);
                 return this;
             }
             if (this.useDefaultLoadingScreen) {
                 this._scene.getEngine().displayLoadingUI();
             }
-            for (var index = 0; index < this.tasks.length; index++) {
-                var task = this.tasks[index];
+            for (var index = 0; index < this._tasks.length; index++) {
+                var task = this._tasks[index];
                 this._runTask(task);
             }
             return this;

+ 452 - 49
dist/preview release/es6.js

@@ -66457,9 +66457,9 @@ var BABYLON;
          * @param scene The scene the texture will be used in
          * @param size The cubemap desired size (the more it increases the longer the generation will be) If the size is omitted this implies you are using a preprocessed cubemap.
          * @param noMipmap Forces to not generate the mipmap if true
-         * @param generateHarmonics Specifies wether you want to extract the polynomial harmonics during the generation process
+         * @param generateHarmonics Specifies whether you want to extract the polynomial harmonics during the generation process
          * @param useInGammaSpace Specifies if the texture will be use in gamma or linear space (the PBR material requires those texture in linear space, but the standard material would require them in Gamma space)
-         * @param usePMREMGenerator Specifies wether or not to generate the CubeMap through CubeMapGen to avoid seams issue at run time.
+         * @param usePMREMGenerator Specifies whether or not to generate the CubeMap through CubeMapGen to avoid seams issue at run time.
          */
         function HDRCubeTexture(url, scene, size, noMipmap, generateHarmonics, useInGammaSpace, usePMREMGenerator, onLoad, onError) {
             if (noMipmap === void 0) { noMipmap = false; }
@@ -78157,34 +78157,114 @@ var BABYLON;
 
 var BABYLON;
 (function (BABYLON) {
+    /**
+     * Defines the list of states available for a task inside a {BABYLON.AssetsManager}
+     */
     var AssetTaskState;
     (function (AssetTaskState) {
+        /**
+         * Initialization
+         */
         AssetTaskState[AssetTaskState["INIT"] = 0] = "INIT";
+        /**
+         * Running
+         */
         AssetTaskState[AssetTaskState["RUNNING"] = 1] = "RUNNING";
+        /**
+         * Done
+         */
         AssetTaskState[AssetTaskState["DONE"] = 2] = "DONE";
+        /**
+         * Error
+         */
         AssetTaskState[AssetTaskState["ERROR"] = 3] = "ERROR";
     })(AssetTaskState = BABYLON.AssetTaskState || (BABYLON.AssetTaskState = {}));
+    /**
+     * Define an abstract asset task used with a {BABYLON.AssetsManager} class to load assets into a scene
+     */
     var AbstractAssetTask = /** @class */ (function () {
-        function AbstractAssetTask(name) {
+        /**
+         * Creates a new {BABYLON.AssetsManager}
+         * @param name defines the name of the task
+         */
+        function AbstractAssetTask(
+            /**
+             * Task name
+             */ name) {
             this.name = name;
-            this.isCompleted = false;
-            this.taskState = AssetTaskState.INIT;
+            this._isCompleted = false;
+            this._taskState = AssetTaskState.INIT;
         }
+        Object.defineProperty(AbstractAssetTask.prototype, "isCompleted", {
+            /**
+             * Get if the task is completed
+             */
+            get: function () {
+                return this._isCompleted;
+            },
+            enumerable: true,
+            configurable: true
+        });
+        Object.defineProperty(AbstractAssetTask.prototype, "taskState", {
+            /**
+             * Gets the current state of the task
+             */
+            get: function () {
+                return this._taskState;
+            },
+            enumerable: true,
+            configurable: true
+        });
+        Object.defineProperty(AbstractAssetTask.prototype, "errorObject", {
+            /**
+             * Gets the current error object (if task is in error)
+             */
+            get: function () {
+                return this._errorObject;
+            },
+            enumerable: true,
+            configurable: true
+        });
+        /**
+         * Internal only
+         * @ignore
+         */
+        AbstractAssetTask.prototype._setErrorObject = function (message, exception) {
+            if (this._errorObject) {
+                return;
+            }
+            this._errorObject = {
+                message: message,
+                exception: exception
+            };
+        };
+        /**
+         * Execute the current task
+         * @param scene defines the scene where you want your assets to be loaded
+         * @param onSuccess is a callback called when the task is successfully executed
+         * @param onError is a callback called if an error occurs
+         */
         AbstractAssetTask.prototype.run = function (scene, onSuccess, onError) {
             var _this = this;
-            this.taskState = AssetTaskState.RUNNING;
+            this._taskState = AssetTaskState.RUNNING;
             this.runTask(scene, function () {
                 _this.onDoneCallback(onSuccess, onError);
             }, function (msg, exception) {
                 _this.onErrorCallback(onError, msg, exception);
             });
         };
+        /**
+         * Execute the current task
+         * @param scene defines the scene where you want your assets to be loaded
+         * @param onSuccess is a callback called when the task is successfully executed
+         * @param onError is a callback called if an error occurs
+         */
         AbstractAssetTask.prototype.runTask = function (scene, onSuccess, onError) {
             throw new Error("runTask is not implemented");
         };
         AbstractAssetTask.prototype.onErrorCallback = function (onError, message, exception) {
-            this.taskState = AssetTaskState.ERROR;
-            this.errorObject = {
+            this._taskState = AssetTaskState.ERROR;
+            this._errorObject = {
                 message: message,
                 exception: exception
             };
@@ -78195,8 +78275,8 @@ var BABYLON;
         };
         AbstractAssetTask.prototype.onDoneCallback = function (onSuccess, onError) {
             try {
-                this.taskState = AssetTaskState.DONE;
-                this.isCompleted = true;
+                this._taskState = AssetTaskState.DONE;
+                this._isCompleted = true;
                 if (this.onSuccess) {
                     this.onSuccess(this);
                 }
@@ -78209,7 +78289,16 @@ var BABYLON;
         return AbstractAssetTask;
     }());
     BABYLON.AbstractAssetTask = AbstractAssetTask;
+    /**
+     * Class used to share progress information about assets loading
+     */
     var AssetsProgressEvent = /** @class */ (function () {
+        /**
+         * Creates a {BABYLON.AssetsProgressEvent}
+         * @param remainingCount defines the number of remaining tasks to process
+         * @param totalCount defines the total number of tasks
+         * @param task defines the task that was just processed
+         */
         function AssetsProgressEvent(remainingCount, totalCount, task) {
             this.remainingCount = remainingCount;
             this.totalCount = totalCount;
@@ -78218,9 +78307,35 @@ var BABYLON;
         return AssetsProgressEvent;
     }());
     BABYLON.AssetsProgressEvent = AssetsProgressEvent;
+    /**
+     * Define a task used by {BABYLON.AssetsManager} to load meshes
+     */
     var MeshAssetTask = /** @class */ (function (_super) {
         __extends(MeshAssetTask, _super);
-        function MeshAssetTask(name, meshesNames, rootUrl, sceneFilename) {
+        /**
+         * Creates a new {BABYLON.MeshAssetTask}
+         * @param name defines the name of the task
+         * @param meshesNames defines the list of mesh's names you want to load
+         * @param rootUrl defines the root url to use as a base to load your meshes and associated resources
+         * @param sceneFilename defines the filename of the scene to load from
+         */
+        function MeshAssetTask(
+            /**
+             * Defines the name of the task
+             */
+            name, 
+            /**
+             * Defines the list of mesh's names you want to load
+             */
+            meshesNames, 
+            /**
+             * Defines the root url to use as a base to load your meshes and associated resources
+             */
+            rootUrl, 
+            /**
+             * Defines the filename of the scene to load from
+             */
+            sceneFilename) {
             var _this = _super.call(this, name) || this;
             _this.name = name;
             _this.meshesNames = meshesNames;
@@ -78228,6 +78343,12 @@ var BABYLON;
             _this.sceneFilename = sceneFilename;
             return _this;
         }
+        /**
+         * Execute the current task
+         * @param scene defines the scene where you want your assets to be loaded
+         * @param onSuccess is a callback called when the task is successfully executed
+         * @param onError is a callback called if an error occurs
+         */
         MeshAssetTask.prototype.runTask = function (scene, onSuccess, onError) {
             var _this = this;
             BABYLON.SceneLoader.ImportMesh(this.meshesNames, this.rootUrl, this.sceneFilename, scene, function (meshes, particleSystems, skeletons) {
@@ -78242,14 +78363,36 @@ var BABYLON;
         return MeshAssetTask;
     }(AbstractAssetTask));
     BABYLON.MeshAssetTask = MeshAssetTask;
+    /**
+     * Define a task used by {BABYLON.AssetsManager} to load text content
+     */
     var TextFileAssetTask = /** @class */ (function (_super) {
         __extends(TextFileAssetTask, _super);
-        function TextFileAssetTask(name, url) {
+        /**
+         * Creates a new TextFileAssetTask object
+         * @param name defines the name of the task
+         * @param url defines the location of the file to load
+         */
+        function TextFileAssetTask(
+            /**
+             * Defines the name of the task
+             */
+            name, 
+            /**
+             * Defines the location of the file to load
+             */
+            url) {
             var _this = _super.call(this, name) || this;
             _this.name = name;
             _this.url = url;
             return _this;
         }
+        /**
+         * Execute the current task
+         * @param scene defines the scene where you want your assets to be loaded
+         * @param onSuccess is a callback called when the task is successfully executed
+         * @param onError is a callback called if an error occurs
+         */
         TextFileAssetTask.prototype.runTask = function (scene, onSuccess, onError) {
             var _this = this;
             scene._loadFile(this.url, function (data) {
@@ -78264,14 +78407,36 @@ var BABYLON;
         return TextFileAssetTask;
     }(AbstractAssetTask));
     BABYLON.TextFileAssetTask = TextFileAssetTask;
+    /**
+     * Define a task used by {BABYLON.AssetsManager} to load binary data
+     */
     var BinaryFileAssetTask = /** @class */ (function (_super) {
         __extends(BinaryFileAssetTask, _super);
-        function BinaryFileAssetTask(name, url) {
+        /**
+         * Creates a new BinaryFileAssetTask object
+         * @param name defines the name of the new task
+         * @param url defines the location of the file to load
+         */
+        function BinaryFileAssetTask(
+            /**
+             * Defines the name of the task
+             */
+            name, 
+            /**
+             * Defines the location of the file to load
+             */
+            url) {
             var _this = _super.call(this, name) || this;
             _this.name = name;
             _this.url = url;
             return _this;
         }
+        /**
+         * Execute the current task
+         * @param scene defines the scene where you want your assets to be loaded
+         * @param onSuccess is a callback called when the task is successfully executed
+         * @param onError is a callback called if an error occurs
+         */
         BinaryFileAssetTask.prototype.runTask = function (scene, onSuccess, onError) {
             var _this = this;
             scene._loadFile(this.url, function (data) {
@@ -78286,14 +78451,36 @@ var BABYLON;
         return BinaryFileAssetTask;
     }(AbstractAssetTask));
     BABYLON.BinaryFileAssetTask = BinaryFileAssetTask;
+    /**
+     * Define a task used by {BABYLON.AssetsManager} to load images
+     */
     var ImageAssetTask = /** @class */ (function (_super) {
         __extends(ImageAssetTask, _super);
-        function ImageAssetTask(name, url) {
+        /**
+         * Creates a new ImageAssetTask
+         * @param name defines the name of the task
+         * @param url defines the location of the image to load
+         */
+        function ImageAssetTask(
+            /**
+             * Defines the name of the task
+             */
+            name, 
+            /**
+             * Defines the location of the image to load
+             */
+            url) {
             var _this = _super.call(this, name) || this;
             _this.name = name;
             _this.url = url;
             return _this;
         }
+        /**
+         * Execute the current task
+         * @param scene defines the scene where you want your assets to be loaded
+         * @param onSuccess is a callback called when the task is successfully executed
+         * @param onError is a callback called if an error occurs
+         */
         ImageAssetTask.prototype.runTask = function (scene, onSuccess, onError) {
             var _this = this;
             var img = new Image();
@@ -78310,9 +78497,40 @@ var BABYLON;
         return ImageAssetTask;
     }(AbstractAssetTask));
     BABYLON.ImageAssetTask = ImageAssetTask;
+    /**
+     * Define a task used by {BABYLON.AssetsManager} to load 2D textures
+     */
     var TextureAssetTask = /** @class */ (function (_super) {
         __extends(TextureAssetTask, _super);
-        function TextureAssetTask(name, url, noMipmap, invertY, samplingMode) {
+        /**
+         * Creates a new TextureAssetTask object
+         * @param name defines the name of the task
+         * @param url defines the location of the file to load
+         * @param noMipmap defines if mipmap should not be generated (default is false)
+         * @param invertY defines if texture must be inverted on Y axis (default is false)
+         * @param samplingMode defines the sampling mode to use (default is BABYLON.Texture.TRILINEAR_SAMPLINGMODE)
+         */
+        function TextureAssetTask(
+            /**
+             * Defines the name of the task
+             */
+            name, 
+            /**
+             * Defines the location of the file to load
+             */
+            url, 
+            /**
+             * Defines if mipmap should not be generated (default is false)
+             */
+            noMipmap, 
+            /**
+             * Defines if texture must be inverted on Y axis (default is false)
+             */
+            invertY, 
+            /**
+             * Defines the sampling mode to use (default is BABYLON.Texture.TRILINEAR_SAMPLINGMODE)
+             */
+            samplingMode) {
             if (samplingMode === void 0) { samplingMode = BABYLON.Texture.TRILINEAR_SAMPLINGMODE; }
             var _this = _super.call(this, name) || this;
             _this.name = name;
@@ -78322,6 +78540,12 @@ var BABYLON;
             _this.samplingMode = samplingMode;
             return _this;
         }
+        /**
+         * Execute the current task
+         * @param scene defines the scene where you want your assets to be loaded
+         * @param onSuccess is a callback called when the task is successfully executed
+         * @param onError is a callback called if an error occurs
+         */
         TextureAssetTask.prototype.runTask = function (scene, onSuccess, onError) {
             var onload = function () {
                 onSuccess();
@@ -78334,9 +78558,40 @@ var BABYLON;
         return TextureAssetTask;
     }(AbstractAssetTask));
     BABYLON.TextureAssetTask = TextureAssetTask;
+    /**
+     * Define a task used by {BABYLON.AssetsManager} to load cube textures
+     */
     var CubeTextureAssetTask = /** @class */ (function (_super) {
         __extends(CubeTextureAssetTask, _super);
-        function CubeTextureAssetTask(name, url, extensions, noMipmap, files) {
+        /**
+         * Creates a new CubeTextureAssetTask
+         * @param name defines the name of the task
+         * @param url defines the location of the files to load (You have to specify the folder where the files are + filename with no extension)
+         * @param extensions defines the extensions to use to load files (["_px", "_py", "_pz", "_nx", "_ny", "_nz"] by default)
+         * @param noMipmap defines if mipmaps should not be generated (default is false)
+         * @param files defines the explicit list of files (undefined by default)
+         */
+        function CubeTextureAssetTask(
+            /**
+             * Defines the name of the task
+             */
+            name, 
+            /**
+             * Defines the location of the files to load (You have to specify the folder where the files are + filename with no extension)
+             */
+            url, 
+            /**
+             * Defines the extensions to use to load files (["_px", "_py", "_pz", "_nx", "_ny", "_nz"] by default)
+             */
+            extensions, 
+            /**
+             * Defines if mipmaps should not be generated (default is false)
+             */
+            noMipmap, 
+            /**
+             * Defines the explicit list of files (undefined by default)
+             */
+            files) {
             var _this = _super.call(this, name) || this;
             _this.name = name;
             _this.url = url;
@@ -78345,6 +78600,12 @@ var BABYLON;
             _this.files = files;
             return _this;
         }
+        /**
+         * Execute the current task
+         * @param scene defines the scene where you want your assets to be loaded
+         * @param onSuccess is a callback called when the task is successfully executed
+         * @param onError is a callback called if an error occurs
+         */
         CubeTextureAssetTask.prototype.runTask = function (scene, onSuccess, onError) {
             var onload = function () {
                 onSuccess();
@@ -78357,9 +78618,50 @@ var BABYLON;
         return CubeTextureAssetTask;
     }(AbstractAssetTask));
     BABYLON.CubeTextureAssetTask = CubeTextureAssetTask;
+    /**
+     * Define a task used by {BABYLON.AssetsManager} to load HDR cube textures
+     */
     var HDRCubeTextureAssetTask = /** @class */ (function (_super) {
         __extends(HDRCubeTextureAssetTask, _super);
-        function HDRCubeTextureAssetTask(name, url, size, noMipmap, generateHarmonics, useInGammaSpace, usePMREMGenerator) {
+        /**
+         * Creates a new HDRCubeTextureAssetTask object
+         * @param name defines the name of the task
+         * @param url defines the location of the file to load
+         * @param size defines the desired size (the more it increases the longer the generation will be) If the size is omitted this implies you are using a preprocessed cubemap.
+         * @param noMipmap defines if mipmaps should not be generated (default is false)
+         * @param generateHarmonics specifies whether you want to extract the polynomial harmonics during the generation process (default is true)
+         * @param useInGammaSpace specifies if the texture will be use in gamma or linear space (the PBR material requires those texture in linear space, but the standard material would require them in Gamma space) (default is false)
+         * @param usePMREMGenerator specifies whether or not to generate the CubeMap through CubeMapGen to avoid seams issue at run time (default is false)
+         */
+        function HDRCubeTextureAssetTask(
+            /**
+             * Defines the name of the task
+             */
+            name, 
+            /**
+             * Defines the location of the file to load
+             */
+            url, 
+            /**
+             * Defines the desired size (the more it increases the longer the generation will be) If the size is omitted this implies you are using a preprocessed cubemap.
+             */
+            size, 
+            /**
+             * Defines if mipmaps should not be generated (default is false)
+             */
+            noMipmap, 
+            /**
+             * Specifies whether you want to extract the polynomial harmonics during the generation process (default is true)
+             */
+            generateHarmonics, 
+            /**
+             * Specifies if the texture will be use in gamma or linear space (the PBR material requires those texture in linear space, but the standard material would require them in Gamma space) (default is false)
+             */
+            useInGammaSpace, 
+            /**
+             * Specifies whether or not to generate the CubeMap through CubeMapGen to avoid seams issue at run time (default is false)
+             */
+            usePMREMGenerator) {
             if (noMipmap === void 0) { noMipmap = false; }
             if (generateHarmonics === void 0) { generateHarmonics = true; }
             if (useInGammaSpace === void 0) { useInGammaSpace = false; }
@@ -78374,6 +78676,12 @@ var BABYLON;
             _this.usePMREMGenerator = usePMREMGenerator;
             return _this;
         }
+        /**
+         * Execute the current task
+         * @param scene defines the scene where you want your assets to be loaded
+         * @param onSuccess is a callback called when the task is successfully executed
+         * @param onError is a callback called if an error occurs
+         */
         HDRCubeTextureAssetTask.prototype.run = function (scene, onSuccess, onError) {
             var onload = function () {
                 onSuccess();
@@ -78386,77 +78694,167 @@ var BABYLON;
         return HDRCubeTextureAssetTask;
     }(AbstractAssetTask));
     BABYLON.HDRCubeTextureAssetTask = HDRCubeTextureAssetTask;
+    /**
+     * This class can be used to easily import assets into a scene
+     * @see http://doc.babylonjs.com/how_to/how_to_use_assetsmanager
+     */
     var AssetsManager = /** @class */ (function () {
+        /**
+         * Creates a new AssetsManager
+         * @param scene defines the scene to work on
+         */
         function AssetsManager(scene) {
             this._isLoading = false;
-            this.tasks = new Array();
-            this.waitingTasksCount = 0;
-            //Observables
+            this._tasks = new Array();
+            this._waitingTasksCount = 0;
+            this._totalTasksCount = 0;
+            /**
+             * Observable called when all tasks are processed
+             */
             this.onTaskSuccessObservable = new BABYLON.Observable();
+            /**
+             * Observable called when a task had an error
+             */
             this.onTaskErrorObservable = new BABYLON.Observable();
+            /**
+             * Observable called when a task is successful
+             */
             this.onTasksDoneObservable = new BABYLON.Observable();
+            /**
+             * Observable called when a task is done (whatever the result is)
+             */
             this.onProgressObservable = new BABYLON.Observable();
+            /**
+             * Gets or sets a boolean defining if the {BABYLON.AssetsManager} should use the default loading screen
+             * @see http://doc.babylonjs.com/how_to/creating_a_custom_loading_screen
+             */
             this.useDefaultLoadingScreen = true;
             this._scene = scene;
         }
+        /**
+         * Add a {BABYLON.MeshAssetTask} to the list of active tasks
+         * @param taskName defines the name of the new task
+         * @param meshesNames defines the name of meshes to load
+         * @param rootUrl defines the root url to use to locate files
+         * @param sceneFilename defines the filename of the scene file
+         * @returns a new {BABYLON.MeshAssetTask} object
+         */
         AssetsManager.prototype.addMeshTask = function (taskName, meshesNames, rootUrl, sceneFilename) {
             var task = new MeshAssetTask(taskName, meshesNames, rootUrl, sceneFilename);
-            this.tasks.push(task);
+            this._tasks.push(task);
             return task;
         };
+        /**
+         * Add a {BABYLON.TextFileAssetTask} to the list of active tasks
+         * @param taskName defines the name of the new task
+         * @param url defines the url of the file to load
+         * @returns a new {BABYLON.TextFileAssetTask} object
+         */
         AssetsManager.prototype.addTextFileTask = function (taskName, url) {
             var task = new TextFileAssetTask(taskName, url);
-            this.tasks.push(task);
+            this._tasks.push(task);
             return task;
         };
+        /**
+         * Add a {BABYLON.BinaryFileAssetTask} to the list of active tasks
+         * @param taskName defines the name of the new task
+         * @param url defines the url of the file to load
+         * @returns a new {BABYLON.BinaryFileAssetTask} object
+         */
         AssetsManager.prototype.addBinaryFileTask = function (taskName, url) {
             var task = new BinaryFileAssetTask(taskName, url);
-            this.tasks.push(task);
+            this._tasks.push(task);
             return task;
         };
+        /**
+         * Add a {BABYLON.ImageAssetTask} to the list of active tasks
+         * @param taskName defines the name of the new task
+         * @param url defines the url of the file to load
+         * @returns a new {BABYLON.ImageAssetTask} object
+         */
         AssetsManager.prototype.addImageTask = function (taskName, url) {
             var task = new ImageAssetTask(taskName, url);
-            this.tasks.push(task);
+            this._tasks.push(task);
             return task;
         };
+        /**
+         * Add a {BABYLON.TextureAssetTask} to the list of active tasks
+         * @param taskName defines the name of the new task
+         * @param url defines the url of the file to load
+         * @param noMipmap defines if the texture must not receive mipmaps (false by default)
+         * @param invertY defines if you want to invert Y axis of the loaded texture (false by default)
+         * @param samplingMode defines the sampling mode to use (BABYLON.Texture.TRILINEAR_SAMPLINGMODE by default)
+         * @returns a new {BABYLON.TextureAssetTask} object
+         */
         AssetsManager.prototype.addTextureTask = function (taskName, url, noMipmap, invertY, samplingMode) {
             if (samplingMode === void 0) { samplingMode = BABYLON.Texture.TRILINEAR_SAMPLINGMODE; }
             var task = new TextureAssetTask(taskName, url, noMipmap, invertY, samplingMode);
-            this.tasks.push(task);
+            this._tasks.push(task);
             return task;
         };
-        AssetsManager.prototype.addCubeTextureTask = function (name, url, extensions, noMipmap, files) {
-            var task = new CubeTextureAssetTask(name, url, extensions, noMipmap, files);
-            this.tasks.push(task);
+        /**
+         * Add a {BABYLON.CubeTextureAssetTask} to the list of active tasks
+         * @param taskName defines the name of the new task
+         * @param url defines the url of the file to load
+         * @param extensions defines the extension to use to load the cube map (can be null)
+         * @param noMipmap defines if the texture must not receive mipmaps (false by default)
+         * @param files defines the list of files to load (can be null)
+         * @returns a new {BABYLON.CubeTextureAssetTask} object
+         */
+        AssetsManager.prototype.addCubeTextureTask = function (taskName, url, extensions, noMipmap, files) {
+            var task = new CubeTextureAssetTask(taskName, url, extensions, noMipmap, files);
+            this._tasks.push(task);
             return task;
         };
-        AssetsManager.prototype.addHDRCubeTextureTask = function (name, url, size, noMipmap, generateHarmonics, useInGammaSpace, usePMREMGenerator) {
+        /**
+         *
+         * Add a {BABYLON.HDRCubeTextureAssetTask} to the list of active tasks
+         * @param taskName defines the name of the new task
+         * @param url defines the url of the file to load
+         * @param size defines the size you want for the cubemap (can be null)
+         * @param noMipmap defines if the texture must not receive mipmaps (false by default)
+         * @param generateHarmonics defines if you want to automatically generate (true by default)
+         * @param useInGammaSpace defines if the texture must be considered in gamma space (false by default)
+         * @param usePMREMGenerator is a reserved parameter and must be set to false or ignored
+         * @returns a new {BABYLON.HDRCubeTextureAssetTask} object
+         */
+        AssetsManager.prototype.addHDRCubeTextureTask = function (taskName, url, size, noMipmap, generateHarmonics, useInGammaSpace, usePMREMGenerator) {
             if (noMipmap === void 0) { noMipmap = false; }
             if (generateHarmonics === void 0) { generateHarmonics = true; }
             if (useInGammaSpace === void 0) { useInGammaSpace = false; }
             if (usePMREMGenerator === void 0) { usePMREMGenerator = false; }
-            var task = new HDRCubeTextureAssetTask(name, url, size, noMipmap, generateHarmonics, useInGammaSpace, usePMREMGenerator);
-            this.tasks.push(task);
+            var task = new HDRCubeTextureAssetTask(taskName, url, size, noMipmap, generateHarmonics, useInGammaSpace, usePMREMGenerator);
+            this._tasks.push(task);
             return task;
         };
         AssetsManager.prototype._decreaseWaitingTasksCount = function (task) {
-            this.waitingTasksCount--;
+            var _this = this;
+            this._waitingTasksCount--;
             try {
+                if (task.taskState === AssetTaskState.DONE) {
+                    // Let's remove successfull tasks
+                    BABYLON.Tools.SetImmediate(function () {
+                        var index = _this._tasks.indexOf(task);
+                        if (index > -1) {
+                            _this._tasks.splice(index, 1);
+                        }
+                    });
+                }
                 if (this.onProgress) {
-                    this.onProgress(this.waitingTasksCount, this.tasks.length, task);
+                    this.onProgress(this._waitingTasksCount, this._totalTasksCount, task);
                 }
-                this.onProgressObservable.notifyObservers(new AssetsProgressEvent(this.waitingTasksCount, this.tasks.length, task));
+                this.onProgressObservable.notifyObservers(new AssetsProgressEvent(this._waitingTasksCount, this._totalTasksCount, task));
             }
             catch (e) {
                 BABYLON.Tools.Error("Error running progress callbacks.");
                 console.log(e);
             }
-            if (this.waitingTasksCount === 0) {
+            if (this._waitingTasksCount === 0) {
                 try {
                     if (this.onFinish) {
-                        this.onFinish(this.tasks);
+                        this.onFinish(this._tasks);
                     }
-                    this.onTasksDoneObservable.notifyObservers(this.tasks);
+                    this.onTasksDoneObservable.notifyObservers(this._tasks);
                 }
                 catch (e) {
                     BABYLON.Tools.Error("Error running tasks-done callbacks.");
@@ -78481,10 +78879,7 @@ var BABYLON;
                 }
             };
             var error = function (message, exception) {
-                task.errorObject = task.errorObject || {
-                    message: message,
-                    exception: exception
-                };
+                task._setErrorObject(message, exception);
                 if (_this.onTaskError) {
                     _this.onTaskError(task);
                 }
@@ -78493,30 +78888,38 @@ var BABYLON;
             };
             task.run(this._scene, done, error);
         };
+        /**
+         * Reset the {BABYLON.AssetsManager} and remove all tasks
+         * @return the current instance of the {BABYLON.AssetsManager}
+         */
         AssetsManager.prototype.reset = function () {
             this._isLoading = false;
-            this.tasks = new Array();
+            this._tasks = new Array();
             return this;
         };
+        /**
+         * Start the loading process
+         * @return the current instance of the {BABYLON.AssetsManager}
+         */
         AssetsManager.prototype.load = function () {
             if (this._isLoading) {
                 return this;
             }
             this._isLoading = true;
-            this.waitingTasksCount = this.tasks.length;
-            if (this.waitingTasksCount === 0) {
+            this._waitingTasksCount = this._tasks.length;
+            this._totalTasksCount = this._tasks.length;
+            if (this._waitingTasksCount === 0) {
                 if (this.onFinish) {
-                    this.onFinish(this.tasks);
+                    this.onFinish(this._tasks);
                 }
-                this.onTasksDoneObservable.notifyObservers(this.tasks);
-                this._isLoading = false;
+                this.onTasksDoneObservable.notifyObservers(this._tasks);
                 return this;
             }
             if (this.useDefaultLoadingScreen) {
                 this._scene.getEngine().displayLoadingUI();
             }
-            for (var index = 0; index < this.tasks.length; index++) {
-                var task = this.tasks[index];
+            for (var index = 0; index < this._tasks.length; index++) {
+                var task = this._tasks[index];
                 this._runTask(task);
             }
             return this;

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


文件差異過大導致無法顯示
+ 2 - 1169
dist/preview release/typedocValidationBaseline.json


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