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

use device position and rotation for webvrcamera forward ray

Trevor Baron 7 лет назад
Родитель
Сommit
b1e348588f
1 измененных файлов с 2 добавлено и 2 удалено
  1. 2 2
      src/Cameras/VR/babylon.webVRCamera.ts

+ 2 - 2
src/Cameras/VR/babylon.webVRCamera.ts

@@ -197,8 +197,8 @@ module BABYLON {
         
         public getForwardRay(length = 100): Ray {
             if (this.leftCamera) {
-                // Use left eye to avoid computation to compute center on every call
-                return super.getForwardRay(length, this.leftCamera.getWorldMatrix(), this.leftCamera.globalPosition); // Need the actual rendered camera
+                this.deviceRotationQuaternion.toRotationMatrix(this._workingMatrix)
+                return super.getForwardRay(length, this._workingMatrix, this.devicePosition); // Need the actual rendered camera
             }
             else {
                 return super.getForwardRay(length);