Przeglądaj źródła

Merge pull request #1856 from BabylonJS/RaananW-patch-1

Update babylon.webVRCamera.ts
Raanan Weber 8 lat temu
rodzic
commit
9bb1a69581
1 zmienionych plików z 1 dodań i 0 usunięć
  1. 1 0
      src/Cameras/VR/babylon.webVRCamera.ts

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

@@ -220,6 +220,7 @@ module BABYLON {
             Vector3.TransformCoordinatesToRef(this._referencePoint, this._cameraRotationMatrix, this._transformedReferencePoint);
             Vector3.TransformCoordinatesToRef(this._referencePoint, this._cameraRotationMatrix, this._transformedReferencePoint);
 
 
             // Computing target for getTarget()
             // Computing target for getTarget()
+            this._positionOffset = this._positionOffset || Vector3.Zero();
             this._webvrViewMatrix.getTranslationToRef(this._positionOffset);
             this._webvrViewMatrix.getTranslationToRef(this._positionOffset);
             this._positionOffset.addToRef(this._transformedReferencePoint, this._currentTarget);
             this._positionOffset.addToRef(this._transformedReferencePoint, this._currentTarget);