@galacean/engine-xr-webxr 1.6.3 → 1.6.4

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/browser.js CHANGED
@@ -226,7 +226,8 @@
226
226
  /**
227
227
  * @internal
228
228
  */ _proto._onUpdate = function _onUpdate() {
229
- var _this__xrManager_inputManager = this._xrManager.inputManager, cameras = _this__xrManager_inputManager._cameras;
229
+ var cameras = this._xrManager.inputManager._cameras;
230
+ var platformSession = this._xrManager.sessionManager._platformSession;
230
231
  for(var i = 0, n = cameras.length; i < n; i++){
231
232
  var cameraDevice = cameras[i];
232
233
  var camera = cameraDevice._camera;
@@ -246,11 +247,22 @@
246
247
  if (!engine.Matrix.equals(camera.projectionMatrix, cameraDevice.projectionMatrix)) {
247
248
  camera.projectionMatrix = cameraDevice.projectionMatrix;
248
249
  }
250
+ // sync pixel viewport (only when rendering to XR main framebuffer)
251
+ if (!camera.renderTarget) {
252
+ // @ts-ignore
253
+ camera._adjustPixelViewport(platformSession.framebufferWidth, platformSession.framebufferHeight);
254
+ }
249
255
  }
250
256
  };
251
257
  /**
252
258
  * @internal
253
- */ _proto._onSessionExit = function _onSessionExit() {};
259
+ */ _proto._onSessionExit = function _onSessionExit() {
260
+ var cameras = this._xrManager.inputManager._cameras;
261
+ for(var i = 0, n = cameras.length; i < n; i++){
262
+ var _cameras_i__camera;
263
+ (_cameras_i__camera = cameras[i]._camera) == null ? void 0 : _cameras_i__camera._updatePixelViewport();
264
+ }
265
+ };
254
266
  /**
255
267
  * @internal
256
268
  */ _proto._getIgnoreClearFlags = function _getIgnoreClearFlags(cameraType) {