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

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


+ 11 - 3
Tools/Gulp/gulpfile.js

@@ -707,10 +707,10 @@ gulp.task("typedoc-generate", function () {
             module: "commonjs",
             target: "es5",
             includeDeclarations: true,
- 
+
             // Output options (see typedoc docs)
             json: config.build.typedocJSON,
- 
+
             // TypeDoc options (see typedoc docs)
             ignoreCompilerErrors: true,
 
@@ -738,7 +738,7 @@ gulp.task("typedoc-validate", function () {
  */
 gulp.task("typedoc-generateValidationBaseline", function () {
     return gulp.src(config.build.typedocJSON)
-    .pipe(validateTypedoc(config.build.typedocValidationBaseline, "BABYLON", true, true));
+        .pipe(validateTypedoc(config.build.typedocValidationBaseline, "BABYLON", true, true));
 });
 
 /**
@@ -749,6 +749,14 @@ gulp.task("typedoc-all", function (cb) {
     runSequence("typedoc-generate", "typedoc-validate", "typedoc-generateValidationBaseline", cb);
 });
 
+
+/**
+ * Validate compile the code and check the comments and style case convention through typedoc
+ */
+gulp.task("typedoc-check", function (cb) {
+    runSequence("typescript-compile", "typedoc-generate", "typedoc-validate", cb);
+});
+
 /**
  * Launches the KARMA validation tests in chrome in order to debug them.
  * (Can only be launch locally.)

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


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


+ 312 - 49
dist/preview release/babylon.max.js

@@ -66360,9 +66360,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; }
@@ -78300,16 +78300,68 @@ var BABYLON;
     var AbstractAssetTask = /** @class */ (function () {
         /**
          * Creates a new {BABYLON.AssetsManager}
-         * @param name define the name of the task
+         * @param name defines the name of the task
          */
-        function AbstractAssetTask(name) {
+        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) {
@@ -78326,8 +78378,8 @@ var BABYLON;
             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
             };
@@ -78338,8 +78390,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);
                 }
@@ -78356,6 +78408,12 @@ var BABYLON;
      * 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;
@@ -78369,7 +78427,30 @@ var BABYLON;
      */
     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;
@@ -78377,6 +78458,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) {
@@ -78396,12 +78483,31 @@ var BABYLON;
      */
     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) {
@@ -78421,12 +78527,31 @@ var BABYLON;
      */
     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) {
@@ -78446,12 +78571,31 @@ var BABYLON;
      */
     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();
@@ -78473,7 +78617,35 @@ var BABYLON;
      */
     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;
@@ -78483,6 +78655,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();
@@ -78500,7 +78678,35 @@ var BABYLON;
      */
     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;
@@ -78509,6 +78715,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();
@@ -78526,7 +78738,45 @@ var BABYLON;
      */
     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; }
@@ -78541,6 +78791,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();
@@ -78558,12 +78814,15 @@ var BABYLON;
      * @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;
-            this.totalTasksCount = 0;
-            //Observables
+            this._tasks = new Array();
+            this._waitingTasksCount = 0;
+            this._totalTasksCount = 0;
             /**
              * Observable called when all tasks are processed
              */
@@ -78593,40 +78852,44 @@ var BABYLON;
          * @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;
         };
         /**
@@ -78636,11 +78899,12 @@ var BABYLON;
          * @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;
         };
         /**
@@ -78650,10 +78914,11 @@ var BABYLON;
          * @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);
+            this._tasks.push(task);
             return task;
         };
         /**
@@ -78666,6 +78931,7 @@ var BABYLON;
          * @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; }
@@ -78673,37 +78939,37 @@ var BABYLON;
             if (useInGammaSpace === void 0) { useInGammaSpace = false; }
             if (usePMREMGenerator === void 0) { usePMREMGenerator = false; }
             var task = new HDRCubeTextureAssetTask(taskName, url, size, noMipmap, generateHarmonics, useInGammaSpace, usePMREMGenerator);
-            this.tasks.push(task);
+            this._tasks.push(task);
             return task;
         };
         AssetsManager.prototype._decreaseWaitingTasksCount = function (task) {
             var _this = this;
-            this.waitingTasksCount--;
+            this._waitingTasksCount--;
             try {
                 if (task.taskState === AssetTaskState.DONE) {
                     // Let's remove successfull tasks
                     BABYLON.Tools.SetImmediate(function () {
-                        var index = _this.tasks.indexOf(task);
+                        var index = _this._tasks.indexOf(task);
                         if (index > -1) {
-                            _this.tasks.splice(index, 1);
+                            _this._tasks.splice(index, 1);
                         }
                     });
                 }
                 if (this.onProgress) {
-                    this.onProgress(this.waitingTasksCount, this.totalTasksCount, task);
+                    this.onProgress(this._waitingTasksCount, this._totalTasksCount, task);
                 }
-                this.onProgressObservable.notifyObservers(new AssetsProgressEvent(this.waitingTasksCount, this.totalTasksCount, 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.");
@@ -78728,10 +78994,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);
                 }
@@ -78746,7 +79009,7 @@ var BABYLON;
          */
         AssetsManager.prototype.reset = function () {
             this._isLoading = false;
-            this.tasks = new Array();
+            this._tasks = new Array();
             return this;
         };
         /**
@@ -78758,20 +79021,20 @@ var BABYLON;
                 return this;
             }
             this._isLoading = true;
-            this.waitingTasksCount = this.tasks.length;
-            this.totalTasksCount = 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.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/babylon.worker.js


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


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


+ 306 - 49
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.max.js

@@ -66206,9 +66206,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; }
@@ -78146,16 +78146,68 @@ var BABYLON;
     var AbstractAssetTask = /** @class */ (function () {
         /**
          * Creates a new {BABYLON.AssetsManager}
-         * @param name define the name of the task
+         * @param name defines the name of the task
          */
-        function AbstractAssetTask(name) {
+        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) {
@@ -78172,8 +78224,8 @@ var BABYLON;
             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
             };
@@ -78184,8 +78236,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);
                 }
@@ -78221,7 +78273,30 @@ var BABYLON;
      */
     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;
@@ -78229,6 +78304,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) {
@@ -78248,12 +78329,31 @@ var BABYLON;
      */
     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) {
@@ -78273,12 +78373,31 @@ var BABYLON;
      */
     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) {
@@ -78298,12 +78417,31 @@ var BABYLON;
      */
     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();
@@ -78325,7 +78463,35 @@ var BABYLON;
      */
     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;
@@ -78335,6 +78501,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();
@@ -78352,7 +78524,35 @@ var BABYLON;
      */
     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;
@@ -78361,6 +78561,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();
@@ -78378,7 +78584,45 @@ var BABYLON;
      */
     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; }
@@ -78393,6 +78637,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();
@@ -78410,12 +78660,15 @@ var BABYLON;
      * @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;
-            this.totalTasksCount = 0;
-            //Observables
+            this._tasks = new Array();
+            this._waitingTasksCount = 0;
+            this._totalTasksCount = 0;
             /**
              * Observable called when all tasks are processed
              */
@@ -78445,40 +78698,44 @@ var BABYLON;
          * @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;
         };
         /**
@@ -78488,11 +78745,12 @@ var BABYLON;
          * @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;
         };
         /**
@@ -78502,10 +78760,11 @@ var BABYLON;
          * @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);
+            this._tasks.push(task);
             return task;
         };
         /**
@@ -78518,6 +78777,7 @@ var BABYLON;
          * @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; }
@@ -78525,37 +78785,37 @@ var BABYLON;
             if (useInGammaSpace === void 0) { useInGammaSpace = false; }
             if (usePMREMGenerator === void 0) { usePMREMGenerator = false; }
             var task = new HDRCubeTextureAssetTask(taskName, url, size, noMipmap, generateHarmonics, useInGammaSpace, usePMREMGenerator);
-            this.tasks.push(task);
+            this._tasks.push(task);
             return task;
         };
         AssetsManager.prototype._decreaseWaitingTasksCount = function (task) {
             var _this = this;
-            this.waitingTasksCount--;
+            this._waitingTasksCount--;
             try {
                 if (task.taskState === AssetTaskState.DONE) {
                     // Let's remove successfull tasks
                     BABYLON.Tools.SetImmediate(function () {
-                        var index = _this.tasks.indexOf(task);
+                        var index = _this._tasks.indexOf(task);
                         if (index > -1) {
-                            _this.tasks.splice(index, 1);
+                            _this._tasks.splice(index, 1);
                         }
                     });
                 }
                 if (this.onProgress) {
-                    this.onProgress(this.waitingTasksCount, this.totalTasksCount, task);
+                    this.onProgress(this._waitingTasksCount, this._totalTasksCount, task);
                 }
-                this.onProgressObservable.notifyObservers(new AssetsProgressEvent(this.waitingTasksCount, this.totalTasksCount, 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.");
@@ -78580,10 +78840,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);
                 }
@@ -78598,7 +78855,7 @@ var BABYLON;
          */
         AssetsManager.prototype.reset = function () {
             this._isLoading = false;
-            this.tasks = new Array();
+            this._tasks = new Array();
             return this;
         };
         /**
@@ -78610,20 +78867,20 @@ var BABYLON;
                 return this;
             }
             this._isLoading = true;
-            this.waitingTasksCount = this.tasks.length;
-            this.totalTasksCount = 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.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/typedocValidationBaseline.json

@@ -1,7 +1,7 @@
 {
-  "errors": 11187,
+  "errors": 10982,
   "babylon.typedoc.json": {
-    "errors": 11187,
+    "errors": 10982,
     "AnimationKeyInterpolation": {
       "Enumeration": {
         "Comments": {

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


+ 2 - 2
src/Materials/Textures/babylon.hdrCubeTexture.ts

@@ -64,9 +64,9 @@ module 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.
          */
         constructor(url: string, scene: Scene, size?: number, noMipmap = false, generateHarmonics = true, useInGammaSpace = false, usePMREMGenerator = false, onLoad: Nullable<() => void> = null, onError: Nullable<(message?: string, exception?: any) => void> = null) {
             super(scene);

+ 323 - 53
src/Tools/babylon.assetsManager.ts

@@ -28,23 +28,22 @@ module BABYLON {
     export abstract class AbstractAssetTask {
         /**
          * Callback called when the task is successful
-         * @param task contains the successful task
          */
         public onSuccess: (task: any) => void;
 
         /**
          * Callback called when the task is successful
-         * @param task contains the successful task
-         * @param message contains the error message
-         * @param exception can contains the inner exception 
          */
         public onError: (task: any, message?: string, exception?: any) => void;
 
         /**
          * Creates a new {BABYLON.AssetsManager}
-         * @param name define the name of the task
+         * @param name defines the name of the task
          */
-        constructor(public name: string) {
+        constructor(
+            /**
+             * Task name
+             */public name: string) {
         }
 
         private _isCompleted = false;
@@ -196,24 +195,62 @@ module BABYLON {
      * Define a task used by {BABYLON.AssetsManager} to load meshes
      */
     export class MeshAssetTask extends AbstractAssetTask {
+        /**
+         * Gets the list of loaded meshes
+         */
         public loadedMeshes: Array<AbstractMesh>;
+        /**
+         * Gets the list of loaded particle systems
+         */
         public loadedParticleSystems: Array<ParticleSystem>;
+        /**
+         * Gets the list of loaded skeletons
+         */
         public loadedSkeletons: Array<Skeleton>;
 
+        /**
+         * Callback called when the task is successful
+         */
         public onSuccess: (task: MeshAssetTask) => void;
+
+        /**
+         * Callback called when the task is successful
+         */
         public onError: (task: MeshAssetTask, message?: string, exception?: any) => void;
 
         /**
          * Creates a new {BABYLON.MeshAssetTask}
          * @param name defines the name of the task
-         * @param meshesNames 
-         * @param rootUrl 
-         * @param sceneFilename 
-         */
-        constructor(public name: string, public meshesNames: any, public rootUrl: string, public sceneFilename: string) {
+         * @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
+         */
+        constructor(
+            /**
+             * Defines the name of the task
+             */
+            public name: string,
+            /**
+             * Defines the list of mesh's names you want to load
+             */
+            public meshesNames: any,
+            /**
+             * Defines the root url to use as a base to load your meshes and associated resources
+             */
+            public rootUrl: string,
+            /**
+             * Defines the filename of the scene to load from
+             */
+            public sceneFilename: string) {
             super(name);
         }
 
+        /**
+         * 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
+         */
         public runTask(scene: Scene, onSuccess: () => void, onError: (message?: string, exception?: any) => void) {
             SceneLoader.ImportMesh(this.meshesNames, this.rootUrl, this.sceneFilename, scene,
                 (meshes: AbstractMesh[], particleSystems: ParticleSystem[], skeletons: Skeleton[]) => {
@@ -232,15 +269,44 @@ module BABYLON {
      * Define a task used by {BABYLON.AssetsManager} to load text content
      */
     export class TextFileAssetTask extends AbstractAssetTask {
+        /**
+         * Gets the loaded text string
+         */
         public text: string;
 
+        /**
+         * Callback called when the task is successful
+         */
         public onSuccess: (task: TextFileAssetTask) => void;
+
+        /**
+         * Callback called when the task is successful
+         */
         public onError: (task: TextFileAssetTask, message?: string, exception?: any) => void;
 
-        constructor(public name: string, public url: string) {
+        /**
+         * Creates a new TextFileAssetTask object
+         * @param name defines the name of the task
+         * @param url defines the location of the file to load
+         */
+        constructor(
+            /**
+             * Defines the name of the task
+             */
+            public name: string,
+            /**
+             * Defines the location of the file to load
+             */
+            public url: string) {
             super(name);
         }
 
+        /**
+         * 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
+         */
         public runTask(scene: Scene, onSuccess: () => void, onError: (message?: string, exception?: any) => void) {
             scene._loadFile(this.url, (data) => {
                 this.text = data as string;
@@ -257,15 +323,43 @@ module BABYLON {
      * Define a task used by {BABYLON.AssetsManager} to load binary data
      */
     export class BinaryFileAssetTask extends AbstractAssetTask {
+        /**
+         * Gets the lodaded data (as an array buffer)
+         */
         public data: ArrayBuffer;
 
+        /**
+         * Callback called when the task is successful
+         */
         public onSuccess: (task: BinaryFileAssetTask) => void;
+        /**
+         * Callback called when the task is successful
+         */
         public onError: (task: BinaryFileAssetTask, message?: string, exception?: any) => void;
 
-        constructor(public name: string, public url: string) {
+        /**
+         * Creates a new BinaryFileAssetTask object
+         * @param name defines the name of the new task
+         * @param url defines the location of the file to load
+         */
+        constructor(
+            /**
+             * Defines the name of the task
+             */
+            public name: string,
+            /**
+             * Defines the location of the file to load
+             */
+            public url: string) {
             super(name);
         }
 
+        /**
+         * 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
+         */
         public runTask(scene: Scene, onSuccess: () => void, onError: (message?: string, exception?: any) => void) {
             scene._loadFile(this.url, (data) => {
                 this.data = data as ArrayBuffer;
@@ -282,15 +376,43 @@ module BABYLON {
      * Define a task used by {BABYLON.AssetsManager} to load images
      */
     export class ImageAssetTask extends AbstractAssetTask {
+        /**
+         * Gets the loaded images
+         */
         public image: HTMLImageElement;
 
+        /**
+         * Callback called when the task is successful
+         */
         public onSuccess: (task: ImageAssetTask) => void;
+        /**
+         * Callback called when the task is successful
+         */
         public onError: (task: ImageAssetTask, message?: string, exception?: any) => void;
 
-        constructor(public name: string, public url: string) {
+        /**
+         * Creates a new ImageAssetTask
+         * @param name defines the name of the task
+         * @param url defines the location of the image to load
+         */
+        constructor(
+            /**
+             * Defines the name of the task
+             */
+            public name: string,
+            /**
+             * Defines the location of the image to load
+             */
+            public url: string) {
             super(name);
         }
 
+        /**
+         * 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
+         */
         public runTask(scene: Scene, onSuccess: () => void, onError: (message?: string, exception?: any) => void) {
             var img = new Image();
 
@@ -309,7 +431,13 @@ module BABYLON {
         }
     }
 
+    /**
+     * Defines the interface used by texture loading tasks
+     */
     export interface ITextureAssetTask<TEX extends BaseTexture> {
+        /**
+         * Gets the loaded texture
+         */
         texture: TEX;
     }
 
@@ -317,15 +445,58 @@ module BABYLON {
      * Define a task used by {BABYLON.AssetsManager} to load 2D textures
      */
     export class TextureAssetTask extends AbstractAssetTask implements ITextureAssetTask<Texture> {
+        /**
+         * Gets the loaded texture
+         */
         public texture: Texture;
 
+        /**
+         * Callback called when the task is successful
+         */
         public onSuccess: (task: TextureAssetTask) => void;
+        /**
+         * Callback called when the task is successful
+         */
         public onError: (task: TextureAssetTask, message?: string, exception?: any) => void;
 
-        constructor(public name: string, public url: string, public noMipmap?: boolean, public invertY?: boolean, public samplingMode: number = Texture.TRILINEAR_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)
+         */
+        constructor(
+            /**
+             * Defines the name of the task
+             */
+            public name: string,
+            /**
+             * Defines the location of the file to load
+             */
+            public url: string,
+            /**
+             * Defines if mipmap should not be generated (default is false)
+             */
+            public noMipmap?: boolean,
+            /**
+             * Defines if texture must be inverted on Y axis (default is false)
+             */
+            public invertY?: boolean,
+            /**
+             * Defines the sampling mode to use (default is BABYLON.Texture.TRILINEAR_SAMPLINGMODE)
+             */
+            public samplingMode: number = Texture.TRILINEAR_SAMPLINGMODE) {
             super(name);
         }
 
+        /**
+         * 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
+         */
         public runTask(scene: Scene, onSuccess: () => void, onError: (message?: string, exception?: any) => void) {
 
             var onload = () => {
@@ -344,15 +515,58 @@ module BABYLON {
      * Define a task used by {BABYLON.AssetsManager} to load cube textures
      */
     export class CubeTextureAssetTask extends AbstractAssetTask implements ITextureAssetTask<CubeTexture> {
+        /**
+         * Gets the loaded texture
+         */
         public texture: CubeTexture;
 
+        /**
+         * Callback called when the task is successful
+         */
         public onSuccess: (task: CubeTextureAssetTask) => void;
+        /**
+         * Callback called when the task is successful
+         */
         public onError: (task: CubeTextureAssetTask, message?: string, exception?: any) => void;
 
-        constructor(public name: string, public url: string, public extensions?: string[], public noMipmap?: boolean, public files?: string[]) {
+        /**
+         * 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)
+         */
+        constructor(
+            /**
+             * Defines the name of the task
+             */
+            public name: string,
+            /**
+             * Defines the location of the files to load (You have to specify the folder where the files are + filename with no extension)
+             */
+            public url: string,
+            /**
+             * Defines the extensions to use to load files (["_px", "_py", "_pz", "_nx", "_ny", "_nz"] by default)
+             */
+            public extensions?: string[],
+            /**
+             * Defines if mipmaps should not be generated (default is false)
+             */
+            public noMipmap?: boolean,
+            /**
+             * Defines the explicit list of files (undefined by default)
+             */
+            public files?: string[]) {
             super(name);
         }
 
+        /**
+         * 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
+         */
         public runTask(scene: Scene, onSuccess: () => void, onError: (message?: string, exception?: any) => void) {
 
             var onload = () => {
@@ -371,15 +585,68 @@ module BABYLON {
      * Define a task used by {BABYLON.AssetsManager} to load HDR cube textures
      */
     export class HDRCubeTextureAssetTask extends AbstractAssetTask implements ITextureAssetTask<HDRCubeTexture> {
+        /**
+         * Gets the loaded texture
+         */
         public texture: HDRCubeTexture;
 
+        /**
+         * Callback called when the task is successful
+         */
         public onSuccess: (task: HDRCubeTextureAssetTask) => void;
+        /**
+         * Callback called when the task is successful
+         */
         public onError: (task: HDRCubeTextureAssetTask, message?: string, exception?: any) => void;
 
-        constructor(public name: string, public url: string, public size?: number, public noMipmap = false, public generateHarmonics = true, public useInGammaSpace = false, public usePMREMGenerator = false) {
+        /**
+         * 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)
+         */
+        constructor(
+            /**
+             * Defines the name of the task
+             */
+            public name: string,
+            /**
+             * Defines the location of the file to load
+             */
+            public url: string,
+            /**
+             * 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.
+             */
+            public size?: number,
+            /**
+             * Defines if mipmaps should not be generated (default is false)
+             */
+            public noMipmap = false,
+            /**
+             * Specifies whether you want to extract the polynomial harmonics during the generation process (default is true)
+             */
+            public generateHarmonics = true,
+            /**
+             * 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)
+             */
+            public useInGammaSpace = false,
+            /**
+             * Specifies whether or not to generate the CubeMap through CubeMapGen to avoid seams issue at run time (default is false)
+             */
+            public usePMREMGenerator = false) {
             super(name);
         }
 
+        /**
+         * 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
+         */
         public run(scene: Scene, onSuccess: () => void, onError: (message?: string, exception?: any) => void) {
 
             var onload = () => {
@@ -402,38 +669,30 @@ module BABYLON {
         private _scene: Scene;
         private _isLoading = false;
 
-        protected tasks = new Array<AbstractAssetTask>();
-        protected waitingTasksCount = 0;
-        protected totalTasksCount = 0;
+        protected _tasks = new Array<AbstractAssetTask>();
+        protected _waitingTasksCount = 0;
+        protected _totalTasksCount = 0;
 
         /**
          * Callback called when all tasks are processed
-         * @param tasks will contains all remaining tasks (ie. all tasks which were not successful)
          */
         public onFinish: (tasks: AbstractAssetTask[]) => void;
 
         /**
          * Callback called when a task is successful
-         * @param task defines the loaded task
          */
         public onTaskSuccess: (task: AbstractAssetTask) => void;
 
         /**
          * Callback called when a task had an error
-         * @param task defines failed task
          */
         public onTaskError: (task: AbstractAssetTask) => void;
 
         /**
          * Callback called when a task is done (whatever the result is)
-         * @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
          */
         public onProgress: (remainingCount: number, totalCount: number, task: AbstractAssetTask) => void;
 
-        //Observables
-
         /**
          * Observable called when all tasks are processed
          */
@@ -460,6 +719,10 @@ module BABYLON {
          */
         public useDefaultLoadingScreen = true;
 
+        /**
+         * Creates a new AssetsManager
+         * @param scene defines the scene to work on
+         */
         constructor(scene: Scene) {
             this._scene = scene;
         }
@@ -470,10 +733,11 @@ module BABYLON {
          * @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
          */
         public addMeshTask(taskName: string, meshesNames: any, rootUrl: string, sceneFilename: string): MeshAssetTask {
             var task = new MeshAssetTask(taskName, meshesNames, rootUrl, sceneFilename);
-            this.tasks.push(task);
+            this._tasks.push(task);
 
             return task;
         }
@@ -482,10 +746,11 @@ module BABYLON {
          * 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
          */
         public addTextFileTask(taskName: string, url: string): TextFileAssetTask {
             var task = new TextFileAssetTask(taskName, url);
-            this.tasks.push(task);
+            this._tasks.push(task);
 
             return task;
         }
@@ -494,10 +759,11 @@ module BABYLON {
          * 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
          */
         public addBinaryFileTask(taskName: string, url: string): BinaryFileAssetTask {
             var task = new BinaryFileAssetTask(taskName, url);
-            this.tasks.push(task);
+            this._tasks.push(task);
 
             return task;
         }
@@ -506,10 +772,11 @@ module BABYLON {
          * 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
          */
         public addImageTask(taskName: string, url: string): ImageAssetTask {
             var task = new ImageAssetTask(taskName, url);
-            this.tasks.push(task);
+            this._tasks.push(task);
 
             return task;
         }
@@ -521,10 +788,11 @@ module BABYLON {
          * @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
          */
         public addTextureTask(taskName: string, url: string, noMipmap?: boolean, invertY?: boolean, samplingMode: number = Texture.TRILINEAR_SAMPLINGMODE): TextureAssetTask {
             var task = new TextureAssetTask(taskName, url, noMipmap, invertY, samplingMode);
-            this.tasks.push(task);
+            this._tasks.push(task);
 
             return task;
         }
@@ -536,10 +804,11 @@ module BABYLON {
          * @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
          */
         public addCubeTextureTask(taskName: string, url: string, extensions?: string[], noMipmap?: boolean, files?: string[]): CubeTextureAssetTask {
             var task = new CubeTextureAssetTask(taskName, url, extensions, noMipmap, files);
-            this.tasks.push(task);
+            this._tasks.push(task);
 
             return task;
         }
@@ -554,41 +823,42 @@ module BABYLON {
          * @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
          */
         public addHDRCubeTextureTask(taskName: string, url: string, size?: number, noMipmap = false, generateHarmonics = true, useInGammaSpace = false, usePMREMGenerator = false): HDRCubeTextureAssetTask {
             var task = new HDRCubeTextureAssetTask(taskName, url, size, noMipmap, generateHarmonics, useInGammaSpace, usePMREMGenerator);
-            this.tasks.push(task);
+            this._tasks.push(task);
 
             return task;
         }
 
         private _decreaseWaitingTasksCount(task: AbstractAssetTask): void {
-            this.waitingTasksCount--;
+            this._waitingTasksCount--;
 
             try {
                 if (task.taskState === AssetTaskState.DONE) {
                     // Let's remove successfull tasks
                     Tools.SetImmediate(() => {
-                        let index = this.tasks.indexOf(task);
+                        let index = this._tasks.indexOf(task);
 
                         if (index > -1) {
-                            this.tasks.splice(index, 1);
+                            this._tasks.splice(index, 1);
                         }
                     });
                 }
 
                 if (this.onProgress) {
                     this.onProgress(
-                        this.waitingTasksCount,
-                        this.totalTasksCount,
+                        this._waitingTasksCount,
+                        this._totalTasksCount,
                         task
                     );
                 }
 
                 this.onProgressObservable.notifyObservers(
                     new AssetsProgressEvent(
-                        this.waitingTasksCount,
-                        this.totalTasksCount,
+                        this._waitingTasksCount,
+                        this._totalTasksCount,
                         task
                     )
                 );
@@ -597,13 +867,13 @@ module BABYLON {
                 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) {
                     Tools.Error("Error running tasks-done callbacks.");
                     console.log(e);
@@ -647,7 +917,7 @@ module BABYLON {
          */
         public reset(): AssetsManager {
             this._isLoading = false;
-            this.tasks = new Array<AbstractAssetTask>();
+            this._tasks = new Array<AbstractAssetTask>();
             return this;
         }
 
@@ -660,14 +930,14 @@ module BABYLON {
                 return this;
             }
             this._isLoading = true;
-            this.waitingTasksCount = this.tasks.length;
-            this.totalTasksCount = this.tasks.length;
+            this._waitingTasksCount = this._tasks.length;
+            this._totalTasksCount = this._tasks.length;
 
-            if (this.waitingTasksCount === 0) {
+            if (this._waitingTasksCount === 0) {
                 if (this.onFinish) {
-                    this.onFinish(this.tasks);
+                    this.onFinish(this._tasks);
                 }
-                this.onTasksDoneObservable.notifyObservers(this.tasks);
+                this.onTasksDoneObservable.notifyObservers(this._tasks);
                 return this;
             }
 
@@ -675,8 +945,8 @@ module BABYLON {
                 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);
             }