@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/module.js CHANGED
@@ -155,7 +155,8 @@ function _instanceof(left, right) {
155
155
  /**
156
156
  * @internal
157
157
  */ _proto._onUpdate = function _onUpdate() {
158
- var _this__xrManager_inputManager = this._xrManager.inputManager, cameras = _this__xrManager_inputManager._cameras;
158
+ var cameras = this._xrManager.inputManager._cameras;
159
+ var platformSession = this._xrManager.sessionManager._platformSession;
159
160
  for(var i = 0, n = cameras.length; i < n; i++){
160
161
  var cameraDevice = cameras[i];
161
162
  var camera = cameraDevice._camera;
@@ -175,11 +176,23 @@ function _instanceof(left, right) {
175
176
  if (!Matrix.equals(camera.projectionMatrix, cameraDevice.projectionMatrix)) {
176
177
  camera.projectionMatrix = cameraDevice.projectionMatrix;
177
178
  }
179
+ // sync pixel viewport (only when rendering to XR main framebuffer)
180
+ if (!camera.renderTarget) {
181
+ // @ts-ignore
182
+ camera._adjustPixelViewport(platformSession.framebufferWidth, platformSession.framebufferHeight);
183
+ }
178
184
  }
179
185
  };
180
186
  /**
181
187
  * @internal
182
- */ _proto._onSessionExit = function _onSessionExit() {};
188
+ */ _proto._onSessionExit = function _onSessionExit() {
189
+ var cameras = this._xrManager.inputManager._cameras;
190
+ for(var i = 0, n = cameras.length; i < n; i++){
191
+ var // @ts-ignore
192
+ _cameras_i__camera;
193
+ (_cameras_i__camera = cameras[i]._camera) == null ? void 0 : _cameras_i__camera._updatePixelViewport();
194
+ }
195
+ };
183
196
  /**
184
197
  * @internal
185
198
  */ _proto._getIgnoreClearFlags = function _getIgnoreClearFlags(cameraType) {