David Catuhe hace 7 años
padre
commit
21d1a6ef5d

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 1975 - 1566
Playground/babylon.d.txt


+ 34 - 12
assets/particles/systems/explosion.json

@@ -2,8 +2,8 @@
     "systems":
     [
         {
-            "name": "default system",
-            "id": "default system",
+            "name": "flash",
+            "id": "flash",
             "capacity": 40,
             "emitter":
             [
@@ -133,8 +133,8 @@
             "preventAutoStart": true
         },
         {
-            "name": "default system",
-            "id": "default system",
+            "name": "shockwave",
+            "id": "shockwave",
             "capacity": 500,
             "emitter":
             [
@@ -415,8 +415,8 @@
             "preventAutoStart": true
         },
         {
-            "name": "default system",
-            "id": "default system",
+            "name": "fireball",
+            "id": "fireball",
             "capacity": 1000,
             "emitter":
             [
@@ -738,6 +738,17 @@
                     "factor1": 1
                 }
             ],
+            "lifeTimeGradients":
+            [
+                {
+                    "gradient": 0,
+                    "factor1": 3
+                },
+                {
+                    "gradient": 1,
+                    "factor1": 1.75
+                }
+            ],            
             "limitVelocityDamping": 0.7,
             "textureMask":
             [
@@ -750,8 +761,8 @@
             "preventAutoStart": true
         },
         {
-            "name": "default system",
-            "id": "default system",
+            "name": "debris",
+            "id": "debris",
             "capacity": 10,
             "emitter":
             [
@@ -878,8 +889,8 @@
                         "inheritedVelocityAmount": 0,
                         "particleSystem":
                         {
-                            "name": "default system",
-                            "id": "default system",
+                            "name": "fireSubEmitter",
+                            "id": "fireSubEmitter",
                             "capacity": 200,
                             "emitter":
                             [
@@ -1060,8 +1071,8 @@
                         "inheritedVelocityAmount": 0,
                         "particleSystem":
                         {
-                            "name": "default system",
-                            "id": "default system",
+                            "name": "smokeSubEmitter",
+                            "id": "smokeSubEmitter",
                             "capacity": 600,
                             "emitter":
                             [
@@ -1321,6 +1332,17 @@
                                     "factor1": 0.05
                                 }
                             ],
+                            "lifeTimeGradients":
+                            [
+                                {
+                                    "gradient": 0,
+                                    "factor1": 3
+                                },
+                                {
+                                    "gradient": 1,
+                                    "factor1": 1.75
+                                }
+                            ],                             
                             "textureMask":
                             [
                                 1,

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 2819 - 2376
dist/preview release/babylon.d.ts


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 1 - 1
dist/preview release/babylon.js


+ 410 - 26
dist/preview release/babylon.max.js

@@ -59551,11 +59551,26 @@ var BABYLON;
                     serializationObject.startSizeGradients.push(serializedGradient);
                 }
             }
+            var lifeTimeGradients = particleSystem.getLifeTimeGradients();
+            if (lifeTimeGradients) {
+                serializationObject.lifeTimeGradients = [];
+                for (var _k = 0, lifeTimeGradients_1 = lifeTimeGradients; _k < lifeTimeGradients_1.length; _k++) {
+                    var lifeTimeGradient = lifeTimeGradients_1[_k];
+                    var serializedGradient = {
+                        gradient: lifeTimeGradient.gradient,
+                        factor1: lifeTimeGradient.factor1
+                    };
+                    if (lifeTimeGradient.factor2 !== undefined) {
+                        serializedGradient.factor2 = lifeTimeGradient.factor2;
+                    }
+                    serializationObject.lifeTimeGradients.push(serializedGradient);
+                }
+            }
             var limitVelocityGradients = particleSystem.getLimitVelocityGradients();
             if (limitVelocityGradients) {
                 serializationObject.limitVelocityGradients = [];
-                for (var _k = 0, limitVelocityGradients_1 = limitVelocityGradients; _k < limitVelocityGradients_1.length; _k++) {
-                    var limitVelocityGradient = limitVelocityGradients_1[_k];
+                for (var _l = 0, limitVelocityGradients_1 = limitVelocityGradients; _l < limitVelocityGradients_1.length; _l++) {
+                    var limitVelocityGradient = limitVelocityGradients_1[_l];
                     var serializedGradient = {
                         gradient: limitVelocityGradient.gradient,
                         factor1: limitVelocityGradient.factor1
@@ -59714,9 +59729,15 @@ var BABYLON;
                     particleSystem.addStartSizeGradient(startSizeGradient.gradient, startSizeGradient.factor1 !== undefined ? startSizeGradient.factor1 : startSizeGradient.factor, startSizeGradient.factor2);
                 }
             }
+            if (parsedParticleSystem.lifeTimeGradients) {
+                for (var _x = 0, _y = parsedParticleSystem.lifeTimeGradients; _x < _y.length; _x++) {
+                    var lifeTimeGradient = _y[_x];
+                    particleSystem.addLifeTimeGradient(lifeTimeGradient.gradient, lifeTimeGradient.factor1 !== undefined ? lifeTimeGradient.factor1 : lifeTimeGradient.factor, lifeTimeGradient.factor2);
+                }
+            }
             if (parsedParticleSystem.limitVelocityGradients) {
-                for (var _x = 0, _y = parsedParticleSystem.limitVelocityGradients; _x < _y.length; _x++) {
-                    var limitVelocityGradient = _y[_x];
+                for (var _z = 0, _0 = parsedParticleSystem.limitVelocityGradients; _z < _0.length; _z++) {
+                    var limitVelocityGradient = _0[_z];
                     particleSystem.addLimitVelocityGradient(limitVelocityGradient.gradient, limitVelocityGradient.factor1 !== undefined ? limitVelocityGradient.factor1 : limitVelocityGradient.factor, limitVelocityGradient.factor2);
                 }
                 particleSystem.limitVelocityDamping = parsedParticleSystem.limitVelocityDamping;
@@ -63971,6 +63992,26 @@ var BABYLON;
             enumerable: true,
             configurable: true
         });
+        /**
+         * Not supported by GPUParticleSystem
+         * @param gradient defines the gradient to use (between 0 and 1)
+         * @param factor defines the life time factor to affect to the specified gradient
+         * @param factor2 defines an additional factor used to define a range ([factor, factor2]) with main value to pick the final value from
+         * @returns the current particle system
+         */
+        GPUParticleSystem.prototype.addLifeTimeGradient = function (gradient, factor, factor2) {
+            //Not supported by GPUParticleSystem
+            return this;
+        };
+        /**
+         * Not supported by GPUParticleSystem
+         * @param gradient defines the gradient to remove
+         * @returns the current particle system
+         */
+        GPUParticleSystem.prototype.removeLifeTimeGradient = function (gradient) {
+            //Not supported by GPUParticleSystem
+            return this;
+        };
         GPUParticleSystem.prototype._reset = function () {
             this._releaseBuffers();
         };
@@ -77705,7 +77746,14 @@ var BABYLON;
 
 var BABYLON;
 (function (BABYLON) {
+    /**
+     * Manager for handling gamepads
+     */
     var GamepadManager = /** @class */ (function () {
+        /**
+         * Initializes the gamepad manager
+         * @param _scene BabylonJS scene
+         */
         function GamepadManager(_scene) {
             var _this = this;
             this._scene = _scene;
@@ -77713,6 +77761,9 @@ var BABYLON;
             this._oneGamepadConnected = false;
             /** @hidden */
             this._isMonitoring = false;
+            /**
+             * observable to be triggered when the gamepad controller has been disconnected
+             */
             this.onGamepadDisconnectedObservable = new BABYLON.Observable();
             if (!BABYLON.Tools.IsWindowObjectExist()) {
                 this._gamepadEventSupported = false;
@@ -77779,12 +77830,20 @@ var BABYLON;
             }
         }
         Object.defineProperty(GamepadManager.prototype, "gamepads", {
+            /**
+             * The gamepads in the game pad manager
+             */
             get: function () {
                 return this._babylonGamepads;
             },
             enumerable: true,
             configurable: true
         });
+        /**
+         * Get the gamepad controllers based on type
+         * @param type The type of gamepad controller
+         * @returns Nullable gamepad
+         */
         GamepadManager.prototype.getGamepadByType = function (type) {
             if (type === void 0) { type = BABYLON.Gamepad.XBOX; }
             for (var _i = 0, _a = this._babylonGamepads; _i < _a.length; _i++) {
@@ -77795,6 +77854,9 @@ var BABYLON;
             }
             return null;
         };
+        /**
+         * Disposes the gamepad manager
+         */
         GamepadManager.prototype.dispose = function () {
             if (this._gamepadEventSupported) {
                 if (this._onGamepadConnectedEvent) {
@@ -77894,16 +77956,57 @@ var BABYLON;
 
 var BABYLON;
 (function (BABYLON) {
+    /**
+     * Represents a gamepad control stick position
+     */
     var StickValues = /** @class */ (function () {
-        function StickValues(x, y) {
+        /**
+         * Initializes the gamepad x and y control stick values
+         * @param x The x component of the gamepad control stick value
+         * @param y The y component of the gamepad control stick value
+         */
+        function StickValues(
+        /**
+         * The x component of the control stick
+         */
+        x, 
+        /**
+         * The y component of the control stick
+         */
+        y) {
             this.x = x;
             this.y = y;
         }
         return StickValues;
     }());
     BABYLON.StickValues = StickValues;
+    /**
+     * Represents a gamepad
+     */
     var Gamepad = /** @class */ (function () {
-        function Gamepad(id, index, browserGamepad, leftStickX, leftStickY, rightStickX, rightStickY) {
+        /**
+         * Initializes the gamepad
+         * @param id The id of the gamepad
+         * @param index The index of the gamepad
+         * @param browserGamepad The browser gamepad
+         * @param leftStickX The x component of the left joystick
+         * @param leftStickY The y component of the left joystick
+         * @param rightStickX The x component of the right joystick
+         * @param rightStickY The y component of the right joystick
+         */
+        function Gamepad(
+        /**
+         * The id of the gamepad
+         */
+        id, 
+        /**
+         * The index of the gamepad
+         */
+        index, 
+        /**
+         * The browser gamepad
+         */
+        browserGamepad, leftStickX, leftStickY, rightStickX, rightStickY) {
             if (leftStickX === void 0) { leftStickX = 0; }
             if (leftStickY === void 0) { leftStickY = 1; }
             if (rightStickX === void 0) { rightStickX = 2; }
@@ -77915,6 +78018,9 @@ var BABYLON;
             this._rightStick = { x: 0, y: 0 };
             /** @hidden */
             this._isConnected = true;
+            /**
+             * Specifies whether the left control stick should be Y-inverted
+             */
             this._invertLeftStickY = false;
             this.type = Gamepad.GAMEPAD;
             this._leftStickAxisX = leftStickX;
@@ -77929,22 +78035,39 @@ var BABYLON;
             }
         }
         Object.defineProperty(Gamepad.prototype, "isConnected", {
+            /**
+             * Specifies if the gamepad has been connected
+             */
             get: function () {
                 return this._isConnected;
             },
             enumerable: true,
             configurable: true
         });
+        /**
+         * Callback triggered when the left joystick has changed
+         * @param callback
+         */
         Gamepad.prototype.onleftstickchanged = function (callback) {
             this._onleftstickchanged = callback;
         };
+        /**
+         * Callback triggered when the right joystick has changed
+         * @param callback
+         */
         Gamepad.prototype.onrightstickchanged = function (callback) {
             this._onrightstickchanged = callback;
         };
         Object.defineProperty(Gamepad.prototype, "leftStick", {
+            /**
+             * Gets the left joystick
+             */
             get: function () {
                 return this._leftStick;
             },
+            /**
+             * Sets the left joystick values
+             */
             set: function (newValues) {
                 if (this._onleftstickchanged && (this._leftStick.x !== newValues.x || this._leftStick.y !== newValues.y)) {
                     this._onleftstickchanged(newValues);
@@ -77955,9 +78078,15 @@ var BABYLON;
             configurable: true
         });
         Object.defineProperty(Gamepad.prototype, "rightStick", {
+            /**
+             * Gets the right joystick
+             */
             get: function () {
                 return this._rightStick;
             },
+            /**
+             * Sets the right joystick value
+             */
             set: function (newValues) {
                 if (this._onrightstickchanged && (this._rightStick.x !== newValues.x || this._rightStick.y !== newValues.y)) {
                     this._onrightstickchanged(newValues);
@@ -77967,6 +78096,9 @@ var BABYLON;
             enumerable: true,
             configurable: true
         });
+        /**
+         * Updates the gamepad joystick positions
+         */
         Gamepad.prototype.update = function () {
             if (this._leftStick) {
                 this.leftStick = { x: this.browserGamepad.axes[this._leftStickAxisX], y: this.browserGamepad.axes[this._leftStickAxisY] };
@@ -77978,28 +78110,66 @@ var BABYLON;
                 this.rightStick = { x: this.browserGamepad.axes[this._rightStickAxisX], y: this.browserGamepad.axes[this._rightStickAxisY] };
             }
         };
+        /**
+         * Disposes the gamepad
+         */
         Gamepad.prototype.dispose = function () {
         };
+        /**
+         * Represents a gamepad controller
+         */
         Gamepad.GAMEPAD = 0;
+        /**
+         * Represents a generic controller
+         */
         Gamepad.GENERIC = 1;
+        /**
+         * Represents an XBox controller
+         */
         Gamepad.XBOX = 2;
+        /**
+         * Represents a pose-enabled controller
+         */
         Gamepad.POSE_ENABLED = 3;
         return Gamepad;
     }());
     BABYLON.Gamepad = Gamepad;
+    /**
+     * Represents a generic gamepad
+     */
     var GenericPad = /** @class */ (function (_super) {
         __extends(GenericPad, _super);
+        /**
+         * Initializes the generic gamepad
+         * @param id The id of the generic gamepad
+         * @param index The index of the generic gamepad
+         * @param browserGamepad The browser gamepad
+         */
         function GenericPad(id, index, browserGamepad) {
             var _this = _super.call(this, id, index, browserGamepad) || this;
+            /**
+             * Observable triggered when a button has been pressed
+             */
             _this.onButtonDownObservable = new BABYLON.Observable();
+            /**
+             * Observable triggered when a button has been released
+             */
             _this.onButtonUpObservable = new BABYLON.Observable();
             _this.type = Gamepad.GENERIC;
             _this._buttons = new Array(browserGamepad.buttons.length);
             return _this;
         }
+        /**
+         * Callback triggered when a button has been pressed
+         * @param callback Called when a button has been pressed
+         */
         GenericPad.prototype.onbuttondown = function (callback) {
             this._onbuttondown = callback;
         };
+        /**
+         * Callback triggered when a button has been released
+         * @param callback Called when a button has been released
+         */
         GenericPad.prototype.onbuttonup = function (callback) {
             this._onbuttonup = callback;
         };
@@ -78020,12 +78190,18 @@ var BABYLON;
             }
             return newValue;
         };
+        /**
+         * Updates the generic gamepad
+         */
         GenericPad.prototype.update = function () {
             _super.prototype.update.call(this);
             for (var index = 0; index < this._buttons.length; index++) {
                 this._buttons[index] = this._setButtonValue(this.browserGamepad.buttons[index].value, this._buttons[index], index);
             }
         };
+        /**
+         * Disposes the generic gamepad
+         */
         GenericPad.prototype.dispose = function () {
             _super.prototype.dispose.call(this);
             this.onButtonDownObservable.clear();
@@ -78139,11 +78315,14 @@ var BABYLON;
         };
         Object.defineProperty(Xbox360Pad.prototype, "leftTrigger", {
             /**
-             * Gets or sets left trigger value
+             * Gets the left trigger value
              */
             get: function () {
                 return this._leftTrigger;
             },
+            /**
+             * Sets the left trigger value
+             */
             set: function (newValue) {
                 if (this._onlefttriggerchanged && this._leftTrigger !== newValue) {
                     this._onlefttriggerchanged(newValue);
@@ -78155,11 +78334,14 @@ var BABYLON;
         });
         Object.defineProperty(Xbox360Pad.prototype, "rightTrigger", {
             /**
-             * Gets or sets right trigger value
+             * Gets the right trigger value
              */
             get: function () {
                 return this._rightTrigger;
             },
+            /**
+             * Sets the right trigger value
+             */
             set: function (newValue) {
                 if (this._onrighttriggerchanged && this._rightTrigger !== newValue) {
                     this._onrighttriggerchanged(newValue);
@@ -78232,10 +78414,15 @@ var BABYLON;
             return newValue;
         };
         Object.defineProperty(Xbox360Pad.prototype, "buttonA", {
-            /** Gets or sets value of A button */
+            /**
+             * Gets the value of the `A` button
+             */
             get: function () {
                 return this._buttonA;
             },
+            /**
+             * Sets the value of the `A` button
+             */
             set: function (value) {
                 this._buttonA = this._setButtonValue(value, this._buttonA, Xbox360Button.A);
             },
@@ -78243,10 +78430,15 @@ var BABYLON;
             configurable: true
         });
         Object.defineProperty(Xbox360Pad.prototype, "buttonB", {
-            /** Gets or sets value of B button */
+            /**
+             * Gets the value of the `B` button
+             */
             get: function () {
                 return this._buttonB;
             },
+            /**
+             * Sets the value of the `B` button
+             */
             set: function (value) {
                 this._buttonB = this._setButtonValue(value, this._buttonB, Xbox360Button.B);
             },
@@ -78254,10 +78446,15 @@ var BABYLON;
             configurable: true
         });
         Object.defineProperty(Xbox360Pad.prototype, "buttonX", {
-            /** Gets or sets value of X button */
+            /**
+             * Gets the value of the `X` button
+             */
             get: function () {
                 return this._buttonX;
             },
+            /**
+             * Sets the value of the `X` button
+             */
             set: function (value) {
                 this._buttonX = this._setButtonValue(value, this._buttonX, Xbox360Button.X);
             },
@@ -78265,10 +78462,15 @@ var BABYLON;
             configurable: true
         });
         Object.defineProperty(Xbox360Pad.prototype, "buttonY", {
-            /** Gets or sets value of Y button */
+            /**
+             * Gets the value of the `Y` button
+             */
             get: function () {
                 return this._buttonY;
             },
+            /**
+             * Sets the value of the `Y` button
+             */
             set: function (value) {
                 this._buttonY = this._setButtonValue(value, this._buttonY, Xbox360Button.Y);
             },
@@ -78276,10 +78478,15 @@ var BABYLON;
             configurable: true
         });
         Object.defineProperty(Xbox360Pad.prototype, "buttonStart", {
-            /** Gets or sets value of Start button  */
+            /**
+             * Gets the value of the `Start` button
+             */
             get: function () {
                 return this._buttonStart;
             },
+            /**
+             * Sets the value of the `Start` button
+             */
             set: function (value) {
                 this._buttonStart = this._setButtonValue(value, this._buttonStart, Xbox360Button.Start);
             },
@@ -78287,10 +78494,15 @@ var BABYLON;
             configurable: true
         });
         Object.defineProperty(Xbox360Pad.prototype, "buttonBack", {
-            /** Gets or sets value of Back button  */
+            /**
+             * Gets the value of the `Back` button
+             */
             get: function () {
                 return this._buttonBack;
             },
+            /**
+             * Sets the value of the `Back` button
+             */
             set: function (value) {
                 this._buttonBack = this._setButtonValue(value, this._buttonBack, Xbox360Button.Back);
             },
@@ -78298,10 +78510,15 @@ var BABYLON;
             configurable: true
         });
         Object.defineProperty(Xbox360Pad.prototype, "buttonLB", {
-            /** Gets or sets value of Left button  */
+            /**
+             * Gets the value of the `Left` button
+             */
             get: function () {
                 return this._buttonLB;
             },
+            /**
+             * Sets the value of the `Left` button
+             */
             set: function (value) {
                 this._buttonLB = this._setButtonValue(value, this._buttonLB, Xbox360Button.LB);
             },
@@ -78309,10 +78526,15 @@ var BABYLON;
             configurable: true
         });
         Object.defineProperty(Xbox360Pad.prototype, "buttonRB", {
-            /** Gets or sets value of Right button  */
+            /**
+             * Gets the value of the `Right` button
+             */
             get: function () {
                 return this._buttonRB;
             },
+            /**
+             * Sets the value of the `Right` button
+             */
             set: function (value) {
                 this._buttonRB = this._setButtonValue(value, this._buttonRB, Xbox360Button.RB);
             },
@@ -78320,10 +78542,15 @@ var BABYLON;
             configurable: true
         });
         Object.defineProperty(Xbox360Pad.prototype, "buttonLeftStick", {
-            /** Gets or sets value of left stick */
+            /**
+             * Gets the value of the Left joystick
+             */
             get: function () {
                 return this._buttonLeftStick;
             },
+            /**
+             * Sets the value of the Left joystick
+             */
             set: function (value) {
                 this._buttonLeftStick = this._setButtonValue(value, this._buttonLeftStick, Xbox360Button.LeftStick);
             },
@@ -78331,10 +78558,15 @@ var BABYLON;
             configurable: true
         });
         Object.defineProperty(Xbox360Pad.prototype, "buttonRightStick", {
-            /** Gets or sets value of right stick */
+            /**
+             * Gets the value of the Right joystick
+             */
             get: function () {
                 return this._buttonRightStick;
             },
+            /**
+             * Sets the value of the Right joystick
+             */
             set: function (value) {
                 this._buttonRightStick = this._setButtonValue(value, this._buttonRightStick, Xbox360Button.RightStick);
             },
@@ -78342,10 +78574,15 @@ var BABYLON;
             configurable: true
         });
         Object.defineProperty(Xbox360Pad.prototype, "dPadUp", {
-            /** Gets or sets value of DPad up */
+            /**
+             * Gets the value of D-pad up
+             */
             get: function () {
                 return this._dPadUp;
             },
+            /**
+             * Sets the value of D-pad up
+             */
             set: function (value) {
                 this._dPadUp = this._setDPadValue(value, this._dPadUp, Xbox360Dpad.Up);
             },
@@ -78353,10 +78590,15 @@ var BABYLON;
             configurable: true
         });
         Object.defineProperty(Xbox360Pad.prototype, "dPadDown", {
-            /** Gets or sets value of DPad down */
+            /**
+             * Gets the value of D-pad down
+             */
             get: function () {
                 return this._dPadDown;
             },
+            /**
+             * Sets the value of D-pad down
+             */
             set: function (value) {
                 this._dPadDown = this._setDPadValue(value, this._dPadDown, Xbox360Dpad.Down);
             },
@@ -78364,10 +78606,15 @@ var BABYLON;
             configurable: true
         });
         Object.defineProperty(Xbox360Pad.prototype, "dPadLeft", {
-            /** Gets or sets value of DPad left */
+            /**
+             * Gets the value of D-pad left
+             */
             get: function () {
                 return this._dPadLeft;
             },
+            /**
+             * Sets the value of D-pad left
+             */
             set: function (value) {
                 this._dPadLeft = this._setDPadValue(value, this._dPadLeft, Xbox360Dpad.Left);
             },
@@ -78375,10 +78622,15 @@ var BABYLON;
             configurable: true
         });
         Object.defineProperty(Xbox360Pad.prototype, "dPadRight", {
-            /** Gets or sets value of DPad right */
+            /**
+             * Gets the value of D-pad right
+             */
             get: function () {
                 return this._dPadRight;
             },
+            /**
+             * Sets the value of D-pad right
+             */
             set: function (value) {
                 this._dPadRight = this._setDPadValue(value, this._dPadRight, Xbox360Dpad.Right);
             },
@@ -78427,6 +78679,9 @@ var BABYLON;
                 this.dPadRight = this.browserGamepad.buttons[15].value;
             }
         };
+        /**
+         * Disposes the gamepad
+         */
         Xbox360Pad.prototype.dispose = function () {
             _super.prototype.dispose.call(this);
             this.onButtonDownObservable.clear();
@@ -79861,10 +80116,16 @@ var BABYLON;
         enumerable: true,
         configurable: true
     });
+    /**
+     * Adds a gamepad to the free camera inputs manager
+     */
     BABYLON.FreeCameraInputsManager.prototype.addGamepad = function () {
         this.add(new BABYLON.FreeCameraGamepadInput());
         return this;
     };
+    /**
+     * Adds a gamepad to the arc rotate camera inputs manager
+     */
     BABYLON.ArcRotateCameraInputsManager.prototype.addGamepad = function () {
         this.add(new BABYLON.ArcRotateCameraGamepadInput());
         return this;
@@ -90914,19 +91175,61 @@ var BABYLON;
 
 var BABYLON;
 (function (BABYLON) {
+    /**
+     * This represents one of the lens effect in a `BABYLON.lensFlareSystem`.
+     * It controls one of the indiviual texture used in the effect.
+     * @see http://doc.babylonjs.com/how_to/how_to_use_lens_flares
+     */
     var LensFlare = /** @class */ (function () {
-        function LensFlare(size, position, color, imgUrl, system) {
+        /**
+         * Instantiates a new Lens Flare.
+         * This represents one of the lens effect in a `BABYLON.lensFlareSystem`.
+         * It controls one of the indiviual texture used in the effect.
+         * @see http://doc.babylonjs.com/how_to/how_to_use_lens_flares
+         * @param size Define the size of the lens flare in the system (a floating value between 0 and 1)
+         * @param position Define the position of the lens flare in the system. (a floating value between -1 and 1). A value of 0 is located on the emitter. A value greater than 0 is beyond the emitter and a value lesser than 0 is behind.
+         * @param color Define the lens color
+         * @param imgUrl Define the lens texture url
+         * @param system Define the `lensFlareSystem` this flare is part of
+         */
+        function LensFlare(
+        /**
+         * Define the size of the lens flare in the system (a floating value between 0 and 1)
+         */
+        size, 
+        /**
+         * Define the position of the lens flare in the system. (a floating value between -1 and 1). A value of 0 is located on the emitter. A value greater than 0 is beyond the emitter and a value lesser than 0 is behind.
+         */
+        position, color, imgUrl, system) {
             this.size = size;
             this.position = position;
+            /**
+             * Define the alpha mode to render this particular lens.
+             */
             this.alphaMode = BABYLON.Engine.ALPHA_ONEONE;
             this.color = color || new BABYLON.Color3(1, 1, 1);
             this.texture = imgUrl ? new BABYLON.Texture(imgUrl, system.getScene(), true) : null;
             this._system = system;
             system.lensFlares.push(this);
         }
+        /**
+         * Creates a new Lens Flare.
+         * This represents one of the lens effect in a `BABYLON.lensFlareSystem`.
+         * It controls one of the indiviual texture used in the effect.
+         * @see http://doc.babylonjs.com/how_to/how_to_use_lens_flares
+         * @param size Define the size of the lens flare (a floating value between 0 and 1)
+         * @param position Define the position of the lens flare in the system. (a floating value between -1 and 1). A value of 0 is located on the emitter. A value greater than 0 is beyond the emitter and a value lesser than 0 is behind.
+         * @param color Define the lens color
+         * @param imgUrl Define the lens texture url
+         * @param system Define the `lensFlareSystem` this flare is part of
+         * @returns The newly created Lens Flare
+         */
         LensFlare.AddFlare = function (size, position, color, imgUrl, system) {
             return new LensFlare(size, position, color, imgUrl, system);
         };
+        /**
+         * Dispose and release the lens flare with its associated resources.
+         */
         LensFlare.prototype.dispose = function () {
             if (this.texture) {
                 this.texture.dispose();
@@ -91086,12 +91389,42 @@ var BABYLON;
 
 var BABYLON;
 (function (BABYLON) {
+    /**
+     * This represents a Lens Flare System or the shiny effect created by the light reflection on the  camera lenses.
+     * It is usually composed of several `BABYLON.lensFlare`.
+     * @see http://doc.babylonjs.com/how_to/how_to_use_lens_flares
+     */
     var LensFlareSystem = /** @class */ (function () {
-        function LensFlareSystem(name, emitter, scene) {
+        /**
+         * Instantiates a lens flare system.
+         * This represents a Lens Flare System or the shiny effect created by the light reflection on the  camera lenses.
+         * It is usually composed of several `BABYLON.lensFlare`.
+         * @see http://doc.babylonjs.com/how_to/how_to_use_lens_flares
+         * @param name Define the name of the lens flare system in the scene
+         * @param emitter Define the source (the emitter) of the lens flares (it can be a camera, a light or a mesh).
+         * @param scene Define the scene the lens flare system belongs to
+         */
+        function LensFlareSystem(
+        /**
+         * Define the name of the lens flare system
+         */
+        name, emitter, scene) {
             this.name = name;
+            /**
+             * List of lens flares used in this system.
+             */
             this.lensFlares = new Array();
+            /**
+             * Define a limit from the border the lens flare can be visible.
+             */
             this.borderLimit = 300;
+            /**
+             * Define a viewport border we do not want to see the lens flare in.
+             */
             this.viewportBorder = 0;
+            /**
+             * Restricts the rendering of the effect to only the camera rendering this layer mask.
+             */
             this.layerMask = 0x0FFFFFFF;
             this._vertexBuffers = {};
             this._isEnabled = true;
@@ -91126,6 +91459,9 @@ var BABYLON;
             this._effect = engine.createEffect("lensFlare", [BABYLON.VertexBuffer.PositionKind], ["color", "viewportMatrix"], ["textureSampler"], "");
         }
         Object.defineProperty(LensFlareSystem.prototype, "isEnabled", {
+            /**
+             * Define if the lens flare system is enabled.
+             */
             get: function () {
                 return this._isEnabled;
             },
@@ -91135,18 +91471,40 @@ var BABYLON;
             enumerable: true,
             configurable: true
         });
+        /**
+         * Get the scene the effects belongs to.
+         * @returns the scene holding the lens flare system
+         */
         LensFlareSystem.prototype.getScene = function () {
             return this._scene;
         };
+        /**
+         * Get the emitter of the lens flare system.
+         * It defines the source of the lens flares (it can be a camera, a light or a mesh).
+         * @returns the emitter of the lens flare system
+         */
         LensFlareSystem.prototype.getEmitter = function () {
             return this._emitter;
         };
+        /**
+         * Set the emitter of the lens flare system.
+         * It defines the source of the lens flares (it can be a camera, a light or a mesh).
+         * @param newEmitter Define the new emitter of the system
+         */
         LensFlareSystem.prototype.setEmitter = function (newEmitter) {
             this._emitter = newEmitter;
         };
+        /**
+         * Get the lens flare system emitter position.
+         * The emitter defines the source of the lens flares (it can be a camera, a light or a mesh).
+         * @returns the position
+         */
         LensFlareSystem.prototype.getEmitterPosition = function () {
             return this._emitter.getAbsolutePosition ? this._emitter.getAbsolutePosition() : this._emitter.position;
         };
+        /**
+         * @hidden
+         */
         LensFlareSystem.prototype.computeEffectivePosition = function (globalViewport) {
             var position = this.getEmitterPosition();
             position = BABYLON.Vector3.Project(position, BABYLON.Matrix.Identity(), this._scene.getTransformMatrix(), globalViewport);
@@ -91185,6 +91543,9 @@ var BABYLON;
             var pickInfo = this._scene.pickWithRay(ray, this.meshesSelectionPredicate, true);
             return !pickInfo || !pickInfo.hit || pickInfo.distance > distance;
         };
+        /**
+         * @hidden
+         */
         LensFlareSystem.prototype.render = function () {
             if (!this._effect.isReady() || !this._scene.activeCamera)
                 return false;
@@ -91274,6 +91635,9 @@ var BABYLON;
             engine.setAlphaMode(BABYLON.Engine.ALPHA_DISABLE);
             return true;
         };
+        /**
+         * Dispose and release the lens flare with its associated resources.
+         */
         LensFlareSystem.prototype.dispose = function () {
             var vertexBuffer = this._vertexBuffers[BABYLON.VertexBuffer.PositionKind];
             if (vertexBuffer) {
@@ -91291,6 +91655,13 @@ var BABYLON;
             var index = this._scene.lensFlareSystems.indexOf(this);
             this._scene.lensFlareSystems.splice(index, 1);
         };
+        /**
+         * Parse a lens flare system from a JSON repressentation
+         * @param parsedLensFlareSystem Define the JSON to parse
+         * @param scene Define the scene the parsed system should be instantiated in
+         * @param rootUrl Define the rootUrl of the load sequence to easily find a load relative dependencies such as textures
+         * @returns the parsed system
+         */
         LensFlareSystem.Parse = function (parsedLensFlareSystem, scene, rootUrl) {
             var emitter = scene.getLastEntryByID(parsedLensFlareSystem.emitterId);
             var name = parsedLensFlareSystem.name || "lensFlareSystem#" + parsedLensFlareSystem.emitterId;
@@ -91303,6 +91674,10 @@ var BABYLON;
             }
             return lensFlareSystem;
         };
+        /**
+         * Serialize the current Lens Flare System into a JSON representation.
+         * @returns the serialized JSON
+         */
         LensFlareSystem.prototype.serialize = function () {
             var serializationObject = {};
             serializationObject.id = this.id;
@@ -95812,6 +96187,7 @@ var BABYLON;
             this.onPointerOutObservable = new BABYLON.Observable();
             // Create scene which will be rendered in the foreground and remove it from being referenced by engine to avoid interfering with existing app
             this.utilityLayerScene = new BABYLON.Scene(originalScene.getEngine());
+            this.utilityLayerScene.useRightHandedSystem = originalScene.useRightHandedSystem;
             this.utilityLayerScene._allowPostProcessClearColor = false;
             originalScene.getEngine().scenes.pop();
             // Detach controls on utility scene, events will be fired by logic below to handle picking priority
@@ -108528,7 +108904,11 @@ var BABYLON;
          * @param isBackground Defines whether the layer is displayed in front or behind the scene
          * @param color Defines a color for the layer
          */
-        function Layer(name, imgUrl, scene, isBackground, color) {
+        function Layer(
+        /**
+         * Define the name of the layer.
+         */
+        name, imgUrl, scene, isBackground, color) {
             this.name = name;
             /**
              * Define the scale of the layer in order to zoom in out of the texture.
@@ -108612,6 +108992,10 @@ var BABYLON;
             configurable: true
         });
         Object.defineProperty(Layer.prototype, "onAfterRender", {
+            /**
+             * Back compatibility with callback before the onAfterRenderObservable existed.
+             * The set callback will be triggered just after rendering the layer.
+             */
             set: function (callback) {
                 if (this._onAfterRenderObserver) {
                     this.onAfterRenderObservable.remove(this._onAfterRenderObserver);
@@ -109114,7 +109498,7 @@ var BABYLON;
                 if (onAnimationEnd) {
                     onAnimationEnd();
                 }
-                if (_this._attachedCamera) {
+                if (_this._attachedCamera && _this._attachedCamera.useInputToRestoreState) {
                     _this._attachedCamera.storeState();
                 }
             });

+ 410 - 26
dist/preview release/babylon.no-module.max.js

@@ -59518,11 +59518,26 @@ var BABYLON;
                     serializationObject.startSizeGradients.push(serializedGradient);
                 }
             }
+            var lifeTimeGradients = particleSystem.getLifeTimeGradients();
+            if (lifeTimeGradients) {
+                serializationObject.lifeTimeGradients = [];
+                for (var _k = 0, lifeTimeGradients_1 = lifeTimeGradients; _k < lifeTimeGradients_1.length; _k++) {
+                    var lifeTimeGradient = lifeTimeGradients_1[_k];
+                    var serializedGradient = {
+                        gradient: lifeTimeGradient.gradient,
+                        factor1: lifeTimeGradient.factor1
+                    };
+                    if (lifeTimeGradient.factor2 !== undefined) {
+                        serializedGradient.factor2 = lifeTimeGradient.factor2;
+                    }
+                    serializationObject.lifeTimeGradients.push(serializedGradient);
+                }
+            }
             var limitVelocityGradients = particleSystem.getLimitVelocityGradients();
             if (limitVelocityGradients) {
                 serializationObject.limitVelocityGradients = [];
-                for (var _k = 0, limitVelocityGradients_1 = limitVelocityGradients; _k < limitVelocityGradients_1.length; _k++) {
-                    var limitVelocityGradient = limitVelocityGradients_1[_k];
+                for (var _l = 0, limitVelocityGradients_1 = limitVelocityGradients; _l < limitVelocityGradients_1.length; _l++) {
+                    var limitVelocityGradient = limitVelocityGradients_1[_l];
                     var serializedGradient = {
                         gradient: limitVelocityGradient.gradient,
                         factor1: limitVelocityGradient.factor1
@@ -59681,9 +59696,15 @@ var BABYLON;
                     particleSystem.addStartSizeGradient(startSizeGradient.gradient, startSizeGradient.factor1 !== undefined ? startSizeGradient.factor1 : startSizeGradient.factor, startSizeGradient.factor2);
                 }
             }
+            if (parsedParticleSystem.lifeTimeGradients) {
+                for (var _x = 0, _y = parsedParticleSystem.lifeTimeGradients; _x < _y.length; _x++) {
+                    var lifeTimeGradient = _y[_x];
+                    particleSystem.addLifeTimeGradient(lifeTimeGradient.gradient, lifeTimeGradient.factor1 !== undefined ? lifeTimeGradient.factor1 : lifeTimeGradient.factor, lifeTimeGradient.factor2);
+                }
+            }
             if (parsedParticleSystem.limitVelocityGradients) {
-                for (var _x = 0, _y = parsedParticleSystem.limitVelocityGradients; _x < _y.length; _x++) {
-                    var limitVelocityGradient = _y[_x];
+                for (var _z = 0, _0 = parsedParticleSystem.limitVelocityGradients; _z < _0.length; _z++) {
+                    var limitVelocityGradient = _0[_z];
                     particleSystem.addLimitVelocityGradient(limitVelocityGradient.gradient, limitVelocityGradient.factor1 !== undefined ? limitVelocityGradient.factor1 : limitVelocityGradient.factor, limitVelocityGradient.factor2);
                 }
                 particleSystem.limitVelocityDamping = parsedParticleSystem.limitVelocityDamping;
@@ -63938,6 +63959,26 @@ var BABYLON;
             enumerable: true,
             configurable: true
         });
+        /**
+         * Not supported by GPUParticleSystem
+         * @param gradient defines the gradient to use (between 0 and 1)
+         * @param factor defines the life time factor to affect to the specified gradient
+         * @param factor2 defines an additional factor used to define a range ([factor, factor2]) with main value to pick the final value from
+         * @returns the current particle system
+         */
+        GPUParticleSystem.prototype.addLifeTimeGradient = function (gradient, factor, factor2) {
+            //Not supported by GPUParticleSystem
+            return this;
+        };
+        /**
+         * Not supported by GPUParticleSystem
+         * @param gradient defines the gradient to remove
+         * @returns the current particle system
+         */
+        GPUParticleSystem.prototype.removeLifeTimeGradient = function (gradient) {
+            //Not supported by GPUParticleSystem
+            return this;
+        };
         GPUParticleSystem.prototype._reset = function () {
             this._releaseBuffers();
         };
@@ -77672,7 +77713,14 @@ var BABYLON;
 
 var BABYLON;
 (function (BABYLON) {
+    /**
+     * Manager for handling gamepads
+     */
     var GamepadManager = /** @class */ (function () {
+        /**
+         * Initializes the gamepad manager
+         * @param _scene BabylonJS scene
+         */
         function GamepadManager(_scene) {
             var _this = this;
             this._scene = _scene;
@@ -77680,6 +77728,9 @@ var BABYLON;
             this._oneGamepadConnected = false;
             /** @hidden */
             this._isMonitoring = false;
+            /**
+             * observable to be triggered when the gamepad controller has been disconnected
+             */
             this.onGamepadDisconnectedObservable = new BABYLON.Observable();
             if (!BABYLON.Tools.IsWindowObjectExist()) {
                 this._gamepadEventSupported = false;
@@ -77746,12 +77797,20 @@ var BABYLON;
             }
         }
         Object.defineProperty(GamepadManager.prototype, "gamepads", {
+            /**
+             * The gamepads in the game pad manager
+             */
             get: function () {
                 return this._babylonGamepads;
             },
             enumerable: true,
             configurable: true
         });
+        /**
+         * Get the gamepad controllers based on type
+         * @param type The type of gamepad controller
+         * @returns Nullable gamepad
+         */
         GamepadManager.prototype.getGamepadByType = function (type) {
             if (type === void 0) { type = BABYLON.Gamepad.XBOX; }
             for (var _i = 0, _a = this._babylonGamepads; _i < _a.length; _i++) {
@@ -77762,6 +77821,9 @@ var BABYLON;
             }
             return null;
         };
+        /**
+         * Disposes the gamepad manager
+         */
         GamepadManager.prototype.dispose = function () {
             if (this._gamepadEventSupported) {
                 if (this._onGamepadConnectedEvent) {
@@ -77861,16 +77923,57 @@ var BABYLON;
 
 var BABYLON;
 (function (BABYLON) {
+    /**
+     * Represents a gamepad control stick position
+     */
     var StickValues = /** @class */ (function () {
-        function StickValues(x, y) {
+        /**
+         * Initializes the gamepad x and y control stick values
+         * @param x The x component of the gamepad control stick value
+         * @param y The y component of the gamepad control stick value
+         */
+        function StickValues(
+        /**
+         * The x component of the control stick
+         */
+        x, 
+        /**
+         * The y component of the control stick
+         */
+        y) {
             this.x = x;
             this.y = y;
         }
         return StickValues;
     }());
     BABYLON.StickValues = StickValues;
+    /**
+     * Represents a gamepad
+     */
     var Gamepad = /** @class */ (function () {
-        function Gamepad(id, index, browserGamepad, leftStickX, leftStickY, rightStickX, rightStickY) {
+        /**
+         * Initializes the gamepad
+         * @param id The id of the gamepad
+         * @param index The index of the gamepad
+         * @param browserGamepad The browser gamepad
+         * @param leftStickX The x component of the left joystick
+         * @param leftStickY The y component of the left joystick
+         * @param rightStickX The x component of the right joystick
+         * @param rightStickY The y component of the right joystick
+         */
+        function Gamepad(
+        /**
+         * The id of the gamepad
+         */
+        id, 
+        /**
+         * The index of the gamepad
+         */
+        index, 
+        /**
+         * The browser gamepad
+         */
+        browserGamepad, leftStickX, leftStickY, rightStickX, rightStickY) {
             if (leftStickX === void 0) { leftStickX = 0; }
             if (leftStickY === void 0) { leftStickY = 1; }
             if (rightStickX === void 0) { rightStickX = 2; }
@@ -77882,6 +77985,9 @@ var BABYLON;
             this._rightStick = { x: 0, y: 0 };
             /** @hidden */
             this._isConnected = true;
+            /**
+             * Specifies whether the left control stick should be Y-inverted
+             */
             this._invertLeftStickY = false;
             this.type = Gamepad.GAMEPAD;
             this._leftStickAxisX = leftStickX;
@@ -77896,22 +78002,39 @@ var BABYLON;
             }
         }
         Object.defineProperty(Gamepad.prototype, "isConnected", {
+            /**
+             * Specifies if the gamepad has been connected
+             */
             get: function () {
                 return this._isConnected;
             },
             enumerable: true,
             configurable: true
         });
+        /**
+         * Callback triggered when the left joystick has changed
+         * @param callback
+         */
         Gamepad.prototype.onleftstickchanged = function (callback) {
             this._onleftstickchanged = callback;
         };
+        /**
+         * Callback triggered when the right joystick has changed
+         * @param callback
+         */
         Gamepad.prototype.onrightstickchanged = function (callback) {
             this._onrightstickchanged = callback;
         };
         Object.defineProperty(Gamepad.prototype, "leftStick", {
+            /**
+             * Gets the left joystick
+             */
             get: function () {
                 return this._leftStick;
             },
+            /**
+             * Sets the left joystick values
+             */
             set: function (newValues) {
                 if (this._onleftstickchanged && (this._leftStick.x !== newValues.x || this._leftStick.y !== newValues.y)) {
                     this._onleftstickchanged(newValues);
@@ -77922,9 +78045,15 @@ var BABYLON;
             configurable: true
         });
         Object.defineProperty(Gamepad.prototype, "rightStick", {
+            /**
+             * Gets the right joystick
+             */
             get: function () {
                 return this._rightStick;
             },
+            /**
+             * Sets the right joystick value
+             */
             set: function (newValues) {
                 if (this._onrightstickchanged && (this._rightStick.x !== newValues.x || this._rightStick.y !== newValues.y)) {
                     this._onrightstickchanged(newValues);
@@ -77934,6 +78063,9 @@ var BABYLON;
             enumerable: true,
             configurable: true
         });
+        /**
+         * Updates the gamepad joystick positions
+         */
         Gamepad.prototype.update = function () {
             if (this._leftStick) {
                 this.leftStick = { x: this.browserGamepad.axes[this._leftStickAxisX], y: this.browserGamepad.axes[this._leftStickAxisY] };
@@ -77945,28 +78077,66 @@ var BABYLON;
                 this.rightStick = { x: this.browserGamepad.axes[this._rightStickAxisX], y: this.browserGamepad.axes[this._rightStickAxisY] };
             }
         };
+        /**
+         * Disposes the gamepad
+         */
         Gamepad.prototype.dispose = function () {
         };
+        /**
+         * Represents a gamepad controller
+         */
         Gamepad.GAMEPAD = 0;
+        /**
+         * Represents a generic controller
+         */
         Gamepad.GENERIC = 1;
+        /**
+         * Represents an XBox controller
+         */
         Gamepad.XBOX = 2;
+        /**
+         * Represents a pose-enabled controller
+         */
         Gamepad.POSE_ENABLED = 3;
         return Gamepad;
     }());
     BABYLON.Gamepad = Gamepad;
+    /**
+     * Represents a generic gamepad
+     */
     var GenericPad = /** @class */ (function (_super) {
         __extends(GenericPad, _super);
+        /**
+         * Initializes the generic gamepad
+         * @param id The id of the generic gamepad
+         * @param index The index of the generic gamepad
+         * @param browserGamepad The browser gamepad
+         */
         function GenericPad(id, index, browserGamepad) {
             var _this = _super.call(this, id, index, browserGamepad) || this;
+            /**
+             * Observable triggered when a button has been pressed
+             */
             _this.onButtonDownObservable = new BABYLON.Observable();
+            /**
+             * Observable triggered when a button has been released
+             */
             _this.onButtonUpObservable = new BABYLON.Observable();
             _this.type = Gamepad.GENERIC;
             _this._buttons = new Array(browserGamepad.buttons.length);
             return _this;
         }
+        /**
+         * Callback triggered when a button has been pressed
+         * @param callback Called when a button has been pressed
+         */
         GenericPad.prototype.onbuttondown = function (callback) {
             this._onbuttondown = callback;
         };
+        /**
+         * Callback triggered when a button has been released
+         * @param callback Called when a button has been released
+         */
         GenericPad.prototype.onbuttonup = function (callback) {
             this._onbuttonup = callback;
         };
@@ -77987,12 +78157,18 @@ var BABYLON;
             }
             return newValue;
         };
+        /**
+         * Updates the generic gamepad
+         */
         GenericPad.prototype.update = function () {
             _super.prototype.update.call(this);
             for (var index = 0; index < this._buttons.length; index++) {
                 this._buttons[index] = this._setButtonValue(this.browserGamepad.buttons[index].value, this._buttons[index], index);
             }
         };
+        /**
+         * Disposes the generic gamepad
+         */
         GenericPad.prototype.dispose = function () {
             _super.prototype.dispose.call(this);
             this.onButtonDownObservable.clear();
@@ -78106,11 +78282,14 @@ var BABYLON;
         };
         Object.defineProperty(Xbox360Pad.prototype, "leftTrigger", {
             /**
-             * Gets or sets left trigger value
+             * Gets the left trigger value
              */
             get: function () {
                 return this._leftTrigger;
             },
+            /**
+             * Sets the left trigger value
+             */
             set: function (newValue) {
                 if (this._onlefttriggerchanged && this._leftTrigger !== newValue) {
                     this._onlefttriggerchanged(newValue);
@@ -78122,11 +78301,14 @@ var BABYLON;
         });
         Object.defineProperty(Xbox360Pad.prototype, "rightTrigger", {
             /**
-             * Gets or sets right trigger value
+             * Gets the right trigger value
              */
             get: function () {
                 return this._rightTrigger;
             },
+            /**
+             * Sets the right trigger value
+             */
             set: function (newValue) {
                 if (this._onrighttriggerchanged && this._rightTrigger !== newValue) {
                     this._onrighttriggerchanged(newValue);
@@ -78199,10 +78381,15 @@ var BABYLON;
             return newValue;
         };
         Object.defineProperty(Xbox360Pad.prototype, "buttonA", {
-            /** Gets or sets value of A button */
+            /**
+             * Gets the value of the `A` button
+             */
             get: function () {
                 return this._buttonA;
             },
+            /**
+             * Sets the value of the `A` button
+             */
             set: function (value) {
                 this._buttonA = this._setButtonValue(value, this._buttonA, Xbox360Button.A);
             },
@@ -78210,10 +78397,15 @@ var BABYLON;
             configurable: true
         });
         Object.defineProperty(Xbox360Pad.prototype, "buttonB", {
-            /** Gets or sets value of B button */
+            /**
+             * Gets the value of the `B` button
+             */
             get: function () {
                 return this._buttonB;
             },
+            /**
+             * Sets the value of the `B` button
+             */
             set: function (value) {
                 this._buttonB = this._setButtonValue(value, this._buttonB, Xbox360Button.B);
             },
@@ -78221,10 +78413,15 @@ var BABYLON;
             configurable: true
         });
         Object.defineProperty(Xbox360Pad.prototype, "buttonX", {
-            /** Gets or sets value of X button */
+            /**
+             * Gets the value of the `X` button
+             */
             get: function () {
                 return this._buttonX;
             },
+            /**
+             * Sets the value of the `X` button
+             */
             set: function (value) {
                 this._buttonX = this._setButtonValue(value, this._buttonX, Xbox360Button.X);
             },
@@ -78232,10 +78429,15 @@ var BABYLON;
             configurable: true
         });
         Object.defineProperty(Xbox360Pad.prototype, "buttonY", {
-            /** Gets or sets value of Y button */
+            /**
+             * Gets the value of the `Y` button
+             */
             get: function () {
                 return this._buttonY;
             },
+            /**
+             * Sets the value of the `Y` button
+             */
             set: function (value) {
                 this._buttonY = this._setButtonValue(value, this._buttonY, Xbox360Button.Y);
             },
@@ -78243,10 +78445,15 @@ var BABYLON;
             configurable: true
         });
         Object.defineProperty(Xbox360Pad.prototype, "buttonStart", {
-            /** Gets or sets value of Start button  */
+            /**
+             * Gets the value of the `Start` button
+             */
             get: function () {
                 return this._buttonStart;
             },
+            /**
+             * Sets the value of the `Start` button
+             */
             set: function (value) {
                 this._buttonStart = this._setButtonValue(value, this._buttonStart, Xbox360Button.Start);
             },
@@ -78254,10 +78461,15 @@ var BABYLON;
             configurable: true
         });
         Object.defineProperty(Xbox360Pad.prototype, "buttonBack", {
-            /** Gets or sets value of Back button  */
+            /**
+             * Gets the value of the `Back` button
+             */
             get: function () {
                 return this._buttonBack;
             },
+            /**
+             * Sets the value of the `Back` button
+             */
             set: function (value) {
                 this._buttonBack = this._setButtonValue(value, this._buttonBack, Xbox360Button.Back);
             },
@@ -78265,10 +78477,15 @@ var BABYLON;
             configurable: true
         });
         Object.defineProperty(Xbox360Pad.prototype, "buttonLB", {
-            /** Gets or sets value of Left button  */
+            /**
+             * Gets the value of the `Left` button
+             */
             get: function () {
                 return this._buttonLB;
             },
+            /**
+             * Sets the value of the `Left` button
+             */
             set: function (value) {
                 this._buttonLB = this._setButtonValue(value, this._buttonLB, Xbox360Button.LB);
             },
@@ -78276,10 +78493,15 @@ var BABYLON;
             configurable: true
         });
         Object.defineProperty(Xbox360Pad.prototype, "buttonRB", {
-            /** Gets or sets value of Right button  */
+            /**
+             * Gets the value of the `Right` button
+             */
             get: function () {
                 return this._buttonRB;
             },
+            /**
+             * Sets the value of the `Right` button
+             */
             set: function (value) {
                 this._buttonRB = this._setButtonValue(value, this._buttonRB, Xbox360Button.RB);
             },
@@ -78287,10 +78509,15 @@ var BABYLON;
             configurable: true
         });
         Object.defineProperty(Xbox360Pad.prototype, "buttonLeftStick", {
-            /** Gets or sets value of left stick */
+            /**
+             * Gets the value of the Left joystick
+             */
             get: function () {
                 return this._buttonLeftStick;
             },
+            /**
+             * Sets the value of the Left joystick
+             */
             set: function (value) {
                 this._buttonLeftStick = this._setButtonValue(value, this._buttonLeftStick, Xbox360Button.LeftStick);
             },
@@ -78298,10 +78525,15 @@ var BABYLON;
             configurable: true
         });
         Object.defineProperty(Xbox360Pad.prototype, "buttonRightStick", {
-            /** Gets or sets value of right stick */
+            /**
+             * Gets the value of the Right joystick
+             */
             get: function () {
                 return this._buttonRightStick;
             },
+            /**
+             * Sets the value of the Right joystick
+             */
             set: function (value) {
                 this._buttonRightStick = this._setButtonValue(value, this._buttonRightStick, Xbox360Button.RightStick);
             },
@@ -78309,10 +78541,15 @@ var BABYLON;
             configurable: true
         });
         Object.defineProperty(Xbox360Pad.prototype, "dPadUp", {
-            /** Gets or sets value of DPad up */
+            /**
+             * Gets the value of D-pad up
+             */
             get: function () {
                 return this._dPadUp;
             },
+            /**
+             * Sets the value of D-pad up
+             */
             set: function (value) {
                 this._dPadUp = this._setDPadValue(value, this._dPadUp, Xbox360Dpad.Up);
             },
@@ -78320,10 +78557,15 @@ var BABYLON;
             configurable: true
         });
         Object.defineProperty(Xbox360Pad.prototype, "dPadDown", {
-            /** Gets or sets value of DPad down */
+            /**
+             * Gets the value of D-pad down
+             */
             get: function () {
                 return this._dPadDown;
             },
+            /**
+             * Sets the value of D-pad down
+             */
             set: function (value) {
                 this._dPadDown = this._setDPadValue(value, this._dPadDown, Xbox360Dpad.Down);
             },
@@ -78331,10 +78573,15 @@ var BABYLON;
             configurable: true
         });
         Object.defineProperty(Xbox360Pad.prototype, "dPadLeft", {
-            /** Gets or sets value of DPad left */
+            /**
+             * Gets the value of D-pad left
+             */
             get: function () {
                 return this._dPadLeft;
             },
+            /**
+             * Sets the value of D-pad left
+             */
             set: function (value) {
                 this._dPadLeft = this._setDPadValue(value, this._dPadLeft, Xbox360Dpad.Left);
             },
@@ -78342,10 +78589,15 @@ var BABYLON;
             configurable: true
         });
         Object.defineProperty(Xbox360Pad.prototype, "dPadRight", {
-            /** Gets or sets value of DPad right */
+            /**
+             * Gets the value of D-pad right
+             */
             get: function () {
                 return this._dPadRight;
             },
+            /**
+             * Sets the value of D-pad right
+             */
             set: function (value) {
                 this._dPadRight = this._setDPadValue(value, this._dPadRight, Xbox360Dpad.Right);
             },
@@ -78394,6 +78646,9 @@ var BABYLON;
                 this.dPadRight = this.browserGamepad.buttons[15].value;
             }
         };
+        /**
+         * Disposes the gamepad
+         */
         Xbox360Pad.prototype.dispose = function () {
             _super.prototype.dispose.call(this);
             this.onButtonDownObservable.clear();
@@ -79828,10 +80083,16 @@ var BABYLON;
         enumerable: true,
         configurable: true
     });
+    /**
+     * Adds a gamepad to the free camera inputs manager
+     */
     BABYLON.FreeCameraInputsManager.prototype.addGamepad = function () {
         this.add(new BABYLON.FreeCameraGamepadInput());
         return this;
     };
+    /**
+     * Adds a gamepad to the arc rotate camera inputs manager
+     */
     BABYLON.ArcRotateCameraInputsManager.prototype.addGamepad = function () {
         this.add(new BABYLON.ArcRotateCameraGamepadInput());
         return this;
@@ -90881,19 +91142,61 @@ var BABYLON;
 
 var BABYLON;
 (function (BABYLON) {
+    /**
+     * This represents one of the lens effect in a `BABYLON.lensFlareSystem`.
+     * It controls one of the indiviual texture used in the effect.
+     * @see http://doc.babylonjs.com/how_to/how_to_use_lens_flares
+     */
     var LensFlare = /** @class */ (function () {
-        function LensFlare(size, position, color, imgUrl, system) {
+        /**
+         * Instantiates a new Lens Flare.
+         * This represents one of the lens effect in a `BABYLON.lensFlareSystem`.
+         * It controls one of the indiviual texture used in the effect.
+         * @see http://doc.babylonjs.com/how_to/how_to_use_lens_flares
+         * @param size Define the size of the lens flare in the system (a floating value between 0 and 1)
+         * @param position Define the position of the lens flare in the system. (a floating value between -1 and 1). A value of 0 is located on the emitter. A value greater than 0 is beyond the emitter and a value lesser than 0 is behind.
+         * @param color Define the lens color
+         * @param imgUrl Define the lens texture url
+         * @param system Define the `lensFlareSystem` this flare is part of
+         */
+        function LensFlare(
+        /**
+         * Define the size of the lens flare in the system (a floating value between 0 and 1)
+         */
+        size, 
+        /**
+         * Define the position of the lens flare in the system. (a floating value between -1 and 1). A value of 0 is located on the emitter. A value greater than 0 is beyond the emitter and a value lesser than 0 is behind.
+         */
+        position, color, imgUrl, system) {
             this.size = size;
             this.position = position;
+            /**
+             * Define the alpha mode to render this particular lens.
+             */
             this.alphaMode = BABYLON.Engine.ALPHA_ONEONE;
             this.color = color || new BABYLON.Color3(1, 1, 1);
             this.texture = imgUrl ? new BABYLON.Texture(imgUrl, system.getScene(), true) : null;
             this._system = system;
             system.lensFlares.push(this);
         }
+        /**
+         * Creates a new Lens Flare.
+         * This represents one of the lens effect in a `BABYLON.lensFlareSystem`.
+         * It controls one of the indiviual texture used in the effect.
+         * @see http://doc.babylonjs.com/how_to/how_to_use_lens_flares
+         * @param size Define the size of the lens flare (a floating value between 0 and 1)
+         * @param position Define the position of the lens flare in the system. (a floating value between -1 and 1). A value of 0 is located on the emitter. A value greater than 0 is beyond the emitter and a value lesser than 0 is behind.
+         * @param color Define the lens color
+         * @param imgUrl Define the lens texture url
+         * @param system Define the `lensFlareSystem` this flare is part of
+         * @returns The newly created Lens Flare
+         */
         LensFlare.AddFlare = function (size, position, color, imgUrl, system) {
             return new LensFlare(size, position, color, imgUrl, system);
         };
+        /**
+         * Dispose and release the lens flare with its associated resources.
+         */
         LensFlare.prototype.dispose = function () {
             if (this.texture) {
                 this.texture.dispose();
@@ -91053,12 +91356,42 @@ var BABYLON;
 
 var BABYLON;
 (function (BABYLON) {
+    /**
+     * This represents a Lens Flare System or the shiny effect created by the light reflection on the  camera lenses.
+     * It is usually composed of several `BABYLON.lensFlare`.
+     * @see http://doc.babylonjs.com/how_to/how_to_use_lens_flares
+     */
     var LensFlareSystem = /** @class */ (function () {
-        function LensFlareSystem(name, emitter, scene) {
+        /**
+         * Instantiates a lens flare system.
+         * This represents a Lens Flare System or the shiny effect created by the light reflection on the  camera lenses.
+         * It is usually composed of several `BABYLON.lensFlare`.
+         * @see http://doc.babylonjs.com/how_to/how_to_use_lens_flares
+         * @param name Define the name of the lens flare system in the scene
+         * @param emitter Define the source (the emitter) of the lens flares (it can be a camera, a light or a mesh).
+         * @param scene Define the scene the lens flare system belongs to
+         */
+        function LensFlareSystem(
+        /**
+         * Define the name of the lens flare system
+         */
+        name, emitter, scene) {
             this.name = name;
+            /**
+             * List of lens flares used in this system.
+             */
             this.lensFlares = new Array();
+            /**
+             * Define a limit from the border the lens flare can be visible.
+             */
             this.borderLimit = 300;
+            /**
+             * Define a viewport border we do not want to see the lens flare in.
+             */
             this.viewportBorder = 0;
+            /**
+             * Restricts the rendering of the effect to only the camera rendering this layer mask.
+             */
             this.layerMask = 0x0FFFFFFF;
             this._vertexBuffers = {};
             this._isEnabled = true;
@@ -91093,6 +91426,9 @@ var BABYLON;
             this._effect = engine.createEffect("lensFlare", [BABYLON.VertexBuffer.PositionKind], ["color", "viewportMatrix"], ["textureSampler"], "");
         }
         Object.defineProperty(LensFlareSystem.prototype, "isEnabled", {
+            /**
+             * Define if the lens flare system is enabled.
+             */
             get: function () {
                 return this._isEnabled;
             },
@@ -91102,18 +91438,40 @@ var BABYLON;
             enumerable: true,
             configurable: true
         });
+        /**
+         * Get the scene the effects belongs to.
+         * @returns the scene holding the lens flare system
+         */
         LensFlareSystem.prototype.getScene = function () {
             return this._scene;
         };
+        /**
+         * Get the emitter of the lens flare system.
+         * It defines the source of the lens flares (it can be a camera, a light or a mesh).
+         * @returns the emitter of the lens flare system
+         */
         LensFlareSystem.prototype.getEmitter = function () {
             return this._emitter;
         };
+        /**
+         * Set the emitter of the lens flare system.
+         * It defines the source of the lens flares (it can be a camera, a light or a mesh).
+         * @param newEmitter Define the new emitter of the system
+         */
         LensFlareSystem.prototype.setEmitter = function (newEmitter) {
             this._emitter = newEmitter;
         };
+        /**
+         * Get the lens flare system emitter position.
+         * The emitter defines the source of the lens flares (it can be a camera, a light or a mesh).
+         * @returns the position
+         */
         LensFlareSystem.prototype.getEmitterPosition = function () {
             return this._emitter.getAbsolutePosition ? this._emitter.getAbsolutePosition() : this._emitter.position;
         };
+        /**
+         * @hidden
+         */
         LensFlareSystem.prototype.computeEffectivePosition = function (globalViewport) {
             var position = this.getEmitterPosition();
             position = BABYLON.Vector3.Project(position, BABYLON.Matrix.Identity(), this._scene.getTransformMatrix(), globalViewport);
@@ -91152,6 +91510,9 @@ var BABYLON;
             var pickInfo = this._scene.pickWithRay(ray, this.meshesSelectionPredicate, true);
             return !pickInfo || !pickInfo.hit || pickInfo.distance > distance;
         };
+        /**
+         * @hidden
+         */
         LensFlareSystem.prototype.render = function () {
             if (!this._effect.isReady() || !this._scene.activeCamera)
                 return false;
@@ -91241,6 +91602,9 @@ var BABYLON;
             engine.setAlphaMode(BABYLON.Engine.ALPHA_DISABLE);
             return true;
         };
+        /**
+         * Dispose and release the lens flare with its associated resources.
+         */
         LensFlareSystem.prototype.dispose = function () {
             var vertexBuffer = this._vertexBuffers[BABYLON.VertexBuffer.PositionKind];
             if (vertexBuffer) {
@@ -91258,6 +91622,13 @@ var BABYLON;
             var index = this._scene.lensFlareSystems.indexOf(this);
             this._scene.lensFlareSystems.splice(index, 1);
         };
+        /**
+         * Parse a lens flare system from a JSON repressentation
+         * @param parsedLensFlareSystem Define the JSON to parse
+         * @param scene Define the scene the parsed system should be instantiated in
+         * @param rootUrl Define the rootUrl of the load sequence to easily find a load relative dependencies such as textures
+         * @returns the parsed system
+         */
         LensFlareSystem.Parse = function (parsedLensFlareSystem, scene, rootUrl) {
             var emitter = scene.getLastEntryByID(parsedLensFlareSystem.emitterId);
             var name = parsedLensFlareSystem.name || "lensFlareSystem#" + parsedLensFlareSystem.emitterId;
@@ -91270,6 +91641,10 @@ var BABYLON;
             }
             return lensFlareSystem;
         };
+        /**
+         * Serialize the current Lens Flare System into a JSON representation.
+         * @returns the serialized JSON
+         */
         LensFlareSystem.prototype.serialize = function () {
             var serializationObject = {};
             serializationObject.id = this.id;
@@ -95779,6 +96154,7 @@ var BABYLON;
             this.onPointerOutObservable = new BABYLON.Observable();
             // Create scene which will be rendered in the foreground and remove it from being referenced by engine to avoid interfering with existing app
             this.utilityLayerScene = new BABYLON.Scene(originalScene.getEngine());
+            this.utilityLayerScene.useRightHandedSystem = originalScene.useRightHandedSystem;
             this.utilityLayerScene._allowPostProcessClearColor = false;
             originalScene.getEngine().scenes.pop();
             // Detach controls on utility scene, events will be fired by logic below to handle picking priority
@@ -108495,7 +108871,11 @@ var BABYLON;
          * @param isBackground Defines whether the layer is displayed in front or behind the scene
          * @param color Defines a color for the layer
          */
-        function Layer(name, imgUrl, scene, isBackground, color) {
+        function Layer(
+        /**
+         * Define the name of the layer.
+         */
+        name, imgUrl, scene, isBackground, color) {
             this.name = name;
             /**
              * Define the scale of the layer in order to zoom in out of the texture.
@@ -108579,6 +108959,10 @@ var BABYLON;
             configurable: true
         });
         Object.defineProperty(Layer.prototype, "onAfterRender", {
+            /**
+             * Back compatibility with callback before the onAfterRenderObservable existed.
+             * The set callback will be triggered just after rendering the layer.
+             */
             set: function (callback) {
                 if (this._onAfterRenderObserver) {
                     this.onAfterRenderObservable.remove(this._onAfterRenderObserver);
@@ -109081,7 +109465,7 @@ var BABYLON;
                 if (onAnimationEnd) {
                     onAnimationEnd();
                 }
-                if (_this._attachedCamera) {
+                if (_this._attachedCamera && _this._attachedCamera.useInputToRestoreState) {
                     _this._attachedCamera.storeState();
                 }
             });

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 1 - 1
dist/preview release/babylon.worker.js


+ 410 - 26
dist/preview release/es6.js

@@ -59518,11 +59518,26 @@ var BABYLON;
                     serializationObject.startSizeGradients.push(serializedGradient);
                 }
             }
+            var lifeTimeGradients = particleSystem.getLifeTimeGradients();
+            if (lifeTimeGradients) {
+                serializationObject.lifeTimeGradients = [];
+                for (var _k = 0, lifeTimeGradients_1 = lifeTimeGradients; _k < lifeTimeGradients_1.length; _k++) {
+                    var lifeTimeGradient = lifeTimeGradients_1[_k];
+                    var serializedGradient = {
+                        gradient: lifeTimeGradient.gradient,
+                        factor1: lifeTimeGradient.factor1
+                    };
+                    if (lifeTimeGradient.factor2 !== undefined) {
+                        serializedGradient.factor2 = lifeTimeGradient.factor2;
+                    }
+                    serializationObject.lifeTimeGradients.push(serializedGradient);
+                }
+            }
             var limitVelocityGradients = particleSystem.getLimitVelocityGradients();
             if (limitVelocityGradients) {
                 serializationObject.limitVelocityGradients = [];
-                for (var _k = 0, limitVelocityGradients_1 = limitVelocityGradients; _k < limitVelocityGradients_1.length; _k++) {
-                    var limitVelocityGradient = limitVelocityGradients_1[_k];
+                for (var _l = 0, limitVelocityGradients_1 = limitVelocityGradients; _l < limitVelocityGradients_1.length; _l++) {
+                    var limitVelocityGradient = limitVelocityGradients_1[_l];
                     var serializedGradient = {
                         gradient: limitVelocityGradient.gradient,
                         factor1: limitVelocityGradient.factor1
@@ -59681,9 +59696,15 @@ var BABYLON;
                     particleSystem.addStartSizeGradient(startSizeGradient.gradient, startSizeGradient.factor1 !== undefined ? startSizeGradient.factor1 : startSizeGradient.factor, startSizeGradient.factor2);
                 }
             }
+            if (parsedParticleSystem.lifeTimeGradients) {
+                for (var _x = 0, _y = parsedParticleSystem.lifeTimeGradients; _x < _y.length; _x++) {
+                    var lifeTimeGradient = _y[_x];
+                    particleSystem.addLifeTimeGradient(lifeTimeGradient.gradient, lifeTimeGradient.factor1 !== undefined ? lifeTimeGradient.factor1 : lifeTimeGradient.factor, lifeTimeGradient.factor2);
+                }
+            }
             if (parsedParticleSystem.limitVelocityGradients) {
-                for (var _x = 0, _y = parsedParticleSystem.limitVelocityGradients; _x < _y.length; _x++) {
-                    var limitVelocityGradient = _y[_x];
+                for (var _z = 0, _0 = parsedParticleSystem.limitVelocityGradients; _z < _0.length; _z++) {
+                    var limitVelocityGradient = _0[_z];
                     particleSystem.addLimitVelocityGradient(limitVelocityGradient.gradient, limitVelocityGradient.factor1 !== undefined ? limitVelocityGradient.factor1 : limitVelocityGradient.factor, limitVelocityGradient.factor2);
                 }
                 particleSystem.limitVelocityDamping = parsedParticleSystem.limitVelocityDamping;
@@ -63938,6 +63959,26 @@ var BABYLON;
             enumerable: true,
             configurable: true
         });
+        /**
+         * Not supported by GPUParticleSystem
+         * @param gradient defines the gradient to use (between 0 and 1)
+         * @param factor defines the life time factor to affect to the specified gradient
+         * @param factor2 defines an additional factor used to define a range ([factor, factor2]) with main value to pick the final value from
+         * @returns the current particle system
+         */
+        GPUParticleSystem.prototype.addLifeTimeGradient = function (gradient, factor, factor2) {
+            //Not supported by GPUParticleSystem
+            return this;
+        };
+        /**
+         * Not supported by GPUParticleSystem
+         * @param gradient defines the gradient to remove
+         * @returns the current particle system
+         */
+        GPUParticleSystem.prototype.removeLifeTimeGradient = function (gradient) {
+            //Not supported by GPUParticleSystem
+            return this;
+        };
         GPUParticleSystem.prototype._reset = function () {
             this._releaseBuffers();
         };
@@ -77672,7 +77713,14 @@ var BABYLON;
 
 var BABYLON;
 (function (BABYLON) {
+    /**
+     * Manager for handling gamepads
+     */
     var GamepadManager = /** @class */ (function () {
+        /**
+         * Initializes the gamepad manager
+         * @param _scene BabylonJS scene
+         */
         function GamepadManager(_scene) {
             var _this = this;
             this._scene = _scene;
@@ -77680,6 +77728,9 @@ var BABYLON;
             this._oneGamepadConnected = false;
             /** @hidden */
             this._isMonitoring = false;
+            /**
+             * observable to be triggered when the gamepad controller has been disconnected
+             */
             this.onGamepadDisconnectedObservable = new BABYLON.Observable();
             if (!BABYLON.Tools.IsWindowObjectExist()) {
                 this._gamepadEventSupported = false;
@@ -77746,12 +77797,20 @@ var BABYLON;
             }
         }
         Object.defineProperty(GamepadManager.prototype, "gamepads", {
+            /**
+             * The gamepads in the game pad manager
+             */
             get: function () {
                 return this._babylonGamepads;
             },
             enumerable: true,
             configurable: true
         });
+        /**
+         * Get the gamepad controllers based on type
+         * @param type The type of gamepad controller
+         * @returns Nullable gamepad
+         */
         GamepadManager.prototype.getGamepadByType = function (type) {
             if (type === void 0) { type = BABYLON.Gamepad.XBOX; }
             for (var _i = 0, _a = this._babylonGamepads; _i < _a.length; _i++) {
@@ -77762,6 +77821,9 @@ var BABYLON;
             }
             return null;
         };
+        /**
+         * Disposes the gamepad manager
+         */
         GamepadManager.prototype.dispose = function () {
             if (this._gamepadEventSupported) {
                 if (this._onGamepadConnectedEvent) {
@@ -77861,16 +77923,57 @@ var BABYLON;
 
 var BABYLON;
 (function (BABYLON) {
+    /**
+     * Represents a gamepad control stick position
+     */
     var StickValues = /** @class */ (function () {
-        function StickValues(x, y) {
+        /**
+         * Initializes the gamepad x and y control stick values
+         * @param x The x component of the gamepad control stick value
+         * @param y The y component of the gamepad control stick value
+         */
+        function StickValues(
+        /**
+         * The x component of the control stick
+         */
+        x, 
+        /**
+         * The y component of the control stick
+         */
+        y) {
             this.x = x;
             this.y = y;
         }
         return StickValues;
     }());
     BABYLON.StickValues = StickValues;
+    /**
+     * Represents a gamepad
+     */
     var Gamepad = /** @class */ (function () {
-        function Gamepad(id, index, browserGamepad, leftStickX, leftStickY, rightStickX, rightStickY) {
+        /**
+         * Initializes the gamepad
+         * @param id The id of the gamepad
+         * @param index The index of the gamepad
+         * @param browserGamepad The browser gamepad
+         * @param leftStickX The x component of the left joystick
+         * @param leftStickY The y component of the left joystick
+         * @param rightStickX The x component of the right joystick
+         * @param rightStickY The y component of the right joystick
+         */
+        function Gamepad(
+        /**
+         * The id of the gamepad
+         */
+        id, 
+        /**
+         * The index of the gamepad
+         */
+        index, 
+        /**
+         * The browser gamepad
+         */
+        browserGamepad, leftStickX, leftStickY, rightStickX, rightStickY) {
             if (leftStickX === void 0) { leftStickX = 0; }
             if (leftStickY === void 0) { leftStickY = 1; }
             if (rightStickX === void 0) { rightStickX = 2; }
@@ -77882,6 +77985,9 @@ var BABYLON;
             this._rightStick = { x: 0, y: 0 };
             /** @hidden */
             this._isConnected = true;
+            /**
+             * Specifies whether the left control stick should be Y-inverted
+             */
             this._invertLeftStickY = false;
             this.type = Gamepad.GAMEPAD;
             this._leftStickAxisX = leftStickX;
@@ -77896,22 +78002,39 @@ var BABYLON;
             }
         }
         Object.defineProperty(Gamepad.prototype, "isConnected", {
+            /**
+             * Specifies if the gamepad has been connected
+             */
             get: function () {
                 return this._isConnected;
             },
             enumerable: true,
             configurable: true
         });
+        /**
+         * Callback triggered when the left joystick has changed
+         * @param callback
+         */
         Gamepad.prototype.onleftstickchanged = function (callback) {
             this._onleftstickchanged = callback;
         };
+        /**
+         * Callback triggered when the right joystick has changed
+         * @param callback
+         */
         Gamepad.prototype.onrightstickchanged = function (callback) {
             this._onrightstickchanged = callback;
         };
         Object.defineProperty(Gamepad.prototype, "leftStick", {
+            /**
+             * Gets the left joystick
+             */
             get: function () {
                 return this._leftStick;
             },
+            /**
+             * Sets the left joystick values
+             */
             set: function (newValues) {
                 if (this._onleftstickchanged && (this._leftStick.x !== newValues.x || this._leftStick.y !== newValues.y)) {
                     this._onleftstickchanged(newValues);
@@ -77922,9 +78045,15 @@ var BABYLON;
             configurable: true
         });
         Object.defineProperty(Gamepad.prototype, "rightStick", {
+            /**
+             * Gets the right joystick
+             */
             get: function () {
                 return this._rightStick;
             },
+            /**
+             * Sets the right joystick value
+             */
             set: function (newValues) {
                 if (this._onrightstickchanged && (this._rightStick.x !== newValues.x || this._rightStick.y !== newValues.y)) {
                     this._onrightstickchanged(newValues);
@@ -77934,6 +78063,9 @@ var BABYLON;
             enumerable: true,
             configurable: true
         });
+        /**
+         * Updates the gamepad joystick positions
+         */
         Gamepad.prototype.update = function () {
             if (this._leftStick) {
                 this.leftStick = { x: this.browserGamepad.axes[this._leftStickAxisX], y: this.browserGamepad.axes[this._leftStickAxisY] };
@@ -77945,28 +78077,66 @@ var BABYLON;
                 this.rightStick = { x: this.browserGamepad.axes[this._rightStickAxisX], y: this.browserGamepad.axes[this._rightStickAxisY] };
             }
         };
+        /**
+         * Disposes the gamepad
+         */
         Gamepad.prototype.dispose = function () {
         };
+        /**
+         * Represents a gamepad controller
+         */
         Gamepad.GAMEPAD = 0;
+        /**
+         * Represents a generic controller
+         */
         Gamepad.GENERIC = 1;
+        /**
+         * Represents an XBox controller
+         */
         Gamepad.XBOX = 2;
+        /**
+         * Represents a pose-enabled controller
+         */
         Gamepad.POSE_ENABLED = 3;
         return Gamepad;
     }());
     BABYLON.Gamepad = Gamepad;
+    /**
+     * Represents a generic gamepad
+     */
     var GenericPad = /** @class */ (function (_super) {
         __extends(GenericPad, _super);
+        /**
+         * Initializes the generic gamepad
+         * @param id The id of the generic gamepad
+         * @param index The index of the generic gamepad
+         * @param browserGamepad The browser gamepad
+         */
         function GenericPad(id, index, browserGamepad) {
             var _this = _super.call(this, id, index, browserGamepad) || this;
+            /**
+             * Observable triggered when a button has been pressed
+             */
             _this.onButtonDownObservable = new BABYLON.Observable();
+            /**
+             * Observable triggered when a button has been released
+             */
             _this.onButtonUpObservable = new BABYLON.Observable();
             _this.type = Gamepad.GENERIC;
             _this._buttons = new Array(browserGamepad.buttons.length);
             return _this;
         }
+        /**
+         * Callback triggered when a button has been pressed
+         * @param callback Called when a button has been pressed
+         */
         GenericPad.prototype.onbuttondown = function (callback) {
             this._onbuttondown = callback;
         };
+        /**
+         * Callback triggered when a button has been released
+         * @param callback Called when a button has been released
+         */
         GenericPad.prototype.onbuttonup = function (callback) {
             this._onbuttonup = callback;
         };
@@ -77987,12 +78157,18 @@ var BABYLON;
             }
             return newValue;
         };
+        /**
+         * Updates the generic gamepad
+         */
         GenericPad.prototype.update = function () {
             _super.prototype.update.call(this);
             for (var index = 0; index < this._buttons.length; index++) {
                 this._buttons[index] = this._setButtonValue(this.browserGamepad.buttons[index].value, this._buttons[index], index);
             }
         };
+        /**
+         * Disposes the generic gamepad
+         */
         GenericPad.prototype.dispose = function () {
             _super.prototype.dispose.call(this);
             this.onButtonDownObservable.clear();
@@ -78106,11 +78282,14 @@ var BABYLON;
         };
         Object.defineProperty(Xbox360Pad.prototype, "leftTrigger", {
             /**
-             * Gets or sets left trigger value
+             * Gets the left trigger value
              */
             get: function () {
                 return this._leftTrigger;
             },
+            /**
+             * Sets the left trigger value
+             */
             set: function (newValue) {
                 if (this._onlefttriggerchanged && this._leftTrigger !== newValue) {
                     this._onlefttriggerchanged(newValue);
@@ -78122,11 +78301,14 @@ var BABYLON;
         });
         Object.defineProperty(Xbox360Pad.prototype, "rightTrigger", {
             /**
-             * Gets or sets right trigger value
+             * Gets the right trigger value
              */
             get: function () {
                 return this._rightTrigger;
             },
+            /**
+             * Sets the right trigger value
+             */
             set: function (newValue) {
                 if (this._onrighttriggerchanged && this._rightTrigger !== newValue) {
                     this._onrighttriggerchanged(newValue);
@@ -78199,10 +78381,15 @@ var BABYLON;
             return newValue;
         };
         Object.defineProperty(Xbox360Pad.prototype, "buttonA", {
-            /** Gets or sets value of A button */
+            /**
+             * Gets the value of the `A` button
+             */
             get: function () {
                 return this._buttonA;
             },
+            /**
+             * Sets the value of the `A` button
+             */
             set: function (value) {
                 this._buttonA = this._setButtonValue(value, this._buttonA, Xbox360Button.A);
             },
@@ -78210,10 +78397,15 @@ var BABYLON;
             configurable: true
         });
         Object.defineProperty(Xbox360Pad.prototype, "buttonB", {
-            /** Gets or sets value of B button */
+            /**
+             * Gets the value of the `B` button
+             */
             get: function () {
                 return this._buttonB;
             },
+            /**
+             * Sets the value of the `B` button
+             */
             set: function (value) {
                 this._buttonB = this._setButtonValue(value, this._buttonB, Xbox360Button.B);
             },
@@ -78221,10 +78413,15 @@ var BABYLON;
             configurable: true
         });
         Object.defineProperty(Xbox360Pad.prototype, "buttonX", {
-            /** Gets or sets value of X button */
+            /**
+             * Gets the value of the `X` button
+             */
             get: function () {
                 return this._buttonX;
             },
+            /**
+             * Sets the value of the `X` button
+             */
             set: function (value) {
                 this._buttonX = this._setButtonValue(value, this._buttonX, Xbox360Button.X);
             },
@@ -78232,10 +78429,15 @@ var BABYLON;
             configurable: true
         });
         Object.defineProperty(Xbox360Pad.prototype, "buttonY", {
-            /** Gets or sets value of Y button */
+            /**
+             * Gets the value of the `Y` button
+             */
             get: function () {
                 return this._buttonY;
             },
+            /**
+             * Sets the value of the `Y` button
+             */
             set: function (value) {
                 this._buttonY = this._setButtonValue(value, this._buttonY, Xbox360Button.Y);
             },
@@ -78243,10 +78445,15 @@ var BABYLON;
             configurable: true
         });
         Object.defineProperty(Xbox360Pad.prototype, "buttonStart", {
-            /** Gets or sets value of Start button  */
+            /**
+             * Gets the value of the `Start` button
+             */
             get: function () {
                 return this._buttonStart;
             },
+            /**
+             * Sets the value of the `Start` button
+             */
             set: function (value) {
                 this._buttonStart = this._setButtonValue(value, this._buttonStart, Xbox360Button.Start);
             },
@@ -78254,10 +78461,15 @@ var BABYLON;
             configurable: true
         });
         Object.defineProperty(Xbox360Pad.prototype, "buttonBack", {
-            /** Gets or sets value of Back button  */
+            /**
+             * Gets the value of the `Back` button
+             */
             get: function () {
                 return this._buttonBack;
             },
+            /**
+             * Sets the value of the `Back` button
+             */
             set: function (value) {
                 this._buttonBack = this._setButtonValue(value, this._buttonBack, Xbox360Button.Back);
             },
@@ -78265,10 +78477,15 @@ var BABYLON;
             configurable: true
         });
         Object.defineProperty(Xbox360Pad.prototype, "buttonLB", {
-            /** Gets or sets value of Left button  */
+            /**
+             * Gets the value of the `Left` button
+             */
             get: function () {
                 return this._buttonLB;
             },
+            /**
+             * Sets the value of the `Left` button
+             */
             set: function (value) {
                 this._buttonLB = this._setButtonValue(value, this._buttonLB, Xbox360Button.LB);
             },
@@ -78276,10 +78493,15 @@ var BABYLON;
             configurable: true
         });
         Object.defineProperty(Xbox360Pad.prototype, "buttonRB", {
-            /** Gets or sets value of Right button  */
+            /**
+             * Gets the value of the `Right` button
+             */
             get: function () {
                 return this._buttonRB;
             },
+            /**
+             * Sets the value of the `Right` button
+             */
             set: function (value) {
                 this._buttonRB = this._setButtonValue(value, this._buttonRB, Xbox360Button.RB);
             },
@@ -78287,10 +78509,15 @@ var BABYLON;
             configurable: true
         });
         Object.defineProperty(Xbox360Pad.prototype, "buttonLeftStick", {
-            /** Gets or sets value of left stick */
+            /**
+             * Gets the value of the Left joystick
+             */
             get: function () {
                 return this._buttonLeftStick;
             },
+            /**
+             * Sets the value of the Left joystick
+             */
             set: function (value) {
                 this._buttonLeftStick = this._setButtonValue(value, this._buttonLeftStick, Xbox360Button.LeftStick);
             },
@@ -78298,10 +78525,15 @@ var BABYLON;
             configurable: true
         });
         Object.defineProperty(Xbox360Pad.prototype, "buttonRightStick", {
-            /** Gets or sets value of right stick */
+            /**
+             * Gets the value of the Right joystick
+             */
             get: function () {
                 return this._buttonRightStick;
             },
+            /**
+             * Sets the value of the Right joystick
+             */
             set: function (value) {
                 this._buttonRightStick = this._setButtonValue(value, this._buttonRightStick, Xbox360Button.RightStick);
             },
@@ -78309,10 +78541,15 @@ var BABYLON;
             configurable: true
         });
         Object.defineProperty(Xbox360Pad.prototype, "dPadUp", {
-            /** Gets or sets value of DPad up */
+            /**
+             * Gets the value of D-pad up
+             */
             get: function () {
                 return this._dPadUp;
             },
+            /**
+             * Sets the value of D-pad up
+             */
             set: function (value) {
                 this._dPadUp = this._setDPadValue(value, this._dPadUp, Xbox360Dpad.Up);
             },
@@ -78320,10 +78557,15 @@ var BABYLON;
             configurable: true
         });
         Object.defineProperty(Xbox360Pad.prototype, "dPadDown", {
-            /** Gets or sets value of DPad down */
+            /**
+             * Gets the value of D-pad down
+             */
             get: function () {
                 return this._dPadDown;
             },
+            /**
+             * Sets the value of D-pad down
+             */
             set: function (value) {
                 this._dPadDown = this._setDPadValue(value, this._dPadDown, Xbox360Dpad.Down);
             },
@@ -78331,10 +78573,15 @@ var BABYLON;
             configurable: true
         });
         Object.defineProperty(Xbox360Pad.prototype, "dPadLeft", {
-            /** Gets or sets value of DPad left */
+            /**
+             * Gets the value of D-pad left
+             */
             get: function () {
                 return this._dPadLeft;
             },
+            /**
+             * Sets the value of D-pad left
+             */
             set: function (value) {
                 this._dPadLeft = this._setDPadValue(value, this._dPadLeft, Xbox360Dpad.Left);
             },
@@ -78342,10 +78589,15 @@ var BABYLON;
             configurable: true
         });
         Object.defineProperty(Xbox360Pad.prototype, "dPadRight", {
-            /** Gets or sets value of DPad right */
+            /**
+             * Gets the value of D-pad right
+             */
             get: function () {
                 return this._dPadRight;
             },
+            /**
+             * Sets the value of D-pad right
+             */
             set: function (value) {
                 this._dPadRight = this._setDPadValue(value, this._dPadRight, Xbox360Dpad.Right);
             },
@@ -78394,6 +78646,9 @@ var BABYLON;
                 this.dPadRight = this.browserGamepad.buttons[15].value;
             }
         };
+        /**
+         * Disposes the gamepad
+         */
         Xbox360Pad.prototype.dispose = function () {
             _super.prototype.dispose.call(this);
             this.onButtonDownObservable.clear();
@@ -79828,10 +80083,16 @@ var BABYLON;
         enumerable: true,
         configurable: true
     });
+    /**
+     * Adds a gamepad to the free camera inputs manager
+     */
     BABYLON.FreeCameraInputsManager.prototype.addGamepad = function () {
         this.add(new BABYLON.FreeCameraGamepadInput());
         return this;
     };
+    /**
+     * Adds a gamepad to the arc rotate camera inputs manager
+     */
     BABYLON.ArcRotateCameraInputsManager.prototype.addGamepad = function () {
         this.add(new BABYLON.ArcRotateCameraGamepadInput());
         return this;
@@ -90881,19 +91142,61 @@ var BABYLON;
 
 var BABYLON;
 (function (BABYLON) {
+    /**
+     * This represents one of the lens effect in a `BABYLON.lensFlareSystem`.
+     * It controls one of the indiviual texture used in the effect.
+     * @see http://doc.babylonjs.com/how_to/how_to_use_lens_flares
+     */
     var LensFlare = /** @class */ (function () {
-        function LensFlare(size, position, color, imgUrl, system) {
+        /**
+         * Instantiates a new Lens Flare.
+         * This represents one of the lens effect in a `BABYLON.lensFlareSystem`.
+         * It controls one of the indiviual texture used in the effect.
+         * @see http://doc.babylonjs.com/how_to/how_to_use_lens_flares
+         * @param size Define the size of the lens flare in the system (a floating value between 0 and 1)
+         * @param position Define the position of the lens flare in the system. (a floating value between -1 and 1). A value of 0 is located on the emitter. A value greater than 0 is beyond the emitter and a value lesser than 0 is behind.
+         * @param color Define the lens color
+         * @param imgUrl Define the lens texture url
+         * @param system Define the `lensFlareSystem` this flare is part of
+         */
+        function LensFlare(
+        /**
+         * Define the size of the lens flare in the system (a floating value between 0 and 1)
+         */
+        size, 
+        /**
+         * Define the position of the lens flare in the system. (a floating value between -1 and 1). A value of 0 is located on the emitter. A value greater than 0 is beyond the emitter and a value lesser than 0 is behind.
+         */
+        position, color, imgUrl, system) {
             this.size = size;
             this.position = position;
+            /**
+             * Define the alpha mode to render this particular lens.
+             */
             this.alphaMode = BABYLON.Engine.ALPHA_ONEONE;
             this.color = color || new BABYLON.Color3(1, 1, 1);
             this.texture = imgUrl ? new BABYLON.Texture(imgUrl, system.getScene(), true) : null;
             this._system = system;
             system.lensFlares.push(this);
         }
+        /**
+         * Creates a new Lens Flare.
+         * This represents one of the lens effect in a `BABYLON.lensFlareSystem`.
+         * It controls one of the indiviual texture used in the effect.
+         * @see http://doc.babylonjs.com/how_to/how_to_use_lens_flares
+         * @param size Define the size of the lens flare (a floating value between 0 and 1)
+         * @param position Define the position of the lens flare in the system. (a floating value between -1 and 1). A value of 0 is located on the emitter. A value greater than 0 is beyond the emitter and a value lesser than 0 is behind.
+         * @param color Define the lens color
+         * @param imgUrl Define the lens texture url
+         * @param system Define the `lensFlareSystem` this flare is part of
+         * @returns The newly created Lens Flare
+         */
         LensFlare.AddFlare = function (size, position, color, imgUrl, system) {
             return new LensFlare(size, position, color, imgUrl, system);
         };
+        /**
+         * Dispose and release the lens flare with its associated resources.
+         */
         LensFlare.prototype.dispose = function () {
             if (this.texture) {
                 this.texture.dispose();
@@ -91053,12 +91356,42 @@ var BABYLON;
 
 var BABYLON;
 (function (BABYLON) {
+    /**
+     * This represents a Lens Flare System or the shiny effect created by the light reflection on the  camera lenses.
+     * It is usually composed of several `BABYLON.lensFlare`.
+     * @see http://doc.babylonjs.com/how_to/how_to_use_lens_flares
+     */
     var LensFlareSystem = /** @class */ (function () {
-        function LensFlareSystem(name, emitter, scene) {
+        /**
+         * Instantiates a lens flare system.
+         * This represents a Lens Flare System or the shiny effect created by the light reflection on the  camera lenses.
+         * It is usually composed of several `BABYLON.lensFlare`.
+         * @see http://doc.babylonjs.com/how_to/how_to_use_lens_flares
+         * @param name Define the name of the lens flare system in the scene
+         * @param emitter Define the source (the emitter) of the lens flares (it can be a camera, a light or a mesh).
+         * @param scene Define the scene the lens flare system belongs to
+         */
+        function LensFlareSystem(
+        /**
+         * Define the name of the lens flare system
+         */
+        name, emitter, scene) {
             this.name = name;
+            /**
+             * List of lens flares used in this system.
+             */
             this.lensFlares = new Array();
+            /**
+             * Define a limit from the border the lens flare can be visible.
+             */
             this.borderLimit = 300;
+            /**
+             * Define a viewport border we do not want to see the lens flare in.
+             */
             this.viewportBorder = 0;
+            /**
+             * Restricts the rendering of the effect to only the camera rendering this layer mask.
+             */
             this.layerMask = 0x0FFFFFFF;
             this._vertexBuffers = {};
             this._isEnabled = true;
@@ -91093,6 +91426,9 @@ var BABYLON;
             this._effect = engine.createEffect("lensFlare", [BABYLON.VertexBuffer.PositionKind], ["color", "viewportMatrix"], ["textureSampler"], "");
         }
         Object.defineProperty(LensFlareSystem.prototype, "isEnabled", {
+            /**
+             * Define if the lens flare system is enabled.
+             */
             get: function () {
                 return this._isEnabled;
             },
@@ -91102,18 +91438,40 @@ var BABYLON;
             enumerable: true,
             configurable: true
         });
+        /**
+         * Get the scene the effects belongs to.
+         * @returns the scene holding the lens flare system
+         */
         LensFlareSystem.prototype.getScene = function () {
             return this._scene;
         };
+        /**
+         * Get the emitter of the lens flare system.
+         * It defines the source of the lens flares (it can be a camera, a light or a mesh).
+         * @returns the emitter of the lens flare system
+         */
         LensFlareSystem.prototype.getEmitter = function () {
             return this._emitter;
         };
+        /**
+         * Set the emitter of the lens flare system.
+         * It defines the source of the lens flares (it can be a camera, a light or a mesh).
+         * @param newEmitter Define the new emitter of the system
+         */
         LensFlareSystem.prototype.setEmitter = function (newEmitter) {
             this._emitter = newEmitter;
         };
+        /**
+         * Get the lens flare system emitter position.
+         * The emitter defines the source of the lens flares (it can be a camera, a light or a mesh).
+         * @returns the position
+         */
         LensFlareSystem.prototype.getEmitterPosition = function () {
             return this._emitter.getAbsolutePosition ? this._emitter.getAbsolutePosition() : this._emitter.position;
         };
+        /**
+         * @hidden
+         */
         LensFlareSystem.prototype.computeEffectivePosition = function (globalViewport) {
             var position = this.getEmitterPosition();
             position = BABYLON.Vector3.Project(position, BABYLON.Matrix.Identity(), this._scene.getTransformMatrix(), globalViewport);
@@ -91152,6 +91510,9 @@ var BABYLON;
             var pickInfo = this._scene.pickWithRay(ray, this.meshesSelectionPredicate, true);
             return !pickInfo || !pickInfo.hit || pickInfo.distance > distance;
         };
+        /**
+         * @hidden
+         */
         LensFlareSystem.prototype.render = function () {
             if (!this._effect.isReady() || !this._scene.activeCamera)
                 return false;
@@ -91241,6 +91602,9 @@ var BABYLON;
             engine.setAlphaMode(BABYLON.Engine.ALPHA_DISABLE);
             return true;
         };
+        /**
+         * Dispose and release the lens flare with its associated resources.
+         */
         LensFlareSystem.prototype.dispose = function () {
             var vertexBuffer = this._vertexBuffers[BABYLON.VertexBuffer.PositionKind];
             if (vertexBuffer) {
@@ -91258,6 +91622,13 @@ var BABYLON;
             var index = this._scene.lensFlareSystems.indexOf(this);
             this._scene.lensFlareSystems.splice(index, 1);
         };
+        /**
+         * Parse a lens flare system from a JSON repressentation
+         * @param parsedLensFlareSystem Define the JSON to parse
+         * @param scene Define the scene the parsed system should be instantiated in
+         * @param rootUrl Define the rootUrl of the load sequence to easily find a load relative dependencies such as textures
+         * @returns the parsed system
+         */
         LensFlareSystem.Parse = function (parsedLensFlareSystem, scene, rootUrl) {
             var emitter = scene.getLastEntryByID(parsedLensFlareSystem.emitterId);
             var name = parsedLensFlareSystem.name || "lensFlareSystem#" + parsedLensFlareSystem.emitterId;
@@ -91270,6 +91641,10 @@ var BABYLON;
             }
             return lensFlareSystem;
         };
+        /**
+         * Serialize the current Lens Flare System into a JSON representation.
+         * @returns the serialized JSON
+         */
         LensFlareSystem.prototype.serialize = function () {
             var serializationObject = {};
             serializationObject.id = this.id;
@@ -95779,6 +96154,7 @@ var BABYLON;
             this.onPointerOutObservable = new BABYLON.Observable();
             // Create scene which will be rendered in the foreground and remove it from being referenced by engine to avoid interfering with existing app
             this.utilityLayerScene = new BABYLON.Scene(originalScene.getEngine());
+            this.utilityLayerScene.useRightHandedSystem = originalScene.useRightHandedSystem;
             this.utilityLayerScene._allowPostProcessClearColor = false;
             originalScene.getEngine().scenes.pop();
             // Detach controls on utility scene, events will be fired by logic below to handle picking priority
@@ -108495,7 +108871,11 @@ var BABYLON;
          * @param isBackground Defines whether the layer is displayed in front or behind the scene
          * @param color Defines a color for the layer
          */
-        function Layer(name, imgUrl, scene, isBackground, color) {
+        function Layer(
+        /**
+         * Define the name of the layer.
+         */
+        name, imgUrl, scene, isBackground, color) {
             this.name = name;
             /**
              * Define the scale of the layer in order to zoom in out of the texture.
@@ -108579,6 +108959,10 @@ var BABYLON;
             configurable: true
         });
         Object.defineProperty(Layer.prototype, "onAfterRender", {
+            /**
+             * Back compatibility with callback before the onAfterRenderObservable existed.
+             * The set callback will be triggered just after rendering the layer.
+             */
             set: function (callback) {
                 if (this._onAfterRenderObserver) {
                     this.onAfterRenderObservable.remove(this._onAfterRenderObserver);
@@ -109081,7 +109465,7 @@ var BABYLON;
                 if (onAnimationEnd) {
                     onAnimationEnd();
                 }
-                if (_this._attachedCamera) {
+                if (_this._attachedCamera && _this._attachedCamera.useInputToRestoreState) {
                     _this._attachedCamera.storeState();
                 }
             });

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 1 - 1
dist/preview release/gui/babylon.gui.js


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 1 - 1
dist/preview release/gui/babylon.gui.min.js


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 1 - 1
dist/preview release/gui/babylon.gui.min.js.map


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

@@ -1,7 +1,7 @@
 {
-  "errors": 2265,
+  "errors": 2163,
   "babylon.typedoc.json": {
-    "errors": 2265,
+    "errors": 2163,
     "BaseSubMesh": {
       "Class": {
         "Comments": {
@@ -1953,278 +1953,6 @@
         }
       }
     },
-    "Layer": {
-      "Property": {
-        "name": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "onAfterRender": {
-          "Comments": {
-            "MissingText": true
-          }
-        }
-      }
-    },
-    "LensFlare": {
-      "Class": {
-        "Comments": {
-          "MissingText": true
-        }
-      },
-      "Constructor": {
-        "new LensFlare": {
-          "Comments": {
-            "MissingText": true
-          },
-          "Parameter": {
-            "size": {
-              "Comments": {
-                "MissingText": true
-              }
-            },
-            "position": {
-              "Comments": {
-                "MissingText": true
-              }
-            },
-            "color": {
-              "Comments": {
-                "MissingText": true
-              }
-            },
-            "imgUrl": {
-              "Comments": {
-                "MissingText": true
-              }
-            },
-            "system": {
-              "Comments": {
-                "MissingText": true
-              }
-            }
-          }
-        }
-      },
-      "Property": {
-        "alphaMode": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "color": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "position": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "size": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "texture": {
-          "Comments": {
-            "MissingText": true
-          }
-        }
-      },
-      "Method": {
-        "dispose": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "AddFlare": {
-          "Comments": {
-            "MissingText": true
-          },
-          "Parameter": {
-            "size": {
-              "Comments": {
-                "MissingText": true
-              }
-            },
-            "position": {
-              "Comments": {
-                "MissingText": true
-              }
-            },
-            "color": {
-              "Comments": {
-                "MissingText": true
-              }
-            },
-            "imgUrl": {
-              "Comments": {
-                "MissingText": true
-              }
-            },
-            "system": {
-              "Comments": {
-                "MissingText": true
-              }
-            }
-          }
-        }
-      }
-    },
-    "LensFlareSystem": {
-      "Class": {
-        "Comments": {
-          "MissingText": true
-        }
-      },
-      "Constructor": {
-        "new LensFlareSystem": {
-          "Comments": {
-            "MissingText": true
-          },
-          "Parameter": {
-            "name": {
-              "Comments": {
-                "MissingText": true
-              }
-            },
-            "emitter": {
-              "Comments": {
-                "MissingText": true
-              }
-            },
-            "scene": {
-              "Comments": {
-                "MissingText": true
-              }
-            }
-          }
-        }
-      },
-      "Property": {
-        "borderLimit": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "id": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "isEnabled": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "layerMask": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "lensFlares": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "meshesSelectionPredicate": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "name": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "viewportBorder": {
-          "Comments": {
-            "MissingText": true
-          }
-        }
-      },
-      "Method": {
-        "computeEffectivePosition": {
-          "Comments": {
-            "MissingText": true
-          },
-          "Parameter": {
-            "globalViewport": {
-              "Comments": {
-                "MissingText": true
-              }
-            }
-          }
-        },
-        "dispose": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "getEmitter": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "getEmitterPosition": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "getScene": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "render": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "serialize": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "setEmitter": {
-          "Comments": {
-            "MissingText": true
-          },
-          "Parameter": {
-            "newEmitter": {
-              "Comments": {
-                "MissingText": true
-              }
-            }
-          }
-        },
-        "Parse": {
-          "Comments": {
-            "MissingText": true
-          },
-          "Parameter": {
-            "parsedLensFlareSystem": {
-              "Comments": {
-                "MissingText": true
-              }
-            },
-            "scene": {
-              "Comments": {
-                "MissingText": true
-              }
-            },
-            "rootUrl": {
-              "Comments": {
-                "MissingText": true
-              }
-            }
-          }
-        }
-      }
-    },
     "LensRenderingPipeline": {
       "Class": {
         "Comments": {
@@ -11690,35 +11418,6 @@
         }
       }
     },
-    "GamepadButtonChanges": {
-      "Interface": {
-        "Comments": {
-          "MissingText": true
-        }
-      },
-      "Property": {
-        "changed": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "pressChanged": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "touchChanged": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "valueChanged": {
-          "Comments": {
-            "MissingText": true
-          }
-        }
-      }
-    },
     "IAnimatable": {
       "Interface": {
         "Comments": {

+ 197 - 15
dist/preview release/viewer/babylon.viewer.d.ts

@@ -924,7 +924,7 @@ declare module BabylonViewer {
       * @param name the name of the custom optimizer configuration
       * @param upgrade set to true if you want to upgrade optimizer and false if you want to degrade
       */
-    export function getCustomOptimizerByName(name: string, upgrade?: boolean): typeof extendedUpgrade;
+    export function getCustomOptimizerByName(name: string, upgrade?: boolean): (sceneManager: SceneManager) => boolean;
     export function registerCustomOptimizer(name: string, optimizer: (sceneManager: SceneManager) => boolean): void;
 }
 declare module BabylonViewer {
@@ -1038,6 +1038,169 @@ declare module BabylonViewer {
     }
 }
 declare module BabylonViewer {
+    /**
+        * The object sent when an event is triggered
+        */
+    export interface EventCallback {
+            event: Event;
+            template: Template;
+            selector: string;
+            payload?: any;
+    }
+    /**
+        * The template manager, a member of the viewer class, will manage the viewer's templates and generate the HTML.
+        * The template manager managers a single viewer and can be seen as the collection of all sub-templates of the viewer.
+        */
+    export class TemplateManager {
+            containerElement: HTMLElement;
+            /**
+                * Will be triggered when any template is initialized
+                */
+            onTemplateInit: BABYLON.Observable<Template>;
+            /**
+                * Will be triggered when any template is fully loaded
+                */
+            onTemplateLoaded: BABYLON.Observable<Template>;
+            /**
+                * Will be triggered when a template state changes
+                */
+            onTemplateStateChange: BABYLON.Observable<Template>;
+            /**
+                * Will be triggered when all templates finished loading
+                */
+            onAllLoaded: BABYLON.Observable<TemplateManager>;
+            /**
+                * Will be triggered when any event on any template is triggered.
+                */
+            onEventTriggered: BABYLON.Observable<EventCallback>;
+            /**
+                * This template manager's event manager. In charge of callback registrations to native event types
+                */
+            eventManager: EventManager;
+            constructor(containerElement: HTMLElement);
+            /**
+                * Initialize the template(s) for the viewer. Called bay the Viewer class
+                * @param templates the templates to be used to initialize the main template
+                */
+            initTemplate(templates: {
+                    [key: string]: ITemplateConfiguration;
+            }): Promise<void>;
+            /**
+                * Get the canvas in the template tree.
+                * There must be one and only one canvas inthe template.
+                */
+            getCanvas(): HTMLCanvasElement | null;
+            /**
+                * Get a specific template from the template tree
+                * @param name the name of the template to load
+                */
+            getTemplate(name: string): Template | undefined;
+            /**
+                * Dispose the template manager
+                */
+            dispose(): void;
+    }
+    /**
+        * This class represents a single template in the viewer's template tree.
+        * An example for a template is a single canvas, an overlay (containing sub-templates) or the navigation bar.
+        * A template is injected using the template manager in the correct position.
+        * The template is rendered using Handlebars and can use Handlebars' features (such as parameter injection)
+        *
+        * For further information please refer to the documentation page, https://doc.babylonjs.com
+        */
+    export class Template {
+            name: string;
+            /**
+                * Will be triggered when the template is loaded
+                */
+            onLoaded: BABYLON.Observable<Template>;
+            /**
+                * will be triggered when the template is appended to the tree
+                */
+            onAppended: BABYLON.Observable<Template>;
+            /**
+                * Will be triggered when the template's state changed (shown, hidden)
+                */
+            onStateChange: BABYLON.Observable<Template>;
+            /**
+                * Will be triggered when an event is triggered on ths template.
+                * The event is a native browser event (like mouse or pointer events)
+                */
+            onEventTriggered: BABYLON.Observable<EventCallback>;
+            onParamsUpdated: BABYLON.Observable<Template>;
+            onHTMLRendered: BABYLON.Observable<Template>;
+            /**
+                * is the template loaded?
+                */
+            isLoaded: boolean;
+            /**
+                * This is meant to be used to track the show and hide functions.
+                * This is NOT (!!) a flag to check if the element is actually visible to the user.
+                */
+            isShown: boolean;
+            /**
+                * Is this template a part of the HTML tree (the template manager injected it)
+                */
+            isInHtmlTree: boolean;
+            /**
+                * The HTML element containing this template
+                */
+            parent: HTMLElement;
+            /**
+                * A promise that is fulfilled when the template finished loading.
+                */
+            initPromise: Promise<Template>;
+            constructor(name: string, _configuration: ITemplateConfiguration);
+            /**
+                * Some templates have parameters (like background color for example).
+                * The parameters are provided to Handlebars which in turn generates the template.
+                * This function will update the template with the new parameters
+                *
+                * Note that when updating parameters the events will be registered again (after being cleared).
+                *
+                * @param params the new template parameters
+                */
+            updateParams(params: {
+                    [key: string]: string | number | boolean | object;
+            }, append?: boolean): void;
+            redraw(): void;
+            /**
+                * Get the template'S configuration
+                */
+            readonly configuration: ITemplateConfiguration;
+            /**
+                * A template can be a parent element for other templates or HTML elements.
+                * This function will deliver all child HTML elements of this template.
+                */
+            getChildElements(): Array<string>;
+            /**
+                * Appending the template to a parent HTML element.
+                * If a parent is already set and you wish to replace the old HTML with new one, forceRemove should be true.
+                * @param parent the parent to which the template is added
+                * @param forceRemove if the parent already exists, shoud the template be removed from it?
+                */
+            appendTo(parent: HTMLElement, forceRemove?: boolean): void;
+            /**
+                * Show the template using the provided visibilityFunction, or natively using display: flex.
+                * The provided function returns a promise that should be fullfilled when the element is shown.
+                * Since it is a promise async operations are more than possible.
+                * See the default viewer for an opacity example.
+                * @param visibilityFunction The function to execute to show the template.
+                */
+            show(visibilityFunction?: (template: Template) => Promise<Template>): Promise<Template>;
+            /**
+                * Hide the template using the provided visibilityFunction, or natively using display: none.
+                * The provided function returns a promise that should be fullfilled when the element is hidden.
+                * Since it is a promise async operations are more than possible.
+                * See the default viewer for an opacity example.
+                * @param visibilityFunction The function to execute to show the template.
+                */
+            hide(visibilityFunction?: (template: Template) => Promise<Template>): Promise<Template>;
+            /**
+                * Dispose this template
+                */
+            dispose(): void;
+    }
 }
 declare module BabylonViewer {
     export class ConfigurationContainer {
@@ -1395,20 +1558,6 @@ declare module BabylonViewer {
     export function addLoaderPlugin(name: string, plugin: ILoaderPlugin): void;
 }
 declare module BabylonViewer {
-    /**
-        * A custom upgrade-oriented function configuration for the scene optimizer.
-        *
-        * @param viewer the viewer to optimize
-        */
-    export function extendedUpgrade(sceneManager: SceneManager): boolean;
-    /**
-        * A custom degrade-oriented function configuration for the scene optimizer.
-        *
-        * @param viewer the viewer to optimize
-        */
-    export function extendedDegrade(sceneManager: SceneManager): boolean;
-}
-declare module BabylonViewer {
 }
 declare module BabylonViewer {
     export interface IEnvironmentMapConfiguration {
@@ -1436,6 +1585,39 @@ declare module BabylonViewer {
 }
 declare module BabylonViewer {
     /**
+        * The EventManager is in charge of registering user interctions with the viewer.
+        * It is used in the TemplateManager
+        */
+    export class EventManager {
+            constructor(_templateManager: TemplateManager);
+            /**
+                * Register a new callback to a specific template.
+                * The best example for the usage can be found in the DefaultViewer
+                *
+                * @param templateName the templateName to register the event to
+                * @param callback The callback to be executed
+                * @param eventType the type of event to register
+                * @param selector an optional selector. if not defined the parent object in the template will be selected
+                */
+            registerCallback(templateName: string, callback: (eventData: EventCallback) => void, eventType?: string, selector?: string): void;
+            /**
+                * This will remove a registered event from the defined template.
+                * Each one of the variables apart from the template name are optional, but one must be provided.
+                *
+                * @param templateName the templateName
+                * @param callback the callback to remove (optional)
+                * @param eventType the event type to remove (optional)
+                * @param selector the selector from which to remove the event (optional)
+                */
+            unregisterCallback(templateName: string, callback: (eventData: EventCallback) => void, eventType?: string, selector?: string): void;
+            /**
+                * Dispose the event manager
+                */
+            dispose(): void;
+    }
+}
+declare module BabylonViewer {
+    /**
         * The ViewerLabs class will hold functions that are not (!) backwards compatible.
         * The APIs in all labs-related classes and configuration  might change.
         * Once stable, lab features will be moved to the publis API and configuration object.

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 1 - 1
dist/preview release/viewer/babylon.viewer.js


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 1 - 1
dist/preview release/viewer/babylon.viewer.max.js


+ 202 - 19
dist/preview release/viewer/babylon.viewer.module.d.ts

@@ -985,14 +985,13 @@ declare module 'babylonjs-viewer/templating/viewerTemplatePlugin' {
 }
 
 declare module 'babylonjs-viewer/optimizer/custom' {
-    import { extendedUpgrade } from "babylonjs-viewer/optimizer/custom/extended";
     import { SceneManager } from "babylonjs-viewer/managers/sceneManager";
     /**
       *
       * @param name the name of the custom optimizer configuration
       * @param upgrade set to true if you want to upgrade optimizer and false if you want to degrade
       */
-    export function getCustomOptimizerByName(name: string, upgrade?: boolean): typeof extendedUpgrade;
+    export function getCustomOptimizerByName(name: string, upgrade?: boolean): (sceneManager: SceneManager) => boolean;
     export function registerCustomOptimizer(name: string, optimizer: (sceneManager: SceneManager) => boolean): void;
 }
 
@@ -1115,7 +1114,172 @@ declare module 'babylonjs-viewer/configuration/configuration' {
 }
 
 declare module 'babylonjs-viewer/templating/templateManager' {
-    
+    import { Observable } from 'babylonjs';
+    import { EventManager } from 'babylonjs-viewer/templating/eventManager';
+    import { ITemplateConfiguration } from 'babylonjs-viewer/configuration/interfaces';
+    /**
+        * The object sent when an event is triggered
+        */
+    export interface EventCallback {
+            event: Event;
+            template: Template;
+            selector: string;
+            payload?: any;
+    }
+    /**
+        * The template manager, a member of the viewer class, will manage the viewer's templates and generate the HTML.
+        * The template manager managers a single viewer and can be seen as the collection of all sub-templates of the viewer.
+        */
+    export class TemplateManager {
+            containerElement: HTMLElement;
+            /**
+                * Will be triggered when any template is initialized
+                */
+            onTemplateInit: Observable<Template>;
+            /**
+                * Will be triggered when any template is fully loaded
+                */
+            onTemplateLoaded: Observable<Template>;
+            /**
+                * Will be triggered when a template state changes
+                */
+            onTemplateStateChange: Observable<Template>;
+            /**
+                * Will be triggered when all templates finished loading
+                */
+            onAllLoaded: Observable<TemplateManager>;
+            /**
+                * Will be triggered when any event on any template is triggered.
+                */
+            onEventTriggered: Observable<EventCallback>;
+            /**
+                * This template manager's event manager. In charge of callback registrations to native event types
+                */
+            eventManager: EventManager;
+            constructor(containerElement: HTMLElement);
+            /**
+                * Initialize the template(s) for the viewer. Called bay the Viewer class
+                * @param templates the templates to be used to initialize the main template
+                */
+            initTemplate(templates: {
+                    [key: string]: ITemplateConfiguration;
+            }): Promise<void>;
+            /**
+                * Get the canvas in the template tree.
+                * There must be one and only one canvas inthe template.
+                */
+            getCanvas(): HTMLCanvasElement | null;
+            /**
+                * Get a specific template from the template tree
+                * @param name the name of the template to load
+                */
+            getTemplate(name: string): Template | undefined;
+            /**
+                * Dispose the template manager
+                */
+            dispose(): void;
+    }
+    /**
+        * This class represents a single template in the viewer's template tree.
+        * An example for a template is a single canvas, an overlay (containing sub-templates) or the navigation bar.
+        * A template is injected using the template manager in the correct position.
+        * The template is rendered using Handlebars and can use Handlebars' features (such as parameter injection)
+        *
+        * For further information please refer to the documentation page, https://doc.babylonjs.com
+        */
+    export class Template {
+            name: string;
+            /**
+                * Will be triggered when the template is loaded
+                */
+            onLoaded: Observable<Template>;
+            /**
+                * will be triggered when the template is appended to the tree
+                */
+            onAppended: Observable<Template>;
+            /**
+                * Will be triggered when the template's state changed (shown, hidden)
+                */
+            onStateChange: Observable<Template>;
+            /**
+                * Will be triggered when an event is triggered on ths template.
+                * The event is a native browser event (like mouse or pointer events)
+                */
+            onEventTriggered: Observable<EventCallback>;
+            onParamsUpdated: Observable<Template>;
+            onHTMLRendered: Observable<Template>;
+            /**
+                * is the template loaded?
+                */
+            isLoaded: boolean;
+            /**
+                * This is meant to be used to track the show and hide functions.
+                * This is NOT (!!) a flag to check if the element is actually visible to the user.
+                */
+            isShown: boolean;
+            /**
+                * Is this template a part of the HTML tree (the template manager injected it)
+                */
+            isInHtmlTree: boolean;
+            /**
+                * The HTML element containing this template
+                */
+            parent: HTMLElement;
+            /**
+                * A promise that is fulfilled when the template finished loading.
+                */
+            initPromise: Promise<Template>;
+            constructor(name: string, _configuration: ITemplateConfiguration);
+            /**
+                * Some templates have parameters (like background color for example).
+                * The parameters are provided to Handlebars which in turn generates the template.
+                * This function will update the template with the new parameters
+                *
+                * Note that when updating parameters the events will be registered again (after being cleared).
+                *
+                * @param params the new template parameters
+                */
+            updateParams(params: {
+                    [key: string]: string | number | boolean | object;
+            }, append?: boolean): void;
+            redraw(): void;
+            /**
+                * Get the template'S configuration
+                */
+            readonly configuration: ITemplateConfiguration;
+            /**
+                * A template can be a parent element for other templates or HTML elements.
+                * This function will deliver all child HTML elements of this template.
+                */
+            getChildElements(): Array<string>;
+            /**
+                * Appending the template to a parent HTML element.
+                * If a parent is already set and you wish to replace the old HTML with new one, forceRemove should be true.
+                * @param parent the parent to which the template is added
+                * @param forceRemove if the parent already exists, shoud the template be removed from it?
+                */
+            appendTo(parent: HTMLElement, forceRemove?: boolean): void;
+            /**
+                * Show the template using the provided visibilityFunction, or natively using display: flex.
+                * The provided function returns a promise that should be fullfilled when the element is shown.
+                * Since it is a promise async operations are more than possible.
+                * See the default viewer for an opacity example.
+                * @param visibilityFunction The function to execute to show the template.
+                */
+            show(visibilityFunction?: (template: Template) => Promise<Template>): Promise<Template>;
+            /**
+                * Hide the template using the provided visibilityFunction, or natively using display: none.
+                * The provided function returns a promise that should be fullfilled when the element is hidden.
+                * Since it is a promise async operations are more than possible.
+                * See the default viewer for an opacity example.
+                * @param visibilityFunction The function to execute to show the template.
+                */
+            hide(visibilityFunction?: (template: Template) => Promise<Template>): Promise<Template>;
+            /**
+                * Dispose this template
+                */
+            dispose(): void;
+    }
 }
 
 declare module 'babylonjs-viewer/configuration/configurationContainer' {
@@ -1498,22 +1662,6 @@ declare module 'babylonjs-viewer/loader/plugins' {
     export function addLoaderPlugin(name: string, plugin: ILoaderPlugin): void;
 }
 
-declare module 'babylonjs-viewer/optimizer/custom/extended' {
-    import { SceneManager } from 'babylonjs-viewer/managers/sceneManager';
-    /**
-        * A custom upgrade-oriented function configuration for the scene optimizer.
-        *
-        * @param viewer the viewer to optimize
-        */
-    export function extendedUpgrade(sceneManager: SceneManager): boolean;
-    /**
-        * A custom degrade-oriented function configuration for the scene optimizer.
-        *
-        * @param viewer the viewer to optimize
-        */
-    export function extendedDegrade(sceneManager: SceneManager): boolean;
-}
-
 declare module 'babylonjs-viewer/configuration/interfaces' {
     export * from 'babylonjs-viewer/configuration/interfaces/cameraConfiguration';
     export * from 'babylonjs-viewer/configuration/interfaces/colorGradingConfiguration';
@@ -1557,6 +1705,41 @@ declare module 'babylonjs-viewer/configuration/interfaces/environmentMapConfigur
     }
 }
 
+declare module 'babylonjs-viewer/templating/eventManager' {
+    import { EventCallback, TemplateManager } from "babylonjs-viewer/templating/templateManager";
+    /**
+        * The EventManager is in charge of registering user interctions with the viewer.
+        * It is used in the TemplateManager
+        */
+    export class EventManager {
+            constructor(_templateManager: TemplateManager);
+            /**
+                * Register a new callback to a specific template.
+                * The best example for the usage can be found in the DefaultViewer
+                *
+                * @param templateName the templateName to register the event to
+                * @param callback The callback to be executed
+                * @param eventType the type of event to register
+                * @param selector an optional selector. if not defined the parent object in the template will be selected
+                */
+            registerCallback(templateName: string, callback: (eventData: EventCallback) => void, eventType?: string, selector?: string): void;
+            /**
+                * This will remove a registered event from the defined template.
+                * Each one of the variables apart from the template name are optional, but one must be provided.
+                *
+                * @param templateName the templateName
+                * @param callback the callback to remove (optional)
+                * @param eventType the event type to remove (optional)
+                * @param selector the selector from which to remove the event (optional)
+                */
+            unregisterCallback(templateName: string, callback: (eventData: EventCallback) => void, eventType?: string, selector?: string): void;
+            /**
+                * Dispose the event manager
+                */
+            dispose(): void;
+    }
+}
+
 declare module 'babylonjs-viewer/labs/viewerLabs' {
     import { PBREnvironment } from "babylonjs-viewer/labs/environmentSerializer";
     import { ShadowLight, Vector3, Scene } from 'babylonjs';

+ 4 - 0
gui/src/2D/controls/control.ts

@@ -891,6 +891,10 @@ export class Control {
 
     /** @hidden */
     public _markAsDirty(): void {
+        if (!this._isVisible) {
+            return;
+        }
+
         this._isDirty = true;
 
         if (!this._host) {

+ 21 - 0
src/Particles/babylon.IParticleSystem.ts

@@ -453,6 +453,27 @@ module BABYLON {
         getStartSizeGradients(): Nullable<Array<FactorGradient>>;  
 
         /**
+         * Adds a new life time gradient
+         * @param gradient defines the gradient to use (between 0 and 1)
+         * @param factor defines the life time factor to affect to the specified gradient         
+         * @param factor2 defines an additional factor used to define a range ([factor, factor2]) with main value to pick the final value from
+         * @returns the current particle system
+         */
+        addLifeTimeGradient(gradient: number, factor: number, factor2?: number): IParticleSystem;
+        /**
+         * Remove a specific life time gradient
+         * @param gradient defines the gradient to remove
+         * @returns the current particle system
+         */
+        removeLifeTimeGradient(gradient: number): IParticleSystem;    
+        /**
+         * Gets the current list of life time gradients.
+         * You must use addLifeTimeGradient and removeLifeTimeGradient to udpate this list
+         * @returns the list of life time gradients
+         */
+        getLifeTimeGradients(): Nullable<Array<FactorGradient>>;          
+
+        /**
          * Gets the current list of color gradients.
          * You must use addColorGradient and removeColorGradient to udpate this list
          * @returns the list of color gradients

+ 24 - 1
src/Particles/babylon.gpuParticleSystem.ts

@@ -558,9 +558,32 @@
         public set useRampGradients(value: boolean) {
             //Not supported by GPUParticleSystem
         }
-        
 
         /**
+         * Not supported by GPUParticleSystem
+         * @param gradient defines the gradient to use (between 0 and 1)
+         * @param factor defines the life time factor to affect to the specified gradient         
+         * @param factor2 defines an additional factor used to define a range ([factor, factor2]) with main value to pick the final value from
+         * @returns the current particle system
+         */
+        public addLifeTimeGradient(gradient: number, factor: number, factor2?: number): IParticleSystem {
+            //Not supported by GPUParticleSystem
+
+            return this;
+        }
+
+        /**
+         * Not supported by GPUParticleSystem
+         * @param gradient defines the gradient to remove
+         * @returns the current particle system
+         */
+        public removeLifeTimeGradient(gradient: number): IParticleSystem {
+            //Not supported by GPUParticleSystem
+
+            return this;
+        }        
+        
+        /**
          * Instantiates a GPU particle system.
          * Particles are often small sprites used to simulate hard-to-reproduce phenomena like fire, smoke, water, or abstract visual effects like magic glitter and faery dust.
          * @param name The name of the particle system

+ 24 - 0
src/Particles/babylon.particleSystem.ts

@@ -2231,6 +2231,24 @@
                 }
             }
 
+            let lifeTimeGradients = particleSystem.getLifeTimeGradients();
+            if (lifeTimeGradients) {
+                serializationObject.lifeTimeGradients = [];
+                for (var lifeTimeGradient of lifeTimeGradients) {
+
+                    var serializedGradient: any = {
+                        gradient: lifeTimeGradient.gradient,
+                        factor1: lifeTimeGradient.factor1
+                    };
+
+                    if (lifeTimeGradient.factor2 !== undefined) {
+                        serializedGradient.factor2 = lifeTimeGradient.factor2;
+                    }
+
+                    serializationObject.lifeTimeGradients.push(serializedGradient);
+                }
+            }            
+
             let limitVelocityGradients = particleSystem.getLimitVelocityGradients();
             if (limitVelocityGradients) {
                 serializationObject.limitVelocityGradients = [];
@@ -2411,6 +2429,12 @@
                 }
             }
 
+            if (parsedParticleSystem.lifeTimeGradients) {
+                for (var lifeTimeGradient of parsedParticleSystem.lifeTimeGradients) {
+                    particleSystem.addLifeTimeGradient(lifeTimeGradient.gradient, lifeTimeGradient.factor1 !== undefined ? lifeTimeGradient.factor1 : lifeTimeGradient.factor, lifeTimeGradient.factor2);
+                }
+            }            
+
             if (parsedParticleSystem.limitVelocityGradients) {
                 for (var limitVelocityGradient of parsedParticleSystem.limitVelocityGradients) {
                     particleSystem.addLimitVelocityGradient(limitVelocityGradient.gradient, limitVelocityGradient.factor1 !== undefined ? limitVelocityGradient.factor1 : limitVelocityGradient.factor, limitVelocityGradient.factor2);