Explorar el Código

Merge pull request #3378 from BabylonJS/master

candidate #2
David Catuhe hace 7 años
padre
commit
dde98b00d3

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


+ 1 - 3
dist/gui/package.json

@@ -32,7 +32,5 @@
     },
     "engines": {
         "node": "*"
-    },
-    "_id": "babylonjs-gui@3.1.0-alpha1",
-    "_from": "babylonjs-gui@"
+    }
 }

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


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


+ 17 - 5
dist/preview release/babylon.max.js

@@ -26878,7 +26878,7 @@ var BABYLON;
                     this._program = engine.createShaderProgram(this._vertexSourceCode, this._fragmentSourceCode, defines, undefined, this._transformFeedbackVaryings);
                 }
                 this._program.__SPECTOR_rebuildProgram = this._rebuildProgram.bind(this);
-                if (engine.webGLVersion > 1) {
+                if (engine.supportsUniformBuffers) {
                     for (var name in this._uniformBuffersNames) {
                         this.bindUniformBlock(name, this._uniformBuffersNames[name]);
                     }
@@ -72325,6 +72325,7 @@ var BABYLON;
             this._interactionsRequested = false;
             this._displayGaze = true;
             this._displayLaserPointer = true;
+            this._dpadPressed = true;
             this._onResize = function () {
                 _this.moveButtonToBottomRight();
                 if (_this._fullscreenVRpresenting && _this._webVRready) {
@@ -72978,7 +72979,7 @@ var BABYLON;
         VRExperienceHelper.prototype._checkTeleportWithRay = function (stateObject, webVRController) {
             if (webVRController === void 0) { webVRController = null; }
             if (!this._teleportationRequestInitiated) {
-                if (stateObject.y < -this._padSensibilityUp) {
+                if (stateObject.y < -this._padSensibilityUp && this._dpadPressed) {
                     if (webVRController) {
                         // If laser pointer wasn't enabled yet
                         if (this._displayLaserPointer && webVRController.hand === "left" && this._leftLaserPointer) {
@@ -73030,7 +73031,7 @@ var BABYLON;
                 return;
             }
             if (!this._rotationLeftAsked) {
-                if (stateObject.x < -this._padSensibilityUp) {
+                if (stateObject.x < -this._padSensibilityUp && this._dpadPressed) {
                     this._rotationLeftAsked = true;
                     if (this._rotationAllowed) {
                         this._rotateCamera(false);
@@ -73043,7 +73044,7 @@ var BABYLON;
                 }
             }
             if (!this._rotationRightAsked) {
-                if (stateObject.x > this._padSensibilityUp) {
+                if (stateObject.x > this._padSensibilityUp && this._dpadPressed) {
                     this._rotationRightAsked = true;
                     if (this._rotationAllowed) {
                         this._rotateCamera(true);
@@ -73062,7 +73063,7 @@ var BABYLON;
                 return;
             }
             // Teleport backwards
-            if (stateObject.y > this._padSensibilityUp) {
+            if (stateObject.y > this._padSensibilityUp && this._dpadPressed) {
                 if (!this._teleportationBackRequestInitiated) {
                     if (!this.currentVRCamera) {
                         return;
@@ -73112,6 +73113,17 @@ var BABYLON;
                     }
                     this._teleportationEnabledOnRightController = true;
                 }
+                if (webVRController.controllerType === BABYLON.PoseEnabledControllerType.VIVE) {
+                    this._dpadPressed = false;
+                    webVRController.onPadStateChangedObservable.add(function (stateObject) {
+                        _this._dpadPressed = stateObject.pressed;
+                        if (!_this._dpadPressed) {
+                            _this._rotationLeftAsked = false;
+                            _this._rotationRightAsked = false;
+                            _this._teleportationBackRequestInitiated = false;
+                        }
+                    });
+                }
                 webVRController.onPadValuesChangedObservable.add(function (stateObject) {
                     _this._checkTeleportBackwards(stateObject);
                     _this._checkTeleportWithRay(stateObject, webVRController);

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


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


+ 17 - 5
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.max.js

@@ -26878,7 +26878,7 @@ var BABYLON;
                     this._program = engine.createShaderProgram(this._vertexSourceCode, this._fragmentSourceCode, defines, undefined, this._transformFeedbackVaryings);
                 }
                 this._program.__SPECTOR_rebuildProgram = this._rebuildProgram.bind(this);
-                if (engine.webGLVersion > 1) {
+                if (engine.supportsUniformBuffers) {
                     for (var name in this._uniformBuffersNames) {
                         this.bindUniformBlock(name, this._uniformBuffersNames[name]);
                     }
@@ -72171,6 +72171,7 @@ var BABYLON;
             this._interactionsRequested = false;
             this._displayGaze = true;
             this._displayLaserPointer = true;
+            this._dpadPressed = true;
             this._onResize = function () {
                 _this.moveButtonToBottomRight();
                 if (_this._fullscreenVRpresenting && _this._webVRready) {
@@ -72824,7 +72825,7 @@ var BABYLON;
         VRExperienceHelper.prototype._checkTeleportWithRay = function (stateObject, webVRController) {
             if (webVRController === void 0) { webVRController = null; }
             if (!this._teleportationRequestInitiated) {
-                if (stateObject.y < -this._padSensibilityUp) {
+                if (stateObject.y < -this._padSensibilityUp && this._dpadPressed) {
                     if (webVRController) {
                         // If laser pointer wasn't enabled yet
                         if (this._displayLaserPointer && webVRController.hand === "left" && this._leftLaserPointer) {
@@ -72876,7 +72877,7 @@ var BABYLON;
                 return;
             }
             if (!this._rotationLeftAsked) {
-                if (stateObject.x < -this._padSensibilityUp) {
+                if (stateObject.x < -this._padSensibilityUp && this._dpadPressed) {
                     this._rotationLeftAsked = true;
                     if (this._rotationAllowed) {
                         this._rotateCamera(false);
@@ -72889,7 +72890,7 @@ var BABYLON;
                 }
             }
             if (!this._rotationRightAsked) {
-                if (stateObject.x > this._padSensibilityUp) {
+                if (stateObject.x > this._padSensibilityUp && this._dpadPressed) {
                     this._rotationRightAsked = true;
                     if (this._rotationAllowed) {
                         this._rotateCamera(true);
@@ -72908,7 +72909,7 @@ var BABYLON;
                 return;
             }
             // Teleport backwards
-            if (stateObject.y > this._padSensibilityUp) {
+            if (stateObject.y > this._padSensibilityUp && this._dpadPressed) {
                 if (!this._teleportationBackRequestInitiated) {
                     if (!this.currentVRCamera) {
                         return;
@@ -72958,6 +72959,17 @@ var BABYLON;
                     }
                     this._teleportationEnabledOnRightController = true;
                 }
+                if (webVRController.controllerType === BABYLON.PoseEnabledControllerType.VIVE) {
+                    this._dpadPressed = false;
+                    webVRController.onPadStateChangedObservable.add(function (stateObject) {
+                        _this._dpadPressed = stateObject.pressed;
+                        if (!_this._dpadPressed) {
+                            _this._rotationLeftAsked = false;
+                            _this._rotationRightAsked = false;
+                            _this._teleportationBackRequestInitiated = false;
+                        }
+                    });
+                }
                 webVRController.onPadValuesChangedObservable.add(function (stateObject) {
                     _this._checkTeleportBackwards(stateObject);
                     _this._checkTeleportWithRay(stateObject, webVRController);

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


+ 1 - 3
package.json

@@ -64,7 +64,5 @@
         "node": "*"
     },
     "readme": "Babylon.js is a 3D engine based on webgl and javascript",
-    "readmeFilename": "README.md",
-    "_id": "babylonjs@3.1.0-alpha2",
-    "_from": "babylonjs@"
+    "readmeFilename": "README.md"
 }

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

@@ -100,6 +100,8 @@ module BABYLON {
         private _displayGaze = true;
         private _displayLaserPointer = true;
 
+        private _dpadPressed = true;
+
         public get teleportationTarget(): Mesh {
             return this._teleportationTarget;
         }
@@ -782,7 +784,7 @@ module BABYLON {
 
         private _checkTeleportWithRay(stateObject: StickValues, webVRController:Nullable<WebVRController> = null){
             if (!this._teleportationRequestInitiated) {
-                if (stateObject.y < -this._padSensibilityUp) {
+                if (stateObject.y < -this._padSensibilityUp && this._dpadPressed) {
                     if(webVRController){
                         // If laser pointer wasn't enabled yet
                         if (this._displayLaserPointer && webVRController.hand === "left" && this._leftLaserPointer) {
@@ -833,7 +835,7 @@ module BABYLON {
             }
 
             if (!this._rotationLeftAsked) {
-                if (stateObject.x < -this._padSensibilityUp) {
+                if (stateObject.x < -this._padSensibilityUp && this._dpadPressed) {
                     this._rotationLeftAsked = true;
                     if (this._rotationAllowed) {
                         this._rotateCamera(false);
@@ -846,7 +848,7 @@ module BABYLON {
             }
 
             if (!this._rotationRightAsked) {
-                if (stateObject.x > this._padSensibilityUp) {
+                if (stateObject.x > this._padSensibilityUp && this._dpadPressed) {
                     this._rotationRightAsked = true;
                     if (this._rotationAllowed) {
                         this._rotateCamera(true);
@@ -864,7 +866,7 @@ module BABYLON {
                 return;
             }
             // Teleport backwards
-            if(stateObject.y > this._padSensibilityUp) {
+            if(stateObject.y > this._padSensibilityUp && this._dpadPressed) {
                 if(!this._teleportationBackRequestInitiated){
                     if(!this.currentVRCamera){
                         return;
@@ -920,6 +922,17 @@ module BABYLON {
                     }
                     this._teleportationEnabledOnRightController = true;
                 }
+                if (webVRController.controllerType === PoseEnabledControllerType.VIVE) {
+                    this._dpadPressed = false;
+                    webVRController.onPadStateChangedObservable.add((stateObject) => {
+                        this._dpadPressed = stateObject.pressed;
+                        if (!this._dpadPressed) {
+                            this._rotationLeftAsked = false;
+                            this._rotationRightAsked = false;
+                            this._teleportationBackRequestInitiated = false;
+                        }
+                    });
+                }
                 webVRController.onPadValuesChangedObservable.add((stateObject) => {
                     this._checkTeleportBackwards(stateObject);
                     this._checkTeleportWithRay(stateObject, webVRController);

+ 1 - 1
src/Materials/babylon.effect.ts

@@ -563,7 +563,7 @@
                 }
                 this._program.__SPECTOR_rebuildProgram = this._rebuildProgram.bind(this);
 
-                if (engine.webGLVersion > 1) {
+                if (engine.supportsUniformBuffers) {
                     for (var name in this._uniformBuffersNames) {
                         this.bindUniformBlock(name, this._uniformBuffersNames[name]);
                     }