Просмотр исходного кода

Merge branch 'master' of https://github.com/BabylonJS/Babylon.js

David Catuhe 5 лет назад
Родитель
Сommit
27516c4b70
2 измененных файлов с 9 добавлено и 0 удалено
  1. 1 0
      dist/preview release/what's new.md
  2. 8 0
      src/Cameras/XR/webXRCamera.ts

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

@@ -255,6 +255,7 @@
 - Fix bug when we call `Mesh.render` twice and the material is still not ready on the second call ([barroij](https://github.com/barroij/))
 - Fixed an issue with pose input in webxr ([RaananW](https://github.com/RaananW/))
 - Fixed bug when parsing animation group without 'to' value ([noalak](https://github.com/noalak/))
+- isRightCamer and isLeftCamera were not set in WebXR ([RaananW](https://github.com/RaananW/))
 
 ## Breaking changes
 

+ 8 - 0
src/Cameras/XR/webXRCamera.ts

@@ -92,6 +92,14 @@ export class WebXRCamera extends FreeCamera {
         this._updateNumberOfRigCameras(pose.views.length);
         pose.views.forEach((view: any, i: number) => {
             const currentRig = <TargetCamera>this.rigCameras[i];
+            // update right and left, where applicable
+            if (!currentRig.isLeftCamera && !currentRig.isRightCamera) {
+                if (view.eye === 'right') {
+                    currentRig._isRightCamera = true;
+                } else if (view.eye === 'left') {
+                    currentRig._isLeftCamera = true;
+                }
+            }
             // Update view/projection matrix
             if (view.transform.position && view.transform.orientation) {
                 currentRig.position.copyFrom(view.transform.position);