{"ast":null,"code":"import { __decorate } from \"../../tslib.es6.js\";\nimport { serialize, serializeAsMatrix, serializeAsVector3 } from \"../../Misc/decorators.js\";\nimport { Tools } from \"../../Misc/tools.js\";\nimport { Matrix, TmpVectors, Vector3 } from \"../../Maths/math.vector.js\";\nimport { BaseTexture } from \"../../Materials/Textures/baseTexture.js\";\nimport { Texture } from \"../../Materials/Textures/texture.js\";\nimport { GetClass, RegisterClass } from \"../../Misc/typeStore.js\";\nimport { Observable } from \"../../Misc/observable.js\";\nimport { SerializationHelper } from \"../../Misc/decorators.serialization.js\";\nimport \"../../Engines/AbstractEngine/abstractEngine.cubeTexture.js\";\n// The default scale applied to environment texture. This manages the range of LOD level used for IBL according to the roughness\nconst defaultLodScale = 0.8;\n/**\n * Class for creating a cube texture\n */\nexport class CubeTexture extends BaseTexture {\n /**\n * Gets or sets the size of the bounding box associated with the cube texture\n * When defined, the cubemap will switch to local mode\n * @see https://community.arm.com/graphics/b/blog/posts/reflections-based-on-local-cubemaps-in-unity\n * @example https://www.babylonjs-playground.com/#RNASML\n */\n set boundingBoxSize(value) {\n if (this._boundingBoxSize && this._boundingBoxSize.equals(value)) {\n return;\n }\n this._boundingBoxSize = value;\n const scene = this.getScene();\n if (scene) {\n scene.markAllMaterialsAsDirty(1);\n }\n }\n /**\n * Returns the bounding box size\n * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/reflectionTexture#using-local-cubemap-mode\n */\n get boundingBoxSize() {\n return this._boundingBoxSize;\n }\n /**\n * Sets texture matrix rotation angle around Y axis in radians.\n */\n set rotationY(value) {\n this._rotationY = value;\n this.setReflectionTextureMatrix(Matrix.RotationY(this._rotationY));\n }\n /**\n * Gets texture matrix rotation angle around Y axis radians.\n */\n get rotationY() {\n return this._rotationY;\n }\n /**\n * Are mip maps generated for this texture or not.\n */\n get noMipmap() {\n return this._noMipmap;\n }\n /**\n * Gets the forced extension (if any)\n */\n get forcedExtension() {\n return this._forcedExtension;\n }\n /**\n * Creates a cube texture from an array of image urls\n * @param files defines an array of image urls\n * @param scene defines the hosting scene\n * @param noMipmap specifies if mip maps are not used\n * @returns a cube texture\n */\n static CreateFromImages(files, scene, noMipmap) {\n let rootUrlKey = \"\";\n files.forEach(url => rootUrlKey += url);\n return new CubeTexture(rootUrlKey, scene, null, noMipmap, files);\n }\n /**\n * Creates and return a texture created from prefilterd data by tools like IBL Baker or Lys.\n * @param url defines the url of the prefiltered texture\n * @param scene defines the scene the texture is attached to\n * @param forcedExtension defines the extension of the file if different from the url\n * @param createPolynomials defines whether or not to create polynomial harmonics from the texture data if necessary\n * @returns the prefiltered texture\n */\n static CreateFromPrefilteredData(url, scene, forcedExtension = null, createPolynomials = true) {\n const oldValue = scene.useDelayedTextureLoading;\n scene.useDelayedTextureLoading = false;\n const result = new CubeTexture(url, scene, null, false, null, null, null, undefined, true, forcedExtension, createPolynomials);\n scene.useDelayedTextureLoading = oldValue;\n return result;\n }\n /**\n * Creates a cube texture to use with reflection for instance. It can be based upon dds or six images as well\n * as prefiltered data.\n * @param rootUrl defines the url of the texture or the root name of the six images\n * @param sceneOrEngine defines the scene or engine the texture is attached to\n * @param extensionsOrOptions defines the suffixes add to the picture name in case six images are in use like _px.jpg or set of all options to create the cube texture\n * @param noMipmap defines if mipmaps should be created or not\n * @param files defines the six files to load for the different faces in that order: px, py, pz, nx, ny, nz\n * @param onLoad defines a callback triggered at the end of the file load if no errors occurred\n * @param onError defines a callback triggered in case of error during load\n * @param format defines the internal format to use for the texture once loaded\n * @param prefiltered defines whether or not the texture is created from prefiltered data\n * @param forcedExtension defines the extensions to use (force a special type of file to load) in case it is different from the file name\n * @param createPolynomials defines whether or not to create polynomial harmonics from the texture data if necessary\n * @param lodScale defines the scale applied to environment texture. This manages the range of LOD level used for IBL according to the roughness\n * @param lodOffset defines the offset applied to environment texture. This manages first LOD level used for IBL according to the roughness\n * @param loaderOptions options to be passed to the loader\n * @param useSRGBBuffer Defines if the texture must be loaded in a sRGB GPU buffer (if supported by the GPU) (default: false)\n * @returns the cube texture\n */\n constructor(rootUrl, sceneOrEngine, extensionsOrOptions = null, noMipmap = false, files = null, onLoad = null, onError = null, format = 5, prefiltered = false, forcedExtension = null, createPolynomials = false, lodScale = defaultLodScale, lodOffset = 0, loaderOptions, useSRGBBuffer) {\n var _this$getScene;\n super(sceneOrEngine);\n /**\n * Observable triggered once the texture has been loaded.\n */\n this.onLoadObservable = new Observable();\n /**\n * Gets or sets the center of the bounding box associated with the cube texture.\n * It must define where the camera used to render the texture was set\n * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/reflectionTexture#using-local-cubemap-mode\n */\n this.boundingBoxPosition = Vector3.Zero();\n this._rotationY = 0;\n /** @internal */\n this._files = null;\n this._forcedExtension = null;\n this._extensions = null;\n this._textureMatrixRefraction = new Matrix();\n this._buffer = null;\n this.name = rootUrl;\n this.url = rootUrl;\n this._noMipmap = noMipmap;\n this.hasAlpha = false;\n this.isCube = true;\n this._textureMatrix = Matrix.Identity();\n this.coordinatesMode = Texture.CUBIC_MODE;\n let extensions = null;\n let buffer = null;\n if (extensionsOrOptions !== null && !Array.isArray(extensionsOrOptions)) {\n var _extensionsOrOptions$, _extensionsOrOptions$2, _extensionsOrOptions$3, _extensionsOrOptions$4, _extensionsOrOptions$5, _extensionsOrOptions$6, _extensionsOrOptions$7, _extensionsOrOptions$8, _extensionsOrOptions$9, _extensionsOrOptions$10, _extensionsOrOptions$11, _extensionsOrOptions$12;\n extensions = (_extensionsOrOptions$ = extensionsOrOptions.extensions) !== null && _extensionsOrOptions$ !== void 0 ? _extensionsOrOptions$ : null;\n this._noMipmap = (_extensionsOrOptions$2 = extensionsOrOptions.noMipmap) !== null && _extensionsOrOptions$2 !== void 0 ? _extensionsOrOptions$2 : false;\n files = (_extensionsOrOptions$3 = extensionsOrOptions.files) !== null && _extensionsOrOptions$3 !== void 0 ? _extensionsOrOptions$3 : null;\n buffer = (_extensionsOrOptions$4 = extensionsOrOptions.buffer) !== null && _extensionsOrOptions$4 !== void 0 ? _extensionsOrOptions$4 : null;\n this._format = (_extensionsOrOptions$5 = extensionsOrOptions.format) !== null && _extensionsOrOptions$5 !== void 0 ? _extensionsOrOptions$5 : 5;\n prefiltered = (_extensionsOrOptions$6 = extensionsOrOptions.prefiltered) !== null && _extensionsOrOptions$6 !== void 0 ? _extensionsOrOptions$6 : false;\n forcedExtension = (_extensionsOrOptions$7 = extensionsOrOptions.forcedExtension) !== null && _extensionsOrOptions$7 !== void 0 ? _extensionsOrOptions$7 : null;\n this._createPolynomials = (_extensionsOrOptions$8 = extensionsOrOptions.createPolynomials) !== null && _extensionsOrOptions$8 !== void 0 ? _extensionsOrOptions$8 : false;\n this._lodScale = (_extensionsOrOptions$9 = extensionsOrOptions.lodScale) !== null && _extensionsOrOptions$9 !== void 0 ? _extensionsOrOptions$9 : defaultLodScale;\n this._lodOffset = (_extensionsOrOptions$10 = extensionsOrOptions.lodOffset) !== null && _extensionsOrOptions$10 !== void 0 ? _extensionsOrOptions$10 : 0;\n this._loaderOptions = extensionsOrOptions.loaderOptions;\n this._useSRGBBuffer = extensionsOrOptions.useSRGBBuffer;\n onLoad = (_extensionsOrOptions$11 = extensionsOrOptions.onLoad) !== null && _extensionsOrOptions$11 !== void 0 ? _extensionsOrOptions$11 : null;\n onError = (_extensionsOrOptions$12 = extensionsOrOptions.onError) !== null && _extensionsOrOptions$12 !== void 0 ? _extensionsOrOptions$12 : null;\n } else {\n this._noMipmap = noMipmap;\n this._format = format;\n this._createPolynomials = createPolynomials;\n extensions = extensionsOrOptions;\n this._loaderOptions = loaderOptions;\n this._useSRGBBuffer = useSRGBBuffer;\n this._lodScale = lodScale;\n this._lodOffset = lodOffset;\n }\n if (!rootUrl && !files) {\n return;\n }\n this.updateURL(rootUrl, forcedExtension, onLoad, prefiltered, onError, extensions, (_this$getScene = this.getScene()) === null || _this$getScene === void 0 ? void 0 : _this$getScene.useDelayedTextureLoading, files, buffer);\n }\n /**\n * Get the current class name of the texture useful for serialization or dynamic coding.\n * @returns \"CubeTexture\"\n */\n getClassName() {\n return \"CubeTexture\";\n }\n /**\n * Update the url (and optional buffer) of this texture if url was null during construction.\n * @param url the url of the texture\n * @param forcedExtension defines the extension to use\n * @param onLoad callback called when the texture is loaded (defaults to null)\n * @param prefiltered Defines whether the updated texture is prefiltered or not\n * @param onError callback called if there was an error during the loading process (defaults to null)\n * @param extensions defines the suffixes add to the picture name in case six images are in use like _px.jpg...\n * @param delayLoad defines if the texture should be loaded now (false by default)\n * @param files defines the six files to load for the different faces in that order: px, py, pz, nx, ny, nz\n * @param buffer the buffer to use instead of loading from the url\n */\n updateURL(url, forcedExtension = null, onLoad = null, prefiltered = false, onError = null, extensions = null, delayLoad = false, files = null, buffer = null) {\n if (!this.name || this.name.startsWith(\"data:\")) {\n this.name = url;\n }\n this.url = url;\n if (forcedExtension) {\n this._forcedExtension = forcedExtension;\n }\n const lastDot = url.lastIndexOf(\".\");\n const extension = forcedExtension ? forcedExtension : lastDot > -1 ? url.substring(lastDot).toLowerCase() : \"\";\n const isDDS = extension.indexOf(\".dds\") === 0;\n const isEnv = extension.indexOf(\".env\") === 0;\n const isBasis = extension.indexOf(\".basis\") === 0;\n if (isEnv) {\n this.gammaSpace = false;\n this._prefiltered = false;\n this.anisotropicFilteringLevel = 1;\n } else {\n this._prefiltered = prefiltered;\n if (prefiltered) {\n this.gammaSpace = false;\n this.anisotropicFilteringLevel = 1;\n }\n }\n if (files) {\n this._files = files;\n } else {\n if (!isBasis && !isEnv && !isDDS && !extensions) {\n extensions = [\"_px.jpg\", \"_py.jpg\", \"_pz.jpg\", \"_nx.jpg\", \"_ny.jpg\", \"_nz.jpg\"];\n }\n this._files = this._files || [];\n this._files.length = 0;\n if (extensions) {\n for (let index = 0; index < extensions.length; index++) {\n this._files.push(url + extensions[index]);\n }\n this._extensions = extensions;\n }\n }\n this._buffer = buffer;\n if (delayLoad) {\n this.delayLoadState = 4;\n this._delayedOnLoad = onLoad;\n this._delayedOnError = onError;\n } else {\n this._loadTexture(onLoad, onError);\n }\n }\n /**\n * Delays loading of the cube texture\n * @param forcedExtension defines the extension to use\n */\n delayLoad(forcedExtension) {\n if (this.delayLoadState !== 4) {\n return;\n }\n if (forcedExtension) {\n this._forcedExtension = forcedExtension;\n }\n this.delayLoadState = 1;\n this._loadTexture(this._delayedOnLoad, this._delayedOnError);\n }\n /**\n * Returns the reflection texture matrix\n * @returns the reflection texture matrix\n */\n getReflectionTextureMatrix() {\n return this._textureMatrix;\n }\n /**\n * Sets the reflection texture matrix\n * @param value Reflection texture matrix\n */\n setReflectionTextureMatrix(value) {\n var _this$getScene3;\n if (value.updateFlag === this._textureMatrix.updateFlag) {\n return;\n }\n if (value.isIdentity() !== this._textureMatrix.isIdentity()) {\n var _this$getScene2;\n (_this$getScene2 = this.getScene()) === null || _this$getScene2 === void 0 || _this$getScene2.markAllMaterialsAsDirty(1, mat => mat.getActiveTextures().indexOf(this) !== -1);\n }\n this._textureMatrix = value;\n if (!((_this$getScene3 = this.getScene()) !== null && _this$getScene3 !== void 0 && _this$getScene3.useRightHandedSystem)) {\n return;\n }\n const scale = TmpVectors.Vector3[0];\n const quat = TmpVectors.Quaternion[0];\n const trans = TmpVectors.Vector3[1];\n this._textureMatrix.decompose(scale, quat, trans);\n quat.z *= -1; // these two operations correspond to negating the x and y euler angles\n quat.w *= -1;\n Matrix.ComposeToRef(scale, quat, trans, this._textureMatrixRefraction);\n }\n /**\n * Gets a suitable rotate/transform matrix when the texture is used for refraction.\n * There's a separate function from getReflectionTextureMatrix because refraction requires a special configuration of the matrix in right-handed mode.\n * @returns The refraction matrix\n */\n getRefractionTextureMatrix() {\n var _this$getScene4;\n return (_this$getScene4 = this.getScene()) !== null && _this$getScene4 !== void 0 && _this$getScene4.useRightHandedSystem ? this._textureMatrixRefraction : this._textureMatrix;\n }\n _loadTexture(onLoad = null, onError = null) {\n const scene = this.getScene();\n const oldTexture = this._texture;\n this._texture = this._getFromCache(this.url, this._noMipmap, undefined, undefined, this._useSRGBBuffer, this.isCube);\n const onLoadProcessing = () => {\n this.onLoadObservable.notifyObservers(this);\n if (oldTexture) {\n var _this$getScene5;\n oldTexture.dispose();\n (_this$getScene5 = this.getScene()) === null || _this$getScene5 === void 0 || _this$getScene5.markAllMaterialsAsDirty(1);\n }\n if (onLoad) {\n onLoad();\n }\n };\n const errorHandler = (message, exception) => {\n this._loadingError = true;\n this._errorObject = {\n message,\n exception\n };\n if (onError) {\n onError(message, exception);\n }\n Texture.OnTextureLoadErrorObservable.notifyObservers(this);\n };\n if (!this._texture) {\n var _this$_texture;\n if (this._prefiltered) {\n this._texture = this._getEngine().createPrefilteredCubeTexture(this.url, scene, this._lodScale, this._lodOffset, onLoad, errorHandler, this._format, this._forcedExtension, this._createPolynomials);\n } else {\n this._texture = this._getEngine().createCubeTexture(this.url, scene, this._files, this._noMipmap, onLoad, errorHandler, this._format, this._forcedExtension, false, this._lodScale, this._lodOffset, null, this._loaderOptions, !!this._useSRGBBuffer, this._buffer);\n }\n (_this$_texture = this._texture) === null || _this$_texture === void 0 || _this$_texture.onLoadedObservable.add(() => this.onLoadObservable.notifyObservers(this));\n } else {\n if (this._texture.isReady) {\n Tools.SetImmediate(() => onLoadProcessing());\n } else {\n this._texture.onLoadedObservable.add(() => onLoadProcessing());\n }\n }\n }\n /**\n * Parses text to create a cube texture\n * @param parsedTexture define the serialized text to read from\n * @param scene defines the hosting scene\n * @param rootUrl defines the root url of the cube texture\n * @returns a cube texture\n */\n static Parse(parsedTexture, scene, rootUrl) {\n const texture = SerializationHelper.Parse(() => {\n var _parsedTexture$url;\n let prefiltered = false;\n if (parsedTexture.prefiltered) {\n prefiltered = parsedTexture.prefiltered;\n }\n return new CubeTexture(rootUrl + ((_parsedTexture$url = parsedTexture.url) !== null && _parsedTexture$url !== void 0 ? _parsedTexture$url : parsedTexture.name), scene, parsedTexture.extensions, false, parsedTexture.files || null, null, null, undefined, prefiltered, parsedTexture.forcedExtension);\n }, parsedTexture, scene);\n // Local Cubemaps\n if (parsedTexture.boundingBoxPosition) {\n texture.boundingBoxPosition = Vector3.FromArray(parsedTexture.boundingBoxPosition);\n }\n if (parsedTexture.boundingBoxSize) {\n texture.boundingBoxSize = Vector3.FromArray(parsedTexture.boundingBoxSize);\n }\n // Animations\n if (parsedTexture.animations) {\n for (let animationIndex = 0; animationIndex < parsedTexture.animations.length; animationIndex++) {\n const parsedAnimation = parsedTexture.animations[animationIndex];\n const internalClass = GetClass(\"BABYLON.Animation\");\n if (internalClass) {\n texture.animations.push(internalClass.Parse(parsedAnimation));\n }\n }\n }\n return texture;\n }\n /**\n * Makes a clone, or deep copy, of the cube texture\n * @returns a new cube texture\n */\n clone() {\n let uniqueId = 0;\n const newCubeTexture = SerializationHelper.Clone(() => {\n const cubeTexture = new CubeTexture(this.url, this.getScene() || this._getEngine(), this._extensions, this._noMipmap, this._files);\n uniqueId = cubeTexture.uniqueId;\n return cubeTexture;\n }, this);\n newCubeTexture.uniqueId = uniqueId;\n return newCubeTexture;\n }\n}\n__decorate([serialize()], CubeTexture.prototype, \"url\", void 0);\n__decorate([serializeAsVector3()], CubeTexture.prototype, \"boundingBoxPosition\", void 0);\n__decorate([serializeAsVector3()], CubeTexture.prototype, \"boundingBoxSize\", null);\n__decorate([serialize(\"rotationY\")], CubeTexture.prototype, \"rotationY\", null);\n__decorate([serialize(\"files\")], CubeTexture.prototype, \"_files\", void 0);\n__decorate([serialize(\"forcedExtension\")], CubeTexture.prototype, \"_forcedExtension\", void 0);\n__decorate([serialize(\"extensions\")], CubeTexture.prototype, \"_extensions\", void 0);\n__decorate([serializeAsMatrix(\"textureMatrix\")], CubeTexture.prototype, \"_textureMatrix\", void 0);\n__decorate([serializeAsMatrix(\"textureMatrixRefraction\")], CubeTexture.prototype, \"_textureMatrixRefraction\", void 0);\nTexture._CubeTextureParser = CubeTexture.Parse;\n// Some exporters relies on Tools.Instantiate\nRegisterClass(\"BABYLON.CubeTexture\", CubeTexture);","map":{"version":3,"names":["__decorate","serialize","serializeAsMatrix","serializeAsVector3","Tools","Matrix","TmpVectors","Vector3","BaseTexture","Texture","GetClass","RegisterClass","Observable","SerializationHelper","defaultLodScale","CubeTexture","boundingBoxSize","value","_boundingBoxSize","equals","scene","getScene","markAllMaterialsAsDirty","rotationY","_rotationY","setReflectionTextureMatrix","RotationY","noMipmap","_noMipmap","forcedExtension","_forcedExtension","CreateFromImages","files","rootUrlKey","forEach","url","CreateFromPrefilteredData","createPolynomials","oldValue","useDelayedTextureLoading","result","undefined","constructor","rootUrl","sceneOrEngine","extensionsOrOptions","onLoad","onError","format","prefiltered","lodScale","lodOffset","loaderOptions","useSRGBBuffer","_this$getScene","onLoadObservable","boundingBoxPosition","Zero","_files","_extensions","_textureMatrixRefraction","_buffer","name","hasAlpha","isCube","_textureMatrix","Identity","coordinatesMode","CUBIC_MODE","extensions","buffer","Array","isArray","_extensionsOrOptions$","_extensionsOrOptions$2","_extensionsOrOptions$3","_extensionsOrOptions$4","_extensionsOrOptions$5","_extensionsOrOptions$6","_extensionsOrOptions$7","_extensionsOrOptions$8","_extensionsOrOptions$9","_extensionsOrOptions$10","_extensionsOrOptions$11","_extensionsOrOptions$12","_format","_createPolynomials","_lodScale","_lodOffset","_loaderOptions","_useSRGBBuffer","updateURL","getClassName","delayLoad","startsWith","lastDot","lastIndexOf","extension","substring","toLowerCase","isDDS","indexOf","isEnv","isBasis","gammaSpace","_prefiltered","anisotropicFilteringLevel","length","index","push","delayLoadState","_delayedOnLoad","_delayedOnError","_loadTexture","getReflectionTextureMatrix","_this$getScene3","updateFlag","isIdentity","_this$getScene2","mat","getActiveTextures","useRightHandedSystem","scale","quat","Quaternion","trans","decompose","z","w","ComposeToRef","getRefractionTextureMatrix","_this$getScene4","oldTexture","_texture","_getFromCache","onLoadProcessing","notifyObservers","_this$getScene5","dispose","errorHandler","message","exception","_loadingError","_errorObject","OnTextureLoadErrorObservable","_this$_texture","_getEngine","createPrefilteredCubeTexture","createCubeTexture","onLoadedObservable","add","isReady","SetImmediate","Parse","parsedTexture","texture","_parsedTexture$url","FromArray","animations","animationIndex","parsedAnimation","internalClass","clone","uniqueId","newCubeTexture","Clone","cubeTexture","prototype","_CubeTextureParser"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/@babylonjs/core/Materials/Textures/cubeTexture.js"],"sourcesContent":["import { __decorate } from \"../../tslib.es6.js\";\nimport { serialize, serializeAsMatrix, serializeAsVector3 } from \"../../Misc/decorators.js\";\nimport { Tools } from \"../../Misc/tools.js\";\nimport { Matrix, TmpVectors, Vector3 } from \"../../Maths/math.vector.js\";\nimport { BaseTexture } from \"../../Materials/Textures/baseTexture.js\";\nimport { Texture } from \"../../Materials/Textures/texture.js\";\n\nimport { GetClass, RegisterClass } from \"../../Misc/typeStore.js\";\nimport { Observable } from \"../../Misc/observable.js\";\nimport { SerializationHelper } from \"../../Misc/decorators.serialization.js\";\nimport \"../../Engines/AbstractEngine/abstractEngine.cubeTexture.js\";\n// The default scale applied to environment texture. This manages the range of LOD level used for IBL according to the roughness\nconst defaultLodScale = 0.8;\n/**\n * Class for creating a cube texture\n */\nexport class CubeTexture extends BaseTexture {\n /**\n * Gets or sets the size of the bounding box associated with the cube texture\n * When defined, the cubemap will switch to local mode\n * @see https://community.arm.com/graphics/b/blog/posts/reflections-based-on-local-cubemaps-in-unity\n * @example https://www.babylonjs-playground.com/#RNASML\n */\n set boundingBoxSize(value) {\n if (this._boundingBoxSize && this._boundingBoxSize.equals(value)) {\n return;\n }\n this._boundingBoxSize = value;\n const scene = this.getScene();\n if (scene) {\n scene.markAllMaterialsAsDirty(1);\n }\n }\n /**\n * Returns the bounding box size\n * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/reflectionTexture#using-local-cubemap-mode\n */\n get boundingBoxSize() {\n return this._boundingBoxSize;\n }\n /**\n * Sets texture matrix rotation angle around Y axis in radians.\n */\n set rotationY(value) {\n this._rotationY = value;\n this.setReflectionTextureMatrix(Matrix.RotationY(this._rotationY));\n }\n /**\n * Gets texture matrix rotation angle around Y axis radians.\n */\n get rotationY() {\n return this._rotationY;\n }\n /**\n * Are mip maps generated for this texture or not.\n */\n get noMipmap() {\n return this._noMipmap;\n }\n /**\n * Gets the forced extension (if any)\n */\n get forcedExtension() {\n return this._forcedExtension;\n }\n /**\n * Creates a cube texture from an array of image urls\n * @param files defines an array of image urls\n * @param scene defines the hosting scene\n * @param noMipmap specifies if mip maps are not used\n * @returns a cube texture\n */\n static CreateFromImages(files, scene, noMipmap) {\n let rootUrlKey = \"\";\n files.forEach((url) => (rootUrlKey += url));\n return new CubeTexture(rootUrlKey, scene, null, noMipmap, files);\n }\n /**\n * Creates and return a texture created from prefilterd data by tools like IBL Baker or Lys.\n * @param url defines the url of the prefiltered texture\n * @param scene defines the scene the texture is attached to\n * @param forcedExtension defines the extension of the file if different from the url\n * @param createPolynomials defines whether or not to create polynomial harmonics from the texture data if necessary\n * @returns the prefiltered texture\n */\n static CreateFromPrefilteredData(url, scene, forcedExtension = null, createPolynomials = true) {\n const oldValue = scene.useDelayedTextureLoading;\n scene.useDelayedTextureLoading = false;\n const result = new CubeTexture(url, scene, null, false, null, null, null, undefined, true, forcedExtension, createPolynomials);\n scene.useDelayedTextureLoading = oldValue;\n return result;\n }\n /**\n * Creates a cube texture to use with reflection for instance. It can be based upon dds or six images as well\n * as prefiltered data.\n * @param rootUrl defines the url of the texture or the root name of the six images\n * @param sceneOrEngine defines the scene or engine the texture is attached to\n * @param extensionsOrOptions defines the suffixes add to the picture name in case six images are in use like _px.jpg or set of all options to create the cube texture\n * @param noMipmap defines if mipmaps should be created or not\n * @param files defines the six files to load for the different faces in that order: px, py, pz, nx, ny, nz\n * @param onLoad defines a callback triggered at the end of the file load if no errors occurred\n * @param onError defines a callback triggered in case of error during load\n * @param format defines the internal format to use for the texture once loaded\n * @param prefiltered defines whether or not the texture is created from prefiltered data\n * @param forcedExtension defines the extensions to use (force a special type of file to load) in case it is different from the file name\n * @param createPolynomials defines whether or not to create polynomial harmonics from the texture data if necessary\n * @param lodScale defines the scale applied to environment texture. This manages the range of LOD level used for IBL according to the roughness\n * @param lodOffset defines the offset applied to environment texture. This manages first LOD level used for IBL according to the roughness\n * @param loaderOptions options to be passed to the loader\n * @param useSRGBBuffer Defines if the texture must be loaded in a sRGB GPU buffer (if supported by the GPU) (default: false)\n * @returns the cube texture\n */\n constructor(rootUrl, sceneOrEngine, extensionsOrOptions = null, noMipmap = false, files = null, onLoad = null, onError = null, format = 5, prefiltered = false, forcedExtension = null, createPolynomials = false, lodScale = defaultLodScale, lodOffset = 0, loaderOptions, useSRGBBuffer) {\n super(sceneOrEngine);\n /**\n * Observable triggered once the texture has been loaded.\n */\n this.onLoadObservable = new Observable();\n /**\n * Gets or sets the center of the bounding box associated with the cube texture.\n * It must define where the camera used to render the texture was set\n * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/reflectionTexture#using-local-cubemap-mode\n */\n this.boundingBoxPosition = Vector3.Zero();\n this._rotationY = 0;\n /** @internal */\n this._files = null;\n this._forcedExtension = null;\n this._extensions = null;\n this._textureMatrixRefraction = new Matrix();\n this._buffer = null;\n this.name = rootUrl;\n this.url = rootUrl;\n this._noMipmap = noMipmap;\n this.hasAlpha = false;\n this.isCube = true;\n this._textureMatrix = Matrix.Identity();\n this.coordinatesMode = Texture.CUBIC_MODE;\n let extensions = null;\n let buffer = null;\n if (extensionsOrOptions !== null && !Array.isArray(extensionsOrOptions)) {\n extensions = extensionsOrOptions.extensions ?? null;\n this._noMipmap = extensionsOrOptions.noMipmap ?? false;\n files = extensionsOrOptions.files ?? null;\n buffer = extensionsOrOptions.buffer ?? null;\n this._format = extensionsOrOptions.format ?? 5;\n prefiltered = extensionsOrOptions.prefiltered ?? false;\n forcedExtension = extensionsOrOptions.forcedExtension ?? null;\n this._createPolynomials = extensionsOrOptions.createPolynomials ?? false;\n this._lodScale = extensionsOrOptions.lodScale ?? defaultLodScale;\n this._lodOffset = extensionsOrOptions.lodOffset ?? 0;\n this._loaderOptions = extensionsOrOptions.loaderOptions;\n this._useSRGBBuffer = extensionsOrOptions.useSRGBBuffer;\n onLoad = extensionsOrOptions.onLoad ?? null;\n onError = extensionsOrOptions.onError ?? null;\n }\n else {\n this._noMipmap = noMipmap;\n this._format = format;\n this._createPolynomials = createPolynomials;\n extensions = extensionsOrOptions;\n this._loaderOptions = loaderOptions;\n this._useSRGBBuffer = useSRGBBuffer;\n this._lodScale = lodScale;\n this._lodOffset = lodOffset;\n }\n if (!rootUrl && !files) {\n return;\n }\n this.updateURL(rootUrl, forcedExtension, onLoad, prefiltered, onError, extensions, this.getScene()?.useDelayedTextureLoading, files, buffer);\n }\n /**\n * Get the current class name of the texture useful for serialization or dynamic coding.\n * @returns \"CubeTexture\"\n */\n getClassName() {\n return \"CubeTexture\";\n }\n /**\n * Update the url (and optional buffer) of this texture if url was null during construction.\n * @param url the url of the texture\n * @param forcedExtension defines the extension to use\n * @param onLoad callback called when the texture is loaded (defaults to null)\n * @param prefiltered Defines whether the updated texture is prefiltered or not\n * @param onError callback called if there was an error during the loading process (defaults to null)\n * @param extensions defines the suffixes add to the picture name in case six images are in use like _px.jpg...\n * @param delayLoad defines if the texture should be loaded now (false by default)\n * @param files defines the six files to load for the different faces in that order: px, py, pz, nx, ny, nz\n * @param buffer the buffer to use instead of loading from the url\n */\n updateURL(url, forcedExtension = null, onLoad = null, prefiltered = false, onError = null, extensions = null, delayLoad = false, files = null, buffer = null) {\n if (!this.name || this.name.startsWith(\"data:\")) {\n this.name = url;\n }\n this.url = url;\n if (forcedExtension) {\n this._forcedExtension = forcedExtension;\n }\n const lastDot = url.lastIndexOf(\".\");\n const extension = forcedExtension ? forcedExtension : lastDot > -1 ? url.substring(lastDot).toLowerCase() : \"\";\n const isDDS = extension.indexOf(\".dds\") === 0;\n const isEnv = extension.indexOf(\".env\") === 0;\n const isBasis = extension.indexOf(\".basis\") === 0;\n if (isEnv) {\n this.gammaSpace = false;\n this._prefiltered = false;\n this.anisotropicFilteringLevel = 1;\n }\n else {\n this._prefiltered = prefiltered;\n if (prefiltered) {\n this.gammaSpace = false;\n this.anisotropicFilteringLevel = 1;\n }\n }\n if (files) {\n this._files = files;\n }\n else {\n if (!isBasis && !isEnv && !isDDS && !extensions) {\n extensions = [\"_px.jpg\", \"_py.jpg\", \"_pz.jpg\", \"_nx.jpg\", \"_ny.jpg\", \"_nz.jpg\"];\n }\n this._files = this._files || [];\n this._files.length = 0;\n if (extensions) {\n for (let index = 0; index < extensions.length; index++) {\n this._files.push(url + extensions[index]);\n }\n this._extensions = extensions;\n }\n }\n this._buffer = buffer;\n if (delayLoad) {\n this.delayLoadState = 4;\n this._delayedOnLoad = onLoad;\n this._delayedOnError = onError;\n }\n else {\n this._loadTexture(onLoad, onError);\n }\n }\n /**\n * Delays loading of the cube texture\n * @param forcedExtension defines the extension to use\n */\n delayLoad(forcedExtension) {\n if (this.delayLoadState !== 4) {\n return;\n }\n if (forcedExtension) {\n this._forcedExtension = forcedExtension;\n }\n this.delayLoadState = 1;\n this._loadTexture(this._delayedOnLoad, this._delayedOnError);\n }\n /**\n * Returns the reflection texture matrix\n * @returns the reflection texture matrix\n */\n getReflectionTextureMatrix() {\n return this._textureMatrix;\n }\n /**\n * Sets the reflection texture matrix\n * @param value Reflection texture matrix\n */\n setReflectionTextureMatrix(value) {\n if (value.updateFlag === this._textureMatrix.updateFlag) {\n return;\n }\n if (value.isIdentity() !== this._textureMatrix.isIdentity()) {\n this.getScene()?.markAllMaterialsAsDirty(1, (mat) => mat.getActiveTextures().indexOf(this) !== -1);\n }\n this._textureMatrix = value;\n if (!this.getScene()?.useRightHandedSystem) {\n return;\n }\n const scale = TmpVectors.Vector3[0];\n const quat = TmpVectors.Quaternion[0];\n const trans = TmpVectors.Vector3[1];\n this._textureMatrix.decompose(scale, quat, trans);\n quat.z *= -1; // these two operations correspond to negating the x and y euler angles\n quat.w *= -1;\n Matrix.ComposeToRef(scale, quat, trans, this._textureMatrixRefraction);\n }\n /**\n * Gets a suitable rotate/transform matrix when the texture is used for refraction.\n * There's a separate function from getReflectionTextureMatrix because refraction requires a special configuration of the matrix in right-handed mode.\n * @returns The refraction matrix\n */\n getRefractionTextureMatrix() {\n return this.getScene()?.useRightHandedSystem ? this._textureMatrixRefraction : this._textureMatrix;\n }\n _loadTexture(onLoad = null, onError = null) {\n const scene = this.getScene();\n const oldTexture = this._texture;\n this._texture = this._getFromCache(this.url, this._noMipmap, undefined, undefined, this._useSRGBBuffer, this.isCube);\n const onLoadProcessing = () => {\n this.onLoadObservable.notifyObservers(this);\n if (oldTexture) {\n oldTexture.dispose();\n this.getScene()?.markAllMaterialsAsDirty(1);\n }\n if (onLoad) {\n onLoad();\n }\n };\n const errorHandler = (message, exception) => {\n this._loadingError = true;\n this._errorObject = { message, exception };\n if (onError) {\n onError(message, exception);\n }\n Texture.OnTextureLoadErrorObservable.notifyObservers(this);\n };\n if (!this._texture) {\n if (this._prefiltered) {\n this._texture = this._getEngine().createPrefilteredCubeTexture(this.url, scene, this._lodScale, this._lodOffset, onLoad, errorHandler, this._format, this._forcedExtension, this._createPolynomials);\n }\n else {\n this._texture = this._getEngine().createCubeTexture(this.url, scene, this._files, this._noMipmap, onLoad, errorHandler, this._format, this._forcedExtension, false, this._lodScale, this._lodOffset, null, this._loaderOptions, !!this._useSRGBBuffer, this._buffer);\n }\n this._texture?.onLoadedObservable.add(() => this.onLoadObservable.notifyObservers(this));\n }\n else {\n if (this._texture.isReady) {\n Tools.SetImmediate(() => onLoadProcessing());\n }\n else {\n this._texture.onLoadedObservable.add(() => onLoadProcessing());\n }\n }\n }\n /**\n * Parses text to create a cube texture\n * @param parsedTexture define the serialized text to read from\n * @param scene defines the hosting scene\n * @param rootUrl defines the root url of the cube texture\n * @returns a cube texture\n */\n static Parse(parsedTexture, scene, rootUrl) {\n const texture = SerializationHelper.Parse(() => {\n let prefiltered = false;\n if (parsedTexture.prefiltered) {\n prefiltered = parsedTexture.prefiltered;\n }\n return new CubeTexture(rootUrl + (parsedTexture.url ?? parsedTexture.name), scene, parsedTexture.extensions, false, parsedTexture.files || null, null, null, undefined, prefiltered, parsedTexture.forcedExtension);\n }, parsedTexture, scene);\n // Local Cubemaps\n if (parsedTexture.boundingBoxPosition) {\n texture.boundingBoxPosition = Vector3.FromArray(parsedTexture.boundingBoxPosition);\n }\n if (parsedTexture.boundingBoxSize) {\n texture.boundingBoxSize = Vector3.FromArray(parsedTexture.boundingBoxSize);\n }\n // Animations\n if (parsedTexture.animations) {\n for (let animationIndex = 0; animationIndex < parsedTexture.animations.length; animationIndex++) {\n const parsedAnimation = parsedTexture.animations[animationIndex];\n const internalClass = GetClass(\"BABYLON.Animation\");\n if (internalClass) {\n texture.animations.push(internalClass.Parse(parsedAnimation));\n }\n }\n }\n return texture;\n }\n /**\n * Makes a clone, or deep copy, of the cube texture\n * @returns a new cube texture\n */\n clone() {\n let uniqueId = 0;\n const newCubeTexture = SerializationHelper.Clone(() => {\n const cubeTexture = new CubeTexture(this.url, this.getScene() || this._getEngine(), this._extensions, this._noMipmap, this._files);\n uniqueId = cubeTexture.uniqueId;\n return cubeTexture;\n }, this);\n newCubeTexture.uniqueId = uniqueId;\n return newCubeTexture;\n }\n}\n__decorate([\n serialize()\n], CubeTexture.prototype, \"url\", void 0);\n__decorate([\n serializeAsVector3()\n], CubeTexture.prototype, \"boundingBoxPosition\", void 0);\n__decorate([\n serializeAsVector3()\n], CubeTexture.prototype, \"boundingBoxSize\", null);\n__decorate([\n serialize(\"rotationY\")\n], CubeTexture.prototype, \"rotationY\", null);\n__decorate([\n serialize(\"files\")\n], CubeTexture.prototype, \"_files\", void 0);\n__decorate([\n serialize(\"forcedExtension\")\n], CubeTexture.prototype, \"_forcedExtension\", void 0);\n__decorate([\n serialize(\"extensions\")\n], CubeTexture.prototype, \"_extensions\", void 0);\n__decorate([\n serializeAsMatrix(\"textureMatrix\")\n], CubeTexture.prototype, \"_textureMatrix\", void 0);\n__decorate([\n serializeAsMatrix(\"textureMatrixRefraction\")\n], CubeTexture.prototype, \"_textureMatrixRefraction\", void 0);\nTexture._CubeTextureParser = CubeTexture.Parse;\n// Some exporters relies on Tools.Instantiate\nRegisterClass(\"BABYLON.CubeTexture\", CubeTexture);\n"],"mappings":"AAAA,SAASA,UAAU,QAAQ,oBAAoB;AAC/C,SAASC,SAAS,EAAEC,iBAAiB,EAAEC,kBAAkB,QAAQ,0BAA0B;AAC3F,SAASC,KAAK,QAAQ,qBAAqB;AAC3C,SAASC,MAAM,EAAEC,UAAU,EAAEC,OAAO,QAAQ,4BAA4B;AACxE,SAASC,WAAW,QAAQ,yCAAyC;AACrE,SAASC,OAAO,QAAQ,qCAAqC;AAE7D,SAASC,QAAQ,EAAEC,aAAa,QAAQ,yBAAyB;AACjE,SAASC,UAAU,QAAQ,0BAA0B;AACrD,SAASC,mBAAmB,QAAQ,wCAAwC;AAC5E,OAAO,4DAA4D;AACnE;AACA,MAAMC,eAAe,GAAG,GAAG;AAC3B;AACA;AACA;AACA,OAAO,MAAMC,WAAW,SAASP,WAAW,CAAC;EACzC;AACJ;AACA;AACA;AACA;AACA;EACI,IAAIQ,eAAeA,CAACC,KAAK,EAAE;IACvB,IAAI,IAAI,CAACC,gBAAgB,IAAI,IAAI,CAACA,gBAAgB,CAACC,MAAM,CAACF,KAAK,CAAC,EAAE;MAC9D;IACJ;IACA,IAAI,CAACC,gBAAgB,GAAGD,KAAK;IAC7B,MAAMG,KAAK,GAAG,IAAI,CAACC,QAAQ,CAAC,CAAC;IAC7B,IAAID,KAAK,EAAE;MACPA,KAAK,CAACE,uBAAuB,CAAC,CAAC,CAAC;IACpC;EACJ;EACA;AACJ;AACA;AACA;EACI,IAAIN,eAAeA,CAAA,EAAG;IAClB,OAAO,IAAI,CAACE,gBAAgB;EAChC;EACA;AACJ;AACA;EACI,IAAIK,SAASA,CAACN,KAAK,EAAE;IACjB,IAAI,CAACO,UAAU,GAAGP,KAAK;IACvB,IAAI,CAACQ,0BAA0B,CAACpB,MAAM,CAACqB,SAAS,CAAC,IAAI,CAACF,UAAU,CAAC,CAAC;EACtE;EAC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