Explorar o código

Merge branch 'master' into viewer-changes-new

Raanan Weber %!s(int64=7) %!d(string=hai) anos
pai
achega
dc4c7583e6

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

@@ -28,6 +28,8 @@
 - Introduced `isStroke` on `HighlightLayerOptions` which makes the highlight solid ([PixelsCommander](https://github.com/pixelscommander))
 - (Viewer) There is now an option to paste payload instead of a URL for configuration ([RaananW](https://github.com/RaananW))
 - (Viewer) Models can be loaded async using JavaScript ([RaananW](https://github.com/RaananW))
+- VRHelper will notify now onSelectedMeshUnselected observable to subscribers when the applied ray selection predicate does not produce a hit and a mesh compliant with the meshSelectionPredicate was previously selected
+   ([carloslanderas](https://github.com/carloslanderas))
 
 ## Bug fixes
 

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

@@ -1487,9 +1487,8 @@ module BABYLON {
                     // Moving the teleportation area to this targetted point
 
                     //Raise onSelectedMeshUnselected observable if ray collided floor mesh/meshes and a non floor mesh was previously selected
-                    if (this._currentMeshSelected &&
-                        !this._isTeleportationFloor(this._currentMeshSelected)) {
-                        this.onSelectedMeshUnselected.notifyObservers(this._currentMeshSelected);
+                    if (this._currentMeshSelected && !this._isTeleportationFloor(this._currentMeshSelected)) {
+                        this._notifySelectedMeshUnselected();
                     }
 
                     this._currentMeshSelected = null;
@@ -1522,9 +1521,7 @@ module BABYLON {
                         }
                     }
                     else {
-                        if (this._currentMeshSelected) {
-                            this.onSelectedMeshUnselected.notifyObservers(this._currentMeshSelected);
-                        }
+                        this._notifySelectedMeshUnselected();
                         this._currentMeshSelected = null;
                         this.changeGazeColor(new Color3(0.7, 0.7, 0.7));
                         this.changeLaserColor(new Color3(0.7, 0.7, 0.7));
@@ -1533,6 +1530,7 @@ module BABYLON {
             }
             else {
                 this._currentHit = null;
+                this._notifySelectedMeshUnselected();
                 this._currentMeshSelected = null;
                 this._teleportationAllowed = false;
                 this._hideTeleportationTarget();
@@ -1540,6 +1538,12 @@ module BABYLON {
                 this.changeLaserColor(new Color3(0.7, 0.7, 0.7));
             }
         }
+        
+        private _notifySelectedMeshUnselected( ) {
+            if(this._currentMeshSelected) {
+                this.onSelectedMeshUnselected.notifyObservers(this._currentMeshSelected);
+            }
+        }
 
         /**
          * Sets the color of the laser ray from the vr controllers.

+ 1 - 1
src/Engine/babylon.engine.ts

@@ -539,7 +539,7 @@
         }
 
         public static get Version(): string {
-            return "3.2.0-alpha5";
+            return "3.2.0-alpha6";
         }
 
         // Updatable statics so stick with vars here

+ 1 - 3
src/Materials/Textures/babylon.videoTexture.ts

@@ -136,11 +136,9 @@
                 this._generateMipMaps,
                 this._samplingMode
             );
-            this._texture.width;
-
-            this._updateInternalTexture();
 
             this._texture.isReady = true;
+            this._updateInternalTexture();
         };
 
         private reset = (): void => {