Forráskód Böngészése

Merge pull request #3437 from BabylonJS/master

Nightly
David Catuhe 7 éve
szülő
commit
7a9c59837c
38 módosított fájl, 25548 hozzáadás és 25200 törlés
  1. 6143 6128
      Playground/babylon.d.txt
  2. 7364 7349
      dist/preview release/babylon.d.ts
  3. 41 41
      dist/preview release/babylon.js
  4. 62 14
      dist/preview release/babylon.max.js
  5. 42 42
      dist/preview release/babylon.worker.js
  6. 11635 11458
      dist/preview release/customConfigurations/minimalGLTFViewer/babylon.d.ts
  7. 44 44
      dist/preview release/customConfigurations/minimalGLTFViewer/babylon.js
  8. 62 14
      dist/preview release/customConfigurations/minimalGLTFViewer/babylon.max.js
  9. 3 3
      dist/preview release/gui/babylon.gui.min.js
  10. 1 1
      dist/preview release/gui/package.json
  11. 4 4
      dist/preview release/inspector/babylon.inspector.bundle.js
  12. 3 3
      dist/preview release/inspector/babylon.inspector.min.js
  13. 1 1
      dist/preview release/inspector/package.json
  14. 2 2
      dist/preview release/loaders/babylon.glTF1FileLoader.min.js
  15. 2 2
      dist/preview release/loaders/babylon.glTF2FileLoader.min.js
  16. 3 3
      dist/preview release/loaders/babylon.glTFFileLoader.min.js
  17. 1 1
      dist/preview release/loaders/babylon.objFileLoader.min.js
  18. 3 3
      dist/preview release/loaders/babylonjs.loaders.min.js
  19. 1 1
      dist/preview release/loaders/package.json
  20. 1 1
      dist/preview release/materialsLibrary/babylon.customMaterial.min.js
  21. 1 1
      dist/preview release/materialsLibrary/babylon.shadowOnlyMaterial.min.js
  22. 1 1
      dist/preview release/materialsLibrary/babylon.waterMaterial.min.js
  23. 3 3
      dist/preview release/materialsLibrary/babylonjs.materials.min.js
  24. 1 1
      dist/preview release/materialsLibrary/package.json
  25. 1 1
      dist/preview release/postProcessesLibrary/babylon.asciiArtPostProcess.min.js
  26. 1 1
      dist/preview release/postProcessesLibrary/babylon.digitalRainPostProcess.min.js
  27. 1 1
      dist/preview release/postProcessesLibrary/babylonjs.postProcess.min.js
  28. 1 1
      dist/preview release/postProcessesLibrary/package.json
  29. 1 1
      dist/preview release/proceduralTexturesLibrary/package.json
  30. 1 1
      dist/preview release/serializers/package.json
  31. 53 53
      dist/preview release/viewer/babylon.viewer.js
  32. 1 1
      dist/preview release/viewer/package.json
  33. 1 0
      dist/preview release/what's new.md
  34. 3 2
      package.json
  35. 5 7
      src/Animations/babylon.animatable.ts
  36. 37 3
      src/Animations/babylon.animationGroup.ts
  37. 17 6
      src/Cameras/VR/babylon.vrExperienceHelper.ts
  38. 1 1
      src/babylon.scene.ts

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 6143 - 6128
Playground/babylon.d.txt


A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 7364 - 7349
dist/preview release/babylon.d.ts


A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 41 - 41
dist/preview release/babylon.js


+ 62 - 14
dist/preview release/babylon.max.js

@@ -41932,17 +41932,43 @@ var BABYLON;
             this._animatables = new Array();
             this._from = Number.MAX_VALUE;
             this._to = Number.MIN_VALUE;
+            this._speedRatio = 1;
             this.onAnimationEndObservable = new BABYLON.Observable();
             this._scene = scene || BABYLON.Engine.LastCreatedScene;
             this._scene.animationGroups.push(this);
         }
         Object.defineProperty(AnimationGroup.prototype, "isStarted", {
+            /**
+             * Define if the animations are started
+             */
             get: function () {
                 return this._isStarted;
             },
             enumerable: true,
             configurable: true
         });
+        Object.defineProperty(AnimationGroup.prototype, "speedRatio", {
+            /**
+             * Gets or sets the speed ratio to use for all animations
+             */
+            get: function () {
+                return this._speedRatio;
+            },
+            /**
+             * Gets or sets the speed ratio to use for all animations
+             */
+            set: function (value) {
+                if (this._speedRatio === value) {
+                    return;
+                }
+                for (var index = 0; index < this._animatables.length; index++) {
+                    var animatable = this._animatables[index];
+                    animatable.speedRatio = this._speedRatio;
+                }
+            },
+            enumerable: true,
+            configurable: true
+        });
         /**
          * Add an animation (with its target) in the group
          * @param animation defines the animation we want to add
@@ -42005,16 +42031,23 @@ var BABYLON;
          * @param speedRatio defines the ratio to apply to animation speed (1 by default)
          */
         AnimationGroup.prototype.start = function (loop, speedRatio) {
+            var _this = this;
             if (loop === void 0) { loop = false; }
             if (speedRatio === void 0) { speedRatio = 1; }
             if (this._isStarted || this._targetedAnimations.length === 0) {
                 return this;
             }
-            for (var index = 0; index < this._targetedAnimations.length; index++) {
-                var targetedAnimation = this._targetedAnimations[index];
-                this._animatables.push(this._scene.beginDirectAnimation(targetedAnimation.target, [targetedAnimation.animation], this._from, this._to, loop, speedRatio, function () {
+            var _loop_1 = function () {
+                var targetedAnimation = this_1._targetedAnimations[index];
+                this_1._animatables.push(this_1._scene.beginDirectAnimation(targetedAnimation.target, [targetedAnimation.animation], this_1._from, this_1._to, loop, speedRatio, function () {
+                    _this.onAnimationEndObservable.notifyObservers(targetedAnimation);
                 }));
+            };
+            var this_1 = this;
+            for (var index = 0; index < this._targetedAnimations.length; index++) {
+                _loop_1();
             }
+            this._speedRatio = speedRatio;
             this._isStarted = true;
             return this;
         };
@@ -42034,10 +42067,16 @@ var BABYLON;
         /**
          * Play all animations to initial state
          * This function will start() the animations if they were not started or will restart() them if they were paused
+         * @param loop defines if animations must loop
          */
         AnimationGroup.prototype.play = function (loop) {
-            if (loop === void 0) { loop = false; }
             if (this.isStarted) {
+                if (loop !== undefined) {
+                    for (var index = 0; index < this._animatables.length; index++) {
+                        var animatable = this._animatables[index];
+                        animatable.loopAnimation = loop;
+                    }
+                }
                 this.restart();
             }
             else {
@@ -42539,12 +42578,11 @@ var BABYLON;
             for (var index = 0; index < runtimeAnimations.length; index++) {
                 runtimeAnimations[index].reset();
             }
-            this._localDelayOffset = null;
-            this._pausedDelay = null;
-            var oldPauseState = this._paused;
-            this._paused = false;
-            this._animate(0);
-            this._paused = oldPauseState;
+            // Reset to original value
+            for (index = 0; index < runtimeAnimations.length; index++) {
+                var animation = runtimeAnimations[index];
+                animation.animate(0, this.fromFrame, this.toFrame, false, this._speedRatio);
+            }
             this._localDelayOffset = null;
             this._pausedDelay = null;
         };
@@ -73014,6 +73052,10 @@ var BABYLON;
             this._padSensibilityUp = 0.65;
             this._padSensibilityDown = 0.35;
             this.onNewMeshSelected = new BABYLON.Observable();
+            /**
+            * Observable raised when current selected mesh gets unselected
+            */
+            this.onSelectedMeshUnselected = new BABYLON.Observable();
             this._pointerDownOnMeshAsked = false;
             this._isActionableMesh = false;
             this._teleportationEnabled = false;
@@ -73508,6 +73550,9 @@ var BABYLON;
             if (this._scene.activeCamera && this._canvas) {
                 this._scene.activeCamera.attachControl(this._canvas);
             }
+            if (this._interactionsEnabled) {
+                this._scene.registerBeforeRender(this.beforeRender);
+            }
         };
         /**
          * Attempt to exit VR, or fullscreen.
@@ -73539,6 +73584,9 @@ var BABYLON;
                 this._scene.activeCamera = this._existingCamera;
             }
             this.updateButtonVisibility();
+            if (this._interactionsEnabled) {
+                this._scene.unregisterBeforeRender(this.beforeRender);
+            }
         };
         Object.defineProperty(VRExperienceHelper.prototype, "position", {
             get: function () {
@@ -73579,7 +73627,6 @@ var BABYLON;
                     }
                     return false;
                 };
-                this._scene.registerBeforeRender(this.beforeRender);
                 this._interactionsEnabled = true;
             }
         };
@@ -73616,9 +73663,7 @@ var BABYLON;
             if (vrTeleportationOptions === void 0) { vrTeleportationOptions = {}; }
             if (!this._teleportationEnabled) {
                 this._teleportationRequested = true;
-                if (!vrTeleportationOptions.disableInteractions) {
-                    this.enableInteractions();
-                }
+                this.enableInteractions();
                 if (vrTeleportationOptions.floorMeshName) {
                     this._floorMeshName = vrTeleportationOptions.floorMeshName;
                 }
@@ -74216,6 +74261,9 @@ var BABYLON;
                         }
                     }
                     else {
+                        if (this._currentMeshSelected) {
+                            this.onSelectedMeshUnselected.notifyObservers(this._currentMeshSelected);
+                        }
                         this._currentMeshSelected = null;
                         this.changeGazeColor(new BABYLON.Color3(0.7, 0.7, 0.7));
                         this.changeLaserColor(new BABYLON.Color3(0.7, 0.7, 0.7));

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 42 - 42
dist/preview release/babylon.worker.js


A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 11635 - 11458
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.d.ts


A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 44 - 44
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.js


+ 62 - 14
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.max.js

@@ -41932,17 +41932,43 @@ var BABYLON;
             this._animatables = new Array();
             this._from = Number.MAX_VALUE;
             this._to = Number.MIN_VALUE;
+            this._speedRatio = 1;
             this.onAnimationEndObservable = new BABYLON.Observable();
             this._scene = scene || BABYLON.Engine.LastCreatedScene;
             this._scene.animationGroups.push(this);
         }
         Object.defineProperty(AnimationGroup.prototype, "isStarted", {
+            /**
+             * Define if the animations are started
+             */
             get: function () {
                 return this._isStarted;
             },
             enumerable: true,
             configurable: true
         });
+        Object.defineProperty(AnimationGroup.prototype, "speedRatio", {
+            /**
+             * Gets or sets the speed ratio to use for all animations
+             */
+            get: function () {
+                return this._speedRatio;
+            },
+            /**
+             * Gets or sets the speed ratio to use for all animations
+             */
+            set: function (value) {
+                if (this._speedRatio === value) {
+                    return;
+                }
+                for (var index = 0; index < this._animatables.length; index++) {
+                    var animatable = this._animatables[index];
+                    animatable.speedRatio = this._speedRatio;
+                }
+            },
+            enumerable: true,
+            configurable: true
+        });
         /**
          * Add an animation (with its target) in the group
          * @param animation defines the animation we want to add
@@ -42005,16 +42031,23 @@ var BABYLON;
          * @param speedRatio defines the ratio to apply to animation speed (1 by default)
          */
         AnimationGroup.prototype.start = function (loop, speedRatio) {
+            var _this = this;
             if (loop === void 0) { loop = false; }
             if (speedRatio === void 0) { speedRatio = 1; }
             if (this._isStarted || this._targetedAnimations.length === 0) {
                 return this;
             }
-            for (var index = 0; index < this._targetedAnimations.length; index++) {
-                var targetedAnimation = this._targetedAnimations[index];
-                this._animatables.push(this._scene.beginDirectAnimation(targetedAnimation.target, [targetedAnimation.animation], this._from, this._to, loop, speedRatio, function () {
+            var _loop_1 = function () {
+                var targetedAnimation = this_1._targetedAnimations[index];
+                this_1._animatables.push(this_1._scene.beginDirectAnimation(targetedAnimation.target, [targetedAnimation.animation], this_1._from, this_1._to, loop, speedRatio, function () {
+                    _this.onAnimationEndObservable.notifyObservers(targetedAnimation);
                 }));
+            };
+            var this_1 = this;
+            for (var index = 0; index < this._targetedAnimations.length; index++) {
+                _loop_1();
             }
+            this._speedRatio = speedRatio;
             this._isStarted = true;
             return this;
         };
@@ -42034,10 +42067,16 @@ var BABYLON;
         /**
          * Play all animations to initial state
          * This function will start() the animations if they were not started or will restart() them if they were paused
+         * @param loop defines if animations must loop
          */
         AnimationGroup.prototype.play = function (loop) {
-            if (loop === void 0) { loop = false; }
             if (this.isStarted) {
+                if (loop !== undefined) {
+                    for (var index = 0; index < this._animatables.length; index++) {
+                        var animatable = this._animatables[index];
+                        animatable.loopAnimation = loop;
+                    }
+                }
                 this.restart();
             }
             else {
@@ -42539,12 +42578,11 @@ var BABYLON;
             for (var index = 0; index < runtimeAnimations.length; index++) {
                 runtimeAnimations[index].reset();
             }
-            this._localDelayOffset = null;
-            this._pausedDelay = null;
-            var oldPauseState = this._paused;
-            this._paused = false;
-            this._animate(0);
-            this._paused = oldPauseState;
+            // Reset to original value
+            for (index = 0; index < runtimeAnimations.length; index++) {
+                var animation = runtimeAnimations[index];
+                animation.animate(0, this.fromFrame, this.toFrame, false, this._speedRatio);
+            }
             this._localDelayOffset = null;
             this._pausedDelay = null;
         };
@@ -72860,6 +72898,10 @@ var BABYLON;
             this._padSensibilityUp = 0.65;
             this._padSensibilityDown = 0.35;
             this.onNewMeshSelected = new BABYLON.Observable();
+            /**
+            * Observable raised when current selected mesh gets unselected
+            */
+            this.onSelectedMeshUnselected = new BABYLON.Observable();
             this._pointerDownOnMeshAsked = false;
             this._isActionableMesh = false;
             this._teleportationEnabled = false;
@@ -73354,6 +73396,9 @@ var BABYLON;
             if (this._scene.activeCamera && this._canvas) {
                 this._scene.activeCamera.attachControl(this._canvas);
             }
+            if (this._interactionsEnabled) {
+                this._scene.registerBeforeRender(this.beforeRender);
+            }
         };
         /**
          * Attempt to exit VR, or fullscreen.
@@ -73385,6 +73430,9 @@ var BABYLON;
                 this._scene.activeCamera = this._existingCamera;
             }
             this.updateButtonVisibility();
+            if (this._interactionsEnabled) {
+                this._scene.unregisterBeforeRender(this.beforeRender);
+            }
         };
         Object.defineProperty(VRExperienceHelper.prototype, "position", {
             get: function () {
@@ -73425,7 +73473,6 @@ var BABYLON;
                     }
                     return false;
                 };
-                this._scene.registerBeforeRender(this.beforeRender);
                 this._interactionsEnabled = true;
             }
         };
@@ -73462,9 +73509,7 @@ var BABYLON;
             if (vrTeleportationOptions === void 0) { vrTeleportationOptions = {}; }
             if (!this._teleportationEnabled) {
                 this._teleportationRequested = true;
-                if (!vrTeleportationOptions.disableInteractions) {
-                    this.enableInteractions();
-                }
+                this.enableInteractions();
                 if (vrTeleportationOptions.floorMeshName) {
                     this._floorMeshName = vrTeleportationOptions.floorMeshName;
                 }
@@ -74062,6 +74107,9 @@ var BABYLON;
                         }
                     }
                     else {
+                        if (this._currentMeshSelected) {
+                            this.onSelectedMeshUnselected.notifyObservers(this._currentMeshSelected);
+                        }
                         this._currentMeshSelected = null;
                         this.changeGazeColor(new BABYLON.Color3(0.7, 0.7, 0.7));
                         this.changeLaserColor(new BABYLON.Color3(0.7, 0.7, 0.7));

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 3 - 3
dist/preview release/gui/babylon.gui.min.js


+ 1 - 1
dist/preview release/gui/package.json

@@ -4,7 +4,7 @@
     },
     "name": "babylonjs-gui",
     "description": "The Babylon.js GUI library is an extension you can use to generate interactive user interface. It is build on top of the DynamicTexture.",
-    "version": "3.1.1",
+    "version": "3.2.0-alpha0",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 4 - 4
dist/preview release/inspector/babylon.inspector.bundle.js


A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 3 - 3
dist/preview release/inspector/babylon.inspector.min.js


+ 1 - 1
dist/preview release/inspector/package.json

@@ -4,7 +4,7 @@
     },
     "name": "babylonjs-inspector",
     "description": "The Babylon.js inspector.",
-    "version": "3.1.1",
+    "version": "3.2.0-alpha0",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 2 - 2
dist/preview release/loaders/babylon.glTF1FileLoader.min.js


A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 2 - 2
dist/preview release/loaders/babylon.glTF2FileLoader.min.js


A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 3 - 3
dist/preview release/loaders/babylon.glTFFileLoader.min.js


A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 1 - 1
dist/preview release/loaders/babylon.objFileLoader.min.js


A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 3 - 3
dist/preview release/loaders/babylonjs.loaders.min.js


+ 1 - 1
dist/preview release/loaders/package.json

@@ -4,7 +4,7 @@
     },
     "name": "babylonjs-loaders",
     "description": "The Babylon.js file loaders library is an extension you can use to load different 3D file types into a Babylon scene.",
-    "version": "3.1.1",
+    "version": "3.2.0-alpha0",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 1 - 1
dist/preview release/materialsLibrary/babylon.customMaterial.min.js


A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 1 - 1
dist/preview release/materialsLibrary/babylon.shadowOnlyMaterial.min.js


A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 1 - 1
dist/preview release/materialsLibrary/babylon.waterMaterial.min.js


A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 3 - 3
dist/preview release/materialsLibrary/babylonjs.materials.min.js


+ 1 - 1
dist/preview release/materialsLibrary/package.json

@@ -4,7 +4,7 @@
     },
     "name": "babylonjs-materials",
     "description": "The Babylon.js materials library is a collection of advanced materials to be used in a Babylon.js scene.",
-    "version": "3.1.1",
+    "version": "3.2.0-alpha0",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 1 - 1
dist/preview release/postProcessesLibrary/babylon.asciiArtPostProcess.min.js


A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 1 - 1
dist/preview release/postProcessesLibrary/babylon.digitalRainPostProcess.min.js


A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 1 - 1
dist/preview release/postProcessesLibrary/babylonjs.postProcess.min.js


+ 1 - 1
dist/preview release/postProcessesLibrary/package.json

@@ -4,7 +4,7 @@
     },
     "name": "babylonjs-post-process",
     "description": "The Babylon.js materials library is a collection of advanced materials to be used in a Babylon.js scene.",
-    "version": "3.1.1",
+    "version": "3.2.0-alpha0",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"

+ 1 - 1
dist/preview release/proceduralTexturesLibrary/package.json

@@ -4,7 +4,7 @@
     },
     "name": "babylonjs-procedural-textures",
     "description": "The Babylon.js materials library is a collection of advanced materials to be used in a Babylon.js scene.",
-    "version": "3.1.1",
+    "version": "3.2.0-alpha0",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"

+ 1 - 1
dist/preview release/serializers/package.json

@@ -4,7 +4,7 @@
     },
     "name": "babylonjs-serializers",
     "description": "The Babylon.js serializers library is an extension you can use to serialize Babylon scenes.",
-    "version": "3.1.1",
+    "version": "3.2.0-alpha0",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 53 - 53
dist/preview release/viewer/babylon.viewer.js


+ 1 - 1
dist/preview release/viewer/package.json

@@ -4,7 +4,7 @@
     },
     "name": "babylonjs-viewer",
     "description": "A simple-to-use viewer based on BabylonJS to display 3D elements natively",
-    "version": "3.1.1",
+    "version": "3.2.0-alpha0",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"

+ 1 - 0
dist/preview release/what's new.md

@@ -2,6 +2,7 @@
 
 ## Major updates
 - Introduced texture binding atlas. This optimization allows the engine to reuse texture bindings instead of rebinding textures when they are not on constant sampler indexes ([deltakosh](https://github.com/deltakosh))
+- New [AnimationGroup class](doc here) to control simultaneously multiple animations with different targets ([deltakosh](https://github.com/deltakosh))
 
 ## Updates
 - New watcher configuration for VSCode. Now the task only compiles changed files ([sebavan](https://github.com/sebavan))

+ 3 - 2
package.json

@@ -4,11 +4,12 @@
     },
     "contributors": [
         "David ROUSSET",
-        "Sebastien VANDENBERGHE"
+        "Sebastien VANDENBERGHE",
+        "Raanan Weber"
     ],
     "name": "babylonjs",
     "description": "Babylon.js is a JavaScript 3D engine based on webgl.",
-    "version": "3.1.1",
+    "version": "3.2.0-alpha0",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"

+ 5 - 7
src/Animations/babylon.animatable.ts

@@ -76,13 +76,11 @@
                 runtimeAnimations[index].reset();
             }
 
-            this._localDelayOffset = null;
-            this._pausedDelay = null;
-
-            let oldPauseState = this._paused;
-            this._paused = false;
-            this._animate(0);
-            this._paused = oldPauseState;
+            // Reset to original value
+            for (index = 0; index < runtimeAnimations.length; index++) {
+                var animation = runtimeAnimations[index];
+                animation.animate(0, this.fromFrame, this.toFrame, false, this._speedRatio);
+            }
 
             this._localDelayOffset = null;
             this._pausedDelay = null;

+ 37 - 3
src/Animations/babylon.animationGroup.ts

@@ -18,13 +18,38 @@ module BABYLON {
         private _from = Number.MAX_VALUE;
         private _to = Number.MIN_VALUE;
         private _isStarted: boolean;
+        private _speedRatio = 1;
 
-        public onAnimationEndObservable = new Observable<Animation>();
+        public onAnimationEndObservable = new Observable<TargetedAnimation>();
 
+        /**
+         * Define if the animations are started
+         */
         public get isStarted(): boolean {
             return this._isStarted;
         }
 
+        /**
+         * Gets or sets the speed ratio to use for all animations
+         */
+        public get speedRatio(): number {
+            return this._speedRatio;
+        }
+
+        /**
+         * Gets or sets the speed ratio to use for all animations
+         */
+        public set speedRatio(value: number) {
+            if (this._speedRatio === value) {
+                return;
+            }
+
+            for (var index = 0; index < this._animatables.length; index++) {
+                let animatable = this._animatables[index];
+                animatable.speedRatio = this._speedRatio;
+            }
+        }
+
         public constructor(public name: string, scene: Nullable<Scene> = null) {
             this._scene = scene || Engine.LastCreatedScene!;
 
@@ -110,10 +135,12 @@ module BABYLON {
             for (var index = 0; index < this._targetedAnimations.length; index++) {
                 let targetedAnimation = this._targetedAnimations[index];
                 this._animatables.push(this._scene.beginDirectAnimation(targetedAnimation.target, [targetedAnimation.animation], this._from, this._to, loop, speedRatio, () => {
-
+                    this.onAnimationEndObservable.notifyObservers(targetedAnimation);
                 }));
             }
 
+            this._speedRatio = speedRatio;
+
             this._isStarted = true;
 
             return this;
@@ -138,9 +165,16 @@ module BABYLON {
         /**
          * Play all animations to initial state
          * This function will start() the animations if they were not started or will restart() them if they were paused
+         * @param loop defines if animations must loop
          */
-        public play(loop = false): AnimationGroup {
+        public play(loop?: boolean): AnimationGroup {
             if (this.isStarted) {
+                if (loop !== undefined) {
+                    for (var index = 0; index < this._animatables.length; index++) {
+                        let animatable = this._animatables[index];
+                        animatable.loopAnimation = loop;
+                    }
+                }
                 this.restart();
             } else {
                 this.start(loop);

+ 17 - 6
src/Cameras/VR/babylon.vrExperienceHelper.ts

@@ -2,7 +2,6 @@ module BABYLON {
     export interface VRTeleportationOptions {
         floorMeshName?: string; // If you'd like to provide a mesh acting as the floor
         floorMeshes?: Mesh[];
-        disableInteractions?: boolean
     }
 
     export interface VRExperienceHelperOptions extends WebVROptions {
@@ -113,6 +112,11 @@ module BABYLON {
         public onNewMeshSelected = new Observable<AbstractMesh>();
         private _circleEase: CircleEase;
 
+        /**
+        * Observable raised when current selected mesh gets unselected
+        */
+        public onSelectedMeshUnselected = new Observable<AbstractMesh>();
+
         private _raySelectionPredicate: (mesh: AbstractMesh) => boolean;
 
         /**
@@ -508,6 +512,10 @@ module BABYLON {
             if (this._scene.activeCamera && this._canvas) {
                 this._scene.activeCamera.attachControl(this._canvas);
             }
+
+            if (this._interactionsEnabled) {
+                this._scene.registerBeforeRender(this.beforeRender);
+            }
         }
 
         /**
@@ -542,6 +550,10 @@ module BABYLON {
             }
 
             this.updateButtonVisibility();
+
+            if (this._interactionsEnabled) {
+                this._scene.unregisterBeforeRender(this.beforeRender);
+            }
         }
 
         public get position(): Vector3 {
@@ -587,8 +599,6 @@ module BABYLON {
                     return false;
                 }
 
-                this._scene.registerBeforeRender(this.beforeRender);
-
                 this._interactionsEnabled = true;
             }
         }
@@ -636,9 +646,7 @@ module BABYLON {
             if (!this._teleportationEnabled) {
                 this._teleportationRequested = true;
 
-                if (!vrTeleportationOptions.disableInteractions) {
-                    this.enableInteractions();
-                }    
+                this.enableInteractions();
 
                 if (vrTeleportationOptions.floorMeshName) {
                     this._floorMeshName = vrTeleportationOptions.floorMeshName;
@@ -1395,6 +1403,9 @@ module BABYLON {
                         }
                     }
                     else {
+                        if (this._currentMeshSelected) {
+                            this.onSelectedMeshUnselected.notifyObservers(this._currentMeshSelected);
+                        }
                         this._currentMeshSelected = null;
                         this.changeGazeColor(new Color3(0.7, 0.7, 0.7));
                         this.changeLaserColor(new Color3(0.7, 0.7, 0.7));

+ 1 - 1
src/babylon.scene.ts

@@ -4441,7 +4441,7 @@
                     camera = freeCamera;
                 }
                 camera.minZ = radius * 0.01;
-                camera.maxZ = radius * 100;
+                camera.maxZ = radius * 1000;
                 camera.speed = radius * 0.2;
                 this.activeCamera = camera;