1 |
- {"ast":null,"code":"/**\n * Wrapper over subclasses of XRLayer.\n * @internal\n */\nexport class WebXRLayerWrapper {\n /**\n * Check if fixed foveation is supported on this device\n */\n get isFixedFoveationSupported() {\n return this.layerType == \"XRWebGLLayer\" && typeof this.layer.fixedFoveation == \"number\";\n }\n /**\n * Get the fixed foveation currently set, as specified by the webxr specs\n * If this returns null, then fixed foveation is not supported\n */\n get fixedFoveation() {\n if (this.isFixedFoveationSupported) {\n return this.layer.fixedFoveation;\n }\n return null;\n }\n /**\n * Set the fixed foveation to the specified value, as specified by the webxr specs\n * This value will be normalized to be between 0 and 1, 1 being max foveation, 0 being no foveation\n */\n set fixedFoveation(value) {\n if (this.isFixedFoveationSupported) {\n const val = Math.max(0, Math.min(1, value || 0));\n this.layer.fixedFoveation = val;\n }\n }\n /**\n * Create a render target provider for the wrapped layer.\n * @param xrSessionManager The XR Session Manager\n * @returns A new render target texture provider for the wrapped layer.\n */\n createRenderTargetTextureProvider(xrSessionManager) {\n this._rttWrapper = this._createRenderTargetTextureProvider(xrSessionManager);\n return this._rttWrapper;\n }\n dispose() {\n if (this._rttWrapper) {\n this._rttWrapper.dispose();\n this._rttWrapper = null;\n }\n }\n constructor( /** The width of the layer's framebuffer. */\n getWidth, /** The height of the layer's framebuffer. */\n getHeight, /** The XR layer that this WebXRLayerWrapper wraps. */\n layer, /** The type of XR layer that is being wrapped. */\n layerType, /** Create a render target provider for the wrapped layer. */\n _createRenderTargetTextureProvider) {\n this.getWidth = getWidth;\n this.getHeight = getHeight;\n this.layer = layer;\n this.layerType = layerType;\n this._createRenderTargetTextureProvider = _createRenderTargetTextureProvider;\n this._rttWrapper = null;\n }\n}","map":{"version":3,"names":["WebXRLayerWrapper","isFixedFoveationSupported","layerType","layer","fixedFoveation","value","val","Math","max","min","createRenderTargetTextureProvider","xrSessionManager","_rttWrapper","_createRenderTargetTextureProvider","dispose","constructor","getWidth","getHeight"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/@babylonjs/core/XR/webXRLayerWrapper.js"],"sourcesContent":["/**\n * Wrapper over subclasses of XRLayer.\n * @internal\n */\nexport class WebXRLayerWrapper {\n /**\n * Check if fixed foveation is supported on this device\n */\n get isFixedFoveationSupported() {\n return this.layerType == \"XRWebGLLayer\" && typeof this.layer.fixedFoveation == \"number\";\n }\n /**\n * Get the fixed foveation currently set, as specified by the webxr specs\n * If this returns null, then fixed foveation is not supported\n */\n get fixedFoveation() {\n if (this.isFixedFoveationSupported) {\n return this.layer.fixedFoveation;\n }\n return null;\n }\n /**\n * Set the fixed foveation to the specified value, as specified by the webxr specs\n * This value will be normalized to be between 0 and 1, 1 being max foveation, 0 being no foveation\n */\n set fixedFoveation(value) {\n if (this.isFixedFoveationSupported) {\n const val = Math.max(0, Math.min(1, value || 0));\n this.layer.fixedFoveation = val;\n }\n }\n /**\n * Create a render target provider for the wrapped layer.\n * @param xrSessionManager The XR Session Manager\n * @returns A new render target texture provider for the wrapped layer.\n */\n createRenderTargetTextureProvider(xrSessionManager) {\n this._rttWrapper = this._createRenderTargetTextureProvider(xrSessionManager);\n return this._rttWrapper;\n }\n dispose() {\n if (this._rttWrapper) {\n this._rttWrapper.dispose();\n this._rttWrapper = null;\n }\n }\n constructor(\n /** The width of the layer's framebuffer. */\n getWidth, \n /** The height of the layer's framebuffer. */\n getHeight, \n /** The XR layer that this WebXRLayerWrapper wraps. */\n layer, \n /** The type of XR layer that is being wrapped. */\n layerType, \n /** Create a render target provider for the wrapped layer. */\n _createRenderTargetTextureProvider) {\n this.getWidth = getWidth;\n this.getHeight = getHeight;\n this.layer = layer;\n this.layerType = layerType;\n this._createRenderTargetTextureProvider = _createRenderTargetTextureProvider;\n this._rttWrapper = null;\n }\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA,OAAO,MAAMA,iBAAiB,CAAC;EAC3B;AACJ;AACA;EACI,IAAIC,yBAAyBA,CAAA,EAAG;IAC5B,OAAO,IAAI,CAACC,SAAS,IAAI,cAAc,IAAI,OAAO,IAAI,CAACC,KAAK,CAACC,cAAc,IAAI,QAAQ;EAC3F;EACA;AACJ;AACA;AACA;EACI,IAAIA,cAAcA,CAAA,EAAG;IACjB,IAAI,IAAI,CAACH,yBAAyB,EAAE;MAChC,OAAO,IAAI,CAACE,KAAK,CAACC,cAAc;IACpC;IACA,OAAO,IAAI;EACf;EACA;AACJ;AACA;AACA;EACI,IAAIA,cAAcA,CAACC,KAAK,EAAE;IACtB,IAAI,IAAI,CAACJ,yBAAyB,EAAE;MAChC,MAAMK,GAAG,GAAGC,IAAI,CAACC,GAAG,CAAC,CAAC,EAAED,IAAI,CAACE,GAAG,CAAC,CAAC,EAAEJ,KAAK,IAAI,CAAC,CAAC,CAAC;MAChD,IAAI,CAACF,KAAK,CAACC,cAAc,GAAGE,GAAG;IACnC;EACJ;EACA;AACJ;AACA;AACA;AACA;EACII,iCAAiCA,CAACC,gBAAgB,EAAE;IAChD,IAAI,CAACC,WAAW,GAAG,IAAI,CAACC,kCAAkC,CAACF,gBAAgB,CAAC;IAC5E,OAAO,IAAI,CAACC,WAAW;EAC3B;EACAE,OAAOA,CAAA,EAAG;IACN,IAAI,IAAI,CAACF,WAAW,EAAE;MAClB,IAAI,CAACA,WAAW,CAACE,OAAO,CAAC,CAAC;MAC1B,IAAI,CAACF,WAAW,GAAG,IAAI;IAC3B;EACJ;EACAG,WAAWA,CAAA,CACX;EACAC,QAAQ,EACR;EACAC,SAAS,EACT;EACAd,KAAK,EACL;EACAD,SAAS,EACT;EACAW,kCAAkC,EAAE;IAChC,IAAI,CAACG,QAAQ,GAAGA,QAAQ;IACxB,IAAI,CAACC,SAAS,GAAGA,SAAS;IAC1B,IAAI,CAACd,KAAK,GAAGA,KAAK;IAClB,IAAI,CAACD,SAAS,GAAGA,SAAS;IAC1B,IAAI,CAACW,kCAAkC,GAAGA,kCAAkC;IAC5E,IAAI,CAACD,WAAW,GAAG,IAAI;EAC3B;AACJ","ignoreList":[]},"metadata":{},"sourceType":"module","externalDependencies":[]}
|