d721999641831b3fee99994109014c3f6e93284a89083cce6e39caaf954a1d88.json 93 KB

1
  1. {"ast":null,"code":"import { SceneLoader } from \"../Loading/sceneLoader.js\";\nimport { Tools } from \"./tools.js\";\nimport { Observable } from \"./observable.js\";\nimport { Texture } from \"../Materials/Textures/texture.js\";\nimport { CubeTexture } from \"../Materials/Textures/cubeTexture.js\";\nimport { HDRCubeTexture } from \"../Materials/Textures/hdrCubeTexture.js\";\nimport { EquiRectangularCubeTexture } from \"../Materials/Textures/equiRectangularCubeTexture.js\";\nimport { Logger } from \"../Misc/logger.js\";\nimport { EngineStore } from \"../Engines/engineStore.js\";\n/**\n * Defines the list of states available for a task inside a AssetsManager\n */\nexport var AssetTaskState;\n(function (AssetTaskState) {\n /**\n * Initialization\n */\n AssetTaskState[AssetTaskState[\"INIT\"] = 0] = \"INIT\";\n /**\n * Running\n */\n AssetTaskState[AssetTaskState[\"RUNNING\"] = 1] = \"RUNNING\";\n /**\n * Done\n */\n AssetTaskState[AssetTaskState[\"DONE\"] = 2] = \"DONE\";\n /**\n * Error\n */\n AssetTaskState[AssetTaskState[\"ERROR\"] = 3] = \"ERROR\";\n})(AssetTaskState || (AssetTaskState = {}));\n/**\n * Define an abstract asset task used with a AssetsManager class to load assets into a scene\n */\nexport class AbstractAssetTask {\n /**\n * Creates a new AssetsManager\n * @param name defines the name of the task\n */\n constructor(\n /**\n * Task name\n */\n name) {\n this.name = name;\n this._isCompleted = false;\n this._taskState = 0 /* AssetTaskState.INIT */;\n }\n /**\n * Get if the task is completed\n */\n get isCompleted() {\n return this._isCompleted;\n }\n /**\n * Gets the current state of the task\n */\n get taskState() {\n return this._taskState;\n }\n /**\n * Gets the current error object (if task is in error)\n */\n get errorObject() {\n return this._errorObject;\n }\n /**\n * Internal only\n * @internal\n */\n _setErrorObject(message, exception) {\n if (this._errorObject) {\n return;\n }\n this._errorObject = {\n message: message,\n exception: exception\n };\n }\n /**\n * Execute the current task\n * @param scene defines the scene where you want your assets to be loaded\n * @param onSuccess is a callback called when the task is successfully executed\n * @param onError is a callback called if an error occurs\n */\n run(scene, onSuccess, onError) {\n this._taskState = 1 /* AssetTaskState.RUNNING */;\n this.runTask(scene, () => {\n this._onDoneCallback(onSuccess, onError);\n }, (msg, exception) => {\n this._onErrorCallback(onError, msg, exception);\n });\n }\n /**\n * Execute the current task\n * @param scene defines the scene where you want your assets to be loaded\n * @param onSuccess is a callback called when the task is successfully executed\n * @param onError is a callback called if an error occurs\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n runTask(scene, onSuccess, onError) {\n throw new Error(\"runTask is not implemented\");\n }\n /**\n * Reset will set the task state back to INIT, so the next load call of the assets manager will execute this task again.\n * This can be used with failed tasks that have the reason for failure fixed.\n */\n reset() {\n this._taskState = 0 /* AssetTaskState.INIT */;\n }\n _onErrorCallback(onError, message, exception) {\n this._taskState = 3 /* AssetTaskState.ERROR */;\n this._errorObject = {\n message: message,\n exception: exception\n };\n if (this.onError) {\n this.onError(this, message, exception);\n }\n onError();\n }\n _onDoneCallback(onSuccess, onError) {\n try {\n this._taskState = 2 /* AssetTaskState.DONE */;\n this._isCompleted = true;\n if (this.onSuccess) {\n this.onSuccess(this);\n }\n onSuccess();\n } catch (e) {\n this._onErrorCallback(onError, \"Task is done, error executing success callback(s)\", e);\n }\n }\n}\n/**\n * Class used to share progress information about assets loading\n */\nexport class AssetsProgressEvent {\n /**\n * Creates a AssetsProgressEvent\n * @param remainingCount defines the number of remaining tasks to process\n * @param totalCount defines the total number of tasks\n * @param task defines the task that was just processed\n */\n constructor(remainingCount, totalCount, task) {\n this.remainingCount = remainingCount;\n this.totalCount = totalCount;\n this.task = task;\n }\n}\n/**\n * Define a task used by AssetsManager to load assets into a container\n */\nexport class ContainerAssetTask extends AbstractAssetTask {\n /**\n * Creates a new ContainerAssetTask\n * @param name defines the name of the task\n * @param meshesNames defines the list of mesh's names you want to load\n * @param rootUrl defines the root url to use as a base to load your meshes and associated resources\n * @param sceneFilename defines the filename or File of the scene to load from\n * @param extension defines the extension to use to load the scene (if not defined, \".babylon\" will be used)\n */\n constructor(\n /**\n * Defines the name of the task\n */\n name,\n /**\n * Defines the list of mesh's names you want to load\n */\n meshesNames,\n /**\n * Defines the root url to use as a base to load your meshes and associated resources\n */\n rootUrl,\n /**\n * Defines the filename or File of the scene to load from\n */\n sceneFilename,\n /**\n * Defines the extension to use to load the scene (if not defined, \".babylon\" will be used)\n */\n extension) {\n super(name);\n this.name = name;\n this.meshesNames = meshesNames;\n this.rootUrl = rootUrl;\n this.sceneFilename = sceneFilename;\n this.extension = extension;\n }\n /**\n * Execute the current task\n * @param scene defines the scene where you want your assets to be loaded\n * @param onSuccess is a callback called when the task is successfully executed\n * @param onError is a callback called if an error occurs\n */\n runTask(scene, onSuccess, onError) {\n SceneLoader.LoadAssetContainer(this.rootUrl, this.sceneFilename, scene, container => {\n this.loadedContainer = container;\n this.loadedMeshes = container.meshes;\n this.loadedTransformNodes = container.transformNodes;\n this.loadedParticleSystems = container.particleSystems;\n this.loadedSkeletons = container.skeletons;\n this.loadedAnimationGroups = container.animationGroups;\n onSuccess();\n }, null, (scene, message, exception) => {\n onError(message, exception);\n }, this.extension);\n }\n}\n/**\n * Define a task used by AssetsManager to load meshes\n */\nexport class MeshAssetTask extends AbstractAssetTask {\n /**\n * Creates a new MeshAssetTask\n * @param name defines the name of the task\n * @param meshesNames defines the list of mesh's names you want to load\n * @param rootUrl defines the root url to use as a base to load your meshes and associated resources\n * @param sceneFilename defines the filename or File of the scene to load from\n * @param extension defines the extension to use to load the scene (if not defined, \".babylon\" will be used)\n */\n constructor(\n /**\n * Defines the name of the task\n */\n name,\n /**\n * Defines the list of mesh's names you want to load\n */\n meshesNames,\n /**\n * Defines the root url to use as a base to load your meshes and associated resources\n */\n rootUrl,\n /**\n * Defines the filename or File of the scene to load from\n */\n sceneFilename,\n /**\n * Defines the extension to use to load the scene (if not defined, \".babylon\" will be used)\n */\n extension) {\n super(name);\n this.name = name;\n this.meshesNames = meshesNames;\n this.rootUrl = rootUrl;\n this.sceneFilename = sceneFilename;\n this.extension = extension;\n }\n /**\n * Execute the current task\n * @param scene defines the scene where you want your assets to be loaded\n * @param onSuccess is a callback called when the task is successfully executed\n * @param onError is a callback called if an error occurs\n */\n runTask(scene, onSuccess, onError) {\n SceneLoader.ImportMesh(this.meshesNames, this.rootUrl, this.sceneFilename, scene, (meshes, particleSystems, skeletons, animationGroups, transformNodes) => {\n this.loadedMeshes = meshes;\n this.loadedTransformNodes = transformNodes;\n this.loadedParticleSystems = particleSystems;\n this.loadedSkeletons = skeletons;\n this.loadedAnimationGroups = animationGroups;\n onSuccess();\n }, null, (scene, message, exception) => {\n onError(message, exception);\n }, this.extension);\n }\n}\n/**\n * Define a task used by AssetsManager to load animations\n */\nexport class AnimationAssetTask extends AbstractAssetTask {\n /**\n * Creates a new AnimationAssetTask\n * @param name defines the name of the task\n * @param rootUrl defines the root url to use as a base to load your meshes and associated resources\n * @param filename defines the filename or File of the scene to load from\n * @param targetConverter defines a function used to convert animation targets from loaded scene to current scene (default: search node by name)\n * @param extension defines the extension to use to load the scene (if not defined, \".babylon\" will be used)\n */\n constructor(\n /**\n * Defines the name of the task\n */\n name,\n /**\n * Defines the root url to use as a base to load your meshes and associated resources\n */\n rootUrl,\n /**\n * Defines the filename to load from\n */\n filename,\n /**\n * Defines a function used to convert animation targets from loaded scene to current scene (default: search node by name)\n */\n targetConverter,\n /**\n * Defines the extension to use to load the scene (if not defined, \".babylon\" will be used)\n */\n extension) {\n super(name);\n this.name = name;\n this.rootUrl = rootUrl;\n this.filename = filename;\n this.targetConverter = targetConverter;\n this.extension = extension;\n }\n /**\n * Execute the current task\n * @param scene defines the scene where you want your assets to be loaded\n * @param onSuccess is a callback called when the task is successfully executed\n * @param onError is a callback called if an error occurs\n */\n runTask(scene, onSuccess, onError) {\n const startingIndexForNewAnimatables = scene.animatables.length;\n const startingIndexForNewAnimationGroups = scene.animationGroups.length;\n this.loadedAnimatables = [];\n this.loadedAnimationGroups = [];\n SceneLoader.ImportAnimations(this.rootUrl, this.filename, scene, false, 3 /* SceneLoaderAnimationGroupLoadingMode.NoSync */, this.targetConverter, () => {\n this.loadedAnimatables = scene.animatables.slice(startingIndexForNewAnimatables);\n this.loadedAnimationGroups = scene.animationGroups.slice(startingIndexForNewAnimationGroups);\n onSuccess();\n }, null, (scene, message, exception) => {\n onError(message, exception);\n }, this.extension);\n }\n}\n/**\n * Define a task used by AssetsManager to load text content\n */\nexport class TextFileAssetTask extends AbstractAssetTask {\n /**\n * Creates a new TextFileAssetTask object\n * @param name defines the name of the task\n * @param url defines the location of the file to load\n */\n constructor(\n /**\n * Defines the name of the task\n */\n name,\n /**\n * Defines the location of the file to load\n */\n url) {\n super(name);\n this.name = name;\n this.url = url;\n }\n /**\n * Execute the current task\n * @param scene defines the scene where you want your assets to be loaded\n * @param onSuccess is a callback called when the task is successfully executed\n * @param onError is a callback called if an error occurs\n */\n runTask(scene, onSuccess, onError) {\n scene._loadFile(this.url, data => {\n this.text = data;\n onSuccess();\n }, undefined, false, false, (request, exception) => {\n if (request) {\n onError(request.status + \" \" + request.statusText, exception);\n }\n });\n }\n}\n/**\n * Define a task used by AssetsManager to load binary data\n */\nexport class BinaryFileAssetTask extends AbstractAssetTask {\n /**\n * Creates a new BinaryFileAssetTask object\n * @param name defines the name of the new task\n * @param url defines the location of the file to load\n */\n constructor(\n /**\n * Defines the name of the task\n */\n name,\n /**\n * Defines the location of the file to load\n */\n url) {\n super(name);\n this.name = name;\n this.url = url;\n }\n /**\n * Execute the current task\n * @param scene defines the scene where you want your assets to be loaded\n * @param onSuccess is a callback called when the task is successfully executed\n * @param onError is a callback called if an error occurs\n */\n runTask(scene, onSuccess, onError) {\n scene._loadFile(this.url, data => {\n this.data = data;\n onSuccess();\n }, undefined, true, true, (request, exception) => {\n if (request) {\n onError(request.status + \" \" + request.statusText, exception);\n }\n });\n }\n}\n/**\n * Define a task used by AssetsManager to load images\n */\nexport class ImageAssetTask extends AbstractAssetTask {\n /**\n * Creates a new ImageAssetTask\n * @param name defines the name of the task\n * @param url defines the location of the image to load\n */\n constructor(\n /**\n * Defines the name of the task\n */\n name,\n /**\n * Defines the location of the image to load\n */\n url) {\n super(name);\n this.name = name;\n this.url = url;\n }\n /**\n * Execute the current task\n * @param scene defines the scene where you want your assets to be loaded\n * @param onSuccess is a callback called when the task is successfully executed\n * @param onError is a callback called if an error occurs\n */\n runTask(scene, onSuccess, onError) {\n const img = new Image();\n Tools.SetCorsBehavior(this.url, img);\n img.onload = () => {\n this.image = img;\n onSuccess();\n };\n img.onerror = err => {\n onError(\"Error loading image\", err);\n };\n img.src = this.url;\n }\n}\n/**\n * Define a task used by AssetsManager to load 2D textures\n */\nexport class TextureAssetTask extends AbstractAssetTask {\n /**\n * Creates a new TextureAssetTask object\n * @param name defines the name of the task\n * @param url defines the location of the file to load\n * @param noMipmap defines if mipmap should not be generated (default is false)\n * @param invertY defines if texture must be inverted on Y axis (default is true)\n * @param samplingMode defines the sampling mode to use (default is Texture.TRILINEAR_SAMPLINGMODE)\n */\n constructor(\n /**\n * Defines the name of the task\n */\n name,\n /**\n * Defines the location of the file to load\n */\n url,\n /**\n * Defines if mipmap should not be generated (default is false)\n */\n noMipmap,\n /**\n * [true] Defines if texture must be inverted on Y axis (default is true)\n */\n invertY = true,\n /**\n * [3] Defines the sampling mode to use (default is Texture.TRILINEAR_SAMPLINGMODE)\n */\n samplingMode = Texture.TRILINEAR_SAMPLINGMODE) {\n super(name);\n this.name = name;\n this.url = url;\n this.noMipmap = noMipmap;\n this.invertY = invertY;\n this.samplingMode = samplingMode;\n }\n /**\n * Execute the current task\n * @param scene defines the scene where you want your assets to be loaded\n * @param onSuccess is a callback called when the task is successfully executed\n * @param onError is a callback called if an error occurs\n */\n runTask(scene, onSuccess, onError) {\n const onload = () => {\n onSuccess();\n };\n const onerror = (message, exception) => {\n onError(message, exception);\n };\n this.texture = new Texture(this.url, scene, this.noMipmap, this.invertY, this.samplingMode, onload, onerror);\n }\n}\n/**\n * Define a task used by AssetsManager to load cube textures\n */\nexport class CubeTextureAssetTask extends AbstractAssetTask {\n /**\n * Creates a new CubeTextureAssetTask\n * @param name defines the name of the task\n * @param url defines the location of the files to load (You have to specify the folder where the files are + filename with no extension)\n * @param extensions defines the extensions to use to load files ([\"_px\", \"_py\", \"_pz\", \"_nx\", \"_ny\", \"_nz\"] by default)\n * @param noMipmap defines if mipmaps should not be generated (default is false)\n * @param files defines the explicit list of files (undefined by default)\n * @param prefiltered\n */\n constructor(\n /**\n * Defines the name of the task\n */\n name,\n /**\n * Defines the location of the files to load (You have to specify the folder where the files are + filename with no extension)\n */\n url,\n /**\n * Defines the extensions to use to load files ([\"_px\", \"_py\", \"_pz\", \"_nx\", \"_ny\", \"_nz\"] by default)\n */\n extensions,\n /**\n * Defines if mipmaps should not be generated (default is false)\n */\n noMipmap,\n /**\n * Defines the explicit list of files (undefined by default)\n */\n files,\n /**\n * Defines the prefiltered texture option (default is false)\n */\n prefiltered) {\n super(name);\n this.name = name;\n this.url = url;\n this.extensions = extensions;\n this.noMipmap = noMipmap;\n this.files = files;\n this.prefiltered = prefiltered;\n }\n /**\n * Execute the current task\n * @param scene defines the scene where you want your assets to be loaded\n * @param onSuccess is a callback called when the task is successfully executed\n * @param onError is a callback called if an error occurs\n */\n runTask(scene, onSuccess, onError) {\n const onload = () => {\n onSuccess();\n };\n const onerror = (message, exception) => {\n onError(message, exception);\n };\n this.texture = new CubeTexture(this.url, scene, this.extensions, this.noMipmap, this.files, onload, onerror, undefined, this.prefiltered);\n }\n}\n/**\n * Define a task used by AssetsManager to load HDR cube textures\n */\nexport class HDRCubeTextureAssetTask extends AbstractAssetTask {\n /**\n * Creates a new HDRCubeTextureAssetTask object\n * @param name defines the name of the task\n * @param url defines the location of the file to load\n * @param size defines the desired size (the more it increases the longer the generation will be) If the size is omitted this implies you are using a preprocessed cubemap.\n * @param noMipmap defines if mipmaps should not be generated (default is false)\n * @param generateHarmonics specifies whether you want to extract the polynomial harmonics during the generation process (default is true)\n * @param gammaSpace specifies if the texture will be use in gamma or linear space (the PBR material requires those texture in linear space, but the standard material would require them in Gamma space) (default is false)\n * @param reserved Internal use only\n */\n constructor(\n /**\n * Defines the name of the task\n */\n name,\n /**\n * Defines the location of the file to load\n */\n url,\n /**\n * Defines the desired size (the more it increases the longer the generation will be)\n */\n size,\n /**\n * [false] Defines if mipmaps should not be generated (default is false)\n */\n noMipmap = false,\n /**\n * [true] Specifies whether you want to extract the polynomial harmonics during the generation process (default is true)\n */\n generateHarmonics = true,\n /**\n * [false] Specifies if the texture will be use in gamma or linear space (the PBR material requires those texture in linear space, but the standard material would require them in Gamma space) (default is false)\n */\n gammaSpace = false,\n /**\n * [false] Internal Use Only\n */\n reserved = false) {\n super(name);\n this.name = name;\n this.url = url;\n this.size = size;\n this.noMipmap = noMipmap;\n this.generateHarmonics = generateHarmonics;\n this.gammaSpace = gammaSpace;\n this.reserved = reserved;\n }\n /**\n * Execute the current task\n * @param scene defines the scene where you want your assets to be loaded\n * @param onSuccess is a callback called when the task is successfully executed\n * @param onError is a callback called if an error occurs\n */\n runTask(scene, onSuccess, onError) {\n const onload = () => {\n onSuccess();\n };\n const onerror = (message, exception) => {\n onError(message, exception);\n };\n this.texture = new HDRCubeTexture(this.url, scene, this.size, this.noMipmap, this.generateHarmonics, this.gammaSpace, this.reserved, onload, onerror);\n }\n}\n/**\n * Define a task used by AssetsManager to load Equirectangular cube textures\n */\nexport class EquiRectangularCubeTextureAssetTask extends AbstractAssetTask {\n /**\n * Creates a new EquiRectangularCubeTextureAssetTask object\n * @param name defines the name of the task\n * @param url defines the location of the file to load\n * @param size defines the desired size (the more it increases the longer the generation will be)\n * If the size is omitted this implies you are using a preprocessed cubemap.\n * @param noMipmap defines if mipmaps should not be generated (default is false)\n * @param gammaSpace specifies if the texture will be used in gamma or linear space\n * (the PBR material requires those texture in linear space, but the standard material would require them in Gamma space)\n * (default is true)\n */\n constructor(\n /**\n * Defines the name of the task\n */\n name,\n /**\n * Defines the location of the file to load\n */\n url,\n /**\n * Defines the desired size (the more it increases the longer the generation will be)\n */\n size,\n /**\n * [false] Defines if mipmaps should not be generated (default is false)\n */\n noMipmap = false,\n /**\n * [true] Specifies if the texture will be use in gamma or linear space (the PBR material requires those texture in linear space,\n * but the standard material would require them in Gamma space) (default is true)\n */\n gammaSpace = true) {\n super(name);\n this.name = name;\n this.url = url;\n this.size = size;\n this.noMipmap = noMipmap;\n this.gammaSpace = gammaSpace;\n }\n /**\n * Execute the current task\n * @param scene defines the scene where you want your assets to be loaded\n * @param onSuccess is a callback called when the task is successfully executed\n * @param onError is a callback called if an error occurs\n */\n runTask(scene, onSuccess, onError) {\n const onload = () => {\n onSuccess();\n };\n const onerror = (message, exception) => {\n onError(message, exception);\n };\n this.texture = new EquiRectangularCubeTexture(this.url, scene, this.size, this.noMipmap, this.gammaSpace, onload, onerror);\n }\n}\n/**\n * This class can be used to easily import assets into a scene\n * @see https://doc.babylonjs.com/features/featuresDeepDive/importers/assetManager\n */\nexport class AssetsManager {\n /**\n * Creates a new AssetsManager\n * @param scene defines the scene to work on\n */\n constructor(scene) {\n this._isLoading = false;\n this._tasks = new Array();\n this._waitingTasksCount = 0;\n this._totalTasksCount = 0;\n /**\n * Observable called when all tasks are processed\n */\n this.onTaskSuccessObservable = new Observable();\n /**\n * Observable called when a task had an error\n */\n this.onTaskErrorObservable = new Observable();\n /**\n * Observable called when all tasks were executed\n */\n this.onTasksDoneObservable = new Observable();\n /**\n * Observable called when a task is done (whatever the result is)\n */\n this.onProgressObservable = new Observable();\n /**\n * Gets or sets a boolean defining if the AssetsManager should use the default loading screen\n * @see https://doc.babylonjs.com/features/featuresDeepDive/scene/customLoadingScreen\n */\n this.useDefaultLoadingScreen = true;\n /**\n * Gets or sets a boolean defining if the AssetsManager should automatically hide the loading screen\n * when all assets have been downloaded.\n * If set to false, you need to manually call in hideLoadingUI() once your scene is ready.\n */\n this.autoHideLoadingUI = true;\n this._scene = scene || EngineStore.LastCreatedScene;\n }\n /**\n * Add a ContainerAssetTask to the list of active tasks\n * @param taskName defines the name of the new task\n * @param meshesNames defines the name of meshes to load\n * @param rootUrl defines the root url to use to locate files\n * @param sceneFilename defines the filename of the scene file or the File itself\n * @param extension defines the extension to use to load the file\n * @returns a new ContainerAssetTask object\n */\n addContainerTask(taskName, meshesNames, rootUrl, sceneFilename, extension) {\n const task = new ContainerAssetTask(taskName, meshesNames, rootUrl, sceneFilename, extension);\n this._tasks.push(task);\n return task;\n }\n /**\n * Add a MeshAssetTask to the list of active tasks\n * @param taskName defines the name of the new task\n * @param meshesNames defines the name of meshes to load\n * @param rootUrl defines the root url to use to locate files\n * @param sceneFilename defines the filename of the scene file or the File itself\n * @param extension defines the extension to use to load the file\n * @returns a new MeshAssetTask object\n */\n addMeshTask(taskName, meshesNames, rootUrl, sceneFilename, extension) {\n const task = new MeshAssetTask(taskName, meshesNames, rootUrl, sceneFilename, extension);\n this._tasks.push(task);\n return task;\n }\n /**\n * Add a TextFileAssetTask to the list of active tasks\n * @param taskName defines the name of the new task\n * @param url defines the url of the file to load\n * @returns a new TextFileAssetTask object\n */\n addTextFileTask(taskName, url) {\n const task = new TextFileAssetTask(taskName, url);\n this._tasks.push(task);\n return task;\n }\n /**\n * Add a BinaryFileAssetTask to the list of active tasks\n * @param taskName defines the name of the new task\n * @param url defines the url of the file to load\n * @returns a new BinaryFileAssetTask object\n */\n addBinaryFileTask(taskName, url) {\n const task = new BinaryFileAssetTask(taskName, url);\n this._tasks.push(task);\n return task;\n }\n /**\n * Add a ImageAssetTask to the list of active tasks\n * @param taskName defines the name of the new task\n * @param url defines the url of the file to load\n * @returns a new ImageAssetTask object\n */\n addImageTask(taskName, url) {\n const task = new ImageAssetTask(taskName, url);\n this._tasks.push(task);\n return task;\n }\n /**\n * Add a TextureAssetTask to the list of active tasks\n * @param taskName defines the name of the new task\n * @param url defines the url of the file to load\n * @param noMipmap defines if the texture must not receive mipmaps (false by default)\n * @param invertY defines if you want to invert Y axis of the loaded texture (true by default)\n * @param samplingMode defines the sampling mode to use (Texture.TRILINEAR_SAMPLINGMODE by default)\n * @returns a new TextureAssetTask object\n */\n addTextureTask(taskName, url, noMipmap, invertY, samplingMode = Texture.TRILINEAR_SAMPLINGMODE) {\n const task = new TextureAssetTask(taskName, url, noMipmap, invertY, samplingMode);\n this._tasks.push(task);\n return task;\n }\n /**\n * Add a CubeTextureAssetTask to the list of active tasks\n * @param taskName defines the name of the new task\n * @param url defines the url of the file to load\n * @param extensions defines the extension to use to load the cube map (can be null)\n * @param noMipmap defines if the texture must not receive mipmaps (false by default)\n * @param files defines the list of files to load (can be null)\n * @param prefiltered defines the prefiltered texture option (default is false)\n * @returns a new CubeTextureAssetTask object\n */\n addCubeTextureTask(taskName, url, extensions, noMipmap, files, prefiltered) {\n const task = new CubeTextureAssetTask(taskName, url, extensions, noMipmap, files, prefiltered);\n this._tasks.push(task);\n return task;\n }\n /**\n *\n * Add a HDRCubeTextureAssetTask to the list of active tasks\n * @param taskName defines the name of the new task\n * @param url defines the url of the file to load\n * @param size defines the size you want for the cubemap (can be null)\n * @param noMipmap defines if the texture must not receive mipmaps (false by default)\n * @param generateHarmonics defines if you want to automatically generate (true by default)\n * @param gammaSpace specifies if the texture will be use in gamma or linear space (the PBR material requires those texture in linear space, but the standard material would require them in Gamma space) (default is false)\n * @param reserved Internal use only\n * @returns a new HDRCubeTextureAssetTask object\n */\n addHDRCubeTextureTask(taskName, url, size, noMipmap = false, generateHarmonics = true, gammaSpace = false, reserved = false) {\n const task = new HDRCubeTextureAssetTask(taskName, url, size, noMipmap, generateHarmonics, gammaSpace, reserved);\n this._tasks.push(task);\n return task;\n }\n /**\n *\n * Add a EquiRectangularCubeTextureAssetTask to the list of active tasks\n * @param taskName defines the name of the new task\n * @param url defines the url of the file to load\n * @param size defines the size you want for the cubemap (can be null)\n * @param noMipmap defines if the texture must not receive mipmaps (false by default)\n * @param gammaSpace Specifies if the texture will be used in gamma or linear space\n * (the PBR material requires those textures in linear space, but the standard material would require them in Gamma space)\n * @returns a new EquiRectangularCubeTextureAssetTask object\n */\n addEquiRectangularCubeTextureAssetTask(taskName, url, size, noMipmap = false, gammaSpace = true) {\n const task = new EquiRectangularCubeTextureAssetTask(taskName, url, size, noMipmap, gammaSpace);\n this._tasks.push(task);\n return task;\n }\n /**\n * Remove a task from the assets manager.\n * @param task the task to remove\n */\n removeTask(task) {\n const index = this._tasks.indexOf(task);\n if (index > -1) {\n this._tasks.splice(index, 1);\n }\n }\n _decreaseWaitingTasksCount(task) {\n this._waitingTasksCount--;\n try {\n if (this.onProgress) {\n this.onProgress(this._waitingTasksCount, this._totalTasksCount, task);\n }\n this.onProgressObservable.notifyObservers(new AssetsProgressEvent(this._waitingTasksCount, this._totalTasksCount, task));\n } catch (e) {\n Logger.Error(\"Error running progress callbacks.\");\n Logger.Log(e);\n }\n if (this._waitingTasksCount === 0) {\n try {\n const currentTasks = this._tasks.slice();\n if (this.onFinish) {\n // Calling onFinish with immutable array of tasks\n this.onFinish(currentTasks);\n }\n // Let's remove successful tasks\n for (const task of currentTasks) {\n if (task.taskState === 2 /* AssetTaskState.DONE */) {\n const index = this._tasks.indexOf(task);\n if (index > -1) {\n this._tasks.splice(index, 1);\n }\n }\n }\n this.onTasksDoneObservable.notifyObservers(this._tasks);\n } catch (e) {\n Logger.Error(\"Error running tasks-done callbacks.\");\n Logger.Log(e);\n }\n this._isLoading = false;\n if (this.autoHideLoadingUI) {\n this._scene.getEngine().hideLoadingUI();\n }\n }\n }\n _runTask(task) {\n const done = () => {\n try {\n if (this.onTaskSuccess) {\n this.onTaskSuccess(task);\n }\n this.onTaskSuccessObservable.notifyObservers(task);\n this._decreaseWaitingTasksCount(task);\n } catch (e) {\n error(\"Error executing task success callbacks\", e);\n }\n };\n const error = (message, exception) => {\n task._setErrorObject(message, exception);\n if (this.onTaskError) {\n this.onTaskError(task);\n } else if (!task.onError) {\n Logger.Error(this._formatTaskErrorMessage(task));\n }\n this.onTaskErrorObservable.notifyObservers(task);\n this._decreaseWaitingTasksCount(task);\n };\n task.run(this._scene, done, error);\n }\n _formatTaskErrorMessage(task) {\n let errorMessage = \"Unable to complete task \" + task.name;\n if (task.errorObject.message) {\n errorMessage += `: ${task.errorObject.message}`;\n }\n if (task.errorObject.exception) {\n errorMessage += `: ${task.errorObject.exception}`;\n }\n return errorMessage;\n }\n /**\n * Reset the AssetsManager and remove all tasks\n * @returns the current instance of the AssetsManager\n */\n reset() {\n this._isLoading = false;\n this._tasks = new Array();\n return this;\n }\n /**\n * Start the loading process\n * @returns the current instance of the AssetsManager\n */\n load() {\n if (this._isLoading) {\n return this;\n }\n this._isLoading = true;\n this._waitingTasksCount = this._tasks.length;\n this._totalTasksCount = this._tasks.length;\n if (this._waitingTasksCount === 0) {\n this._isLoading = false;\n if (this.onFinish) {\n this.onFinish(this._tasks);\n }\n this.onTasksDoneObservable.notifyObservers(this._tasks);\n return this;\n }\n if (this.useDefaultLoadingScreen) {\n this._scene.getEngine().displayLoadingUI();\n }\n for (let index = 0; index < this._tasks.length; index++) {\n const task = this._tasks[index];\n if (task.taskState === 0 /* AssetTaskState.INIT */) {\n this._runTask(task);\n }\n }\n return this;\n }\n /**\n * Start the loading process as an async operation\n * @returns a promise returning the list of failed tasks\n */\n loadAsync() {\n return new Promise((resolve, reject) => {\n if (this._isLoading) {\n resolve();\n return;\n }\n this.onTasksDoneObservable.addOnce(remainingTasks => {\n if (remainingTasks && remainingTasks.length) {\n reject(remainingTasks);\n } else {\n resolve();\n }\n });\n this.load();\n });\n }\n}","map":{"version":3,"names":["SceneLoader","Tools","Observable","Texture","CubeTexture","HDRCubeTexture","EquiRectangularCubeTexture","Logger","EngineStore","AssetTaskState","AbstractAssetTask","constructor","name","_isCompleted","_taskState","isCompleted","taskState","errorObject","_errorObject","_setErrorObject","message","exception","run","scene","onSuccess","onError","runTask","_onDoneCallback","msg","_onErrorCallback","Error","reset","e","AssetsProgressEvent","remainingCount","totalCount","task","ContainerAssetTask","meshesNames","rootUrl","sceneFilename","extension","LoadAssetContainer","container","loadedContainer","loadedMeshes","meshes","loadedTransformNodes","transformNodes","loadedParticleSystems","particleSystems","loadedSkeletons","skeletons","loadedAnimationGroups","animationGroups","MeshAssetTask","ImportMesh","AnimationAssetTask","filename","targetConverter","startingIndexForNewAnimatables","animatables","length","startingIndexForNewAnimationGroups","loadedAnimatables","ImportAnimations","slice","TextFileAssetTask","url","_loadFile","data","text","undefined","request","status","statusText","BinaryFileAssetTask","ImageAssetTask","img","Image","SetCorsBehavior","onload","image","onerror","err","src","TextureAssetTask","noMipmap","invertY","samplingMode","TRILINEAR_SAMPLINGMODE","texture","CubeTextureAssetTask","extensions","files","prefiltered","HDRCubeTextureAssetTask","size","generateHarmonics","gammaSpace","reserved","EquiRectangularCubeTextureAssetTask","AssetsManager","_isLoading","_tasks","Array","_waitingTasksCount","_totalTasksCount","onTaskSuccessObservable","onTaskErrorObservable","onTasksDoneObservable","onProgressObservable","useDefaultLoadingScreen","autoHideLoadingUI","_scene","LastCreatedScene","addContainerTask","taskName","push","addMeshTask","addTextFileTask","addBinaryFileTask","addImageTask","addTextureTask","addCubeTextureTask","addHDRCubeTextureTask","addEquiRectangularCubeTextureAssetTask","removeTask","index","indexOf","splice","_decreaseWaitingTasksCount","onProgress","notifyObservers","Log","currentTasks","onFinish","getEngine","hideLoadingUI","_runTask","done","onTaskSuccess","error","onTaskError","_formatTaskErrorMessage","errorMessage","load","displayLoadingUI","loadAsync","Promise","resolve","reject","addOnce","remainingTasks"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/@babylonjs/core/Misc/assetsManager.js"],"sourcesContent":["import { SceneLoader } from \"../Loading/sceneLoader.js\";\nimport { Tools } from \"./tools.js\";\nimport { Observable } from \"./observable.js\";\nimport { Texture } from \"../Materials/Textures/texture.js\";\nimport { CubeTexture } from \"../Materials/Textures/cubeTexture.js\";\nimport { HDRCubeTexture } from \"../Materials/Textures/hdrCubeTexture.js\";\nimport { EquiRectangularCubeTexture } from \"../Materials/Textures/equiRectangularCubeTexture.js\";\nimport { Logger } from \"../Misc/logger.js\";\nimport { EngineStore } from \"../Engines/engineStore.js\";\n/**\n * Defines the list of states available for a task inside a AssetsManager\n */\nexport var AssetTaskState;\n(function (AssetTaskState) {\n /**\n * Initialization\n */\n AssetTaskState[AssetTaskState[\"INIT\"] = 0] = \"INIT\";\n /**\n * Running\n */\n AssetTaskState[AssetTaskState[\"RUNNING\"] = 1] = \"RUNNING\";\n /**\n * Done\n */\n AssetTaskState[AssetTaskState[\"DONE\"] = 2] = \"DONE\";\n /**\n * Error\n */\n AssetTaskState[AssetTaskState[\"ERROR\"] = 3] = \"ERROR\";\n})(AssetTaskState || (AssetTaskState = {}));\n/**\n * Define an abstract asset task used with a AssetsManager class to load assets into a scene\n */\nexport class AbstractAssetTask {\n /**\n * Creates a new AssetsManager\n * @param name defines the name of the task\n */\n constructor(\n /**\n * Task name\n */ name) {\n this.name = name;\n this._isCompleted = false;\n this._taskState = 0 /* AssetTaskState.INIT */;\n }\n /**\n * Get if the task is completed\n */\n get isCompleted() {\n return this._isCompleted;\n }\n /**\n * Gets the current state of the task\n */\n get taskState() {\n return this._taskState;\n }\n /**\n * Gets the current error object (if task is in error)\n */\n get errorObject() {\n return this._errorObject;\n }\n /**\n * Internal only\n * @internal\n */\n _setErrorObject(message, exception) {\n if (this._errorObject) {\n return;\n }\n this._errorObject = {\n message: message,\n exception: exception,\n };\n }\n /**\n * Execute the current task\n * @param scene defines the scene where you want your assets to be loaded\n * @param onSuccess is a callback called when the task is successfully executed\n * @param onError is a callback called if an error occurs\n */\n run(scene, onSuccess, onError) {\n this._taskState = 1 /* AssetTaskState.RUNNING */;\n this.runTask(scene, () => {\n this._onDoneCallback(onSuccess, onError);\n }, (msg, exception) => {\n this._onErrorCallback(onError, msg, exception);\n });\n }\n /**\n * Execute the current task\n * @param scene defines the scene where you want your assets to be loaded\n * @param onSuccess is a callback called when the task is successfully executed\n * @param onError is a callback called if an error occurs\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n runTask(scene, onSuccess, onError) {\n throw new Error(\"runTask is not implemented\");\n }\n /**\n * Reset will set the task state back to INIT, so the next load call of the assets manager will execute this task again.\n * This can be used with failed tasks that have the reason for failure fixed.\n */\n reset() {\n this._taskState = 0 /* AssetTaskState.INIT */;\n }\n _onErrorCallback(onError, message, exception) {\n this._taskState = 3 /* AssetTaskState.ERROR */;\n this._errorObject = {\n message: message,\n exception: exception,\n };\n if (this.onError) {\n this.onError(this, message, exception);\n }\n onError();\n }\n _onDoneCallback(onSuccess, onError) {\n try {\n this._taskState = 2 /* AssetTaskState.DONE */;\n this._isCompleted = true;\n if (this.onSuccess) {\n this.onSuccess(this);\n }\n onSuccess();\n }\n catch (e) {\n this._onErrorCallback(onError, \"Task is done, error executing success callback(s)\", e);\n }\n }\n}\n/**\n * Class used to share progress information about assets loading\n */\nexport class AssetsProgressEvent {\n /**\n * Creates a AssetsProgressEvent\n * @param remainingCount defines the number of remaining tasks to process\n * @param totalCount defines the total number of tasks\n * @param task defines the task that was just processed\n */\n constructor(remainingCount, totalCount, task) {\n this.remainingCount = remainingCount;\n this.totalCount = totalCount;\n this.task = task;\n }\n}\n/**\n * Define a task used by AssetsManager to load assets into a container\n */\nexport class ContainerAssetTask extends AbstractAssetTask {\n /**\n * Creates a new ContainerAssetTask\n * @param name defines the name of the task\n * @param meshesNames defines the list of mesh's names you want to load\n * @param rootUrl defines the root url to use as a base to load your meshes and associated resources\n * @param sceneFilename defines the filename or File of the scene to load from\n * @param extension defines the extension to use to load the scene (if not defined, \".babylon\" will be used)\n */\n constructor(\n /**\n * Defines the name of the task\n */\n name, \n /**\n * Defines the list of mesh's names you want to load\n */\n meshesNames, \n /**\n * Defines the root url to use as a base to load your meshes and associated resources\n */\n rootUrl, \n /**\n * Defines the filename or File of the scene to load from\n */\n sceneFilename, \n /**\n * Defines the extension to use to load the scene (if not defined, \".babylon\" will be used)\n */\n extension) {\n super(name);\n this.name = name;\n this.meshesNames = meshesNames;\n this.rootUrl = rootUrl;\n this.sceneFilename = sceneFilename;\n this.extension = extension;\n }\n /**\n * Execute the current task\n * @param scene defines the scene where you want your assets to be loaded\n * @param onSuccess is a callback called when the task is successfully executed\n * @param onError is a callback called if an error occurs\n */\n runTask(scene, onSuccess, onError) {\n SceneLoader.LoadAssetContainer(this.rootUrl, this.sceneFilename, scene, (container) => {\n this.loadedContainer = container;\n this.loadedMeshes = container.meshes;\n this.loadedTransformNodes = container.transformNodes;\n this.loadedParticleSystems = container.particleSystems;\n this.loadedSkeletons = container.skeletons;\n this.loadedAnimationGroups = container.animationGroups;\n onSuccess();\n }, null, (scene, message, exception) => {\n onError(message, exception);\n }, this.extension);\n }\n}\n/**\n * Define a task used by AssetsManager to load meshes\n */\nexport class MeshAssetTask extends AbstractAssetTask {\n /**\n * Creates a new MeshAssetTask\n * @param name defines the name of the task\n * @param meshesNames defines the list of mesh's names you want to load\n * @param rootUrl defines the root url to use as a base to load your meshes and associated resources\n * @param sceneFilename defines the filename or File of the scene to load from\n * @param extension defines the extension to use to load the scene (if not defined, \".babylon\" will be used)\n */\n constructor(\n /**\n * Defines the name of the task\n */\n name, \n /**\n * Defines the list of mesh's names you want to load\n */\n meshesNames, \n /**\n * Defines the root url to use as a base to load your meshes and associated resources\n */\n rootUrl, \n /**\n * Defines the filename or File of the scene to load from\n */\n sceneFilename, \n /**\n * Defines the extension to use to load the scene (if not defined, \".babylon\" will be used)\n */\n extension) {\n super(name);\n this.name = name;\n this.meshesNames = meshesNames;\n this.rootUrl = rootUrl;\n this.sceneFilename = sceneFilename;\n this.extension = extension;\n }\n /**\n * Execute the current task\n * @param scene defines the scene where you want your assets to be loaded\n * @param onSuccess is a callback called when the task is successfully executed\n * @param onError is a callback called if an error occurs\n */\n runTask(scene, onSuccess, onError) {\n SceneLoader.ImportMesh(this.meshesNames, this.rootUrl, this.sceneFilename, scene, (meshes, particleSystems, skeletons, animationGroups, transformNodes) => {\n this.loadedMeshes = meshes;\n this.loadedTransformNodes = transformNodes;\n this.loadedParticleSystems = particleSystems;\n this.loadedSkeletons = skeletons;\n this.loadedAnimationGroups = animationGroups;\n onSuccess();\n }, null, (scene, message, exception) => {\n onError(message, exception);\n }, this.extension);\n }\n}\n/**\n * Define a task used by AssetsManager to load animations\n */\nexport class AnimationAssetTask extends AbstractAssetTask {\n /**\n * Creates a new AnimationAssetTask\n * @param name defines the name of the task\n * @param rootUrl defines the root url to use as a base to load your meshes and associated resources\n * @param filename defines the filename or File of the scene to load from\n * @param targetConverter defines a function used to convert animation targets from loaded scene to current scene (default: search node by name)\n * @param extension defines the extension to use to load the scene (if not defined, \".babylon\" will be used)\n */\n constructor(\n /**\n * Defines the name of the task\n */\n name, \n /**\n * Defines the root url to use as a base to load your meshes and associated resources\n */\n rootUrl, \n /**\n * Defines the filename to load from\n */\n filename, \n /**\n * Defines a function used to convert animation targets from loaded scene to current scene (default: search node by name)\n */\n targetConverter, \n /**\n * Defines the extension to use to load the scene (if not defined, \".babylon\" will be used)\n */\n extension) {\n super(name);\n this.name = name;\n this.rootUrl = rootUrl;\n this.filename = filename;\n this.targetConverter = targetConverter;\n this.extension = extension;\n }\n /**\n * Execute the current task\n * @param scene defines the scene where you want your assets to be loaded\n * @param onSuccess is a callback called when the task is successfully executed\n * @param onError is a callback called if an error occurs\n */\n runTask(scene, onSuccess, onError) {\n const startingIndexForNewAnimatables = scene.animatables.length;\n const startingIndexForNewAnimationGroups = scene.animationGroups.length;\n this.loadedAnimatables = [];\n this.loadedAnimationGroups = [];\n SceneLoader.ImportAnimations(this.rootUrl, this.filename, scene, false, 3 /* SceneLoaderAnimationGroupLoadingMode.NoSync */, this.targetConverter, () => {\n this.loadedAnimatables = scene.animatables.slice(startingIndexForNewAnimatables);\n this.loadedAnimationGroups = scene.animationGroups.slice(startingIndexForNewAnimationGroups);\n onSuccess();\n }, null, (scene, message, exception) => {\n onError(message, exception);\n }, this.extension);\n }\n}\n/**\n * Define a task used by AssetsManager to load text content\n */\nexport class TextFileAssetTask extends AbstractAssetTask {\n /**\n * Creates a new TextFileAssetTask object\n * @param name defines the name of the task\n * @param url defines the location of the file to load\n */\n constructor(\n /**\n * Defines the name of the task\n */\n name, \n /**\n * Defines the location of the file to load\n */\n url) {\n super(name);\n this.name = name;\n this.url = url;\n }\n /**\n * Execute the current task\n * @param scene defines the scene where you want your assets to be loaded\n * @param onSuccess is a callback called when the task is successfully executed\n * @param onError is a callback called if an error occurs\n */\n runTask(scene, onSuccess, onError) {\n scene._loadFile(this.url, (data) => {\n this.text = data;\n onSuccess();\n }, undefined, false, false, (request, exception) => {\n if (request) {\n onError(request.status + \" \" + request.statusText, exception);\n }\n });\n }\n}\n/**\n * Define a task used by AssetsManager to load binary data\n */\nexport class BinaryFileAssetTask extends AbstractAssetTask {\n /**\n * Creates a new BinaryFileAssetTask object\n * @param name defines the name of the new task\n * @param url defines the location of the file to load\n */\n constructor(\n /**\n * Defines the name of the task\n */\n name, \n /**\n * Defines the location of the file to load\n */\n url) {\n super(name);\n this.name = name;\n this.url = url;\n }\n /**\n * Execute the current task\n * @param scene defines the scene where you want your assets to be loaded\n * @param onSuccess is a callback called when the task is successfully executed\n * @param onError is a callback called if an error occurs\n */\n runTask(scene, onSuccess, onError) {\n scene._loadFile(this.url, (data) => {\n this.data = data;\n onSuccess();\n }, undefined, true, true, (request, exception) => {\n if (request) {\n onError(request.status + \" \" + request.statusText, exception);\n }\n });\n }\n}\n/**\n * Define a task used by AssetsManager to load images\n */\nexport class ImageAssetTask extends AbstractAssetTask {\n /**\n * Creates a new ImageAssetTask\n * @param name defines the name of the task\n * @param url defines the location of the image to load\n */\n constructor(\n /**\n * Defines the name of the task\n */\n name, \n /**\n * Defines the location of the image to load\n */\n url) {\n super(name);\n this.name = name;\n this.url = url;\n }\n /**\n * Execute the current task\n * @param scene defines the scene where you want your assets to be loaded\n * @param onSuccess is a callback called when the task is successfully executed\n * @param onError is a callback called if an error occurs\n */\n runTask(scene, onSuccess, onError) {\n const img = new Image();\n Tools.SetCorsBehavior(this.url, img);\n img.onload = () => {\n this.image = img;\n onSuccess();\n };\n img.onerror = (err) => {\n onError(\"Error loading image\", err);\n };\n img.src = this.url;\n }\n}\n/**\n * Define a task used by AssetsManager to load 2D textures\n */\nexport class TextureAssetTask extends AbstractAssetTask {\n /**\n * Creates a new TextureAssetTask object\n * @param name defines the name of the task\n * @param url defines the location of the file to load\n * @param noMipmap defines if mipmap should not be generated (default is false)\n * @param invertY defines if texture must be inverted on Y axis (default is true)\n * @param samplingMode defines the sampling mode to use (default is Texture.TRILINEAR_SAMPLINGMODE)\n */\n constructor(\n /**\n * Defines the name of the task\n */\n name, \n /**\n * Defines the location of the file to load\n */\n url, \n /**\n * Defines if mipmap should not be generated (default is false)\n */\n noMipmap, \n /**\n * [true] Defines if texture must be inverted on Y axis (default is true)\n */\n invertY = true, \n /**\n * [3] Defines the sampling mode to use (default is Texture.TRILINEAR_SAMPLINGMODE)\n */\n samplingMode = Texture.TRILINEAR_SAMPLINGMODE) {\n super(name);\n this.name = name;\n this.url = url;\n this.noMipmap = noMipmap;\n this.invertY = invertY;\n this.samplingMode = samplingMode;\n }\n /**\n * Execute the current task\n * @param scene defines the scene where you want your assets to be loaded\n * @param onSuccess is a callback called when the task is successfully executed\n * @param onError is a callback called if an error occurs\n */\n runTask(scene, onSuccess, onError) {\n const onload = () => {\n onSuccess();\n };\n const onerror = (message, exception) => {\n onError(message, exception);\n };\n this.texture = new Texture(this.url, scene, this.noMipmap, this.invertY, this.samplingMode, onload, onerror);\n }\n}\n/**\n * Define a task used by AssetsManager to load cube textures\n */\nexport class CubeTextureAssetTask extends AbstractAssetTask {\n /**\n * Creates a new CubeTextureAssetTask\n * @param name defines the name of the task\n * @param url defines the location of the files to load (You have to specify the folder where the files are + filename with no extension)\n * @param extensions defines the extensions to use to load files ([\"_px\", \"_py\", \"_pz\", \"_nx\", \"_ny\", \"_nz\"] by default)\n * @param noMipmap defines if mipmaps should not be generated (default is false)\n * @param files defines the explicit list of files (undefined by default)\n * @param prefiltered\n */\n constructor(\n /**\n * Defines the name of the task\n */\n name, \n /**\n * Defines the location of the files to load (You have to specify the folder where the files are + filename with no extension)\n */\n url, \n /**\n * Defines the extensions to use to load files ([\"_px\", \"_py\", \"_pz\", \"_nx\", \"_ny\", \"_nz\"] by default)\n */\n extensions, \n /**\n * Defines if mipmaps should not be generated (default is false)\n */\n noMipmap, \n /**\n * Defines the explicit list of files (undefined by default)\n */\n files, \n /**\n * Defines the prefiltered texture option (default is false)\n */\n prefiltered) {\n super(name);\n this.name = name;\n this.url = url;\n this.extensions = extensions;\n this.noMipmap = noMipmap;\n this.files = files;\n this.prefiltered = prefiltered;\n }\n /**\n * Execute the current task\n * @param scene defines the scene where you want your assets to be loaded\n * @param onSuccess is a callback called when the task is successfully executed\n * @param onError is a callback called if an error occurs\n */\n runTask(scene, onSuccess, onError) {\n const onload = () => {\n onSuccess();\n };\n const onerror = (message, exception) => {\n onError(message, exception);\n };\n this.texture = new CubeTexture(this.url, scene, this.extensions, this.noMipmap, this.files, onload, onerror, undefined, this.prefiltered);\n }\n}\n/**\n * Define a task used by AssetsManager to load HDR cube textures\n */\nexport class HDRCubeTextureAssetTask extends AbstractAssetTask {\n /**\n * Creates a new HDRCubeTextureAssetTask object\n * @param name defines the name of the task\n * @param url defines the location of the file to load\n * @param size defines the desired size (the more it increases the longer the generation will be) If the size is omitted this implies you are using a preprocessed cubemap.\n * @param noMipmap defines if mipmaps should not be generated (default is false)\n * @param generateHarmonics specifies whether you want to extract the polynomial harmonics during the generation process (default is true)\n * @param gammaSpace specifies if the texture will be use in gamma or linear space (the PBR material requires those texture in linear space, but the standard material would require them in Gamma space) (default is false)\n * @param reserved Internal use only\n */\n constructor(\n /**\n * Defines the name of the task\n */\n name, \n /**\n * Defines the location of the file to load\n */\n url, \n /**\n * Defines the desired size (the more it increases the longer the generation will be)\n */\n size, \n /**\n * [false] Defines if mipmaps should not be generated (default is false)\n */\n noMipmap = false, \n /**\n * [true] Specifies whether you want to extract the polynomial harmonics during the generation process (default is true)\n */\n generateHarmonics = true, \n /**\n * [false] Specifies if the texture will be use in gamma or linear space (the PBR material requires those texture in linear space, but the standard material would require them in Gamma space) (default is false)\n */\n gammaSpace = false, \n /**\n * [false] Internal Use Only\n */\n reserved = false) {\n super(name);\n this.name = name;\n this.url = url;\n this.size = size;\n this.noMipmap = noMipmap;\n this.generateHarmonics = generateHarmonics;\n this.gammaSpace = gammaSpace;\n this.reserved = reserved;\n }\n /**\n * Execute the current task\n * @param scene defines the scene where you want your assets to be loaded\n * @param onSuccess is a callback called when the task is successfully executed\n * @param onError is a callback called if an error occurs\n */\n runTask(scene, onSuccess, onError) {\n const onload = () => {\n onSuccess();\n };\n const onerror = (message, exception) => {\n onError(message, exception);\n };\n this.texture = new HDRCubeTexture(this.url, scene, this.size, this.noMipmap, this.generateHarmonics, this.gammaSpace, this.reserved, onload, onerror);\n }\n}\n/**\n * Define a task used by AssetsManager to load Equirectangular cube textures\n */\nexport class EquiRectangularCubeTextureAssetTask extends AbstractAssetTask {\n /**\n * Creates a new EquiRectangularCubeTextureAssetTask object\n * @param name defines the name of the task\n * @param url defines the location of the file to load\n * @param size defines the desired size (the more it increases the longer the generation will be)\n * If the size is omitted this implies you are using a preprocessed cubemap.\n * @param noMipmap defines if mipmaps should not be generated (default is false)\n * @param gammaSpace specifies if the texture will be used in gamma or linear space\n * (the PBR material requires those texture in linear space, but the standard material would require them in Gamma space)\n * (default is true)\n */\n constructor(\n /**\n * Defines the name of the task\n */\n name, \n /**\n * Defines the location of the file to load\n */\n url, \n /**\n * Defines the desired size (the more it increases the longer the generation will be)\n */\n size, \n /**\n * [false] Defines if mipmaps should not be generated (default is false)\n */\n noMipmap = false, \n /**\n * [true] Specifies if the texture will be use in gamma or linear space (the PBR material requires those texture in linear space,\n * but the standard material would require them in Gamma space) (default is true)\n */\n gammaSpace = true) {\n super(name);\n this.name = name;\n this.url = url;\n this.size = size;\n this.noMipmap = noMipmap;\n this.gammaSpace = gammaSpace;\n }\n /**\n * Execute the current task\n * @param scene defines the scene where you want your assets to be loaded\n * @param onSuccess is a callback called when the task is successfully executed\n * @param onError is a callback called if an error occurs\n */\n runTask(scene, onSuccess, onError) {\n const onload = () => {\n onSuccess();\n };\n const onerror = (message, exception) => {\n onError(message, exception);\n };\n this.texture = new EquiRectangularCubeTexture(this.url, scene, this.size, this.noMipmap, this.gammaSpace, onload, onerror);\n }\n}\n/**\n * This class can be used to easily import assets into a scene\n * @see https://doc.babylonjs.com/features/featuresDeepDive/importers/assetManager\n */\nexport class AssetsManager {\n /**\n * Creates a new AssetsManager\n * @param scene defines the scene to work on\n */\n constructor(scene) {\n this._isLoading = false;\n this._tasks = new Array();\n this._waitingTasksCount = 0;\n this._totalTasksCount = 0;\n /**\n * Observable called when all tasks are processed\n */\n this.onTaskSuccessObservable = new Observable();\n /**\n * Observable called when a task had an error\n */\n this.onTaskErrorObservable = new Observable();\n /**\n * Observable called when all tasks were executed\n */\n this.onTasksDoneObservable = new Observable();\n /**\n * Observable called when a task is done (whatever the result is)\n */\n this.onProgressObservable = new Observable();\n /**\n * Gets or sets a boolean defining if the AssetsManager should use the default loading screen\n * @see https://doc.babylonjs.com/features/featuresDeepDive/scene/customLoadingScreen\n */\n this.useDefaultLoadingScreen = true;\n /**\n * Gets or sets a boolean defining if the AssetsManager should automatically hide the loading screen\n * when all assets have been downloaded.\n * If set to false, you need to manually call in hideLoadingUI() once your scene is ready.\n */\n this.autoHideLoadingUI = true;\n this._scene = scene || EngineStore.LastCreatedScene;\n }\n /**\n * Add a ContainerAssetTask to the list of active tasks\n * @param taskName defines the name of the new task\n * @param meshesNames defines the name of meshes to load\n * @param rootUrl defines the root url to use to locate files\n * @param sceneFilename defines the filename of the scene file or the File itself\n * @param extension defines the extension to use to load the file\n * @returns a new ContainerAssetTask object\n */\n addContainerTask(taskName, meshesNames, rootUrl, sceneFilename, extension) {\n const task = new ContainerAssetTask(taskName, meshesNames, rootUrl, sceneFilename, extension);\n this._tasks.push(task);\n return task;\n }\n /**\n * Add a MeshAssetTask to the list of active tasks\n * @param taskName defines the name of the new task\n * @param meshesNames defines the name of meshes to load\n * @param rootUrl defines the root url to use to locate files\n * @param sceneFilename defines the filename of the scene file or the File itself\n * @param extension defines the extension to use to load the file\n * @returns a new MeshAssetTask object\n */\n addMeshTask(taskName, meshesNames, rootUrl, sceneFilename, extension) {\n const task = new MeshAssetTask(taskName, meshesNames, rootUrl, sceneFilename, extension);\n this._tasks.push(task);\n return task;\n }\n /**\n * Add a TextFileAssetTask to the list of active tasks\n * @param taskName defines the name of the new task\n * @param url defines the url of the file to load\n * @returns a new TextFileAssetTask object\n */\n addTextFileTask(taskName, url) {\n const task = new TextFileAssetTask(taskName, url);\n this._tasks.push(task);\n return task;\n }\n /**\n * Add a BinaryFileAssetTask to the list of active tasks\n * @param taskName defines the name of the new task\n * @param url defines the url of the file to load\n * @returns a new BinaryFileAssetTask object\n */\n addBinaryFileTask(taskName, url) {\n const task = new BinaryFileAssetTask(taskName, url);\n this._tasks.push(task);\n return task;\n }\n /**\n * Add a ImageAssetTask to the list of active tasks\n * @param taskName defines the name of the new task\n * @param url defines the url of the file to load\n * @returns a new ImageAssetTask object\n */\n addImageTask(taskName, url) {\n const task = new ImageAssetTask(taskName, url);\n this._tasks.push(task);\n return task;\n }\n /**\n * Add a TextureAssetTask to the list of active tasks\n * @param taskName defines the name of the new task\n * @param url defines the url of the file to load\n * @param noMipmap defines if the texture must not receive mipmaps (false by default)\n * @param invertY defines if you want to invert Y axis of the loaded texture (true by default)\n * @param samplingMode defines the sampling mode to use (Texture.TRILINEAR_SAMPLINGMODE by default)\n * @returns a new TextureAssetTask object\n */\n addTextureTask(taskName, url, noMipmap, invertY, samplingMode = Texture.TRILINEAR_SAMPLINGMODE) {\n const task = new TextureAssetTask(taskName, url, noMipmap, invertY, samplingMode);\n this._tasks.push(task);\n return task;\n }\n /**\n * Add a CubeTextureAssetTask to the list of active tasks\n * @param taskName defines the name of the new task\n * @param url defines the url of the file to load\n * @param extensions defines the extension to use to load the cube map (can be null)\n * @param noMipmap defines if the texture must not receive mipmaps (false by default)\n * @param files defines the list of files to load (can be null)\n * @param prefiltered defines the prefiltered texture option (default is false)\n * @returns a new CubeTextureAssetTask object\n */\n addCubeTextureTask(taskName, url, extensions, noMipmap, files, prefiltered) {\n const task = new CubeTextureAssetTask(taskName, url, extensions, noMipmap, files, prefiltered);\n this._tasks.push(task);\n return task;\n }\n /**\n *\n * Add a HDRCubeTextureAssetTask to the list of active tasks\n * @param taskName defines the name of the new task\n * @param url defines the url of the file to load\n * @param size defines the size you want for the cubemap (can be null)\n * @param noMipmap defines if the texture must not receive mipmaps (false by default)\n * @param generateHarmonics defines if you want to automatically generate (true by default)\n * @param gammaSpace specifies if the texture will be use in gamma or linear space (the PBR material requires those texture in linear space, but the standard material would require them in Gamma space) (default is false)\n * @param reserved Internal use only\n * @returns a new HDRCubeTextureAssetTask object\n */\n addHDRCubeTextureTask(taskName, url, size, noMipmap = false, generateHarmonics = true, gammaSpace = false, reserved = false) {\n const task = new HDRCubeTextureAssetTask(taskName, url, size, noMipmap, generateHarmonics, gammaSpace, reserved);\n this._tasks.push(task);\n return task;\n }\n /**\n *\n * Add a EquiRectangularCubeTextureAssetTask to the list of active tasks\n * @param taskName defines the name of the new task\n * @param url defines the url of the file to load\n * @param size defines the size you want for the cubemap (can be null)\n * @param noMipmap defines if the texture must not receive mipmaps (false by default)\n * @param gammaSpace Specifies if the texture will be used in gamma or linear space\n * (the PBR material requires those textures in linear space, but the standard material would require them in Gamma space)\n * @returns a new EquiRectangularCubeTextureAssetTask object\n */\n addEquiRectangularCubeTextureAssetTask(taskName, url, size, noMipmap = false, gammaSpace = true) {\n const task = new EquiRectangularCubeTextureAssetTask(taskName, url, size, noMipmap, gammaSpace);\n this._tasks.push(task);\n return task;\n }\n /**\n * Remove a task from the assets manager.\n * @param task the task to remove\n */\n removeTask(task) {\n const index = this._tasks.indexOf(task);\n if (index > -1) {\n this._tasks.splice(index, 1);\n }\n }\n _decreaseWaitingTasksCount(task) {\n this._waitingTasksCount--;\n try {\n if (this.onProgress) {\n this.onProgress(this._waitingTasksCount, this._totalTasksCount, task);\n }\n this.onProgressObservable.notifyObservers(new AssetsProgressEvent(this._waitingTasksCount, this._totalTasksCount, task));\n }\n catch (e) {\n Logger.Error(\"Error running progress callbacks.\");\n Logger.Log(e);\n }\n if (this._waitingTasksCount === 0) {\n try {\n const currentTasks = this._tasks.slice();\n if (this.onFinish) {\n // Calling onFinish with immutable array of tasks\n this.onFinish(currentTasks);\n }\n // Let's remove successful tasks\n for (const task of currentTasks) {\n if (task.taskState === 2 /* AssetTaskState.DONE */) {\n const index = this._tasks.indexOf(task);\n if (index > -1) {\n this._tasks.splice(index, 1);\n }\n }\n }\n this.onTasksDoneObservable.notifyObservers(this._tasks);\n }\n catch (e) {\n Logger.Error(\"Error running tasks-done callbacks.\");\n Logger.Log(e);\n }\n this._isLoading = false;\n if (this.autoHideLoadingUI) {\n this._scene.getEngine().hideLoadingUI();\n }\n }\n }\n _runTask(task) {\n const done = () => {\n try {\n if (this.onTaskSuccess) {\n this.onTaskSuccess(task);\n }\n this.onTaskSuccessObservable.notifyObservers(task);\n this._decreaseWaitingTasksCount(task);\n }\n catch (e) {\n error(\"Error executing task success callbacks\", e);\n }\n };\n const error = (message, exception) => {\n task._setErrorObject(message, exception);\n if (this.onTaskError) {\n this.onTaskError(task);\n }\n else if (!task.onError) {\n Logger.Error(this._formatTaskErrorMessage(task));\n }\n this.onTaskErrorObservable.notifyObservers(task);\n this._decreaseWaitingTasksCount(task);\n };\n task.run(this._scene, done, error);\n }\n _formatTaskErrorMessage(task) {\n let errorMessage = \"Unable to complete task \" + task.name;\n if (task.errorObject.message) {\n errorMessage += `: ${task.errorObject.message}`;\n }\n if (task.errorObject.exception) {\n errorMessage += `: ${task.errorObject.exception}`;\n }\n return errorMessage;\n }\n /**\n * Reset the AssetsManager and remove all tasks\n * @returns the current instance of the AssetsManager\n */\n reset() {\n this._isLoading = false;\n this._tasks = new Array();\n return this;\n }\n /**\n * Start the loading process\n * @returns the current instance of the AssetsManager\n */\n load() {\n if (this._isLoading) {\n return this;\n }\n this._isLoading = true;\n this._waitingTasksCount = this._tasks.length;\n this._totalTasksCount = this._tasks.length;\n if (this._waitingTasksCount === 0) {\n this._isLoading = false;\n if (this.onFinish) {\n this.onFinish(this._tasks);\n }\n this.onTasksDoneObservable.notifyObservers(this._tasks);\n return this;\n }\n if (this.useDefaultLoadingScreen) {\n this._scene.getEngine().displayLoadingUI();\n }\n for (let index = 0; index < this._tasks.length; index++) {\n const task = this._tasks[index];\n if (task.taskState === 0 /* AssetTaskState.INIT */) {\n this._runTask(task);\n }\n }\n return this;\n }\n /**\n * Start the loading process as an async operation\n * @returns a promise returning the list of failed tasks\n */\n loadAsync() {\n return new Promise((resolve, reject) => {\n if (this._isLoading) {\n resolve();\n return;\n }\n this.onTasksDoneObservable.addOnce((remainingTasks) => {\n if (remainingTasks && remainingTasks.length) {\n reject(remainingTasks);\n }\n else {\n resolve();\n }\n });\n this.load();\n });\n }\n}\n"],"mappings":"AAAA,SAASA,WAAW,QAAQ,2BAA2B;AACvD,SAASC,KAAK,QAAQ,YAAY;AAClC,SAASC,UAAU,QAAQ,iBAAiB;AAC5C,SAASC,OAAO,QAAQ,kCAAkC;AAC1D,SAASC,WAAW,QAAQ,sCAAsC;AAClE,SAASC,cAAc,QAAQ,yCAAyC;AACxE,SAASC,0BAA0B,QAAQ,qDAAqD;AAChG,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,SAASC,WAAW,QAAQ,2BAA2B;AACvD;AACA;AACA;AACA,OAAO,IAAIC,cAAc;AACzB,CAAC,UAAUA,cAAc,EAAE;EACvB;AACJ;AACA;EACIA,cAAc,CAACA,cAAc,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,MAAM;EACnD;AACJ;AACA;EACIA,cAAc,CAACA,cAAc,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,GAAG,SAAS;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