瀏覽代碼

candidate #2

David Catuhe 7 年之前
父節點
當前提交
bf147d0374

File diff suppressed because it is too large
+ 3592 - 3591
Playground/babylon.d.txt


File diff suppressed because it is too large
+ 3615 - 3614
dist/preview release/babylon.d.ts


File diff suppressed because it is too large
+ 4 - 4
dist/preview release/babylon.js


+ 16 - 4
dist/preview release/babylon.max.js

@@ -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);

File diff suppressed because it is too large
+ 4 - 4
dist/preview release/babylon.worker.js


File diff suppressed because it is too large
+ 4 - 4
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.js


+ 16 - 4
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.max.js

@@ -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);

File diff suppressed because it is too large
+ 5 - 5
dist/preview release/viewer/babylon.viewer.js