@onerjs/core 8.25.1 → 8.25.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (119) hide show
  1. package/Bones/bone.js +14 -54
  2. package/Bones/bone.js.map +1 -1
  3. package/Engines/AbstractEngine/abstractEngine.cubeTexture.js +1 -1
  4. package/Engines/AbstractEngine/abstractEngine.cubeTexture.js.map +1 -1
  5. package/Engines/Native/nativeShaderProcessors.js +3 -0
  6. package/Engines/Native/nativeShaderProcessors.js.map +1 -1
  7. package/Engines/WebGL/webGL2ShaderProcessors.js +3 -0
  8. package/Engines/WebGL/webGL2ShaderProcessors.js.map +1 -1
  9. package/Engines/WebGPU/webgpuShaderProcessorsGLSL.d.ts +3 -1
  10. package/Engines/WebGPU/webgpuShaderProcessorsGLSL.js +4 -1
  11. package/Engines/WebGPU/webgpuShaderProcessorsGLSL.js.map +1 -1
  12. package/Engines/WebGPU/webgpuShaderProcessorsWGSL.js +4 -1
  13. package/Engines/WebGPU/webgpuShaderProcessorsWGSL.js.map +1 -1
  14. package/Engines/abstractEngine.d.ts +1 -1
  15. package/Engines/abstractEngine.functions.d.ts +2 -2
  16. package/Engines/abstractEngine.functions.js.map +1 -1
  17. package/Engines/abstractEngine.js +2 -2
  18. package/Engines/abstractEngine.js.map +1 -1
  19. package/Engines/nullEngine.js +1 -0
  20. package/Engines/nullEngine.js.map +1 -1
  21. package/FrameGraph/Node/Blocks/Rendering/baseObjectRendererBlock.d.ts +3 -0
  22. package/FrameGraph/Node/Blocks/Rendering/baseObjectRendererBlock.js +10 -0
  23. package/FrameGraph/Node/Blocks/Rendering/baseObjectRendererBlock.js.map +1 -1
  24. package/FrameGraph/Node/Blocks/Rendering/geometryRendererBlock.d.ts +3 -0
  25. package/FrameGraph/Node/Blocks/Rendering/geometryRendererBlock.js +10 -0
  26. package/FrameGraph/Node/Blocks/Rendering/geometryRendererBlock.js.map +1 -1
  27. package/FrameGraph/Node/Blocks/Rendering/objectRendererBlock.js +8 -0
  28. package/FrameGraph/Node/Blocks/Rendering/objectRendererBlock.js.map +1 -1
  29. package/FrameGraph/Node/Blocks/Rendering/taaObjectRendererBlock.js +16 -0
  30. package/FrameGraph/Node/Blocks/Rendering/taaObjectRendererBlock.js.map +1 -1
  31. package/FrameGraph/Node/Blocks/inputBlock.js +2 -0
  32. package/FrameGraph/Node/Blocks/inputBlock.js.map +1 -1
  33. package/FrameGraph/Tasks/Rendering/geometryRendererTask.d.ts +6 -0
  34. package/FrameGraph/Tasks/Rendering/geometryRendererTask.js +16 -0
  35. package/FrameGraph/Tasks/Rendering/geometryRendererTask.js.map +1 -1
  36. package/FrameGraph/Tasks/Rendering/objectRendererTask.d.ts +8 -1
  37. package/FrameGraph/Tasks/Rendering/objectRendererTask.js +40 -1
  38. package/FrameGraph/Tasks/Rendering/objectRendererTask.js.map +1 -1
  39. package/FrameGraph/Tasks/Rendering/taaObjectRendererTask.d.ts +3 -1
  40. package/FrameGraph/Tasks/Rendering/taaObjectRendererTask.js +10 -7
  41. package/FrameGraph/Tasks/Rendering/taaObjectRendererTask.js.map +1 -1
  42. package/FrameGraph/frameGraph.d.ts +2 -2
  43. package/FrameGraph/frameGraph.js.map +1 -1
  44. package/FrameGraph/frameGraphTextureManager.js +4 -0
  45. package/FrameGraph/frameGraphTextureManager.js.map +1 -1
  46. package/Gizmos/cameraGizmo.js +11 -13
  47. package/Gizmos/cameraGizmo.js.map +1 -1
  48. package/Gizmos/planeDragGizmo.js +21 -13
  49. package/Gizmos/planeDragGizmo.js.map +1 -1
  50. package/Loading/sceneLoader.d.ts +3 -1
  51. package/Loading/sceneLoader.js +3 -2
  52. package/Loading/sceneLoader.js.map +1 -1
  53. package/Materials/Background/backgroundMaterial.js +1 -1
  54. package/Materials/Background/backgroundMaterial.js.map +1 -1
  55. package/Materials/GaussianSplatting/gaussianSplattingMaterial.js +1 -1
  56. package/Materials/GaussianSplatting/gaussianSplattingMaterial.js.map +1 -1
  57. package/Materials/Node/nodeMaterial.d.ts +1 -1
  58. package/Materials/Node/nodeMaterial.js +3 -14
  59. package/Materials/Node/nodeMaterial.js.map +1 -1
  60. package/Materials/PBR/pbrBaseMaterial.js +1 -1
  61. package/Materials/PBR/pbrBaseMaterial.js.map +1 -1
  62. package/Materials/Textures/renderTargetTexture.d.ts +5 -0
  63. package/Materials/Textures/renderTargetTexture.js +9 -0
  64. package/Materials/Textures/renderTargetTexture.js.map +1 -1
  65. package/Materials/material.d.ts +17 -1
  66. package/Materials/material.js +38 -7
  67. package/Materials/material.js.map +1 -1
  68. package/Materials/materialDefines.d.ts +1 -0
  69. package/Materials/materialDefines.js +1 -0
  70. package/Materials/materialDefines.js.map +1 -1
  71. package/Materials/materialHelper.functions.d.ts +2 -1
  72. package/Materials/materialHelper.functions.js +3 -1
  73. package/Materials/materialHelper.functions.js.map +1 -1
  74. package/Materials/standardMaterial.js +1 -1
  75. package/Materials/standardMaterial.js.map +1 -1
  76. package/Meshes/GaussianSplatting/gaussianSplattingMesh.js +3 -10
  77. package/Meshes/GaussianSplatting/gaussianSplattingMesh.js.map +1 -1
  78. package/Meshes/geometry.js +4 -4
  79. package/Meshes/geometry.js.map +1 -1
  80. package/Misc/assetsManager.d.ts +81 -25
  81. package/Misc/assetsManager.js +70 -32
  82. package/Misc/assetsManager.js.map +1 -1
  83. package/Misc/fileTools.d.ts +2 -2
  84. package/Misc/fileTools.js +3 -1
  85. package/Misc/fileTools.js.map +1 -1
  86. package/Misc/sceneSerializer.js +3 -1
  87. package/Misc/sceneSerializer.js.map +1 -1
  88. package/Particles/IParticleSystem.d.ts +6 -0
  89. package/Particles/IParticleSystem.js.map +1 -1
  90. package/Particles/gpuParticleSystem.d.ts +4 -0
  91. package/Particles/gpuParticleSystem.js +4 -0
  92. package/Particles/gpuParticleSystem.js.map +1 -1
  93. package/Particles/thinParticleSystem.d.ts +14 -0
  94. package/Particles/thinParticleSystem.js +19 -0
  95. package/Particles/thinParticleSystem.js.map +1 -1
  96. package/Physics/joinedPhysicsEngineComponent.js +1 -1
  97. package/Physics/joinedPhysicsEngineComponent.js.map +1 -1
  98. package/PostProcesses/RenderPipeline/Pipelines/ssao2RenderingPipeline.d.ts +5 -3
  99. package/PostProcesses/RenderPipeline/Pipelines/ssao2RenderingPipeline.js +22 -9
  100. package/PostProcesses/RenderPipeline/Pipelines/ssao2RenderingPipeline.js.map +1 -1
  101. package/PostProcesses/RenderPipeline/Pipelines/taaMaterialManager.js +3 -0
  102. package/PostProcesses/RenderPipeline/Pipelines/taaMaterialManager.js.map +1 -1
  103. package/Rendering/objectRenderer.d.ts +18 -2
  104. package/Rendering/objectRenderer.js +69 -29
  105. package/Rendering/objectRenderer.js.map +1 -1
  106. package/Rendering/outlineRenderer.d.ts +4 -0
  107. package/Rendering/outlineRenderer.js +10 -0
  108. package/Rendering/outlineRenderer.js.map +1 -1
  109. package/Shaders/pbr.vertex.js +1 -5
  110. package/Shaders/pbr.vertex.js.map +1 -1
  111. package/Shaders/ssao2.fragment.js +14 -2
  112. package/Shaders/ssao2.fragment.js.map +1 -1
  113. package/ShadersWGSL/ssao2.fragment.js +14 -2
  114. package/ShadersWGSL/ssao2.fragment.js.map +1 -1
  115. package/XR/features/WebXRDepthSensing.js +6 -2
  116. package/XR/features/WebXRDepthSensing.js.map +1 -1
  117. package/package.json +1 -1
  118. package/scene.js +2 -0
  119. package/scene.js.map +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"assetsManager.js","sourceRoot":"","sources":["../../../../dev/core/src/Misc/assetsManager.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,WAAW,EAAwC,MAAM,wBAAwB,CAAC;AAC3F,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAC;AAChE,OAAO,EAAE,cAA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GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,CAAC;YACtD,MAAM,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YAChC,IAAI,IAAI,CAAC,SAAS,gCAAwB,EAAE,CAAC;gBACzC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;YACxB,CAAC;QACL,CAAC;QAED,OAAO,IAAI,CAAC;IAChB,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,SAAS;QAClB,OAAO,MAAM,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YACzC,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;gBAClB,OAAO,EAAE,CAAC;gBACV,OAAO;YACX,CAAC;YACD,IAAI,CAAC,qBAAqB,CAAC,OAAO,CAAC,CAAC,cAAc,EAAE,EAAE;gBAClD,IAAI,cAAc,IAAI,cAAc,CAAC,MAAM,EAAE,CAAC;oBAC1C,2EAA2E;oBAC3E,MAAM,CAAC,cAAc,CAAC,CAAC;gBAC3B,CAAC;qBAAM,CAAC;oBACJ,OAAO,EAAE,CAAC;gBACd,CAAC;YACL,CAAC,CAAC,CAAC;YAEH,IAAI,CAAC,IAAI,EAAE,CAAC;QAChB,CAAC,CAAC,CAAC;IACP,CAAC;CACJ","sourcesContent":["import type { Scene } from \"../scene\";\r\nimport type { AbstractMesh } from \"../Meshes/abstractMesh\";\r\nimport type { TransformNode } from \"../Meshes/transformNode\";\r\nimport type { IParticleSystem } from \"../Particles/IParticleSystem\";\r\nimport type { Skeleton } from \"../Bones/skeleton\";\r\nimport { SceneLoader, SceneLoaderAnimationGroupLoadingMode } from \"../Loading/sceneLoader\";\r\nimport { Tools } from \"./tools\";\r\nimport { Observable } from \"./observable\";\r\nimport type { BaseTexture } from \"../Materials/Textures/baseTexture\";\r\nimport { Texture } from \"../Materials/Textures/texture\";\r\nimport { CubeTexture } from \"../Materials/Textures/cubeTexture\";\r\nimport { HDRCubeTexture } from \"../Materials/Textures/hdrCubeTexture\";\r\nimport { EquiRectangularCubeTexture } from \"../Materials/Textures/equiRectangularCubeTexture\";\r\nimport { Logger } from \"../Misc/logger\";\r\nimport type { Animatable } from \"../Animations/animatable.core\";\r\nimport type { AnimationGroup } from \"../Animations/animationGroup\";\r\nimport type { AssetContainer } from \"../assetContainer\";\r\nimport { EngineStore } from \"../Engines/engineStore\";\r\nimport type { Nullable } from \"../types\";\r\n\r\n/**\r\n * Defines the list of states available for a task inside a AssetsManager\r\n */\r\nexport const enum AssetTaskState {\r\n /**\r\n * Initialization\r\n */\r\n INIT,\r\n /**\r\n * Running\r\n */\r\n RUNNING,\r\n /**\r\n * Done\r\n */\r\n DONE,\r\n /**\r\n * Error\r\n */\r\n ERROR,\r\n}\r\n\r\n/**\r\n * Define an abstract asset task used with a AssetsManager class to load assets into a scene\r\n */\r\nexport abstract class AbstractAssetTask {\r\n /**\r\n * Callback called when the task is successful\r\n */\r\n public onSuccess: (task: any) => void;\r\n\r\n /**\r\n * Callback called when the task is not successful\r\n */\r\n public onError: (task: any, message?: string, exception?: any) => void;\r\n\r\n /**\r\n * Creates a new AssetsManager\r\n * @param name defines the name of the task\r\n */\r\n constructor(\r\n /**\r\n * Task name\r\n */ public name: string\r\n ) {}\r\n\r\n private _isCompleted = false;\r\n private _taskState = AssetTaskState.INIT;\r\n private _errorObject: { message?: string; exception?: any };\r\n\r\n /**\r\n * Get if the task is completed\r\n */\r\n public get isCompleted(): boolean {\r\n return this._isCompleted;\r\n }\r\n\r\n /**\r\n * Gets the current state of the task\r\n */\r\n public get taskState(): AssetTaskState {\r\n return this._taskState;\r\n }\r\n\r\n /**\r\n * Gets the current error object (if task is in error)\r\n */\r\n public get errorObject(): { message?: string; exception?: any } {\r\n return this._errorObject;\r\n }\r\n\r\n /**\r\n * Internal only\r\n * @internal\r\n */\r\n public _setErrorObject(message?: string, exception?: any) {\r\n if (this._errorObject) {\r\n return;\r\n }\r\n\r\n this._errorObject = {\r\n message: message,\r\n exception: exception,\r\n };\r\n }\r\n\r\n /**\r\n * Execute the current task\r\n * @param scene defines the scene where you want your assets to be loaded\r\n * @param onSuccess is a callback called when the task is successfully executed\r\n * @param onError is a callback called if an error occurs\r\n */\r\n public run(scene: Scene, onSuccess: () => void, onError: (message?: string, exception?: any) => void) {\r\n this._taskState = AssetTaskState.RUNNING;\r\n this.runTask(\r\n scene,\r\n () => {\r\n this._onDoneCallback(onSuccess, onError);\r\n },\r\n (msg, exception) => {\r\n this._onErrorCallback(onError, msg, exception);\r\n }\r\n );\r\n }\r\n\r\n /**\r\n * Execute the current task\r\n * @param scene defines the scene where you want your assets to be loaded\r\n * @param onSuccess is a callback called when the task is successfully executed\r\n * @param onError is a callback called if an error occurs\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n public runTask(scene: Scene, onSuccess: () => void, onError: (message?: string, exception?: any) => void) {\r\n throw new Error(\"runTask is not implemented\");\r\n }\r\n\r\n /**\r\n * Reset will set the task state back to INIT, so the next load call of the assets manager will execute this task again.\r\n * This can be used with failed tasks that have the reason for failure fixed.\r\n */\r\n public reset() {\r\n this._taskState = AssetTaskState.INIT;\r\n }\r\n\r\n private _onErrorCallback(onError: (message?: string, exception?: any) => void, message?: string, exception?: any) {\r\n this._taskState = AssetTaskState.ERROR;\r\n\r\n this._errorObject = {\r\n message: message,\r\n exception: exception,\r\n };\r\n\r\n if (this.onError) {\r\n this.onError(this, message, exception);\r\n }\r\n\r\n onError();\r\n }\r\n\r\n private _onDoneCallback(onSuccess: () => void, onError: (message?: string, exception?: any) => void) {\r\n try {\r\n this._taskState = AssetTaskState.DONE;\r\n this._isCompleted = true;\r\n\r\n if (this.onSuccess) {\r\n this.onSuccess(this);\r\n }\r\n\r\n onSuccess();\r\n } catch (e) {\r\n this._onErrorCallback(onError, \"Task is done, error executing success callback(s)\", e);\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * Define the interface used by progress events raised during assets loading\r\n */\r\nexport interface IAssetsProgressEvent {\r\n /**\r\n * Defines the number of remaining tasks to process\r\n */\r\n remainingCount: number;\r\n /**\r\n * Defines the total number of tasks\r\n */\r\n totalCount: number;\r\n /**\r\n * Defines the task that was just processed\r\n */\r\n task: AbstractAssetTask;\r\n}\r\n\r\n/**\r\n * Class used to share progress information about assets loading\r\n */\r\nexport class AssetsProgressEvent implements IAssetsProgressEvent {\r\n /**\r\n * Defines the number of remaining tasks to process\r\n */\r\n public remainingCount: number;\r\n /**\r\n * Defines the total number of tasks\r\n */\r\n public totalCount: number;\r\n /**\r\n * Defines the task that was just processed\r\n */\r\n public task: AbstractAssetTask;\r\n\r\n /**\r\n * Creates a AssetsProgressEvent\r\n * @param remainingCount defines the number of remaining tasks to process\r\n * @param totalCount defines the total number of tasks\r\n * @param task defines the task that was just processed\r\n */\r\n constructor(remainingCount: number, totalCount: number, task: AbstractAssetTask) {\r\n this.remainingCount = remainingCount;\r\n this.totalCount = totalCount;\r\n this.task = task;\r\n }\r\n}\r\n\r\n/**\r\n * Define a task used by AssetsManager to load assets into a container\r\n */\r\nexport class ContainerAssetTask extends AbstractAssetTask {\r\n /**\r\n * Get the loaded asset container\r\n */\r\n public loadedContainer: AssetContainer;\r\n /**\r\n * Gets the list of loaded transforms\r\n */\r\n public loadedTransformNodes: Array<TransformNode>;\r\n /**\r\n * Gets the list of loaded meshes\r\n */\r\n public loadedMeshes: Array<AbstractMesh>;\r\n /**\r\n * Gets the list of loaded particle systems\r\n */\r\n public loadedParticleSystems: Array<IParticleSystem>;\r\n /**\r\n * Gets the list of loaded skeletons\r\n */\r\n public loadedSkeletons: Array<Skeleton>;\r\n /**\r\n * Gets the list of loaded animation groups\r\n */\r\n public loadedAnimationGroups: Array<AnimationGroup>;\r\n\r\n /**\r\n * Callback called when the task is successful\r\n */\r\n public override onSuccess: (task: ContainerAssetTask) => void;\r\n\r\n /**\r\n * Callback called when the task is successful\r\n */\r\n public override onError: (task: ContainerAssetTask, message?: string, exception?: any) => void;\r\n\r\n /**\r\n * Creates a new ContainerAssetTask\r\n * @param name defines the name of the task\r\n * @param meshesNames defines the list of mesh's names you want to load\r\n * @param rootUrl defines the root url to use as a base to load your meshes and associated resources\r\n * @param sceneFilename defines the filename or File of the scene to load from\r\n * @param extension defines the extension to use to load the scene (if not defined, \".babylon\" will be used)\r\n */\r\n constructor(\r\n /**\r\n * Defines the name of the task\r\n */\r\n public override name: string,\r\n /**\r\n * Defines the list of mesh's names you want to load\r\n */\r\n public meshesNames: any,\r\n /**\r\n * Defines the root url to use as a base to load your meshes and associated resources\r\n */\r\n public rootUrl: string,\r\n /**\r\n * Defines the filename or File of the scene to load from\r\n */\r\n public sceneFilename: string | File,\r\n /**\r\n * Defines the extension to use to load the scene (if not defined, \".babylon\" will be used)\r\n */\r\n public extension?: string\r\n ) {\r\n super(name);\r\n }\r\n\r\n /**\r\n * Execute the current task\r\n * @param scene defines the scene where you want your assets to be loaded\r\n * @param onSuccess is a callback called when the task is successfully executed\r\n * @param onError is a callback called if an error occurs\r\n */\r\n public override runTask(scene: Scene, onSuccess: () => void, onError: (message?: string, exception?: any) => void) {\r\n SceneLoader.LoadAssetContainer(\r\n this.rootUrl,\r\n this.sceneFilename,\r\n scene,\r\n (container: AssetContainer) => {\r\n this.loadedContainer = container;\r\n this.loadedMeshes = container.meshes;\r\n this.loadedTransformNodes = container.transformNodes;\r\n this.loadedParticleSystems = container.particleSystems;\r\n this.loadedSkeletons = container.skeletons;\r\n this.loadedAnimationGroups = container.animationGroups;\r\n onSuccess();\r\n },\r\n null,\r\n (scene, message, exception) => {\r\n onError(message, exception);\r\n },\r\n this.extension\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Define a task used by AssetsManager to load meshes\r\n */\r\nexport class MeshAssetTask extends AbstractAssetTask {\r\n /**\r\n * Gets the list of loaded transforms\r\n */\r\n public loadedTransformNodes: Array<TransformNode>;\r\n /**\r\n * Gets the list of loaded meshes\r\n */\r\n public loadedMeshes: Array<AbstractMesh>;\r\n /**\r\n * Gets the list of loaded particle systems\r\n */\r\n public loadedParticleSystems: Array<IParticleSystem>;\r\n /**\r\n * Gets the list of loaded skeletons\r\n */\r\n public loadedSkeletons: Array<Skeleton>;\r\n /**\r\n * Gets the list of loaded animation groups\r\n */\r\n public loadedAnimationGroups: Array<AnimationGroup>;\r\n\r\n /**\r\n * Callback called when the task is successful\r\n */\r\n public override onSuccess: (task: MeshAssetTask) => void;\r\n\r\n /**\r\n * Callback called when the task is successful\r\n */\r\n public override onError: (task: MeshAssetTask, message?: string, exception?: any) => void;\r\n\r\n /**\r\n * Creates a new MeshAssetTask\r\n * @param name defines the name of the task\r\n * @param meshesNames defines the list of mesh's names you want to load\r\n * @param rootUrl defines the root url to use as a base to load your meshes and associated resources\r\n * @param sceneFilename defines the filename or File of the scene to load from\r\n * @param extension defines the extension to use to load the scene (if not defined, \".babylon\" will be used)\r\n */\r\n constructor(\r\n /**\r\n * Defines the name of the task\r\n */\r\n public override name: string,\r\n /**\r\n * Defines the list of mesh's names you want to load\r\n */\r\n public meshesNames: any,\r\n /**\r\n * Defines the root url to use as a base to load your meshes and associated resources\r\n */\r\n public rootUrl: string,\r\n /**\r\n * Defines the filename or File of the scene to load from\r\n */\r\n public sceneFilename: string | File,\r\n /**\r\n * Defines the extension to use to load the scene (if not defined, \".babylon\" will be used)\r\n */\r\n public extension?: string\r\n ) {\r\n super(name);\r\n }\r\n\r\n /**\r\n * Execute the current task\r\n * @param scene defines the scene where you want your assets to be loaded\r\n * @param onSuccess is a callback called when the task is successfully executed\r\n * @param onError is a callback called if an error occurs\r\n */\r\n public override runTask(scene: Scene, onSuccess: () => void, onError: (message?: string, exception?: any) => void) {\r\n SceneLoader.ImportMesh(\r\n this.meshesNames,\r\n this.rootUrl,\r\n this.sceneFilename,\r\n scene,\r\n (meshes: AbstractMesh[], particleSystems: IParticleSystem[], skeletons: Skeleton[], animationGroups: AnimationGroup[], transformNodes: TransformNode[]) => {\r\n this.loadedMeshes = meshes;\r\n this.loadedTransformNodes = transformNodes;\r\n this.loadedParticleSystems = particleSystems;\r\n this.loadedSkeletons = skeletons;\r\n this.loadedAnimationGroups = animationGroups;\r\n onSuccess();\r\n },\r\n null,\r\n (scene, message, exception) => {\r\n onError(message, exception);\r\n },\r\n this.extension\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Define a task used by AssetsManager to load animations\r\n */\r\nexport class AnimationAssetTask extends AbstractAssetTask {\r\n /**\r\n * Gets the list of loaded animation groups\r\n */\r\n public loadedAnimationGroups: Array<AnimationGroup>;\r\n /**\r\n * Gets the list of loaded animatables\r\n */\r\n public loadedAnimatables: Array<Animatable>;\r\n\r\n /**\r\n * Callback called when the task is successful\r\n */\r\n public override onSuccess: (task: AnimationAssetTask) => void;\r\n\r\n /**\r\n * Callback called when the task is successful\r\n */\r\n public override onError: (task: AnimationAssetTask, message?: string, exception?: any) => void;\r\n\r\n /**\r\n * Creates a new AnimationAssetTask\r\n * @param name defines the name of the task\r\n * @param rootUrl defines the root url to use as a base to load your meshes and associated resources\r\n * @param filename defines the filename or File of the scene to load from\r\n * @param targetConverter defines a function used to convert animation targets from loaded scene to current scene (default: search node by name)\r\n * @param extension defines the extension to use to load the scene (if not defined, \".babylon\" will be used)\r\n */\r\n constructor(\r\n /**\r\n * Defines the name of the task\r\n */\r\n public override name: string,\r\n /**\r\n * Defines the root url to use as a base to load your meshes and associated resources\r\n */\r\n public rootUrl: string,\r\n /**\r\n * Defines the filename to load from\r\n */\r\n public filename: string | File,\r\n /**\r\n * Defines a function used to convert animation targets from loaded scene to current scene (default: search node by name)\r\n */\r\n public targetConverter?: Nullable<(target: any) => any>,\r\n /**\r\n * Defines the extension to use to load the scene (if not defined, \".babylon\" will be used)\r\n */\r\n public extension?: string\r\n ) {\r\n super(name);\r\n }\r\n\r\n /**\r\n * Execute the current task\r\n * @param scene defines the scene where you want your assets to be loaded\r\n * @param onSuccess is a callback called when the task is successfully executed\r\n * @param onError is a callback called if an error occurs\r\n */\r\n public override runTask(scene: Scene, onSuccess: () => void, onError: (message?: string, exception?: any) => void) {\r\n const startingIndexForNewAnimatables = scene.animatables.length;\r\n const startingIndexForNewAnimationGroups = scene.animationGroups.length;\r\n this.loadedAnimatables = [];\r\n this.loadedAnimationGroups = [];\r\n SceneLoader.ImportAnimations(\r\n this.rootUrl,\r\n this.filename,\r\n scene,\r\n false,\r\n SceneLoaderAnimationGroupLoadingMode.NoSync,\r\n this.targetConverter,\r\n () => {\r\n this.loadedAnimatables = scene.animatables.slice(startingIndexForNewAnimatables);\r\n this.loadedAnimationGroups = scene.animationGroups.slice(startingIndexForNewAnimationGroups);\r\n\r\n onSuccess();\r\n },\r\n null,\r\n (scene, message, exception) => {\r\n onError(message, exception);\r\n },\r\n this.extension\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Define a task used by AssetsManager to load text content\r\n */\r\nexport class TextFileAssetTask extends AbstractAssetTask {\r\n /**\r\n * Gets the loaded text string\r\n */\r\n public text: string;\r\n\r\n /**\r\n * Callback called when the task is successful\r\n */\r\n public override onSuccess: (task: TextFileAssetTask) => void;\r\n\r\n /**\r\n * Callback called when the task is successful\r\n */\r\n public override onError: (task: TextFileAssetTask, message?: string, exception?: any) => void;\r\n\r\n /**\r\n * Creates a new TextFileAssetTask object\r\n * @param name defines the name of the task\r\n * @param url defines the location of the file to load\r\n */\r\n constructor(\r\n /**\r\n * Defines the name of the task\r\n */\r\n public override name: string,\r\n /**\r\n * Defines the location of the file to load\r\n */\r\n public url: string\r\n ) {\r\n super(name);\r\n }\r\n\r\n /**\r\n * Execute the current task\r\n * @param scene defines the scene where you want your assets to be loaded\r\n * @param onSuccess is a callback called when the task is successfully executed\r\n * @param onError is a callback called if an error occurs\r\n */\r\n public override runTask(scene: Scene, onSuccess: () => void, onError: (message?: string, exception?: any) => void) {\r\n scene._loadFile(\r\n this.url,\r\n (data) => {\r\n this.text = data as string;\r\n onSuccess();\r\n },\r\n undefined,\r\n false,\r\n false,\r\n (request, exception) => {\r\n if (request) {\r\n onError(request.status + \" \" + request.statusText, exception);\r\n }\r\n }\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Define a task used by AssetsManager to load binary data\r\n */\r\nexport class BinaryFileAssetTask extends AbstractAssetTask {\r\n /**\r\n * Gets the loaded data (as an array buffer)\r\n */\r\n public data: ArrayBuffer;\r\n\r\n /**\r\n * Callback called when the task is successful\r\n */\r\n public override onSuccess: (task: BinaryFileAssetTask) => void;\r\n /**\r\n * Callback called when the task is successful\r\n */\r\n public override onError: (task: BinaryFileAssetTask, message?: string, exception?: any) => void;\r\n\r\n /**\r\n * Creates a new BinaryFileAssetTask object\r\n * @param name defines the name of the new task\r\n * @param url defines the location of the file to load\r\n */\r\n constructor(\r\n /**\r\n * Defines the name of the task\r\n */\r\n public override name: string,\r\n /**\r\n * Defines the location of the file to load\r\n */\r\n public url: string\r\n ) {\r\n super(name);\r\n }\r\n\r\n /**\r\n * Execute the current task\r\n * @param scene defines the scene where you want your assets to be loaded\r\n * @param onSuccess is a callback called when the task is successfully executed\r\n * @param onError is a callback called if an error occurs\r\n */\r\n public override runTask(scene: Scene, onSuccess: () => void, onError: (message?: string, exception?: any) => void) {\r\n scene._loadFile(\r\n this.url,\r\n (data) => {\r\n this.data = data as ArrayBuffer;\r\n onSuccess();\r\n },\r\n undefined,\r\n true,\r\n true,\r\n (request, exception) => {\r\n if (request) {\r\n onError(request.status + \" \" + request.statusText, exception);\r\n }\r\n }\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Define a task used by AssetsManager to load images\r\n */\r\nexport class ImageAssetTask extends AbstractAssetTask {\r\n /**\r\n * Gets the loaded images\r\n */\r\n public image: HTMLImageElement;\r\n\r\n /**\r\n * Callback called when the task is successful\r\n */\r\n public override onSuccess: (task: ImageAssetTask) => void;\r\n /**\r\n * Callback called when the task is successful\r\n */\r\n public override onError: (task: ImageAssetTask, message?: string, exception?: any) => void;\r\n\r\n /**\r\n * Creates a new ImageAssetTask\r\n * @param name defines the name of the task\r\n * @param url defines the location of the image to load\r\n */\r\n constructor(\r\n /**\r\n * Defines the name of the task\r\n */\r\n public override name: string,\r\n /**\r\n * Defines the location of the image to load\r\n */\r\n public url: string\r\n ) {\r\n super(name);\r\n }\r\n\r\n /**\r\n * Execute the current task\r\n * @param scene defines the scene where you want your assets to be loaded\r\n * @param onSuccess is a callback called when the task is successfully executed\r\n * @param onError is a callback called if an error occurs\r\n */\r\n public override runTask(scene: Scene, onSuccess: () => void, onError: (message?: string, exception?: any) => void) {\r\n const img = new Image();\r\n\r\n Tools.SetCorsBehavior(this.url, img);\r\n\r\n img.onload = () => {\r\n this.image = img;\r\n onSuccess();\r\n };\r\n\r\n img.onerror = (err: string | Event): any => {\r\n onError(\"Error loading image\", err);\r\n };\r\n\r\n img.src = this.url;\r\n }\r\n}\r\n\r\n/**\r\n * Defines the interface used by texture loading tasks\r\n */\r\nexport interface ITextureAssetTask<Tex extends BaseTexture> {\r\n /**\r\n * Gets the loaded texture\r\n */\r\n texture: Tex;\r\n}\r\n\r\n/**\r\n * Define a task used by AssetsManager to load 2D textures\r\n */\r\nexport class TextureAssetTask extends AbstractAssetTask implements ITextureAssetTask<Texture> {\r\n /**\r\n * Gets the loaded texture\r\n */\r\n public texture: Texture;\r\n\r\n /**\r\n * Callback called when the task is successful\r\n */\r\n public override onSuccess: (task: TextureAssetTask) => void;\r\n /**\r\n * Callback called when the task is successful\r\n */\r\n public override onError: (task: TextureAssetTask, message?: string, exception?: any) => void;\r\n\r\n /**\r\n * Creates a new TextureAssetTask object\r\n * @param name defines the name of the task\r\n * @param url defines the location of the file to load\r\n * @param noMipmap defines if mipmap should not be generated (default is false)\r\n * @param invertY defines if texture must be inverted on Y axis (default is true)\r\n * @param samplingMode defines the sampling mode to use (default is Texture.TRILINEAR_SAMPLINGMODE)\r\n */\r\n constructor(\r\n /**\r\n * Defines the name of the task\r\n */\r\n public override name: string,\r\n /**\r\n * Defines the location of the file to load\r\n */\r\n public url: string,\r\n /**\r\n * Defines if mipmap should not be generated (default is false)\r\n */\r\n public noMipmap?: boolean,\r\n /**\r\n * [true] Defines if texture must be inverted on Y axis (default is true)\r\n */\r\n public invertY: boolean = true,\r\n /**\r\n * [3] Defines the sampling mode to use (default is Texture.TRILINEAR_SAMPLINGMODE)\r\n */\r\n public samplingMode: number = Texture.TRILINEAR_SAMPLINGMODE\r\n ) {\r\n super(name);\r\n }\r\n\r\n /**\r\n * Execute the current task\r\n * @param scene defines the scene where you want your assets to be loaded\r\n * @param onSuccess is a callback called when the task is successfully executed\r\n * @param onError is a callback called if an error occurs\r\n */\r\n public override runTask(scene: Scene, onSuccess: () => void, onError: (message?: string, exception?: any) => void) {\r\n const onload = () => {\r\n onSuccess();\r\n };\r\n\r\n const onerror = (message?: string, exception?: any) => {\r\n onError(message, exception);\r\n };\r\n\r\n this.texture = new Texture(this.url, scene, this.noMipmap, this.invertY, this.samplingMode, onload, onerror);\r\n }\r\n}\r\n\r\n/**\r\n * Define a task used by AssetsManager to load cube textures\r\n */\r\nexport class CubeTextureAssetTask extends AbstractAssetTask implements ITextureAssetTask<CubeTexture> {\r\n /**\r\n * Gets the loaded texture\r\n */\r\n public texture: CubeTexture;\r\n\r\n /**\r\n * Callback called when the task is successful\r\n */\r\n public override onSuccess: (task: CubeTextureAssetTask) => void;\r\n /**\r\n * Callback called when the task is successful\r\n */\r\n public override onError: (task: CubeTextureAssetTask, message?: string, exception?: any) => void;\r\n\r\n /**\r\n * Creates a new CubeTextureAssetTask\r\n * @param name defines the name of the task\r\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)\r\n * @param extensions defines the extensions to use to load files ([\"_px\", \"_py\", \"_pz\", \"_nx\", \"_ny\", \"_nz\"] by default)\r\n * @param noMipmap defines if mipmaps should not be generated (default is false)\r\n * @param files defines the explicit list of files (undefined by default)\r\n * @param prefiltered\r\n */\r\n constructor(\r\n /**\r\n * Defines the name of the task\r\n */\r\n public override name: string,\r\n /**\r\n * Defines the location of the files to load (You have to specify the folder where the files are + filename with no extension)\r\n */\r\n public url: string,\r\n /**\r\n * Defines the extensions to use to load files ([\"_px\", \"_py\", \"_pz\", \"_nx\", \"_ny\", \"_nz\"] by default)\r\n */\r\n public extensions?: string[],\r\n /**\r\n * Defines if mipmaps should not be generated (default is false)\r\n */\r\n public noMipmap?: boolean,\r\n /**\r\n * Defines the explicit list of files (undefined by default)\r\n */\r\n public files?: string[],\r\n /**\r\n * Defines the prefiltered texture option (default is false)\r\n */\r\n public prefiltered?: boolean\r\n ) {\r\n super(name);\r\n }\r\n\r\n /**\r\n * Execute the current task\r\n * @param scene defines the scene where you want your assets to be loaded\r\n * @param onSuccess is a callback called when the task is successfully executed\r\n * @param onError is a callback called if an error occurs\r\n */\r\n public override runTask(scene: Scene, onSuccess: () => void, onError: (message?: string, exception?: any) => void) {\r\n const onload = () => {\r\n onSuccess();\r\n };\r\n\r\n const onerror = (message?: string, exception?: any) => {\r\n onError(message, exception);\r\n };\r\n\r\n this.texture = new CubeTexture(this.url, scene, this.extensions, this.noMipmap, this.files, onload, onerror, undefined, this.prefiltered);\r\n }\r\n}\r\n\r\n/**\r\n * Define a task used by AssetsManager to load HDR cube textures\r\n */\r\nexport class HDRCubeTextureAssetTask extends AbstractAssetTask implements ITextureAssetTask<HDRCubeTexture> {\r\n /**\r\n * Gets the loaded texture\r\n */\r\n public texture: HDRCubeTexture;\r\n\r\n /**\r\n * Callback called when the task is successful\r\n */\r\n public override onSuccess: (task: HDRCubeTextureAssetTask) => void;\r\n /**\r\n * Callback called when the task is successful\r\n */\r\n public override onError: (task: HDRCubeTextureAssetTask, message?: string, exception?: any) => void;\r\n\r\n /**\r\n * Creates a new HDRCubeTextureAssetTask object\r\n * @param name defines the name of the task\r\n * @param url defines the location of the file to load\r\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.\r\n * @param noMipmap defines if mipmaps should not be generated (default is false)\r\n * @param generateHarmonics specifies whether you want to extract the polynomial harmonics during the generation process (default is true)\r\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)\r\n * @param reserved Internal use only\r\n */\r\n constructor(\r\n /**\r\n * Defines the name of the task\r\n */\r\n public override name: string,\r\n /**\r\n * Defines the location of the file to load\r\n */\r\n public url: string,\r\n /**\r\n * Defines the desired size (the more it increases the longer the generation will be)\r\n */\r\n public size: number,\r\n /**\r\n * [false] Defines if mipmaps should not be generated (default is false)\r\n */\r\n public noMipmap = false,\r\n /**\r\n * [true] Specifies whether you want to extract the polynomial harmonics during the generation process (default is true)\r\n */\r\n public generateHarmonics = true,\r\n /**\r\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)\r\n */\r\n public gammaSpace = false,\r\n /**\r\n * [false] Internal Use Only\r\n */\r\n public reserved = false\r\n ) {\r\n super(name);\r\n }\r\n\r\n /**\r\n * Execute the current task\r\n * @param scene defines the scene where you want your assets to be loaded\r\n * @param onSuccess is a callback called when the task is successfully executed\r\n * @param onError is a callback called if an error occurs\r\n */\r\n public override runTask(scene: Scene, onSuccess: () => void, onError: (message?: string, exception?: any) => void) {\r\n const onload = () => {\r\n onSuccess();\r\n };\r\n\r\n const onerror = (message?: string, exception?: any) => {\r\n onError(message, exception);\r\n };\r\n\r\n this.texture = new HDRCubeTexture(this.url, scene, this.size, this.noMipmap, this.generateHarmonics, this.gammaSpace, this.reserved, onload, onerror);\r\n }\r\n}\r\n\r\n/**\r\n * Define a task used by AssetsManager to load Equirectangular cube textures\r\n */\r\nexport class EquiRectangularCubeTextureAssetTask extends AbstractAssetTask implements ITextureAssetTask<EquiRectangularCubeTexture> {\r\n /**\r\n * Gets the loaded texture\r\n */\r\n public texture: EquiRectangularCubeTexture;\r\n\r\n /**\r\n * Callback called when the task is successful\r\n */\r\n public override onSuccess: (task: EquiRectangularCubeTextureAssetTask) => void;\r\n /**\r\n * Callback called when the task is successful\r\n */\r\n public override onError: (task: EquiRectangularCubeTextureAssetTask, message?: string, exception?: any) => void;\r\n\r\n /**\r\n * Creates a new EquiRectangularCubeTextureAssetTask object\r\n * @param name defines the name of the task\r\n * @param url defines the location of the file to load\r\n * @param size defines the desired size (the more it increases the longer the generation will be)\r\n * If the size is omitted this implies you are using a preprocessed cubemap.\r\n * @param noMipmap defines if mipmaps should not be generated (default is false)\r\n * @param gammaSpace specifies if the texture will be used in gamma or linear space\r\n * (the PBR material requires those texture in linear space, but the standard material would require them in Gamma space)\r\n * (default is true)\r\n */\r\n constructor(\r\n /**\r\n * Defines the name of the task\r\n */\r\n public override name: string,\r\n /**\r\n * Defines the location of the file to load\r\n */\r\n public url: string,\r\n /**\r\n * Defines the desired size (the more it increases the longer the generation will be)\r\n */\r\n public size: number,\r\n /**\r\n * [false] Defines if mipmaps should not be generated (default is false)\r\n */\r\n public noMipmap: boolean = false,\r\n /**\r\n * [true] Specifies if the texture will be use in gamma or linear space (the PBR material requires those texture in linear space,\r\n * but the standard material would require them in Gamma space) (default is true)\r\n */\r\n public gammaSpace: boolean = true\r\n ) {\r\n super(name);\r\n }\r\n\r\n /**\r\n * Execute the current task\r\n * @param scene defines the scene where you want your assets to be loaded\r\n * @param onSuccess is a callback called when the task is successfully executed\r\n * @param onError is a callback called if an error occurs\r\n */\r\n public override runTask(scene: Scene, onSuccess: () => void, onError: (message?: string, exception?: any) => void): void {\r\n const onload = () => {\r\n onSuccess();\r\n };\r\n\r\n const onerror = (message?: string, exception?: any) => {\r\n onError(message, exception);\r\n };\r\n\r\n this.texture = new EquiRectangularCubeTexture(this.url, scene, this.size, this.noMipmap, this.gammaSpace, onload, onerror);\r\n }\r\n}\r\n\r\n/**\r\n * This class can be used to easily import assets into a scene\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/importers/assetManager\r\n */\r\nexport class AssetsManager {\r\n private _scene: Scene;\r\n private _isLoading = false;\r\n\r\n protected _tasks = new Array<AbstractAssetTask>();\r\n protected _waitingTasksCount = 0;\r\n protected _totalTasksCount = 0;\r\n\r\n /**\r\n * Callback called when all tasks are processed\r\n */\r\n public onFinish: (tasks: AbstractAssetTask[]) => void;\r\n\r\n /**\r\n * Callback called when a task is successful\r\n */\r\n public onTaskSuccess: (task: AbstractAssetTask) => void;\r\n\r\n /**\r\n * Callback called when a task had an error\r\n */\r\n public onTaskError: (task: AbstractAssetTask) => void;\r\n\r\n /**\r\n * Callback called when a task is done (whatever the result is)\r\n */\r\n public onProgress: (remainingCount: number, totalCount: number, task: AbstractAssetTask) => void;\r\n\r\n /**\r\n * Observable called when all tasks are processed\r\n */\r\n public onTaskSuccessObservable = new Observable<AbstractAssetTask>();\r\n\r\n /**\r\n * Observable called when a task had an error\r\n */\r\n public onTaskErrorObservable = new Observable<AbstractAssetTask>();\r\n\r\n /**\r\n * Observable called when all tasks were executed\r\n */\r\n public onTasksDoneObservable = new Observable<AbstractAssetTask[]>();\r\n\r\n /**\r\n * Observable called when a task is done (whatever the result is)\r\n */\r\n public onProgressObservable = new Observable<IAssetsProgressEvent>();\r\n\r\n /**\r\n * Gets or sets a boolean defining if the AssetsManager should use the default loading screen\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/scene/customLoadingScreen\r\n */\r\n public useDefaultLoadingScreen = true;\r\n\r\n /**\r\n * Gets or sets a boolean defining if the AssetsManager should automatically hide the loading screen\r\n * when all assets have been downloaded.\r\n * If set to false, you need to manually call in hideLoadingUI() once your scene is ready.\r\n */\r\n public autoHideLoadingUI = true;\r\n\r\n /**\r\n * Creates a new AssetsManager\r\n * @param scene defines the scene to work on\r\n */\r\n constructor(scene?: Scene) {\r\n this._scene = scene || <Scene>EngineStore.LastCreatedScene;\r\n }\r\n\r\n /**\r\n * Add a ContainerAssetTask to the list of active tasks\r\n * @param taskName defines the name of the new task\r\n * @param meshesNames defines the name of meshes to load\r\n * @param rootUrl defines the root url to use to locate files\r\n * @param sceneFilename defines the filename of the scene file or the File itself\r\n * @param extension defines the extension to use to load the file\r\n * @returns a new ContainerAssetTask object\r\n */\r\n public addContainerTask(taskName: string, meshesNames: any, rootUrl: string, sceneFilename: string | File, extension?: string): ContainerAssetTask {\r\n const task = new ContainerAssetTask(taskName, meshesNames, rootUrl, sceneFilename, extension);\r\n this._tasks.push(task);\r\n\r\n return task;\r\n }\r\n\r\n /**\r\n * Add a MeshAssetTask to the list of active tasks\r\n * @param taskName defines the name of the new task\r\n * @param meshesNames defines the name of meshes to load\r\n * @param rootUrl defines the root url to use to locate files\r\n * @param sceneFilename defines the filename of the scene file or the File itself\r\n * @param extension defines the extension to use to load the file\r\n * @returns a new MeshAssetTask object\r\n */\r\n public addMeshTask(taskName: string, meshesNames: any, rootUrl: string, sceneFilename: string | File, extension?: string): MeshAssetTask {\r\n const task = new MeshAssetTask(taskName, meshesNames, rootUrl, sceneFilename, extension);\r\n this._tasks.push(task);\r\n\r\n return task;\r\n }\r\n\r\n /**\r\n * Add a TextFileAssetTask to the list of active tasks\r\n * @param taskName defines the name of the new task\r\n * @param url defines the url of the file to load\r\n * @returns a new TextFileAssetTask object\r\n */\r\n public addTextFileTask(taskName: string, url: string): TextFileAssetTask {\r\n const task = new TextFileAssetTask(taskName, url);\r\n this._tasks.push(task);\r\n\r\n return task;\r\n }\r\n\r\n /**\r\n * Add a BinaryFileAssetTask to the list of active tasks\r\n * @param taskName defines the name of the new task\r\n * @param url defines the url of the file to load\r\n * @returns a new BinaryFileAssetTask object\r\n */\r\n public addBinaryFileTask(taskName: string, url: string): BinaryFileAssetTask {\r\n const task = new BinaryFileAssetTask(taskName, url);\r\n this._tasks.push(task);\r\n\r\n return task;\r\n }\r\n\r\n /**\r\n * Add a ImageAssetTask to the list of active tasks\r\n * @param taskName defines the name of the new task\r\n * @param url defines the url of the file to load\r\n * @returns a new ImageAssetTask object\r\n */\r\n public addImageTask(taskName: string, url: string): ImageAssetTask {\r\n const task = new ImageAssetTask(taskName, url);\r\n this._tasks.push(task);\r\n\r\n return task;\r\n }\r\n\r\n /**\r\n * Add a TextureAssetTask to the list of active tasks\r\n * @param taskName defines the name of the new task\r\n * @param url defines the url of the file to load\r\n * @param noMipmap defines if the texture must not receive mipmaps (false by default)\r\n * @param invertY defines if you want to invert Y axis of the loaded texture (true by default)\r\n * @param samplingMode defines the sampling mode to use (Texture.TRILINEAR_SAMPLINGMODE by default)\r\n * @returns a new TextureAssetTask object\r\n */\r\n public addTextureTask(taskName: string, url: string, noMipmap?: boolean, invertY?: boolean, samplingMode: number = Texture.TRILINEAR_SAMPLINGMODE): TextureAssetTask {\r\n const task = new TextureAssetTask(taskName, url, noMipmap, invertY, samplingMode);\r\n this._tasks.push(task);\r\n\r\n return task;\r\n }\r\n\r\n /**\r\n * Add a CubeTextureAssetTask to the list of active tasks\r\n * @param taskName defines the name of the new task\r\n * @param url defines the url of the file to load\r\n * @param extensions defines the extension to use to load the cube map (can be null)\r\n * @param noMipmap defines if the texture must not receive mipmaps (false by default)\r\n * @param files defines the list of files to load (can be null)\r\n * @param prefiltered defines the prefiltered texture option (default is false)\r\n * @returns a new CubeTextureAssetTask object\r\n */\r\n public addCubeTextureTask(taskName: string, url: string, extensions?: string[], noMipmap?: boolean, files?: string[], prefiltered?: boolean): CubeTextureAssetTask {\r\n const task = new CubeTextureAssetTask(taskName, url, extensions, noMipmap, files, prefiltered);\r\n this._tasks.push(task);\r\n\r\n return task;\r\n }\r\n\r\n /**\r\n *\r\n * Add a HDRCubeTextureAssetTask to the list of active tasks\r\n * @param taskName defines the name of the new task\r\n * @param url defines the url of the file to load\r\n * @param size defines the size you want for the cubemap (can be null)\r\n * @param noMipmap defines if the texture must not receive mipmaps (false by default)\r\n * @param generateHarmonics defines if you want to automatically generate (true by default)\r\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)\r\n * @param reserved Internal use only\r\n * @returns a new HDRCubeTextureAssetTask object\r\n */\r\n public addHDRCubeTextureTask(\r\n taskName: string,\r\n url: string,\r\n size: number,\r\n noMipmap = false,\r\n generateHarmonics = true,\r\n gammaSpace = false,\r\n reserved = false\r\n ): HDRCubeTextureAssetTask {\r\n const task = new HDRCubeTextureAssetTask(taskName, url, size, noMipmap, generateHarmonics, gammaSpace, reserved);\r\n this._tasks.push(task);\r\n\r\n return task;\r\n }\r\n\r\n /**\r\n *\r\n * Add a EquiRectangularCubeTextureAssetTask to the list of active tasks\r\n * @param taskName defines the name of the new task\r\n * @param url defines the url of the file to load\r\n * @param size defines the size you want for the cubemap (can be null)\r\n * @param noMipmap defines if the texture must not receive mipmaps (false by default)\r\n * @param gammaSpace Specifies if the texture will be used in gamma or linear space\r\n * (the PBR material requires those textures in linear space, but the standard material would require them in Gamma space)\r\n * @returns a new EquiRectangularCubeTextureAssetTask object\r\n */\r\n public addEquiRectangularCubeTextureAssetTask(taskName: string, url: string, size: number, noMipmap = false, gammaSpace = true): EquiRectangularCubeTextureAssetTask {\r\n const task = new EquiRectangularCubeTextureAssetTask(taskName, url, size, noMipmap, gammaSpace);\r\n this._tasks.push(task);\r\n\r\n return task;\r\n }\r\n\r\n /**\r\n * Remove a task from the assets manager.\r\n * @param task the task to remove\r\n */\r\n public removeTask(task: AbstractAssetTask) {\r\n const index = this._tasks.indexOf(task);\r\n\r\n if (index > -1) {\r\n this._tasks.splice(index, 1);\r\n }\r\n }\r\n\r\n private _decreaseWaitingTasksCount(task: AbstractAssetTask): void {\r\n this._waitingTasksCount--;\r\n\r\n try {\r\n if (this.onProgress) {\r\n this.onProgress(this._waitingTasksCount, this._totalTasksCount, task);\r\n }\r\n\r\n this.onProgressObservable.notifyObservers(new AssetsProgressEvent(this._waitingTasksCount, this._totalTasksCount, task));\r\n } catch (e) {\r\n Logger.Error(\"Error running progress callbacks.\");\r\n Logger.Log(e);\r\n }\r\n\r\n if (this._waitingTasksCount === 0) {\r\n try {\r\n const currentTasks = this._tasks.slice();\r\n\r\n if (this.onFinish) {\r\n // Calling onFinish with immutable array of tasks\r\n this.onFinish(currentTasks);\r\n }\r\n\r\n // Let's remove successful tasks\r\n for (const task of currentTasks) {\r\n if (task.taskState === AssetTaskState.DONE) {\r\n const index = this._tasks.indexOf(task);\r\n\r\n if (index > -1) {\r\n this._tasks.splice(index, 1);\r\n }\r\n }\r\n }\r\n\r\n this.onTasksDoneObservable.notifyObservers(this._tasks);\r\n } catch (e) {\r\n Logger.Error(\"Error running tasks-done callbacks.\");\r\n Logger.Log(e);\r\n }\r\n this._isLoading = false;\r\n if (this.autoHideLoadingUI) {\r\n this._scene.getEngine().hideLoadingUI();\r\n }\r\n }\r\n }\r\n\r\n private _runTask(task: AbstractAssetTask): void {\r\n const done = () => {\r\n try {\r\n if (this.onTaskSuccess) {\r\n this.onTaskSuccess(task);\r\n }\r\n this.onTaskSuccessObservable.notifyObservers(task);\r\n this._decreaseWaitingTasksCount(task);\r\n } catch (e) {\r\n error(\"Error executing task success callbacks\", e);\r\n }\r\n };\r\n\r\n const error = (message?: string, exception?: any) => {\r\n task._setErrorObject(message, exception);\r\n\r\n if (this.onTaskError) {\r\n this.onTaskError(task);\r\n } else if (!task.onError) {\r\n Logger.Error(this._formatTaskErrorMessage(task));\r\n }\r\n this.onTaskErrorObservable.notifyObservers(task);\r\n this._decreaseWaitingTasksCount(task);\r\n };\r\n\r\n task.run(this._scene, done, error);\r\n }\r\n\r\n private _formatTaskErrorMessage(task: AbstractAssetTask) {\r\n let errorMessage = \"Unable to complete task \" + task.name;\r\n\r\n if (task.errorObject.message) {\r\n errorMessage += `: ${task.errorObject.message}`;\r\n }\r\n if (task.errorObject.exception) {\r\n errorMessage += `: ${task.errorObject.exception}`;\r\n }\r\n\r\n return errorMessage;\r\n }\r\n\r\n /**\r\n * Reset the AssetsManager and remove all tasks\r\n * @returns the current instance of the AssetsManager\r\n */\r\n public reset(): AssetsManager {\r\n this._isLoading = false;\r\n this._tasks = new Array<AbstractAssetTask>();\r\n return this;\r\n }\r\n\r\n /**\r\n * Start the loading process\r\n * @returns the current instance of the AssetsManager\r\n */\r\n public load(): AssetsManager {\r\n if (this._isLoading) {\r\n return this;\r\n }\r\n this._isLoading = true;\r\n this._waitingTasksCount = this._tasks.length;\r\n this._totalTasksCount = this._tasks.length;\r\n\r\n if (this._waitingTasksCount === 0) {\r\n this._isLoading = false;\r\n if (this.onFinish) {\r\n this.onFinish(this._tasks);\r\n }\r\n this.onTasksDoneObservable.notifyObservers(this._tasks);\r\n return this;\r\n }\r\n\r\n if (this.useDefaultLoadingScreen) {\r\n this._scene.getEngine().displayLoadingUI();\r\n }\r\n\r\n for (let index = 0; index < this._tasks.length; index++) {\r\n const task = this._tasks[index];\r\n if (task.taskState === AssetTaskState.INIT) {\r\n this._runTask(task);\r\n }\r\n }\r\n\r\n return this;\r\n }\r\n\r\n /**\r\n * Start the loading process as an async operation\r\n * @returns a promise returning the list of failed tasks\r\n */\r\n public async loadAsync(): Promise<void> {\r\n return await new Promise((resolve, reject) => {\r\n if (this._isLoading) {\r\n resolve();\r\n return;\r\n }\r\n this.onTasksDoneObservable.addOnce((remainingTasks) => {\r\n if (remainingTasks && remainingTasks.length) {\r\n // eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors\r\n reject(remainingTasks);\r\n } else {\r\n resolve();\r\n }\r\n });\r\n\r\n this.load();\r\n });\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"assetsManager.js","sourceRoot":"","sources":["../../../../dev/core/src/Misc/assetsManager.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,WAAW,EAAwC,MAAM,wBAAwB,CAAC;AAC3F,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAG1C,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAExD,OAAO,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAC;AAChE,OAAO,EAAE,cAAc,EAAE,MAAM,sCAAsC,CAAC;AACtE,OAAO,EAAE,0BAA0B,EAAE,MAAM,kDAAkD,CAAC;AAC9F,OAAO,EAAE,MAAM,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AAc,CAAC,MAAM,EAAE,CAAC;oBAC1C,2EAA2E;oBAC3E,MAAM,CAAC,cAAc,CAAC,CAAC;gBAC3B,CAAC;qBAAM,CAAC;oBACJ,OAAO,EAAE,CAAC;gBACd,CAAC;YACL,CAAC,CAAC,CAAC;YAEH,IAAI,CAAC,IAAI,EAAE,CAAC;QAChB,CAAC,CAAC,CAAC;IACP,CAAC;CACJ","sourcesContent":["import type { Scene } from \"../scene\";\r\nimport type { AbstractMesh } from \"../Meshes/abstractMesh\";\r\nimport type { TransformNode } from \"../Meshes/transformNode\";\r\nimport type { IParticleSystem } from \"../Particles/IParticleSystem\";\r\nimport type { Skeleton } from \"../Bones/skeleton\";\r\nimport type { PluginOptions } from \"../Loading/sceneLoader\";\r\nimport { SceneLoader, SceneLoaderAnimationGroupLoadingMode } from \"../Loading/sceneLoader\";\r\nimport { Tools } from \"./tools\";\r\nimport { Observable } from \"./observable\";\r\nimport type { BaseTexture } from \"../Materials/Textures/baseTexture\";\r\nimport type { ITextureCreationOptions } from \"../Materials/Textures/texture\";\r\nimport { Texture } from \"../Materials/Textures/texture\";\r\nimport type { ICubeTextureCreationOptions } from \"../Materials/Textures/cubeTexture\";\r\nimport { CubeTexture } from \"../Materials/Textures/cubeTexture\";\r\nimport { HDRCubeTexture } from \"../Materials/Textures/hdrCubeTexture\";\r\nimport { EquiRectangularCubeTexture } from \"../Materials/Textures/equiRectangularCubeTexture\";\r\nimport { Logger } from \"../Misc/logger\";\r\nimport type { Animatable } from \"../Animations/animatable.core\";\r\nimport type { AnimationGroup } from \"../Animations/animationGroup\";\r\nimport type { AssetContainer } from \"../assetContainer\";\r\nimport { EngineStore } from \"../Engines/engineStore\";\r\nimport type { Nullable } from \"../types\";\r\n\r\n/**\r\n * Defines the list of states available for a task inside a AssetsManager\r\n */\r\nexport const enum AssetTaskState {\r\n /**\r\n * Initialization\r\n */\r\n INIT,\r\n /**\r\n * Running\r\n */\r\n RUNNING,\r\n /**\r\n * Done\r\n */\r\n DONE,\r\n /**\r\n * Error\r\n */\r\n ERROR,\r\n}\r\n\r\n/**\r\n * Define an abstract asset task used with a AssetsManager class to load assets into a scene\r\n */\r\nexport abstract class AbstractAssetTask {\r\n /**\r\n * Callback called when the task is successful\r\n */\r\n public onSuccess: (task: any) => void;\r\n\r\n /**\r\n * Callback called when the task is not successful\r\n */\r\n public onError: (task: any, message?: string, exception?: any) => void;\r\n\r\n /**\r\n * Creates a new AssetsManager\r\n * @param name defines the name of the task\r\n */\r\n constructor(\r\n /**\r\n * Task name\r\n */ public name: string\r\n ) {}\r\n\r\n private _isCompleted = false;\r\n private _taskState = AssetTaskState.INIT;\r\n private _errorObject: { message?: string; exception?: any };\r\n\r\n /**\r\n * Get if the task is completed\r\n */\r\n public get isCompleted(): boolean {\r\n return this._isCompleted;\r\n }\r\n\r\n /**\r\n * Gets the current state of the task\r\n */\r\n public get taskState(): AssetTaskState {\r\n return this._taskState;\r\n }\r\n\r\n /**\r\n * Gets the current error object (if task is in error)\r\n */\r\n public get errorObject(): { message?: string; exception?: any } {\r\n return this._errorObject;\r\n }\r\n\r\n /**\r\n * Internal only\r\n * @internal\r\n */\r\n public _setErrorObject(message?: string, exception?: any) {\r\n if (this._errorObject) {\r\n return;\r\n }\r\n\r\n this._errorObject = {\r\n message: message,\r\n exception: exception,\r\n };\r\n }\r\n\r\n /**\r\n * Execute the current task\r\n * @param scene defines the scene where you want your assets to be loaded\r\n * @param onSuccess is a callback called when the task is successfully executed\r\n * @param onError is a callback called if an error occurs\r\n */\r\n public run(scene: Scene, onSuccess: () => void, onError: (message?: string, exception?: any) => void) {\r\n this._taskState = AssetTaskState.RUNNING;\r\n this.runTask(\r\n scene,\r\n () => {\r\n this._onDoneCallback(onSuccess, onError);\r\n },\r\n (msg, exception) => {\r\n this._onErrorCallback(onError, msg, exception);\r\n }\r\n );\r\n }\r\n\r\n /**\r\n * Execute the current task\r\n * @param scene defines the scene where you want your assets to be loaded\r\n * @param onSuccess is a callback called when the task is successfully executed\r\n * @param onError is a callback called if an error occurs\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n public runTask(scene: Scene, onSuccess: () => void, onError: (message?: string, exception?: any) => void) {\r\n throw new Error(\"runTask is not implemented\");\r\n }\r\n\r\n /**\r\n * Reset will set the task state back to INIT, so the next load call of the assets manager will execute this task again.\r\n * This can be used with failed tasks that have the reason for failure fixed.\r\n */\r\n public reset() {\r\n this._taskState = AssetTaskState.INIT;\r\n }\r\n\r\n private _onErrorCallback(onError: (message?: string, exception?: any) => void, message?: string, exception?: any) {\r\n this._taskState = AssetTaskState.ERROR;\r\n\r\n this._errorObject = {\r\n message: message,\r\n exception: exception,\r\n };\r\n\r\n if (this.onError) {\r\n this.onError(this, message, exception);\r\n }\r\n\r\n onError();\r\n }\r\n\r\n private _onDoneCallback(onSuccess: () => void, onError: (message?: string, exception?: any) => void) {\r\n try {\r\n this._taskState = AssetTaskState.DONE;\r\n this._isCompleted = true;\r\n\r\n if (this.onSuccess) {\r\n this.onSuccess(this);\r\n }\r\n\r\n onSuccess();\r\n } catch (e) {\r\n this._onErrorCallback(onError, \"Task is done, error executing success callback(s)\", e);\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * Define the interface used by progress events raised during assets loading\r\n */\r\nexport interface IAssetsProgressEvent {\r\n /**\r\n * Defines the number of remaining tasks to process\r\n */\r\n remainingCount: number;\r\n /**\r\n * Defines the total number of tasks\r\n */\r\n totalCount: number;\r\n /**\r\n * Defines the task that was just processed\r\n */\r\n task: AbstractAssetTask;\r\n}\r\n\r\n/**\r\n * Class used to share progress information about assets loading\r\n */\r\nexport class AssetsProgressEvent implements IAssetsProgressEvent {\r\n /**\r\n * Defines the number of remaining tasks to process\r\n */\r\n public remainingCount: number;\r\n /**\r\n * Defines the total number of tasks\r\n */\r\n public totalCount: number;\r\n /**\r\n * Defines the task that was just processed\r\n */\r\n public task: AbstractAssetTask;\r\n\r\n /**\r\n * Creates a AssetsProgressEvent\r\n * @param remainingCount defines the number of remaining tasks to process\r\n * @param totalCount defines the total number of tasks\r\n * @param task defines the task that was just processed\r\n */\r\n constructor(remainingCount: number, totalCount: number, task: AbstractAssetTask) {\r\n this.remainingCount = remainingCount;\r\n this.totalCount = totalCount;\r\n this.task = task;\r\n }\r\n}\r\n\r\n/**\r\n * Define a task used by AssetsManager to load assets into a container\r\n */\r\nexport class ContainerAssetTask extends AbstractAssetTask {\r\n /**\r\n * Get the loaded asset container\r\n */\r\n public loadedContainer: AssetContainer;\r\n /**\r\n * Gets the list of loaded transforms\r\n */\r\n public loadedTransformNodes: Array<TransformNode>;\r\n /**\r\n * Gets the list of loaded meshes\r\n */\r\n public loadedMeshes: Array<AbstractMesh>;\r\n /**\r\n * Gets the list of loaded particle systems\r\n */\r\n public loadedParticleSystems: Array<IParticleSystem>;\r\n /**\r\n * Gets the list of loaded skeletons\r\n */\r\n public loadedSkeletons: Array<Skeleton>;\r\n /**\r\n * Gets the list of loaded animation groups\r\n */\r\n public loadedAnimationGroups: Array<AnimationGroup>;\r\n\r\n /**\r\n * Callback called when the task is successful\r\n */\r\n public override onSuccess: (task: ContainerAssetTask) => void;\r\n\r\n /**\r\n * Callback called when the task is successful\r\n */\r\n public override onError: (task: ContainerAssetTask, message?: string, exception?: any) => void;\r\n\r\n /**\r\n * Creates a new ContainerAssetTask\r\n * @param name defines the name of the task\r\n * @param meshesNames defines the list of mesh's names you want to load\r\n * @param rootUrl defines the root url to use as a base to load your meshes and associated resources\r\n * @param sceneFilename defines the filename or File of the scene to load from\r\n * @param extension defines the extension to use to load the scene (if not defined, \".babylon\" will be used)\r\n */\r\n constructor(\r\n /**\r\n * Defines the name of the task\r\n */\r\n public override name: string,\r\n /**\r\n * Defines the list of mesh's names you want to load\r\n */\r\n public meshesNames: any,\r\n /**\r\n * Defines the root url to use as a base to load your meshes and associated resources\r\n */\r\n public rootUrl: string,\r\n /**\r\n * Defines the filename or File of the scene to load from\r\n */\r\n public sceneFilename: string | File,\r\n /**\r\n * Defines the extension to use to load the scene (if not defined, \".babylon\" will be used)\r\n */\r\n public extension?: string\r\n ) {\r\n super(name);\r\n }\r\n\r\n /**\r\n * Execute the current task\r\n * @param scene defines the scene where you want your assets to be loaded\r\n * @param onSuccess is a callback called when the task is successfully executed\r\n * @param onError is a callback called if an error occurs\r\n */\r\n public override runTask(scene: Scene, onSuccess: () => void, onError: (message?: string, exception?: any) => void) {\r\n SceneLoader.LoadAssetContainer(\r\n this.rootUrl,\r\n this.sceneFilename,\r\n scene,\r\n (container: AssetContainer) => {\r\n this.loadedContainer = container;\r\n this.loadedMeshes = container.meshes;\r\n this.loadedTransformNodes = container.transformNodes;\r\n this.loadedParticleSystems = container.particleSystems;\r\n this.loadedSkeletons = container.skeletons;\r\n this.loadedAnimationGroups = container.animationGroups;\r\n onSuccess();\r\n },\r\n null,\r\n (scene, message, exception) => {\r\n onError(message, exception);\r\n },\r\n this.extension\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Define a task used by AssetsManager to load meshes\r\n */\r\nexport class MeshAssetTask extends AbstractAssetTask {\r\n /**\r\n * Gets the list of loaded transforms\r\n */\r\n public loadedTransformNodes: Array<TransformNode>;\r\n /**\r\n * Gets the list of loaded meshes\r\n */\r\n public loadedMeshes: Array<AbstractMesh>;\r\n /**\r\n * Gets the list of loaded particle systems\r\n */\r\n public loadedParticleSystems: Array<IParticleSystem>;\r\n /**\r\n * Gets the list of loaded skeletons\r\n */\r\n public loadedSkeletons: Array<Skeleton>;\r\n /**\r\n * Gets the list of loaded animation groups\r\n */\r\n public loadedAnimationGroups: Array<AnimationGroup>;\r\n\r\n /**\r\n * Callback called when the task is successful\r\n */\r\n public override onSuccess: (task: MeshAssetTask) => void;\r\n\r\n /**\r\n * Callback called when the task is successful\r\n */\r\n public override onError: (task: MeshAssetTask, message?: string, exception?: any) => void;\r\n\r\n /**\r\n * Creates a new MeshAssetTask\r\n * @param name defines the name of the task\r\n * @param meshesNames defines the list of mesh's names you want to load\r\n * @param rootUrl defines the root url to use as a base to load your meshes and associated resources\r\n * @param sceneFilename defines the filename or File of the scene to load from\r\n * @param extension defines the extension to use to load the scene (if not defined, \".babylon\" will be used)\r\n * @param fileName defines the name of the file, if the data is binary\r\n * @param pluginOptions defines the options to use with the plugin\r\n */\r\n constructor(\r\n /**\r\n * Defines the name of the task\r\n */\r\n public override name: string,\r\n /**\r\n * Defines the list of mesh's names you want to load\r\n */\r\n public meshesNames: any,\r\n /**\r\n * Defines the root url to use as a base to load your meshes and associated resources\r\n */\r\n public rootUrl: string,\r\n /**\r\n * Defines the filename or File of the scene to load from\r\n */\r\n public sceneFilename: string | File,\r\n /**\r\n * Defines the extension to use to load the scene (if not defined, \".babylon\" will be used)\r\n */\r\n public extension?: string,\r\n /**\r\n * defines the name of the file, if the data is binary\r\n */\r\n public fileName?: string,\r\n /**\r\n * defines the options to use with the plugin\r\n */\r\n public pluginOptions?: PluginOptions\r\n ) {\r\n super(name);\r\n }\r\n\r\n /**\r\n * Execute the current task\r\n * @param scene defines the scene where you want your assets to be loaded\r\n * @param onSuccess is a callback called when the task is successfully executed\r\n * @param onError is a callback called if an error occurs\r\n */\r\n public override runTask(scene: Scene, onSuccess: () => void, onError: (message?: string, exception?: any) => void) {\r\n SceneLoader.ImportMesh(\r\n this.meshesNames,\r\n this.rootUrl,\r\n this.sceneFilename,\r\n scene,\r\n (meshes: AbstractMesh[], particleSystems: IParticleSystem[], skeletons: Skeleton[], animationGroups: AnimationGroup[], transformNodes: TransformNode[]) => {\r\n this.loadedMeshes = meshes;\r\n this.loadedTransformNodes = transformNodes;\r\n this.loadedParticleSystems = particleSystems;\r\n this.loadedSkeletons = skeletons;\r\n this.loadedAnimationGroups = animationGroups;\r\n onSuccess();\r\n },\r\n null,\r\n (scene, message, exception) => {\r\n onError(message, exception);\r\n },\r\n this.extension,\r\n this.fileName,\r\n this.pluginOptions\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Define a task used by AssetsManager to load animations\r\n */\r\nexport class AnimationAssetTask extends AbstractAssetTask {\r\n /**\r\n * Gets the list of loaded animation groups\r\n */\r\n public loadedAnimationGroups: Array<AnimationGroup>;\r\n /**\r\n * Gets the list of loaded animatables\r\n */\r\n public loadedAnimatables: Array<Animatable>;\r\n\r\n /**\r\n * Callback called when the task is successful\r\n */\r\n public override onSuccess: (task: AnimationAssetTask) => void;\r\n\r\n /**\r\n * Callback called when the task is successful\r\n */\r\n public override onError: (task: AnimationAssetTask, message?: string, exception?: any) => void;\r\n\r\n /**\r\n * Creates a new AnimationAssetTask\r\n * @param name defines the name of the task\r\n * @param rootUrl defines the root url to use as a base to load your meshes and associated resources\r\n * @param filename defines the filename or File of the scene to load from\r\n * @param targetConverter defines a function used to convert animation targets from loaded scene to current scene (default: search node by name)\r\n * @param extension defines the extension to use to load the scene (if not defined, \".babylon\" will be used)\r\n */\r\n constructor(\r\n /**\r\n * Defines the name of the task\r\n */\r\n public override name: string,\r\n /**\r\n * Defines the root url to use as a base to load your meshes and associated resources\r\n */\r\n public rootUrl: string,\r\n /**\r\n * Defines the filename to load from\r\n */\r\n public filename: string | File,\r\n /**\r\n * Defines a function used to convert animation targets from loaded scene to current scene (default: search node by name)\r\n */\r\n public targetConverter?: Nullable<(target: any) => any>,\r\n /**\r\n * Defines the extension to use to load the scene (if not defined, \".babylon\" will be used)\r\n */\r\n public extension?: string\r\n ) {\r\n super(name);\r\n }\r\n\r\n /**\r\n * Execute the current task\r\n * @param scene defines the scene where you want your assets to be loaded\r\n * @param onSuccess is a callback called when the task is successfully executed\r\n * @param onError is a callback called if an error occurs\r\n */\r\n public override runTask(scene: Scene, onSuccess: () => void, onError: (message?: string, exception?: any) => void) {\r\n const startingIndexForNewAnimatables = scene.animatables.length;\r\n const startingIndexForNewAnimationGroups = scene.animationGroups.length;\r\n this.loadedAnimatables = [];\r\n this.loadedAnimationGroups = [];\r\n SceneLoader.ImportAnimations(\r\n this.rootUrl,\r\n this.filename,\r\n scene,\r\n false,\r\n SceneLoaderAnimationGroupLoadingMode.NoSync,\r\n this.targetConverter,\r\n () => {\r\n this.loadedAnimatables = scene.animatables.slice(startingIndexForNewAnimatables);\r\n this.loadedAnimationGroups = scene.animationGroups.slice(startingIndexForNewAnimationGroups);\r\n\r\n onSuccess();\r\n },\r\n null,\r\n (scene, message, exception) => {\r\n onError(message, exception);\r\n },\r\n this.extension\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Define a task used by AssetsManager to load text content\r\n */\r\nexport class TextFileAssetTask extends AbstractAssetTask {\r\n /**\r\n * Gets the loaded text string\r\n */\r\n public text: string;\r\n\r\n /**\r\n * Callback called when the task is successful\r\n */\r\n public override onSuccess: (task: TextFileAssetTask) => void;\r\n\r\n /**\r\n * Callback called when the task is successful\r\n */\r\n public override onError: (task: TextFileAssetTask, message?: string, exception?: any) => void;\r\n\r\n /**\r\n * Creates a new TextFileAssetTask object\r\n * @param name defines the name of the task\r\n * @param url defines the location of the file to load\r\n */\r\n constructor(\r\n /**\r\n * Defines the name of the task\r\n */\r\n public override name: string,\r\n /**\r\n * Defines the location of the file to load\r\n */\r\n public url: string\r\n ) {\r\n super(name);\r\n }\r\n\r\n /**\r\n * Execute the current task\r\n * @param scene defines the scene where you want your assets to be loaded\r\n * @param onSuccess is a callback called when the task is successfully executed\r\n * @param onError is a callback called if an error occurs\r\n */\r\n public override runTask(scene: Scene, onSuccess: () => void, onError: (message?: string, exception?: any) => void) {\r\n scene._loadFile(\r\n this.url,\r\n (data) => {\r\n this.text = data as string;\r\n onSuccess();\r\n },\r\n undefined,\r\n false,\r\n false,\r\n (request, exception) => {\r\n if (request) {\r\n onError(request.status + \" \" + request.statusText, exception);\r\n }\r\n }\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Define a task used by AssetsManager to load binary data\r\n */\r\nexport class BinaryFileAssetTask extends AbstractAssetTask {\r\n /**\r\n * Gets the loaded data (as an array buffer)\r\n */\r\n public data: ArrayBuffer;\r\n\r\n /**\r\n * Callback called when the task is successful\r\n */\r\n public override onSuccess: (task: BinaryFileAssetTask) => void;\r\n /**\r\n * Callback called when the task is successful\r\n */\r\n public override onError: (task: BinaryFileAssetTask, message?: string, exception?: any) => void;\r\n\r\n /**\r\n * Creates a new BinaryFileAssetTask object\r\n * @param name defines the name of the new task\r\n * @param url defines the location of the file to load\r\n */\r\n constructor(\r\n /**\r\n * Defines the name of the task\r\n */\r\n public override name: string,\r\n /**\r\n * Defines the location of the file to load\r\n */\r\n public url: string\r\n ) {\r\n super(name);\r\n }\r\n\r\n /**\r\n * Execute the current task\r\n * @param scene defines the scene where you want your assets to be loaded\r\n * @param onSuccess is a callback called when the task is successfully executed\r\n * @param onError is a callback called if an error occurs\r\n */\r\n public override runTask(scene: Scene, onSuccess: () => void, onError: (message?: string, exception?: any) => void) {\r\n scene._loadFile(\r\n this.url,\r\n (data) => {\r\n this.data = data as ArrayBuffer;\r\n onSuccess();\r\n },\r\n undefined,\r\n true,\r\n true,\r\n (request, exception) => {\r\n if (request) {\r\n onError(request.status + \" \" + request.statusText, exception);\r\n }\r\n }\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Define a task used by AssetsManager to load images\r\n */\r\nexport class ImageAssetTask extends AbstractAssetTask {\r\n /**\r\n * Gets the loaded images\r\n */\r\n public image: HTMLImageElement;\r\n\r\n /**\r\n * Callback called when the task is successful\r\n */\r\n public override onSuccess: (task: ImageAssetTask) => void;\r\n /**\r\n * Callback called when the task is successful\r\n */\r\n public override onError: (task: ImageAssetTask, message?: string, exception?: any) => void;\r\n\r\n /**\r\n * Creates a new ImageAssetTask\r\n * @param name defines the name of the task\r\n * @param url defines the location of the image to load\r\n */\r\n constructor(\r\n /**\r\n * Defines the name of the task\r\n */\r\n public override name: string,\r\n /**\r\n * Defines the location of the image to load\r\n */\r\n public url: string\r\n ) {\r\n super(name);\r\n }\r\n\r\n /**\r\n * Execute the current task\r\n * @param scene defines the scene where you want your assets to be loaded\r\n * @param onSuccess is a callback called when the task is successfully executed\r\n * @param onError is a callback called if an error occurs\r\n */\r\n public override runTask(scene: Scene, onSuccess: () => void, onError: (message?: string, exception?: any) => void) {\r\n const img = new Image();\r\n\r\n Tools.SetCorsBehavior(this.url, img);\r\n\r\n img.onload = () => {\r\n this.image = img;\r\n onSuccess();\r\n };\r\n\r\n img.onerror = (err: string | Event): any => {\r\n onError(\"Error loading image\", err);\r\n };\r\n\r\n img.src = this.url;\r\n }\r\n}\r\n\r\n/**\r\n * Defines the interface used by texture loading tasks\r\n */\r\nexport interface ITextureAssetTask<Tex extends BaseTexture> {\r\n /**\r\n * Gets the loaded texture\r\n */\r\n texture: Tex;\r\n}\r\n\r\n/**\r\n * Define a task used by AssetsManager to load 2D textures\r\n */\r\nexport class TextureAssetTask extends AbstractAssetTask implements ITextureAssetTask<Texture> {\r\n /**\r\n * Gets the loaded texture\r\n */\r\n public texture: Texture;\r\n\r\n /**\r\n * Callback called when the task is successful\r\n */\r\n public override onSuccess: (task: TextureAssetTask) => void;\r\n /**\r\n * Callback called when the task is successful\r\n */\r\n public override onError: (task: TextureAssetTask, message?: string, exception?: any) => void;\r\n\r\n /**\r\n * Creates a new TextureAssetTask object\r\n * @param name defines the name of the task\r\n * @param url defines the location of the file to load\r\n * @param noMipmapOrOptions defines if mipmap should not be generated (default is false) or the creation options to use\r\n * @param invertY defines if texture must be inverted on Y axis (default is true)\r\n * @param samplingMode defines the sampling mode to use (default is Texture.TRILINEAR_SAMPLINGMODE)\r\n */\r\n constructor(\r\n /**\r\n * Defines the name of the task\r\n */\r\n public override name: string,\r\n /**\r\n * Defines the location of the file to load\r\n */\r\n public url: string,\r\n /**\r\n * Defines if mipmap should not be generated (default is false) or the creation options to use\r\n */\r\n public noMipmapOrOptions?: boolean | ITextureCreationOptions,\r\n /**\r\n * [true] Defines if texture must be inverted on Y axis (default is true)\r\n */\r\n public invertY: boolean = true,\r\n /**\r\n * [3] Defines the sampling mode to use (default is Texture.TRILINEAR_SAMPLINGMODE)\r\n */\r\n public samplingMode: number = Texture.TRILINEAR_SAMPLINGMODE\r\n ) {\r\n super(name);\r\n }\r\n\r\n /**\r\n * Execute the current task\r\n * @param scene defines the scene where you want your assets to be loaded\r\n * @param onSuccess is a callback called when the task is successfully executed\r\n * @param onError is a callback called if an error occurs\r\n */\r\n public override runTask(scene: Scene, onSuccess: () => void, onError: (message?: string, exception?: any) => void) {\r\n const onload = () => {\r\n onSuccess();\r\n };\r\n\r\n const onerror = (message?: string, exception?: any) => {\r\n onError(message, exception);\r\n };\r\n\r\n this.texture = new Texture(this.url, scene, this.noMipmapOrOptions, this.invertY, this.samplingMode, onload, onerror);\r\n }\r\n}\r\n\r\n/**\r\n * Define a task used by AssetsManager to load cube textures\r\n */\r\nexport class CubeTextureAssetTask extends AbstractAssetTask implements ITextureAssetTask<CubeTexture> {\r\n /**\r\n * Gets the loaded texture\r\n */\r\n public texture: CubeTexture;\r\n\r\n /**\r\n * Callback called when the task is successful\r\n */\r\n public override onSuccess: (task: CubeTextureAssetTask) => void;\r\n /**\r\n * Callback called when the task is successful\r\n */\r\n public override onError: (task: CubeTextureAssetTask, message?: string, exception?: any) => void;\r\n\r\n /**\r\n * Creates a new CubeTextureAssetTask\r\n * @param name defines the name of the task\r\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)\r\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\r\n * @param noMipmap defines if mipmaps should not be generated (default is false)\r\n * @param files defines the explicit list of files (undefined by default)\r\n * @param prefiltered\r\n */\r\n constructor(\r\n /**\r\n * Defines the name of the task\r\n */\r\n public override name: string,\r\n /**\r\n * Defines the location of the files to load (You have to specify the folder where the files are + filename with no extension)\r\n */\r\n public url: string,\r\n /**\r\n * 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\r\n */\r\n public extensionsOrOptions: Nullable<string[] | ICubeTextureCreationOptions> = null,\r\n /**\r\n * Defines if mipmaps should not be generated (default is false)\r\n */\r\n public noMipmap?: boolean,\r\n /**\r\n * Defines the explicit list of files (undefined by default)\r\n */\r\n public files?: string[],\r\n /**\r\n * Defines the prefiltered texture option (default is false)\r\n */\r\n public prefiltered?: boolean\r\n ) {\r\n super(name);\r\n }\r\n\r\n /**\r\n * Execute the current task\r\n * @param scene defines the scene where you want your assets to be loaded\r\n * @param onSuccess is a callback called when the task is successfully executed\r\n * @param onError is a callback called if an error occurs\r\n */\r\n public override runTask(scene: Scene, onSuccess: () => void, onError: (message?: string, exception?: any) => void) {\r\n const onload = () => {\r\n onSuccess();\r\n };\r\n\r\n const onerror = (message?: string, exception?: any) => {\r\n onError(message, exception);\r\n };\r\n\r\n this.texture = new CubeTexture(this.url, scene, this.extensionsOrOptions, this.noMipmap, this.files, onload, onerror, undefined, this.prefiltered);\r\n }\r\n}\r\n\r\n/**\r\n * Define a task used by AssetsManager to load HDR cube textures\r\n */\r\nexport class HDRCubeTextureAssetTask extends AbstractAssetTask implements ITextureAssetTask<HDRCubeTexture> {\r\n /**\r\n * Gets the loaded texture\r\n */\r\n public texture: HDRCubeTexture;\r\n\r\n /**\r\n * Callback called when the task is successful\r\n */\r\n public override onSuccess: (task: HDRCubeTextureAssetTask) => void;\r\n /**\r\n * Callback called when the task is successful\r\n */\r\n public override onError: (task: HDRCubeTextureAssetTask, message?: string, exception?: any) => void;\r\n\r\n /**\r\n * Creates a new HDRCubeTextureAssetTask object\r\n * @param name defines the name of the task\r\n * @param url defines the location of the file to load\r\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.\r\n * @param noMipmap defines if mipmaps should not be generated (default is false)\r\n * @param generateHarmonics specifies whether you want to extract the polynomial harmonics during the generation process (default is true)\r\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)\r\n * @param prefilterOnLoad specifies if the texture should be prefiltered on load (default is false)\r\n * @param supersample specifies if the texture will be generated with super sampling (default is false)\r\n * @param prefilterIrradianceOnLoad specifies if the irradiance should be prefiltered on load (default is false)\r\n * @param prefilterUsingCdf specifies if the texture should be prefiltered using CDF (default is false)\r\n */\r\n constructor(\r\n /**\r\n * Defines the name of the task\r\n */\r\n public override name: string,\r\n /**\r\n * Defines the location of the file to load\r\n */\r\n public url: string,\r\n /**\r\n * Defines the desired size (the more it increases the longer the generation will be)\r\n */\r\n public size: number,\r\n /**\r\n * [false] Defines if mipmaps should not be generated (default is false)\r\n */\r\n public noMipmap = false,\r\n /**\r\n * [true] Specifies whether you want to extract the polynomial harmonics during the generation process (default is true)\r\n */\r\n public generateHarmonics = true,\r\n /**\r\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)\r\n */\r\n public gammaSpace = false,\r\n /**\r\n * [false] Specifies if the texture should be prefiltered on load (default is false)\r\n */\r\n public prefilterOnLoad = false,\r\n /**\r\n * [false] Specifies if the texture will be generated with super sampling (default is false)\r\n */\r\n public supersample = false,\r\n /**\r\n * [false] Specifies if the irradiance should be prefiltered on load (default is false)\r\n */\r\n public prefilterIrradianceOnLoad = false,\r\n /**\r\n * [false] Specifies if the texture should be prefiltered using CDF (default is false)\r\n */\r\n public prefilterUsingCdf = false\r\n ) {\r\n super(name);\r\n }\r\n\r\n /**\r\n * Execute the current task\r\n * @param scene defines the scene where you want your assets to be loaded\r\n * @param onSuccess is a callback called when the task is successfully executed\r\n * @param onError is a callback called if an error occurs\r\n */\r\n public override runTask(scene: Scene, onSuccess: () => void, onError: (message?: string, exception?: any) => void) {\r\n const onload = () => {\r\n onSuccess();\r\n };\r\n\r\n const onerror = (message?: string, exception?: any) => {\r\n onError(message, exception);\r\n };\r\n\r\n this.texture = new HDRCubeTexture(\r\n this.url,\r\n scene,\r\n this.size,\r\n this.noMipmap,\r\n this.generateHarmonics,\r\n this.gammaSpace,\r\n this.prefilterOnLoad,\r\n onload,\r\n onerror,\r\n this.supersample,\r\n this.prefilterIrradianceOnLoad,\r\n this.prefilterUsingCdf\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Define a task used by AssetsManager to load Equirectangular cube textures\r\n */\r\nexport class EquiRectangularCubeTextureAssetTask extends AbstractAssetTask implements ITextureAssetTask<EquiRectangularCubeTexture> {\r\n /**\r\n * Gets the loaded texture\r\n */\r\n public texture: EquiRectangularCubeTexture;\r\n\r\n /**\r\n * Callback called when the task is successful\r\n */\r\n public override onSuccess: (task: EquiRectangularCubeTextureAssetTask) => void;\r\n /**\r\n * Callback called when the task is successful\r\n */\r\n public override onError: (task: EquiRectangularCubeTextureAssetTask, message?: string, exception?: any) => void;\r\n\r\n /**\r\n * Creates a new EquiRectangularCubeTextureAssetTask object\r\n * @param name defines the name of the task\r\n * @param url defines the location of the file to load\r\n * @param size defines the desired size (the more it increases the longer the generation will be)\r\n * If the size is omitted this implies you are using a preprocessed cubemap.\r\n * @param noMipmap defines if mipmaps should not be generated (default is false)\r\n * @param gammaSpace specifies if the texture will be used in gamma or linear space\r\n * @param superSample specifies if the texture will be generated with super sampling (default is false)\r\n * (the PBR material requires those texture in linear space, but the standard material would require them in Gamma space)\r\n * (default is true)\r\n */\r\n constructor(\r\n /**\r\n * Defines the name of the task\r\n */\r\n public override name: string,\r\n /**\r\n * Defines the location of the file to load\r\n */\r\n public url: string,\r\n /**\r\n * Defines the desired size (the more it increases the longer the generation will be)\r\n */\r\n public size: number,\r\n /**\r\n * [false] Defines if mipmaps should not be generated (default is false)\r\n */\r\n public noMipmap: boolean = false,\r\n /**\r\n * [true] Specifies if the texture will be use in gamma or linear space (the PBR material requires those texture in linear space,\r\n * but the standard material would require them in Gamma space) (default is true)\r\n */\r\n public gammaSpace: boolean = true,\r\n\r\n public superSample: boolean = false\r\n ) {\r\n super(name);\r\n }\r\n\r\n /**\r\n * Execute the current task\r\n * @param scene defines the scene where you want your assets to be loaded\r\n * @param onSuccess is a callback called when the task is successfully executed\r\n * @param onError is a callback called if an error occurs\r\n */\r\n public override runTask(scene: Scene, onSuccess: () => void, onError: (message?: string, exception?: any) => void): void {\r\n const onload = () => {\r\n onSuccess();\r\n };\r\n\r\n const onerror = (message?: string, exception?: any) => {\r\n onError(message, exception);\r\n };\r\n\r\n this.texture = new EquiRectangularCubeTexture(this.url, scene, this.size, this.noMipmap, this.gammaSpace, onload, onerror, this.superSample);\r\n }\r\n}\r\n\r\n/**\r\n * This class can be used to easily import assets into a scene\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/importers/assetManager\r\n */\r\nexport class AssetsManager {\r\n private _scene: Scene;\r\n private _isLoading = false;\r\n\r\n protected _tasks = new Array<AbstractAssetTask>();\r\n protected _waitingTasksCount = 0;\r\n protected _totalTasksCount = 0;\r\n\r\n /**\r\n * Callback called when all tasks are processed\r\n */\r\n public onFinish: (tasks: AbstractAssetTask[]) => void;\r\n\r\n /**\r\n * Callback called when a task is successful\r\n */\r\n public onTaskSuccess: (task: AbstractAssetTask) => void;\r\n\r\n /**\r\n * Callback called when a task had an error\r\n */\r\n public onTaskError: (task: AbstractAssetTask) => void;\r\n\r\n /**\r\n * Callback called when a task is done (whatever the result is)\r\n */\r\n public onProgress: (remainingCount: number, totalCount: number, task: AbstractAssetTask) => void;\r\n\r\n /**\r\n * Observable called when all tasks are processed\r\n */\r\n public onTaskSuccessObservable = new Observable<AbstractAssetTask>();\r\n\r\n /**\r\n * Observable called when a task had an error\r\n */\r\n public onTaskErrorObservable = new Observable<AbstractAssetTask>();\r\n\r\n /**\r\n * Observable called when all tasks were executed\r\n */\r\n public onTasksDoneObservable = new Observable<AbstractAssetTask[]>();\r\n\r\n /**\r\n * Observable called when a task is done (whatever the result is)\r\n */\r\n public onProgressObservable = new Observable<IAssetsProgressEvent>();\r\n\r\n /**\r\n * Gets or sets a boolean defining if the AssetsManager should use the default loading screen\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/scene/customLoadingScreen\r\n */\r\n public useDefaultLoadingScreen = true;\r\n\r\n /**\r\n * Gets or sets a boolean defining if the AssetsManager should automatically hide the loading screen\r\n * when all assets have been downloaded.\r\n * If set to false, you need to manually call in hideLoadingUI() once your scene is ready.\r\n */\r\n public autoHideLoadingUI = true;\r\n\r\n /**\r\n * Creates a new AssetsManager\r\n * @param scene defines the scene to work on\r\n */\r\n constructor(scene?: Scene) {\r\n this._scene = scene || <Scene>EngineStore.LastCreatedScene;\r\n }\r\n\r\n /**\r\n * Add a ContainerAssetTask to the list of active tasks\r\n * @param taskName defines the name of the new task\r\n * @param meshesNames defines the name of meshes to load\r\n * @param rootUrl defines the root url to use to locate files\r\n * @param sceneFilename defines the filename of the scene file or the File itself\r\n * @param extension defines the extension to use to load the file\r\n * @returns a new ContainerAssetTask object\r\n */\r\n public addContainerTask(taskName: string, meshesNames: any, rootUrl: string, sceneFilename: string | File, extension?: string): ContainerAssetTask {\r\n const task = new ContainerAssetTask(taskName, meshesNames, rootUrl, sceneFilename, extension);\r\n this._tasks.push(task);\r\n\r\n return task;\r\n }\r\n\r\n /**\r\n * Add a MeshAssetTask to the list of active tasks\r\n * @param taskName defines the name of the new task\r\n * @param meshesNames defines the name of meshes to load\r\n * @param rootUrl defines the root url to use to locate files\r\n * @param sceneFilename defines the filename of the scene file or the File itself\r\n * @param extension defines the extension to use to load the file\r\n * @param filename defines the name of the file, if the data is binary\r\n * @param pluginOptions defines the options to use with the plugin\r\n * @returns a new MeshAssetTask object\r\n */\r\n public addMeshTask(\r\n taskName: string,\r\n meshesNames: any,\r\n rootUrl: string,\r\n sceneFilename: string | File,\r\n extension?: string,\r\n filename?: string,\r\n pluginOptions?: PluginOptions\r\n ): MeshAssetTask {\r\n const task = new MeshAssetTask(taskName, meshesNames, rootUrl, sceneFilename, extension, filename, pluginOptions);\r\n this._tasks.push(task);\r\n\r\n return task;\r\n }\r\n\r\n /**\r\n * Add a TextFileAssetTask to the list of active tasks\r\n * @param taskName defines the name of the new task\r\n * @param url defines the url of the file to load\r\n * @returns a new TextFileAssetTask object\r\n */\r\n public addTextFileTask(taskName: string, url: string): TextFileAssetTask {\r\n const task = new TextFileAssetTask(taskName, url);\r\n this._tasks.push(task);\r\n\r\n return task;\r\n }\r\n\r\n /**\r\n * Add a BinaryFileAssetTask to the list of active tasks\r\n * @param taskName defines the name of the new task\r\n * @param url defines the url of the file to load\r\n * @returns a new BinaryFileAssetTask object\r\n */\r\n public addBinaryFileTask(taskName: string, url: string): BinaryFileAssetTask {\r\n const task = new BinaryFileAssetTask(taskName, url);\r\n this._tasks.push(task);\r\n\r\n return task;\r\n }\r\n\r\n /**\r\n * Add a ImageAssetTask to the list of active tasks\r\n * @param taskName defines the name of the new task\r\n * @param url defines the url of the file to load\r\n * @returns a new ImageAssetTask object\r\n */\r\n public addImageTask(taskName: string, url: string): ImageAssetTask {\r\n const task = new ImageAssetTask(taskName, url);\r\n this._tasks.push(task);\r\n\r\n return task;\r\n }\r\n\r\n /**\r\n * Add a TextureAssetTask to the list of active tasks\r\n * @param taskName defines the name of the new task\r\n * @param url defines the url of the file to load\r\n * @param noMipmapOrOptions defines if mipmap should not be generated (default is false) or the creation options to use\r\n * @param invertY defines if you want to invert Y axis of the loaded texture (true by default)\r\n * @param samplingMode defines the sampling mode to use (Texture.TRILINEAR_SAMPLINGMODE by default)\r\n * @returns a new TextureAssetTask object\r\n */\r\n public addTextureTask(\r\n taskName: string,\r\n url: string,\r\n noMipmapOrOptions?: boolean | ITextureCreationOptions,\r\n invertY?: boolean,\r\n samplingMode: number = Texture.TRILINEAR_SAMPLINGMODE\r\n ): TextureAssetTask {\r\n const task = new TextureAssetTask(taskName, url, noMipmapOrOptions, invertY, samplingMode);\r\n this._tasks.push(task);\r\n\r\n return task;\r\n }\r\n\r\n /**\r\n * Add a CubeTextureAssetTask to the list of active tasks\r\n * @param taskName defines the name of the new task\r\n * @param url defines the url of the file to load\r\n * @param extensionsOrOptions defines the extension to use to load the cube map (can be null) or the options to use for the cube texture\r\n * @param noMipmap defines if the texture must not receive mipmaps (false by default)\r\n * @param files defines the list of files to load (can be null)\r\n * @param prefiltered defines the prefiltered texture option (default is false)\r\n * @returns a new CubeTextureAssetTask object\r\n */\r\n public addCubeTextureTask(\r\n taskName: string,\r\n url: string,\r\n extensionsOrOptions?: string[] | ICubeTextureCreationOptions,\r\n noMipmap?: boolean,\r\n files?: string[],\r\n prefiltered?: boolean\r\n ): CubeTextureAssetTask {\r\n const task = new CubeTextureAssetTask(taskName, url, extensionsOrOptions, noMipmap, files, prefiltered);\r\n this._tasks.push(task);\r\n\r\n return task;\r\n }\r\n\r\n /**\r\n *\r\n * Add a HDRCubeTextureAssetTask to the list of active tasks\r\n * @param taskName defines the name of the new task\r\n * @param url defines the url of the file to load\r\n * @param size defines the size you want for the cubemap (can be null)\r\n * @param noMipmap defines if the texture must not receive mipmaps (false by default)\r\n * @param generateHarmonics defines if you want to automatically generate (true by default)\r\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)\r\n * @param prefilterOnLoad specifies if the texture should be prefiltered on load (default is false)\r\n * @param supersample specifies if the texture will be generated with super sampling (default is false)\r\n * @param prefilterIrradianceOnLoad specifies if the irradiance should be prefiltered on load (default is false)\r\n * @param prefilterUsingCdf specifies if the texture should be prefiltered using CDF (default is false)\r\n * @returns a new HDRCubeTextureAssetTask object\r\n */\r\n public addHDRCubeTextureTask(\r\n taskName: string,\r\n url: string,\r\n size: number,\r\n noMipmap = false,\r\n generateHarmonics = true,\r\n gammaSpace = false,\r\n prefilterOnLoad = false,\r\n supersample = false,\r\n prefilterIrradianceOnLoad = false,\r\n prefilterUsingCdf = false\r\n ): HDRCubeTextureAssetTask {\r\n const task = new HDRCubeTextureAssetTask(\r\n taskName,\r\n url,\r\n size,\r\n noMipmap,\r\n generateHarmonics,\r\n gammaSpace,\r\n prefilterOnLoad,\r\n supersample,\r\n prefilterIrradianceOnLoad,\r\n prefilterUsingCdf\r\n );\r\n this._tasks.push(task);\r\n\r\n return task;\r\n }\r\n\r\n /**\r\n *\r\n * Add a EquiRectangularCubeTextureAssetTask to the list of active tasks\r\n * @param taskName defines the name of the new task\r\n * @param url defines the url of the file to load\r\n * @param size defines the size you want for the cubemap (can be null)\r\n * @param noMipmap defines if the texture must not receive mipmaps (false by default)\r\n * @param gammaSpace Specifies if the texture will be used in gamma or linear space\r\n * @param superSample specifies if the texture will be generated with super sampling (default is false)\r\n * (the PBR material requires those textures in linear space, but the standard material would require them in Gamma space)\r\n * @returns a new EquiRectangularCubeTextureAssetTask object\r\n */\r\n public addEquiRectangularCubeTextureAssetTask(\r\n taskName: string,\r\n url: string,\r\n size: number,\r\n noMipmap = false,\r\n gammaSpace = true,\r\n superSample = false\r\n ): EquiRectangularCubeTextureAssetTask {\r\n const task = new EquiRectangularCubeTextureAssetTask(taskName, url, size, noMipmap, gammaSpace, superSample);\r\n this._tasks.push(task);\r\n\r\n return task;\r\n }\r\n\r\n /**\r\n * Remove a task from the assets manager.\r\n * @param task the task to remove\r\n */\r\n public removeTask(task: AbstractAssetTask) {\r\n const index = this._tasks.indexOf(task);\r\n\r\n if (index > -1) {\r\n this._tasks.splice(index, 1);\r\n }\r\n }\r\n\r\n private _decreaseWaitingTasksCount(task: AbstractAssetTask): void {\r\n this._waitingTasksCount--;\r\n\r\n try {\r\n if (this.onProgress) {\r\n this.onProgress(this._waitingTasksCount, this._totalTasksCount, task);\r\n }\r\n\r\n this.onProgressObservable.notifyObservers(new AssetsProgressEvent(this._waitingTasksCount, this._totalTasksCount, task));\r\n } catch (e) {\r\n Logger.Error(\"Error running progress callbacks.\");\r\n Logger.Log(e);\r\n }\r\n\r\n if (this._waitingTasksCount === 0) {\r\n try {\r\n const currentTasks = this._tasks.slice();\r\n\r\n if (this.onFinish) {\r\n // Calling onFinish with immutable array of tasks\r\n this.onFinish(currentTasks);\r\n }\r\n\r\n // Let's remove successful tasks\r\n for (const task of currentTasks) {\r\n if (task.taskState === AssetTaskState.DONE) {\r\n const index = this._tasks.indexOf(task);\r\n\r\n if (index > -1) {\r\n this._tasks.splice(index, 1);\r\n }\r\n }\r\n }\r\n\r\n this.onTasksDoneObservable.notifyObservers(this._tasks);\r\n } catch (e) {\r\n Logger.Error(\"Error running tasks-done callbacks.\");\r\n Logger.Log(e);\r\n }\r\n this._isLoading = false;\r\n if (this.autoHideLoadingUI) {\r\n this._scene.getEngine().hideLoadingUI();\r\n }\r\n }\r\n }\r\n\r\n private _runTask(task: AbstractAssetTask): void {\r\n const done = () => {\r\n try {\r\n if (this.onTaskSuccess) {\r\n this.onTaskSuccess(task);\r\n }\r\n this.onTaskSuccessObservable.notifyObservers(task);\r\n this._decreaseWaitingTasksCount(task);\r\n } catch (e) {\r\n error(\"Error executing task success callbacks\", e);\r\n }\r\n };\r\n\r\n const error = (message?: string, exception?: any) => {\r\n task._setErrorObject(message, exception);\r\n\r\n if (this.onTaskError) {\r\n this.onTaskError(task);\r\n } else if (!task.onError) {\r\n Logger.Error(this._formatTaskErrorMessage(task));\r\n }\r\n this.onTaskErrorObservable.notifyObservers(task);\r\n this._decreaseWaitingTasksCount(task);\r\n };\r\n\r\n task.run(this._scene, done, error);\r\n }\r\n\r\n private _formatTaskErrorMessage(task: AbstractAssetTask) {\r\n let errorMessage = \"Unable to complete task \" + task.name;\r\n\r\n if (task.errorObject.message) {\r\n errorMessage += `: ${task.errorObject.message}`;\r\n }\r\n if (task.errorObject.exception) {\r\n errorMessage += `: ${task.errorObject.exception}`;\r\n }\r\n\r\n return errorMessage;\r\n }\r\n\r\n /**\r\n * Reset the AssetsManager and remove all tasks\r\n * @returns the current instance of the AssetsManager\r\n */\r\n public reset(): AssetsManager {\r\n this._isLoading = false;\r\n this._tasks = new Array<AbstractAssetTask>();\r\n return this;\r\n }\r\n\r\n /**\r\n * Start the loading process\r\n * @returns the current instance of the AssetsManager\r\n */\r\n public load(): AssetsManager {\r\n if (this._isLoading) {\r\n return this;\r\n }\r\n this._isLoading = true;\r\n this._waitingTasksCount = this._tasks.length;\r\n this._totalTasksCount = this._tasks.length;\r\n\r\n if (this._waitingTasksCount === 0) {\r\n this._isLoading = false;\r\n if (this.onFinish) {\r\n this.onFinish(this._tasks);\r\n }\r\n this.onTasksDoneObservable.notifyObservers(this._tasks);\r\n return this;\r\n }\r\n\r\n if (this.useDefaultLoadingScreen) {\r\n this._scene.getEngine().displayLoadingUI();\r\n }\r\n\r\n for (let index = 0; index < this._tasks.length; index++) {\r\n const task = this._tasks[index];\r\n if (task.taskState === AssetTaskState.INIT) {\r\n this._runTask(task);\r\n }\r\n }\r\n\r\n return this;\r\n }\r\n\r\n /**\r\n * Start the loading process as an async operation\r\n * @returns a promise returning the list of failed tasks\r\n */\r\n public async loadAsync(): Promise<void> {\r\n return await new Promise((resolve, reject) => {\r\n if (this._isLoading) {\r\n resolve();\r\n return;\r\n }\r\n this.onTasksDoneObservable.addOnce((remainingTasks) => {\r\n if (remainingTasks && remainingTasks.length) {\r\n // eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors\r\n reject(remainingTasks);\r\n } else {\r\n resolve();\r\n }\r\n });\r\n\r\n this.load();\r\n });\r\n }\r\n}\r\n"]}
@@ -105,7 +105,7 @@ export declare const ReadFile: (file: File, onSuccess: (data: any) => void, onPr
105
105
  * @returns a file request object
106
106
  * @internal
107
107
  */
108
- export declare const LoadFile: (fileOrUrl: File | string, onSuccess: (data: string | ArrayBuffer, responseURL?: string, contentType?: Nullable<string>) => void, onProgress?: (ev: ProgressEvent) => void, offlineProvider?: IOfflineProvider, useArrayBuffer?: boolean, onError?: (request?: WebRequest, exception?: LoadFileError) => void, onOpened?: (request: WebRequest) => void) => IFileRequest;
108
+ export declare const LoadFile: (fileOrUrl: File | string, onSuccess: (data: string | ArrayBuffer, responseURL?: string, contentType?: Nullable<string>) => void, onProgress?: (ev: ProgressEvent) => void, offlineProvider?: Nullable<IOfflineProvider>, useArrayBuffer?: boolean, onError?: (request?: WebRequest, exception?: LoadFileError) => void, onOpened?: (request: WebRequest) => void) => IFileRequest;
109
109
  /**
110
110
  * Loads a file from a url
111
111
  * @param url url to load
@@ -118,7 +118,7 @@ export declare const LoadFile: (fileOrUrl: File | string, onSuccess: (data: stri
118
118
  * @returns a file request object
119
119
  * @internal
120
120
  */
121
- export declare const RequestFile: (url: string, onSuccess?: (data: string | ArrayBuffer, request?: WebRequest) => void, onProgress?: (event: ProgressEvent) => void, offlineProvider?: IOfflineProvider, useArrayBuffer?: boolean, onError?: (error: RequestFileError) => void, onOpened?: (request: WebRequest) => void) => IFileRequest;
121
+ export declare const RequestFile: (url: string, onSuccess?: (data: string | ArrayBuffer, request?: WebRequest) => void, onProgress?: (event: ProgressEvent) => void, offlineProvider?: Nullable<IOfflineProvider>, useArrayBuffer?: boolean, onError?: (error: RequestFileError) => void, onOpened?: (request: WebRequest) => void) => IFileRequest;
122
122
  /**
123
123
  * Reads the mime type from a URL, if available.
124
124
  * @param url
package/Misc/fileTools.js CHANGED
@@ -434,7 +434,9 @@ export const LoadFile = (fileOrUrl, onSuccess, onProgress, offlineProvider, useA
434
434
  * @internal
435
435
  */
436
436
  export const RequestFile = (url, onSuccess, onProgress, offlineProvider, useArrayBuffer, onError, onOpened) => {
437
- offlineProvider ?? (offlineProvider = EngineStore.LastCreatedScene?.offlineProvider);
437
+ if (offlineProvider !== null) {
438
+ offlineProvider ?? (offlineProvider = EngineStore.LastCreatedScene?.offlineProvider);
439
+ }
438
440
  url = FileToolsOptions.CleanUrl(url);
439
441
  url = FileToolsOptions.PreprocessUrl(url);
440
442
  const loadUrl = FileToolsOptions.BaseUrl + url;