فهرست منبع

Fixing bug case in Edge where WebVR is enabled but no device is connected yet.

davrous 8 سال پیش
والد
کامیت
2da9ee1b03
2فایلهای تغییر یافته به همراه7 افزوده شده و 2 حذف شده
  1. 6 1
      src/Cameras/VR/babylon.webVRCamera.ts
  2. 1 1
      src/Cameras/babylon.camera.ts

+ 6 - 1
src/Cameras/VR/babylon.webVRCamera.ts

@@ -195,7 +195,12 @@ module BABYLON {
         };
 
         public getForwardRay(length = 100): Ray {
-            return super.getForwardRay(length, this.leftCamera.getWorldMatrix(), this.position.add(this.devicePosition)); // Need the actual rendered camera
+            if (this.leftCamera) {
+                return super.getForwardRay(length, this.leftCamera.getWorldMatrix(), this.position.add(this.devicePosition)); // Need the actual rendered camera
+            }
+            else {
+                return super.getForwardRay(length); 
+            }
         } 
 
         public _checkInputs(): void {

+ 1 - 1
src/Cameras/babylon.camera.ts

@@ -530,7 +530,7 @@
             return target.isCompletelyInFrustum(this._frustumPlanes);
         }
 
-        public getForwardRay(length = 100, transform: Matrix, origin: Vector3): Ray {
+        public getForwardRay(length = 100, transform?: Matrix, origin?: Vector3): Ray {
             if (!transform) {
                 transform = this.getWorldMatrix();
             }