Browse Source

Update babylon.webVRCamera.ts

Fixing context errors
Raanan Weber 8 năm trước cách đây
mục cha
commit
ce660bf53f
1 tập tin đã thay đổi với 1 bổ sung0 xóa
  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);
 
             // Computing target for getTarget()
+            this._positionOffset = this._positionOffset || Vector3.Zero();
             this._webvrViewMatrix.getTranslationToRef(this._positionOffset);
             this._positionOffset.addToRef(this._transformedReferencePoint, this._currentTarget);