@galacean/engine-xr 1.6.3 → 1.6.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/main.js CHANGED
@@ -159,7 +159,8 @@ function _instanceof(left, right) {
159
159
  /**
160
160
  * @internal
161
161
  */ _proto._onUpdate = function _onUpdate() {
162
- var _this__xrManager_inputManager = this._xrManager.inputManager, cameras = _this__xrManager_inputManager._cameras;
162
+ var cameras = this._xrManager.inputManager._cameras;
163
+ var platformSession = this._xrManager.sessionManager._platformSession;
163
164
  for(var i = 0, n = cameras.length; i < n; i++){
164
165
  var cameraDevice = cameras[i];
165
166
  var camera = cameraDevice._camera;
@@ -179,11 +180,23 @@ function _instanceof(left, right) {
179
180
  if (!engine.Matrix.equals(camera.projectionMatrix, cameraDevice.projectionMatrix)) {
180
181
  camera.projectionMatrix = cameraDevice.projectionMatrix;
181
182
  }
183
+ // sync pixel viewport (only when rendering to XR main framebuffer)
184
+ if (!camera.renderTarget) {
185
+ // @ts-ignore
186
+ camera._adjustPixelViewport(platformSession.framebufferWidth, platformSession.framebufferHeight);
187
+ }
182
188
  }
183
189
  };
184
190
  /**
185
191
  * @internal
186
- */ _proto._onSessionExit = function _onSessionExit() {};
192
+ */ _proto._onSessionExit = function _onSessionExit() {
193
+ var cameras = this._xrManager.inputManager._cameras;
194
+ for(var i = 0, n = cameras.length; i < n; i++){
195
+ var // @ts-ignore
196
+ _cameras_i__camera;
197
+ (_cameras_i__camera = cameras[i]._camera) == null ? void 0 : _cameras_i__camera._updatePixelViewport();
198
+ }
199
+ };
187
200
  /**
188
201
  * @internal
189
202
  */ _proto._getIgnoreClearFlags = function _getIgnoreClearFlags(cameraType) {