Browse Source

Update videoDome.ts

Due to the way the video is displayed, eyes should be switched in halfDome mode.
Raanan Weber 6 years ago
parent
commit
54f2b77cde
1 changed files with 6 additions and 1 deletions
  1. 6 1
      src/Helpers/videoDome.ts

+ 6 - 1
src/Helpers/videoDome.ts

@@ -230,7 +230,12 @@ export class VideoDome extends TransformNode {
                 // Use 0.99999 to boost perf by not switching program
                 // Use 0.99999 to boost perf by not switching program
                 this._videoTexture.uScale = this._halfDome ? 0.99999 : 0.5;
                 this._videoTexture.uScale = this._halfDome ? 0.99999 : 0.5;
                 this._onBeforeCameraRenderObserver = this._scene.onBeforeCameraRenderObservable.add((camera) => {
                 this._onBeforeCameraRenderObserver = this._scene.onBeforeCameraRenderObservable.add((camera) => {
-                    this._videoTexture.uOffset = camera.isRightCamera ? 0.5 : 0.0;
+                    if(this._halfDome) {
+                        // due to the way the video is displayed (and half hidden) we need to switch eyes.
+                        this._videoTexture.uOffset = camera.isRightCamera ? 0.0 : 0.5;
+                    } else {
+                        this._videoTexture.uOffset = camera.isRightCamera ? 0.5 : 0.0;
+                    }
                 });
                 });
                 break;
                 break;
             case VideoDome.MODE_TOPBOTTOM:
             case VideoDome.MODE_TOPBOTTOM: