@babylonjs/core 6.38.0 → 6.39.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Behaviors/Meshes/sixDofDragBehavior.js +14 -20
- package/Behaviors/Meshes/sixDofDragBehavior.js.map +1 -1
- package/Cameras/Inputs/BaseCameraPointersInput.d.ts +9 -9
- package/Cameras/Inputs/BaseCameraPointersInput.js +10 -10
- package/Cameras/Inputs/BaseCameraPointersInput.js.map +1 -1
- package/Cameras/Inputs/freeCameraMouseInput.d.ts +1 -1
- package/Cameras/Inputs/freeCameraMouseInput.js +1 -1
- package/Cameras/Inputs/freeCameraMouseInput.js.map +1 -1
- package/Cameras/VR/vrExperienceHelper.d.ts +2 -2
- package/Cameras/VR/vrExperienceHelper.js +2 -2
- package/Cameras/VR/vrExperienceHelper.js.map +1 -1
- package/Culling/Octrees/octree.d.ts +4 -4
- package/Culling/Octrees/octree.js +4 -4
- package/Culling/Octrees/octree.js.map +1 -1
- package/Debug/physicsViewer.d.ts +5 -1
- package/Debug/physicsViewer.js +5 -1
- package/Debug/physicsViewer.js.map +1 -1
- package/Engines/ICanvas.d.ts +60 -0
- package/Engines/ICanvas.js.map +1 -1
- package/Engines/IPipelineContext.d.ts +3 -3
- package/Engines/IPipelineContext.js.map +1 -1
- package/Engines/Native/nativePipelineContext.d.ts +4 -5
- package/Engines/Native/nativePipelineContext.js +2 -9
- package/Engines/Native/nativePipelineContext.js.map +1 -1
- package/Engines/Native/nativeRenderTargetWrapper.js +2 -0
- package/Engines/Native/nativeRenderTargetWrapper.js.map +1 -1
- package/Engines/Native/validatedNativeDataStream.d.ts +3 -0
- package/Engines/Native/validatedNativeDataStream.js +3 -0
- package/Engines/Native/validatedNativeDataStream.js.map +1 -1
- package/Engines/WebGL/webGLHardwareTexture.js +1 -0
- package/Engines/WebGL/webGLHardwareTexture.js.map +1 -1
- package/Engines/WebGL/webGLRenderTargetWrapper.js +1 -0
- package/Engines/WebGL/webGLRenderTargetWrapper.js.map +1 -1
- package/Engines/WebGPU/webgpuCacheRenderPipeline.js.map +1 -1
- package/Engines/WebGPU/webgpuConstants.d.ts +3 -1
- package/Engines/WebGPU/webgpuConstants.js +2 -0
- package/Engines/WebGPU/webgpuConstants.js.map +1 -1
- package/Engines/WebGPU/webgpuTintWASM.d.ts +1 -1
- package/Engines/WebGPU/webgpuTintWASM.js +5 -5
- package/Engines/WebGPU/webgpuTintWASM.js.map +1 -1
- package/Engines/engine.d.ts +11 -45
- package/Engines/nativeEngine.d.ts +3 -1
- package/Engines/nativeEngine.js +29 -30
- package/Engines/nativeEngine.js.map +1 -1
- package/Engines/thinEngine.js +2 -2
- package/Engines/thinEngine.js.map +1 -1
- package/Engines/webgpuEngine.js +0 -1
- package/Engines/webgpuEngine.js.map +1 -1
- package/FlowGraph/Blocks/Data/Logic/index.d.ts +0 -1
- package/FlowGraph/Blocks/Data/Logic/index.js +0 -1
- package/FlowGraph/Blocks/Data/Logic/index.js.map +1 -1
- package/FlowGraph/Blocks/Data/Math/flowGraphMathBlocks.d.ts +334 -1
- package/FlowGraph/Blocks/Data/Math/flowGraphMathBlocks.js +472 -74
- package/FlowGraph/Blocks/Data/Math/flowGraphMathBlocks.js.map +1 -1
- package/FlowGraph/Blocks/Data/flowGraphCachedOperationBlock.js +6 -6
- package/FlowGraph/Blocks/Data/flowGraphCachedOperationBlock.js.map +1 -1
- package/FlowGraph/Blocks/Data/flowGraphGetVariableBlock.d.ts +3 -0
- package/FlowGraph/Blocks/Data/flowGraphGetVariableBlock.js.map +1 -1
- package/FlowGraph/Blocks/Data/flowGraphUnaryOperationBlock.d.ts +1 -1
- package/FlowGraph/Blocks/Data/flowGraphUnaryOperationBlock.js +2 -2
- package/FlowGraph/Blocks/Data/flowGraphUnaryOperationBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDoNBlock.d.ts +7 -3
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDoNBlock.js +7 -6
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDoNBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphSequenceBlock.d.ts +14 -0
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphSequenceBlock.js +4 -0
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphSequenceBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/flowGraphSetVariableBlock.d.ts +3 -0
- package/FlowGraph/Blocks/Execution/flowGraphSetVariableBlock.js.map +1 -1
- package/FlowGraph/flowGraphConnection.d.ts +16 -0
- package/FlowGraph/flowGraphConnection.js.map +1 -1
- package/FlowGraph/flowGraphContext.d.ts +14 -0
- package/FlowGraph/flowGraphContext.js.map +1 -1
- package/FlowGraph/flowGraphInteger.d.ts +62 -0
- package/FlowGraph/flowGraphInteger.js +76 -0
- package/FlowGraph/flowGraphInteger.js.map +1 -0
- package/FlowGraph/flowGraphPathConverterComponent.d.ts +2 -1
- package/FlowGraph/flowGraphPathConverterComponent.js +3 -3
- package/FlowGraph/flowGraphPathConverterComponent.js.map +1 -1
- package/FlowGraph/flowGraphRichTypes.d.ts +2 -0
- package/FlowGraph/flowGraphRichTypes.js +5 -0
- package/FlowGraph/flowGraphRichTypes.js.map +1 -1
- package/FlowGraph/serialization.js +8 -1
- package/FlowGraph/serialization.js.map +1 -1
- package/Gizmos/gizmo.d.ts +4 -1
- package/Gizmos/gizmo.js.map +1 -1
- package/Inputs/scene.inputManager.js +1 -1
- package/Inputs/scene.inputManager.js.map +1 -1
- package/Lights/spotLight.js +1 -1
- package/Lights/spotLight.js.map +1 -1
- package/Loading/sceneLoader.d.ts +9 -0
- package/Loading/sceneLoader.js +7 -0
- package/Loading/sceneLoader.js.map +1 -1
- package/Materials/GreasedLine/greasedLineMaterialInterfaces.d.ts +1 -1
- package/Materials/GreasedLine/greasedLineMaterialInterfaces.js.map +1 -1
- package/Materials/GreasedLine/greasedLinePluginMaterial.d.ts +2 -1
- package/Materials/GreasedLine/greasedLinePluginMaterial.js +2 -1
- package/Materials/GreasedLine/greasedLinePluginMaterial.js.map +1 -1
- package/Materials/Node/Blocks/Dual/index.d.ts +1 -0
- package/Materials/Node/Blocks/Dual/index.js +1 -0
- package/Materials/Node/Blocks/Dual/index.js.map +1 -1
- package/Materials/Node/Blocks/Dual/reflectionTextureBaseBlock.d.ts +5 -0
- package/Materials/Node/Blocks/Dual/reflectionTextureBaseBlock.js +5 -0
- package/Materials/Node/Blocks/Dual/reflectionTextureBaseBlock.js.map +1 -1
- package/Materials/Node/Blocks/Input/prePassTextureBlock.d.ts +1 -1
- package/Materials/Node/Blocks/Input/prePassTextureBlock.js +1 -1
- package/Materials/Node/Blocks/Input/prePassTextureBlock.js.map +1 -1
- package/Materials/Node/Blocks/addBlock.js +1 -1
- package/Materials/Node/Blocks/addBlock.js.map +1 -1
- package/Materials/Node/Blocks/divideBlock.js +1 -1
- package/Materials/Node/Blocks/divideBlock.js.map +1 -1
- package/Materials/Node/Blocks/multiplyBlock.js +1 -1
- package/Materials/Node/Blocks/multiplyBlock.js.map +1 -1
- package/Materials/Node/Blocks/subtractBlock.js +1 -1
- package/Materials/Node/Blocks/subtractBlock.js.map +1 -1
- package/Materials/Node/nodeMaterial.d.ts +2 -1
- package/Materials/Node/nodeMaterial.js +2 -1
- package/Materials/Node/nodeMaterial.js.map +1 -1
- package/Materials/PBR/pbrBaseMaterial.d.ts +3 -3
- package/Materials/PBR/pbrBaseMaterial.js +3 -3
- package/Materials/PBR/pbrBaseMaterial.js.map +1 -1
- package/Materials/PBR/pbrMaterial.d.ts +1 -0
- package/Materials/PBR/pbrMaterial.js +2 -1
- package/Materials/PBR/pbrMaterial.js.map +1 -1
- package/Materials/PBR/pbrMetallicRoughnessMaterial.d.ts +3 -3
- package/Materials/PBR/pbrMetallicRoughnessMaterial.js +3 -3
- package/Materials/PBR/pbrMetallicRoughnessMaterial.js.map +1 -1
- package/Materials/PBR/pbrSpecularGlossinessMaterial.d.ts +3 -3
- package/Materials/PBR/pbrSpecularGlossinessMaterial.js +3 -3
- package/Materials/PBR/pbrSpecularGlossinessMaterial.js.map +1 -1
- package/Materials/Textures/Procedurals/noiseProceduralTexture.d.ts +1 -1
- package/Materials/Textures/Procedurals/noiseProceduralTexture.js +1 -1
- package/Materials/Textures/Procedurals/noiseProceduralTexture.js.map +1 -1
- package/Materials/Textures/baseTexture.js +3 -0
- package/Materials/Textures/baseTexture.js.map +1 -1
- package/Materials/Textures/multiRenderTarget.d.ts +1 -1
- package/Materials/Textures/multiRenderTarget.js +1 -1
- package/Materials/Textures/multiRenderTarget.js.map +1 -1
- package/Materials/Textures/texture.d.ts +4 -1
- package/Materials/Textures/texture.js +4 -1
- package/Materials/Textures/texture.js.map +1 -1
- package/Materials/Textures/thinRenderTargetTexture.d.ts +1 -1
- package/Materials/Textures/thinRenderTargetTexture.js +1 -1
- package/Materials/Textures/thinRenderTargetTexture.js.map +1 -1
- package/Materials/Textures/thinTexture.js +3 -0
- package/Materials/Textures/thinTexture.js.map +1 -1
- package/Materials/effect.js +2 -1
- package/Materials/effect.js.map +1 -1
- package/Materials/material.d.ts +1 -1
- package/Materials/material.js +2 -2
- package/Materials/material.js.map +1 -1
- package/Materials/standardMaterial.js +1 -1
- package/Materials/standardMaterial.js.map +1 -1
- package/Maths/math.like.d.ts +3 -0
- package/Maths/math.like.js.map +1 -1
- package/Maths/math.polar.d.ts +3 -2
- package/Maths/math.polar.js +8 -2
- package/Maths/math.polar.js.map +1 -1
- package/Maths/math.vector.d.ts +1 -1
- package/Maths/math.vector.js +1 -1
- package/Maths/math.vector.js.map +1 -1
- package/Meshes/GreasedLine/greasedLineBaseMesh.d.ts +2 -0
- package/Meshes/GreasedLine/greasedLineBaseMesh.js +2 -0
- package/Meshes/GreasedLine/greasedLineBaseMesh.js.map +1 -1
- package/Meshes/GreasedLine/greasedLineRibbonMesh.d.ts +2 -0
- package/Meshes/GreasedLine/greasedLineRibbonMesh.js +2 -0
- package/Meshes/GreasedLine/greasedLineRibbonMesh.js.map +1 -1
- package/Meshes/Node/Blocks/Textures/geometryTextureBlock.d.ts +1 -1
- package/Meshes/Node/Blocks/Textures/geometryTextureBlock.js +1 -1
- package/Meshes/Node/Blocks/Textures/geometryTextureBlock.js.map +1 -1
- package/Meshes/geodesicMesh.d.ts +32 -1
- package/Meshes/geodesicMesh.js +17 -1
- package/Meshes/geodesicMesh.js.map +1 -1
- package/Meshes/instancedMesh.d.ts +27 -14
- package/Meshes/instancedMesh.js +27 -14
- package/Meshes/instancedMesh.js.map +1 -1
- package/Meshes/linesMesh.d.ts +3 -3
- package/Meshes/linesMesh.js +3 -3
- package/Meshes/linesMesh.js.map +1 -1
- package/Meshes/transformNode.js +18 -0
- package/Meshes/transformNode.js.map +1 -1
- package/Misc/HighDynamicRange/hdr.d.ts +1 -0
- package/Misc/HighDynamicRange/hdr.js +1 -0
- package/Misc/HighDynamicRange/hdr.js.map +1 -1
- package/Misc/HighDynamicRange/panoramaToCubemap.d.ts +1 -0
- package/Misc/HighDynamicRange/panoramaToCubemap.js +1 -0
- package/Misc/HighDynamicRange/panoramaToCubemap.js.map +1 -1
- package/Misc/decorators.d.ts +1 -0
- package/Misc/decorators.js +1 -0
- package/Misc/decorators.js.map +1 -1
- package/Misc/greasedLineTools.d.ts +5 -1
- package/Misc/greasedLineTools.js +5 -1
- package/Misc/greasedLineTools.js.map +1 -1
- package/Misc/tools.d.ts +4 -0
- package/Misc/tools.js +4 -0
- package/Misc/tools.js.map +1 -1
- package/Misc/videoRecorder.d.ts +4 -1
- package/Misc/videoRecorder.js +7 -5
- package/Misc/videoRecorder.js.map +1 -1
- package/Misc/webRequest.d.ts +3 -0
- package/Misc/webRequest.js +3 -0
- package/Misc/webRequest.js.map +1 -1
- package/Navigation/INavigationEngine.d.ts +10 -1
- package/Navigation/INavigationEngine.js.map +1 -1
- package/Navigation/Plugins/recastJSPlugin.d.ts +20 -0
- package/Navigation/Plugins/recastJSPlugin.js +43 -8
- package/Navigation/Plugins/recastJSPlugin.js.map +1 -1
- package/ObjectModel/objectModelInterfaces.d.ts +5 -0
- package/ObjectModel/objectModelInterfaces.js.map +1 -1
- package/Physics/physicsHelper.d.ts +2 -2
- package/Physics/physicsHelper.js +4 -4
- package/Physics/physicsHelper.js.map +1 -1
- package/Physics/physicsRaycastResult.d.ts +2 -1
- package/Physics/physicsRaycastResult.js +2 -1
- package/Physics/physicsRaycastResult.js.map +1 -1
- package/Physics/v1/physicsImpostor.d.ts +2 -2
- package/Physics/v1/physicsImpostor.js +2 -2
- package/Physics/v1/physicsImpostor.js.map +1 -1
- package/Physics/v2/Plugins/havokPlugin.d.ts +49 -4
- package/Physics/v2/Plugins/havokPlugin.js +51 -4
- package/Physics/v2/Plugins/havokPlugin.js.map +1 -1
- package/Physics/v2/physicsBody.d.ts +33 -3
- package/Physics/v2/physicsBody.js +24 -5
- package/Physics/v2/physicsBody.js.map +1 -1
- package/Physics/v2/physicsEngine.d.ts +4 -1
- package/Physics/v2/physicsEngine.js +4 -1
- package/Physics/v2/physicsEngine.js.map +1 -1
- package/Physics/v2/ragdoll.js +4 -0
- package/Physics/v2/ragdoll.js.map +1 -1
- package/PostProcesses/RenderPipeline/Pipelines/ssao2RenderingPipeline.d.ts +1 -1
- package/PostProcesses/RenderPipeline/Pipelines/ssao2RenderingPipeline.js +1 -1
- package/PostProcesses/RenderPipeline/Pipelines/ssao2RenderingPipeline.js.map +1 -1
- package/PostProcesses/RenderPipeline/Pipelines/ssaoRenderingPipeline.d.ts +1 -1
- package/PostProcesses/RenderPipeline/Pipelines/ssaoRenderingPipeline.js +1 -1
- package/PostProcesses/RenderPipeline/Pipelines/ssaoRenderingPipeline.js.map +1 -1
- package/PostProcesses/RenderPipeline/Pipelines/ssrRenderingPipeline.d.ts +1 -1
- package/PostProcesses/RenderPipeline/Pipelines/ssrRenderingPipeline.js +1 -1
- package/PostProcesses/RenderPipeline/Pipelines/ssrRenderingPipeline.js.map +1 -1
- package/PostProcesses/volumetricLightScatteringPostProcess.d.ts +1 -1
- package/PostProcesses/volumetricLightScatteringPostProcess.js +1 -1
- package/PostProcesses/volumetricLightScatteringPostProcess.js.map +1 -1
- package/Rendering/GlobalIllumination/giRSMManager.d.ts +2 -1
- package/Rendering/GlobalIllumination/giRSMManager.js +5 -2
- package/Rendering/GlobalIllumination/giRSMManager.js.map +1 -1
- package/Rendering/prePassRenderer.d.ts +2 -2
- package/Rendering/prePassRenderer.js +2 -2
- package/Rendering/prePassRenderer.js.map +1 -1
- package/Rendering/reflectiveShadowMap.d.ts +4 -0
- package/Rendering/reflectiveShadowMap.js +7 -0
- package/Rendering/reflectiveShadowMap.js.map +1 -1
- package/Rendering/renderingManager.d.ts +1 -0
- package/Rendering/renderingManager.js +1 -0
- package/Rendering/renderingManager.js.map +1 -1
- package/XR/features/WebXRAbstractFeature.d.ts +4 -0
- package/XR/features/WebXRAbstractFeature.js.map +1 -1
- package/XR/features/WebXRControllerPointerSelection.js +1 -0
- package/XR/features/WebXRControllerPointerSelection.js.map +1 -1
- package/XR/features/WebXRDepthSensing.d.ts +1 -1
- package/XR/features/WebXRDepthSensing.js +1 -1
- package/XR/features/WebXRDepthSensing.js.map +1 -1
- package/XR/features/WebXRSpaceWarp.d.ts +0 -27
- package/XR/features/WebXRSpaceWarp.js +0 -27
- package/XR/features/WebXRSpaceWarp.js.map +1 -1
- package/XR/index.d.ts +1 -0
- package/XR/index.js +1 -0
- package/XR/index.js.map +1 -1
- package/assetContainer.d.ts +1 -1
- package/assetContainer.js +1 -1
- package/assetContainer.js.map +1 -1
- package/node.d.ts +3 -0
- package/node.js +3 -0
- package/node.js.map +1 -1
- package/package.json +1 -1
- package/FlowGraph/Blocks/Data/Logic/flowGraphBitwiseBlocks.d.ts +0 -60
- package/FlowGraph/Blocks/Data/Logic/flowGraphBitwiseBlocks.js +0 -104
- package/FlowGraph/Blocks/Data/Logic/flowGraphBitwiseBlocks.js.map +0 -1
package/Loading/sceneLoader.d.ts
CHANGED
|
@@ -114,10 +114,12 @@ export interface ISceneLoaderPluginBase {
|
|
|
114
114
|
* The callback called when loading from a url.
|
|
115
115
|
* @param scene scene loading this url
|
|
116
116
|
* @param fileOrUrl file or url to load
|
|
117
|
+
* @param rootUrl root url to use to load assets
|
|
117
118
|
* @param onSuccess callback called when the file successfully loads
|
|
118
119
|
* @param onProgress callback called while file is loading (if the server supports this mode)
|
|
119
120
|
* @param useArrayBuffer defines a boolean indicating that date must be returned as ArrayBuffer
|
|
120
121
|
* @param onError callback called when the file fails to load
|
|
122
|
+
* @param name defines the name of the file when loading a binary file
|
|
121
123
|
* @returns a file request object
|
|
122
124
|
*/
|
|
123
125
|
loadFile?(scene: Scene, fileOrUrl: File | string | ArrayBufferView, rootUrl: string, onSuccess: (data: any, responseURL?: string) => void, onProgress?: (ev: ISceneLoaderProgressEvent) => void, useArrayBuffer?: boolean, onError?: (request?: WebRequest, exception?: LoadFileError) => void, name?: string): Nullable<IFileRequest>;
|
|
@@ -335,6 +337,7 @@ export declare class SceneLoader {
|
|
|
335
337
|
* @param onProgress a callback with a progress event for each file being loaded
|
|
336
338
|
* @param onError a callback with the scene, a message, and possibly an exception when import fails
|
|
337
339
|
* @param pluginExtension the extension used to determine the plugin
|
|
340
|
+
* @param name defines the name of the file, if the data is binary
|
|
338
341
|
* @returns The loaded plugin
|
|
339
342
|
*/
|
|
340
343
|
static ImportMesh(meshNames: any, rootUrl: string, sceneFilename?: string | File | ArrayBufferView, scene?: Nullable<Scene>, onSuccess?: Nullable<SceneLoaderSuccessCallback>, onProgress?: Nullable<(event: ISceneLoaderProgressEvent) => void>, onError?: Nullable<(scene: Scene, message: string, exception?: any) => void>, pluginExtension?: Nullable<string>, name?: string): Nullable<ISceneLoaderPlugin | ISceneLoaderPluginAsync>;
|
|
@@ -346,6 +349,7 @@ export declare class SceneLoader {
|
|
|
346
349
|
* @param scene the instance of BABYLON.Scene to append to
|
|
347
350
|
* @param onProgress a callback with a progress event for each file being loaded
|
|
348
351
|
* @param pluginExtension the extension used to determine the plugin
|
|
352
|
+
* @param name defines the name of the file
|
|
349
353
|
* @returns The loaded list of imported meshes, particle systems, skeletons, and animation groups
|
|
350
354
|
*/
|
|
351
355
|
static ImportMeshAsync(meshNames: any, rootUrl: string, sceneFilename?: string | File | ArrayBufferView, scene?: Nullable<Scene>, onProgress?: Nullable<(event: ISceneLoaderProgressEvent) => void>, pluginExtension?: Nullable<string>, name?: string): Promise<ISceneLoaderAsyncResult>;
|
|
@@ -358,6 +362,7 @@ export declare class SceneLoader {
|
|
|
358
362
|
* @param onProgress a callback with a progress event for each file being loaded
|
|
359
363
|
* @param onError a callback with the scene, a message, and possibly an exception when import fails
|
|
360
364
|
* @param pluginExtension the extension used to determine the plugin
|
|
365
|
+
* @param name defines the filename, if the data is binary
|
|
361
366
|
* @returns The loaded plugin
|
|
362
367
|
*/
|
|
363
368
|
static Load(rootUrl: string, sceneFilename?: string | File | ArrayBufferView, engine?: Nullable<Engine>, onSuccess?: Nullable<(scene: Scene) => void>, onProgress?: Nullable<(event: ISceneLoaderProgressEvent) => void>, onError?: Nullable<(scene: Scene, message: string, exception?: any) => void>, pluginExtension?: Nullable<string>, name?: string): Nullable<ISceneLoaderPlugin | ISceneLoaderPluginAsync>;
|
|
@@ -368,6 +373,7 @@ export declare class SceneLoader {
|
|
|
368
373
|
* @param engine is the instance of BABYLON.Engine to use to create the scene
|
|
369
374
|
* @param onProgress a callback with a progress event for each file being loaded
|
|
370
375
|
* @param pluginExtension the extension used to determine the plugin
|
|
376
|
+
* @param name defines the filename, if the data is binary
|
|
371
377
|
* @returns The loaded scene
|
|
372
378
|
*/
|
|
373
379
|
static LoadAsync(rootUrl: string, sceneFilename?: string | File | ArrayBufferView, engine?: Nullable<Engine>, onProgress?: Nullable<(event: ISceneLoaderProgressEvent) => void>, pluginExtension?: Nullable<string>, name?: string): Promise<Scene>;
|
|
@@ -380,6 +386,7 @@ export declare class SceneLoader {
|
|
|
380
386
|
* @param onProgress a callback with a progress event for each file being loaded
|
|
381
387
|
* @param onError a callback with the scene, a message, and possibly an exception when import fails
|
|
382
388
|
* @param pluginExtension the extension used to determine the plugin
|
|
389
|
+
* @param name defines the name of the file, if the data is binary
|
|
383
390
|
* @returns The loaded plugin
|
|
384
391
|
*/
|
|
385
392
|
static Append(rootUrl: string, sceneFilename?: string | File | ArrayBufferView, scene?: Nullable<Scene>, onSuccess?: Nullable<(scene: Scene) => void>, onProgress?: Nullable<(event: ISceneLoaderProgressEvent) => void>, onError?: Nullable<(scene: Scene, message: string, exception?: any) => void>, pluginExtension?: Nullable<string>, name?: string): Nullable<ISceneLoaderPlugin | ISceneLoaderPluginAsync>;
|
|
@@ -390,6 +397,7 @@ export declare class SceneLoader {
|
|
|
390
397
|
* @param scene is the instance of BABYLON.Scene to append to
|
|
391
398
|
* @param onProgress a callback with a progress event for each file being loaded
|
|
392
399
|
* @param pluginExtension the extension used to determine the plugin
|
|
400
|
+
* @param name defines the name of the file, if the data is binary
|
|
393
401
|
* @returns The given scene
|
|
394
402
|
*/
|
|
395
403
|
static AppendAsync(rootUrl: string, sceneFilename?: string | File | ArrayBufferView, scene?: Nullable<Scene>, onProgress?: Nullable<(event: ISceneLoaderProgressEvent) => void>, pluginExtension?: Nullable<string>, name?: string): Promise<Scene>;
|
|
@@ -402,6 +410,7 @@ export declare class SceneLoader {
|
|
|
402
410
|
* @param onProgress a callback with a progress event for each file being loaded
|
|
403
411
|
* @param onError a callback with the scene, a message, and possibly an exception when import fails
|
|
404
412
|
* @param pluginExtension the extension used to determine the plugin
|
|
413
|
+
* @param name defines the filename, if the data is binary
|
|
405
414
|
* @returns The loaded plugin
|
|
406
415
|
*/
|
|
407
416
|
static LoadAssetContainer(rootUrl: string, sceneFilename?: string | File | ArrayBufferView, scene?: Nullable<Scene>, onSuccess?: Nullable<(assets: AssetContainer) => void>, onProgress?: Nullable<(event: ISceneLoaderProgressEvent) => void>, onError?: Nullable<(scene: Scene, message: string, exception?: any) => void>, pluginExtension?: Nullable<string>, name?: string): Nullable<ISceneLoaderPlugin | ISceneLoaderPluginAsync>;
|
package/Loading/sceneLoader.js
CHANGED
|
@@ -321,6 +321,7 @@ export class SceneLoader {
|
|
|
321
321
|
* @param onProgress a callback with a progress event for each file being loaded
|
|
322
322
|
* @param onError a callback with the scene, a message, and possibly an exception when import fails
|
|
323
323
|
* @param pluginExtension the extension used to determine the plugin
|
|
324
|
+
* @param name defines the name of the file, if the data is binary
|
|
324
325
|
* @returns The loaded plugin
|
|
325
326
|
*/
|
|
326
327
|
static ImportMesh(meshNames, rootUrl, sceneFilename = "", scene = EngineStore.LastCreatedScene, onSuccess = null, onProgress = null, onError = null, pluginExtension = null, name = "") {
|
|
@@ -407,6 +408,7 @@ export class SceneLoader {
|
|
|
407
408
|
* @param scene the instance of BABYLON.Scene to append to
|
|
408
409
|
* @param onProgress a callback with a progress event for each file being loaded
|
|
409
410
|
* @param pluginExtension the extension used to determine the plugin
|
|
411
|
+
* @param name defines the name of the file
|
|
410
412
|
* @returns The loaded list of imported meshes, particle systems, skeletons, and animation groups
|
|
411
413
|
*/
|
|
412
414
|
static ImportMeshAsync(meshNames, rootUrl, sceneFilename = "", scene = EngineStore.LastCreatedScene, onProgress = null, pluginExtension = null, name = "") {
|
|
@@ -435,6 +437,7 @@ export class SceneLoader {
|
|
|
435
437
|
* @param onProgress a callback with a progress event for each file being loaded
|
|
436
438
|
* @param onError a callback with the scene, a message, and possibly an exception when import fails
|
|
437
439
|
* @param pluginExtension the extension used to determine the plugin
|
|
440
|
+
* @param name defines the filename, if the data is binary
|
|
438
441
|
* @returns The loaded plugin
|
|
439
442
|
*/
|
|
440
443
|
static Load(rootUrl, sceneFilename = "", engine = EngineStore.LastCreatedEngine, onSuccess = null, onProgress = null, onError = null, pluginExtension = null, name = "") {
|
|
@@ -451,6 +454,7 @@ export class SceneLoader {
|
|
|
451
454
|
* @param engine is the instance of BABYLON.Engine to use to create the scene
|
|
452
455
|
* @param onProgress a callback with a progress event for each file being loaded
|
|
453
456
|
* @param pluginExtension the extension used to determine the plugin
|
|
457
|
+
* @param name defines the filename, if the data is binary
|
|
454
458
|
* @returns The loaded scene
|
|
455
459
|
*/
|
|
456
460
|
static LoadAsync(rootUrl, sceneFilename = "", engine = EngineStore.LastCreatedEngine, onProgress = null, pluginExtension = null, name = "") {
|
|
@@ -471,6 +475,7 @@ export class SceneLoader {
|
|
|
471
475
|
* @param onProgress a callback with a progress event for each file being loaded
|
|
472
476
|
* @param onError a callback with the scene, a message, and possibly an exception when import fails
|
|
473
477
|
* @param pluginExtension the extension used to determine the plugin
|
|
478
|
+
* @param name defines the name of the file, if the data is binary
|
|
474
479
|
* @returns The loaded plugin
|
|
475
480
|
*/
|
|
476
481
|
static Append(rootUrl, sceneFilename = "", scene = EngineStore.LastCreatedScene, onSuccess = null, onProgress = null, onError = null, pluginExtension = null, name = "") {
|
|
@@ -557,6 +562,7 @@ export class SceneLoader {
|
|
|
557
562
|
* @param scene is the instance of BABYLON.Scene to append to
|
|
558
563
|
* @param onProgress a callback with a progress event for each file being loaded
|
|
559
564
|
* @param pluginExtension the extension used to determine the plugin
|
|
565
|
+
* @param name defines the name of the file, if the data is binary
|
|
560
566
|
* @returns The given scene
|
|
561
567
|
*/
|
|
562
568
|
static AppendAsync(rootUrl, sceneFilename = "", scene = EngineStore.LastCreatedScene, onProgress = null, pluginExtension = null, name = "") {
|
|
@@ -577,6 +583,7 @@ export class SceneLoader {
|
|
|
577
583
|
* @param onProgress a callback with a progress event for each file being loaded
|
|
578
584
|
* @param onError a callback with the scene, a message, and possibly an exception when import fails
|
|
579
585
|
* @param pluginExtension the extension used to determine the plugin
|
|
586
|
+
* @param name defines the filename, if the data is binary
|
|
580
587
|
* @returns The loaded plugin
|
|
581
588
|
*/
|
|
582
589
|
static LoadAssetContainer(rootUrl, sceneFilename = "", scene = EngineStore.LastCreatedScene, onSuccess = null, onProgress = null, onError = null, pluginExtension = null, name = "") {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sceneLoader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SAAS,IAAI,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;YAC5C,CAAC,EACD,eAAe,CAClB,CAAC;QACN,CAAC,CAAC,CAAC;IACP,CAAC;;AAjgCD;;GAEG;AACoB,sBAAU,GAAG,SAAS,CAAC,sBAAsB,CAAC;AAErE;;GAEG;AACoB,2BAAe,GAAG,SAAS,CAAC,2BAA2B,CAAC;AAE/E;;GAEG;AACoB,2BAAe,GAAG,SAAS,CAAC,2BAA2B,CAAC;AAE/E;;GAEG;AACoB,4BAAgB,GAAG,SAAS,CAAC,4BAA4B,CAAC;AAiDjF,UAAU;AAEV;;GAEG;AACW,uCAA2B,GAAG,IAAI,UAAU,EAAgD,CAAC;AAE5F,8BAAkB,GAA+C,EAAE,CAAC;AAEpE,iCAAqB,GAAG,KAAK,CAAC","sourcesContent":["import { Tools } from \"../Misc/tools\";\r\nimport { Observable } from \"../Misc/observable\";\r\nimport type { Nullable } from \"../types\";\r\nimport { Scene } from \"../scene\";\r\nimport { Engine } from \"../Engines/engine\";\r\nimport { EngineStore } from \"../Engines/engineStore\";\r\nimport type { AbstractMesh } from \"../Meshes/abstractMesh\";\r\nimport type { AnimationGroup } from \"../Animations/animationGroup\";\r\nimport type { AssetContainer } from \"../assetContainer\";\r\nimport type { IParticleSystem } from \"../Particles/IParticleSystem\";\r\nimport type { Skeleton } from \"../Bones/skeleton\";\r\nimport { Logger } from \"../Misc/logger\";\r\nimport { Constants } from \"../Engines/constants\";\r\nimport { SceneLoaderFlags } from \"./sceneLoaderFlags\";\r\nimport type { IFileRequest } from \"../Misc/fileRequest\";\r\nimport type { WebRequest } from \"../Misc/webRequest\";\r\nimport type { LoadFileError } from \"../Misc/fileTools\";\r\nimport { IsBase64DataUrl } from \"../Misc/fileTools\";\r\nimport type { TransformNode } from \"../Meshes/transformNode\";\r\nimport type { Geometry } from \"../Meshes/geometry\";\r\nimport type { Light } from \"../Lights/light\";\r\nimport { RuntimeError, ErrorCodes } from \"../Misc/error\";\r\n\r\n/**\r\n * Type used for the success callback of ImportMesh\r\n */\r\nexport type SceneLoaderSuccessCallback = (\r\n meshes: AbstractMesh[],\r\n particleSystems: IParticleSystem[],\r\n skeletons: Skeleton[],\r\n animationGroups: AnimationGroup[],\r\n transformNodes: TransformNode[],\r\n geometries: Geometry[],\r\n lights: Light[]\r\n) => void;\r\n\r\n/**\r\n * Interface used for the result of ImportMeshAsync\r\n */\r\nexport interface ISceneLoaderAsyncResult {\r\n /**\r\n * The array of loaded meshes\r\n */\r\n readonly meshes: AbstractMesh[];\r\n\r\n /**\r\n * The array of loaded particle systems\r\n */\r\n readonly particleSystems: IParticleSystem[];\r\n\r\n /**\r\n * The array of loaded skeletons\r\n */\r\n readonly skeletons: Skeleton[];\r\n\r\n /**\r\n * The array of loaded animation groups\r\n */\r\n readonly animationGroups: AnimationGroup[];\r\n\r\n /**\r\n * The array of loaded transform nodes\r\n */\r\n readonly transformNodes: TransformNode[];\r\n\r\n /**\r\n * The array of loaded geometries\r\n */\r\n readonly geometries: Geometry[];\r\n\r\n /**\r\n * The array of loaded lights\r\n */\r\n readonly lights: Light[];\r\n}\r\n\r\n/**\r\n * Interface used to represent data loading progression\r\n */\r\nexport interface ISceneLoaderProgressEvent {\r\n /**\r\n * Defines if data length to load can be evaluated\r\n */\r\n readonly lengthComputable: boolean;\r\n\r\n /**\r\n * Defines the loaded data length\r\n */\r\n readonly loaded: number;\r\n\r\n /**\r\n * Defines the data length to load\r\n */\r\n readonly total: number;\r\n}\r\n\r\n/**\r\n * Interface used by SceneLoader plugins to define supported file extensions\r\n */\r\nexport interface ISceneLoaderPluginExtensions {\r\n /**\r\n * Defines the list of supported extensions\r\n */\r\n [extension: string]: {\r\n isBinary: boolean;\r\n };\r\n}\r\n\r\n/**\r\n * Interface used by SceneLoader plugin factory\r\n */\r\nexport interface ISceneLoaderPluginFactory {\r\n /**\r\n * Defines the name of the factory\r\n */\r\n name: string;\r\n\r\n /**\r\n * Function called to create a new plugin\r\n * @returns the new plugin\r\n */\r\n createPlugin(): ISceneLoaderPlugin | ISceneLoaderPluginAsync;\r\n\r\n /**\r\n * The callback that returns true if the data can be directly loaded.\r\n * @param data string containing the file data\r\n * @returns if the data can be loaded directly\r\n */\r\n canDirectLoad?(data: string): boolean;\r\n}\r\n\r\n/**\r\n * Interface used to define the base of ISceneLoaderPlugin and ISceneLoaderPluginAsync\r\n */\r\nexport interface ISceneLoaderPluginBase {\r\n /**\r\n * The friendly name of this plugin.\r\n */\r\n name: string;\r\n\r\n /**\r\n * The file extensions supported by this plugin.\r\n */\r\n extensions: string | ISceneLoaderPluginExtensions;\r\n\r\n /**\r\n * The callback called when loading from a url.\r\n * @param scene scene loading this url\r\n * @param fileOrUrl file or url to load\r\n * @param onSuccess callback called when the file successfully loads\r\n * @param onProgress callback called while file is loading (if the server supports this mode)\r\n * @param useArrayBuffer defines a boolean indicating that date must be returned as ArrayBuffer\r\n * @param onError callback called when the file fails to load\r\n * @returns a file request object\r\n */\r\n loadFile?(\r\n scene: Scene,\r\n fileOrUrl: File | string | ArrayBufferView,\r\n rootUrl: string,\r\n onSuccess: (data: any, responseURL?: string) => void,\r\n onProgress?: (ev: ISceneLoaderProgressEvent) => void,\r\n useArrayBuffer?: boolean,\r\n onError?: (request?: WebRequest, exception?: LoadFileError) => void,\r\n name?: string\r\n ): Nullable<IFileRequest>;\r\n\r\n /**\r\n * The callback that returns true if the data can be directly loaded.\r\n * @param data string containing the file data\r\n * @returns if the data can be loaded directly\r\n */\r\n canDirectLoad?(data: string): boolean;\r\n\r\n /**\r\n * The callback that returns the data to pass to the plugin if the data can be directly loaded.\r\n * @param scene scene loading this data\r\n * @param data string containing the data\r\n * @returns data to pass to the plugin\r\n */\r\n directLoad?(scene: Scene, data: string): any;\r\n\r\n /**\r\n * The callback that allows custom handling of the root url based on the response url.\r\n * @param rootUrl the original root url\r\n * @param responseURL the response url if available\r\n * @returns the new root url\r\n */\r\n rewriteRootURL?(rootUrl: string, responseURL?: string): string;\r\n}\r\n\r\n/**\r\n * Interface used to define a SceneLoader plugin\r\n */\r\nexport interface ISceneLoaderPlugin extends ISceneLoaderPluginBase {\r\n /**\r\n * Import meshes into a scene.\r\n * @param meshesNames An array of mesh names, a single mesh name, or empty string for all meshes that filter what meshes are imported\r\n * @param scene The scene to import into\r\n * @param data The data to import\r\n * @param rootUrl The root url for scene and resources\r\n * @param meshes The meshes array to import into\r\n * @param particleSystems The particle systems array to import into\r\n * @param skeletons The skeletons array to import into\r\n * @param onError The callback when import fails\r\n * @returns True if successful or false otherwise\r\n */\r\n importMesh(\r\n meshesNames: any,\r\n scene: Scene,\r\n data: any,\r\n rootUrl: string,\r\n meshes: AbstractMesh[],\r\n particleSystems: IParticleSystem[],\r\n skeletons: Skeleton[],\r\n onError?: (message: string, exception?: any) => void\r\n ): boolean;\r\n\r\n /**\r\n * Load into a scene.\r\n * @param scene The scene to load into\r\n * @param data The data to import\r\n * @param rootUrl The root url for scene and resources\r\n * @param onError The callback when import fails\r\n * @returns True if successful or false otherwise\r\n */\r\n load(scene: Scene, data: any, rootUrl: string, onError?: (message: string, exception?: any) => void): boolean;\r\n\r\n /**\r\n * Load into an asset container.\r\n * @param scene The scene to load into\r\n * @param data The data to import\r\n * @param rootUrl The root url for scene and resources\r\n * @param onError The callback when import fails\r\n * @returns The loaded asset container\r\n */\r\n loadAssetContainer(scene: Scene, data: any, rootUrl: string, onError?: (message: string, exception?: any) => void): AssetContainer;\r\n}\r\n\r\n/**\r\n * Interface used to define an async SceneLoader plugin\r\n */\r\nexport interface ISceneLoaderPluginAsync extends ISceneLoaderPluginBase {\r\n /**\r\n * Import meshes into a scene.\r\n * @param meshesNames An array of mesh names, a single mesh name, or empty string for all meshes that filter what meshes are imported\r\n * @param scene The scene to import into\r\n * @param data The data to import\r\n * @param rootUrl The root url for scene and resources\r\n * @param onProgress The callback when the load progresses\r\n * @param fileName Defines the name of the file to load\r\n * @returns The loaded objects (e.g. meshes, particle systems, skeletons, animation groups, etc.)\r\n */\r\n importMeshAsync(\r\n meshesNames: any,\r\n scene: Scene,\r\n data: any,\r\n rootUrl: string,\r\n onProgress?: (event: ISceneLoaderProgressEvent) => void,\r\n fileName?: string\r\n ): Promise<ISceneLoaderAsyncResult>;\r\n\r\n /**\r\n * Load into a scene.\r\n * @param scene The scene to load into\r\n * @param data The data to import\r\n * @param rootUrl The root url for scene and resources\r\n * @param onProgress The callback when the load progresses\r\n * @param fileName Defines the name of the file to load\r\n * @returns Nothing\r\n */\r\n loadAsync(scene: Scene, data: any, rootUrl: string, onProgress?: (event: ISceneLoaderProgressEvent) => void, fileName?: string): Promise<void>;\r\n\r\n /**\r\n * Load into an asset container.\r\n * @param scene The scene to load into\r\n * @param data The data to import\r\n * @param rootUrl The root url for scene and resources\r\n * @param onProgress The callback when the load progresses\r\n * @param fileName Defines the name of the file to load\r\n * @returns The loaded asset container\r\n */\r\n loadAssetContainerAsync(scene: Scene, data: any, rootUrl: string, onProgress?: (event: ISceneLoaderProgressEvent) => void, fileName?: string): Promise<AssetContainer>;\r\n}\r\n\r\n/**\r\n * Mode that determines how to handle old animation groups before loading new ones.\r\n */\r\nexport enum SceneLoaderAnimationGroupLoadingMode {\r\n /**\r\n * Reset all old animations to initial state then dispose them.\r\n */\r\n Clean = 0,\r\n\r\n /**\r\n * Stop all old animations.\r\n */\r\n Stop = 1,\r\n\r\n /**\r\n * Restart old animations from first frame.\r\n */\r\n Sync = 2,\r\n\r\n /**\r\n * Old animations remains untouched.\r\n */\r\n NoSync = 3,\r\n}\r\n\r\n/**\r\n * Defines a plugin registered by the SceneLoader\r\n */\r\ninterface IRegisteredPlugin {\r\n /**\r\n * Defines the plugin to use\r\n */\r\n plugin: ISceneLoaderPlugin | ISceneLoaderPluginAsync | ISceneLoaderPluginFactory;\r\n /**\r\n * Defines if the plugin supports binary data\r\n */\r\n isBinary: boolean;\r\n}\r\n\r\n/**\r\n * Defines file information\r\n */\r\ninterface IFileInfo {\r\n /**\r\n * Gets the file url\r\n */\r\n url: string;\r\n /**\r\n * Gets the root url\r\n */\r\n rootUrl: string;\r\n /**\r\n * Gets filename\r\n */\r\n name: string;\r\n /**\r\n * Gets the file\r\n */\r\n file: Nullable<File>;\r\n\r\n /**\r\n * Gets raw binary data.\r\n */\r\n rawData: Nullable<ArrayBufferView>;\r\n}\r\n\r\n/**\r\n * Class used to load scene from various file formats using registered plugins\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/importers/loadingFileTypes\r\n */\r\nexport class SceneLoader {\r\n /**\r\n * No logging while loading\r\n */\r\n public static readonly NO_LOGGING = Constants.SCENELOADER_NO_LOGGING;\r\n\r\n /**\r\n * Minimal logging while loading\r\n */\r\n public static readonly MINIMAL_LOGGING = Constants.SCENELOADER_MINIMAL_LOGGING;\r\n\r\n /**\r\n * Summary logging while loading\r\n */\r\n public static readonly SUMMARY_LOGGING = Constants.SCENELOADER_SUMMARY_LOGGING;\r\n\r\n /**\r\n * Detailed logging while loading\r\n */\r\n public static readonly DETAILED_LOGGING = Constants.SCENELOADER_DETAILED_LOGGING;\r\n\r\n /**\r\n * Gets or sets a boolean indicating if entire scene must be loaded even if scene contains incremental data\r\n */\r\n public static get ForceFullSceneLoadingForIncremental() {\r\n return SceneLoaderFlags.ForceFullSceneLoadingForIncremental;\r\n }\r\n\r\n public static set ForceFullSceneLoadingForIncremental(value: boolean) {\r\n SceneLoaderFlags.ForceFullSceneLoadingForIncremental = value;\r\n }\r\n\r\n /**\r\n * Gets or sets a boolean indicating if loading screen must be displayed while loading a scene\r\n */\r\n public static get ShowLoadingScreen(): boolean {\r\n return SceneLoaderFlags.ShowLoadingScreen;\r\n }\r\n\r\n public static set ShowLoadingScreen(value: boolean) {\r\n SceneLoaderFlags.ShowLoadingScreen = value;\r\n }\r\n\r\n /**\r\n * Defines the current logging level (while loading the scene)\r\n * @ignorenaming\r\n */\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n public static get loggingLevel(): number {\r\n return SceneLoaderFlags.loggingLevel;\r\n }\r\n\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n public static set loggingLevel(value: number) {\r\n SceneLoaderFlags.loggingLevel = value;\r\n }\r\n\r\n /**\r\n * Gets or set a boolean indicating if matrix weights must be cleaned upon loading\r\n */\r\n public static get CleanBoneMatrixWeights(): boolean {\r\n return SceneLoaderFlags.CleanBoneMatrixWeights;\r\n }\r\n\r\n public static set CleanBoneMatrixWeights(value: boolean) {\r\n SceneLoaderFlags.CleanBoneMatrixWeights = value;\r\n }\r\n\r\n // Members\r\n\r\n /**\r\n * Event raised when a plugin is used to load a scene\r\n */\r\n public static OnPluginActivatedObservable = new Observable<ISceneLoaderPlugin | ISceneLoaderPluginAsync>();\r\n\r\n private static _RegisteredPlugins: { [extension: string]: IRegisteredPlugin } = {};\r\n\r\n private static _ShowingLoadingScreen = false;\r\n\r\n /**\r\n * Gets the default plugin (used to load Babylon files)\r\n * @returns the .babylon plugin\r\n */\r\n public static GetDefaultPlugin(): IRegisteredPlugin {\r\n return SceneLoader._RegisteredPlugins[\".babylon\"];\r\n }\r\n\r\n private static _GetPluginForExtension(extension: string): IRegisteredPlugin {\r\n const registeredPlugin = SceneLoader._RegisteredPlugins[extension];\r\n if (registeredPlugin) {\r\n return registeredPlugin;\r\n }\r\n Logger.Warn(\r\n \"Unable to find a plugin to load \" +\r\n extension +\r\n \" files. Trying to use .babylon default plugin. To load from a specific filetype (eg. gltf) see: https://doc.babylonjs.com/features/featuresDeepDive/importers/loadingFileTypes\"\r\n );\r\n return SceneLoader.GetDefaultPlugin();\r\n }\r\n\r\n private static _GetPluginForDirectLoad(data: string): IRegisteredPlugin {\r\n for (const extension in SceneLoader._RegisteredPlugins) {\r\n const plugin = SceneLoader._RegisteredPlugins[extension].plugin;\r\n\r\n if (plugin.canDirectLoad && plugin.canDirectLoad(data)) {\r\n return SceneLoader._RegisteredPlugins[extension];\r\n }\r\n }\r\n\r\n return SceneLoader.GetDefaultPlugin();\r\n }\r\n\r\n private static _GetPluginForFilename(sceneFilename: string): IRegisteredPlugin {\r\n const queryStringPosition = sceneFilename.indexOf(\"?\");\r\n\r\n if (queryStringPosition !== -1) {\r\n sceneFilename = sceneFilename.substring(0, queryStringPosition);\r\n }\r\n\r\n const dotPosition = sceneFilename.lastIndexOf(\".\");\r\n\r\n const extension = sceneFilename.substring(dotPosition, sceneFilename.length).toLowerCase();\r\n return SceneLoader._GetPluginForExtension(extension);\r\n }\r\n\r\n private static _GetDirectLoad(sceneFilename: string): Nullable<string> {\r\n if (sceneFilename.substr(0, 5) === \"data:\") {\r\n return sceneFilename.substr(5);\r\n }\r\n\r\n return null;\r\n }\r\n\r\n private static _FormatErrorMessage(fileInfo: IFileInfo, message?: string, exception?: any): string {\r\n const fromLoad = fileInfo.rawData ? \"binary data\" : fileInfo.url;\r\n let errorMessage = \"Unable to load from \" + fromLoad;\r\n\r\n if (message) {\r\n errorMessage += `: ${message}`;\r\n } else if (exception) {\r\n errorMessage += `: ${exception}`;\r\n }\r\n\r\n return errorMessage;\r\n }\r\n\r\n private static _LoadData(\r\n fileInfo: IFileInfo,\r\n scene: Scene,\r\n onSuccess: (plugin: ISceneLoaderPlugin | ISceneLoaderPluginAsync, data: any, responseURL?: string) => void,\r\n onProgress: ((event: ISceneLoaderProgressEvent) => void) | undefined,\r\n onError: (message?: string, exception?: any) => void,\r\n onDispose: () => void,\r\n pluginExtension: Nullable<string>,\r\n name: string\r\n ): Nullable<ISceneLoaderPlugin | ISceneLoaderPluginAsync> {\r\n const directLoad = SceneLoader._GetDirectLoad(fileInfo.url);\r\n\r\n if (fileInfo.rawData && !pluginExtension) {\r\n throw \"When using ArrayBufferView to load data the file extension must be provided.\";\r\n }\r\n\r\n const registeredPlugin = pluginExtension\r\n ? SceneLoader._GetPluginForExtension(pluginExtension)\r\n : directLoad\r\n ? SceneLoader._GetPluginForDirectLoad(fileInfo.url)\r\n : SceneLoader._GetPluginForFilename(fileInfo.url);\r\n\r\n if (fileInfo.rawData && !registeredPlugin.isBinary) {\r\n throw \"Loading from ArrayBufferView can not be used with plugins that don't support binary loading.\";\r\n }\r\n\r\n let plugin: ISceneLoaderPlugin | ISceneLoaderPluginAsync;\r\n\r\n if ((registeredPlugin.plugin as ISceneLoaderPluginFactory).createPlugin !== undefined) {\r\n plugin = (registeredPlugin.plugin as ISceneLoaderPluginFactory).createPlugin();\r\n } else {\r\n plugin = <any>registeredPlugin.plugin;\r\n }\r\n\r\n if (!plugin) {\r\n throw \"The loader plugin corresponding to the file type you are trying to load has not been found. If using es6, please import the plugin you wish to use before.\";\r\n }\r\n\r\n SceneLoader.OnPluginActivatedObservable.notifyObservers(plugin);\r\n\r\n // Check if we have a direct load url. If the plugin is registered to handle\r\n // it or it's not a base64 data url, then pass it through the direct load path.\r\n if (directLoad && ((plugin.canDirectLoad && plugin.canDirectLoad(fileInfo.url)) || !IsBase64DataUrl(fileInfo.url))) {\r\n if (plugin.directLoad) {\r\n const result = plugin.directLoad(scene, directLoad);\r\n if (result.then) {\r\n result\r\n .then((data: any) => {\r\n onSuccess(plugin, data);\r\n })\r\n .catch((error: any) => {\r\n onError(\"Error in directLoad of _loadData: \" + error, error);\r\n });\r\n } else {\r\n onSuccess(plugin, result);\r\n }\r\n } else {\r\n onSuccess(plugin, directLoad);\r\n }\r\n return plugin;\r\n }\r\n\r\n const useArrayBuffer = registeredPlugin.isBinary;\r\n\r\n const dataCallback = (data: any, responseURL?: string) => {\r\n if (scene.isDisposed) {\r\n onError(\"Scene has been disposed\");\r\n return;\r\n }\r\n\r\n onSuccess(plugin, data, responseURL);\r\n };\r\n\r\n let request: Nullable<IFileRequest> = null;\r\n let pluginDisposed = false;\r\n const onDisposeObservable = (plugin as any).onDisposeObservable as Observable<ISceneLoaderPlugin | ISceneLoaderPluginAsync>;\r\n if (onDisposeObservable) {\r\n onDisposeObservable.add(() => {\r\n pluginDisposed = true;\r\n\r\n if (request) {\r\n request.abort();\r\n request = null;\r\n }\r\n\r\n onDispose();\r\n });\r\n }\r\n\r\n const manifestChecked = () => {\r\n if (pluginDisposed) {\r\n return;\r\n }\r\n\r\n const errorCallback = (request?: WebRequest, exception?: LoadFileError) => {\r\n onError(request?.statusText, exception);\r\n };\r\n\r\n if (!plugin.loadFile && fileInfo.rawData) {\r\n throw \"Plugin does not support loading ArrayBufferView.\";\r\n }\r\n\r\n request = plugin.loadFile\r\n ? plugin.loadFile(scene, fileInfo.rawData || fileInfo.file || fileInfo.url, fileInfo.rootUrl, dataCallback, onProgress, useArrayBuffer, errorCallback, name)\r\n : scene._loadFile(fileInfo.file || fileInfo.url, dataCallback, onProgress, true, useArrayBuffer, errorCallback);\r\n };\r\n\r\n const engine = scene.getEngine();\r\n let canUseOfflineSupport = engine.enableOfflineSupport;\r\n if (canUseOfflineSupport) {\r\n // Also check for exceptions\r\n let exceptionFound = false;\r\n for (const regex of scene.disableOfflineSupportExceptionRules) {\r\n if (regex.test(fileInfo.url)) {\r\n exceptionFound = true;\r\n break;\r\n }\r\n }\r\n\r\n canUseOfflineSupport = !exceptionFound;\r\n }\r\n\r\n if (canUseOfflineSupport && Engine.OfflineProviderFactory) {\r\n // Checking if a manifest file has been set for this scene and if offline mode has been requested\r\n scene.offlineProvider = Engine.OfflineProviderFactory(fileInfo.url, manifestChecked, engine.disableManifestCheck);\r\n } else {\r\n manifestChecked();\r\n }\r\n\r\n return plugin;\r\n }\r\n\r\n private static _GetFileInfo(rootUrl: string, sceneFilename: string | File | ArrayBufferView): Nullable<IFileInfo> {\r\n let url: string;\r\n let name: string;\r\n let file: Nullable<File> = null;\r\n let rawData: Nullable<ArrayBufferView> = null;\r\n\r\n if (!sceneFilename) {\r\n url = rootUrl;\r\n name = Tools.GetFilename(rootUrl);\r\n rootUrl = Tools.GetFolderPath(rootUrl);\r\n } else if ((sceneFilename as File).name) {\r\n const sceneFile = sceneFilename as File;\r\n url = `file:${sceneFile.name}`;\r\n name = sceneFile.name;\r\n file = sceneFile;\r\n } else if (ArrayBuffer.isView(sceneFilename)) {\r\n url = \"\";\r\n name = \"arrayBuffer\";\r\n rawData = sceneFilename as ArrayBufferView;\r\n } else if (typeof sceneFilename === \"string\" && sceneFilename.startsWith(\"data:\")) {\r\n url = sceneFilename;\r\n name = \"\";\r\n } else {\r\n const filename = sceneFilename as string;\r\n if (filename.substr(0, 1) === \"/\") {\r\n Tools.Error(\"Wrong sceneFilename parameter\");\r\n return null;\r\n }\r\n\r\n url = rootUrl + filename;\r\n name = filename;\r\n }\r\n\r\n return {\r\n url: url,\r\n rootUrl: rootUrl,\r\n name: name,\r\n file: file,\r\n rawData,\r\n };\r\n }\r\n\r\n // Public functions\r\n\r\n /**\r\n * Gets a plugin that can load the given extension\r\n * @param extension defines the extension to load\r\n * @returns a plugin or null if none works\r\n */\r\n public static GetPluginForExtension(extension: string): ISceneLoaderPlugin | ISceneLoaderPluginAsync | ISceneLoaderPluginFactory {\r\n return SceneLoader._GetPluginForExtension(extension).plugin;\r\n }\r\n\r\n /**\r\n * Gets a boolean indicating that the given extension can be loaded\r\n * @param extension defines the extension to load\r\n * @returns true if the extension is supported\r\n */\r\n public static IsPluginForExtensionAvailable(extension: string): boolean {\r\n return !!SceneLoader._RegisteredPlugins[extension];\r\n }\r\n\r\n /**\r\n * Adds a new plugin to the list of registered plugins\r\n * @param plugin defines the plugin to add\r\n */\r\n public static RegisterPlugin(plugin: ISceneLoaderPlugin | ISceneLoaderPluginAsync): void {\r\n if (typeof plugin.extensions === \"string\") {\r\n const extension = <string>plugin.extensions;\r\n SceneLoader._RegisteredPlugins[extension.toLowerCase()] = {\r\n plugin: plugin,\r\n isBinary: false,\r\n };\r\n } else {\r\n const extensions = <ISceneLoaderPluginExtensions>plugin.extensions;\r\n Object.keys(extensions).forEach((extension) => {\r\n SceneLoader._RegisteredPlugins[extension.toLowerCase()] = {\r\n plugin: plugin,\r\n isBinary: extensions[extension].isBinary,\r\n };\r\n });\r\n }\r\n }\r\n\r\n /**\r\n * Import meshes into a scene\r\n * @param meshNames an array of mesh names, a single mesh name, or empty string for all meshes that filter what meshes are imported\r\n * @param rootUrl a string that defines the root url for the scene and resources or the concatenation of rootURL and filename (e.g. http://example.com/test.glb)\r\n * @param sceneFilename a string that defines the name of the scene file or starts with \"data:\" following by the stringified version of the scene or a File object (default: empty string)\r\n * @param scene the instance of BABYLON.Scene to append to\r\n * @param onSuccess a callback with a list of imported meshes, particleSystems, skeletons, and animationGroups when import succeeds\r\n * @param onProgress a callback with a progress event for each file being loaded\r\n * @param onError a callback with the scene, a message, and possibly an exception when import fails\r\n * @param pluginExtension the extension used to determine the plugin\r\n * @returns The loaded plugin\r\n */\r\n public static ImportMesh(\r\n meshNames: any,\r\n rootUrl: string,\r\n sceneFilename: string | File | ArrayBufferView = \"\",\r\n scene: Nullable<Scene> = EngineStore.LastCreatedScene,\r\n onSuccess: Nullable<SceneLoaderSuccessCallback> = null,\r\n onProgress: Nullable<(event: ISceneLoaderProgressEvent) => void> = null,\r\n onError: Nullable<(scene: Scene, message: string, exception?: any) => void> = null,\r\n pluginExtension: Nullable<string> = null,\r\n name: string = \"\"\r\n ): Nullable<ISceneLoaderPlugin | ISceneLoaderPluginAsync> {\r\n if (!scene) {\r\n Logger.Error(\"No scene available to import mesh to\");\r\n return null;\r\n }\r\n\r\n const fileInfo = SceneLoader._GetFileInfo(rootUrl, sceneFilename);\r\n if (!fileInfo) {\r\n return null;\r\n }\r\n\r\n const loadingToken = {};\r\n scene.addPendingData(loadingToken);\r\n\r\n const disposeHandler = () => {\r\n scene.removePendingData(loadingToken);\r\n };\r\n\r\n const errorHandler = (message?: string, exception?: any) => {\r\n const errorMessage = SceneLoader._FormatErrorMessage(fileInfo, message, exception);\r\n\r\n if (onError) {\r\n onError(scene, errorMessage, new RuntimeError(errorMessage, ErrorCodes.SceneLoaderError, exception));\r\n } else {\r\n Logger.Error(errorMessage);\r\n // should the exception be thrown?\r\n }\r\n\r\n disposeHandler();\r\n };\r\n\r\n const progressHandler = onProgress\r\n ? (event: ISceneLoaderProgressEvent) => {\r\n try {\r\n onProgress(event);\r\n } catch (e) {\r\n errorHandler(\"Error in onProgress callback: \" + e, e);\r\n }\r\n }\r\n : undefined;\r\n\r\n const successHandler: SceneLoaderSuccessCallback = (meshes, particleSystems, skeletons, animationGroups, transformNodes, geometries, lights) => {\r\n scene.importedMeshesFiles.push(fileInfo.url);\r\n\r\n if (onSuccess) {\r\n try {\r\n onSuccess(meshes, particleSystems, skeletons, animationGroups, transformNodes, geometries, lights);\r\n } catch (e) {\r\n errorHandler(\"Error in onSuccess callback: \" + e, e);\r\n }\r\n }\r\n\r\n scene.removePendingData(loadingToken);\r\n };\r\n\r\n return SceneLoader._LoadData(\r\n fileInfo,\r\n scene,\r\n (plugin, data, responseURL) => {\r\n if (plugin.rewriteRootURL) {\r\n fileInfo.rootUrl = plugin.rewriteRootURL(fileInfo.rootUrl, responseURL);\r\n }\r\n\r\n if ((<any>plugin).importMesh) {\r\n const syncedPlugin = <ISceneLoaderPlugin>plugin;\r\n const meshes: AbstractMesh[] = [];\r\n const particleSystems: IParticleSystem[] = [];\r\n const skeletons: Skeleton[] = [];\r\n\r\n if (!syncedPlugin.importMesh(meshNames, scene, data, fileInfo.rootUrl, meshes, particleSystems, skeletons, errorHandler)) {\r\n return;\r\n }\r\n\r\n scene.loadingPluginName = plugin.name;\r\n successHandler(meshes, particleSystems, skeletons, [], [], [], []);\r\n } else {\r\n const asyncedPlugin = <ISceneLoaderPluginAsync>plugin;\r\n asyncedPlugin\r\n .importMeshAsync(meshNames, scene, data, fileInfo.rootUrl, progressHandler, fileInfo.name)\r\n .then((result) => {\r\n scene.loadingPluginName = plugin.name;\r\n successHandler(\r\n result.meshes,\r\n result.particleSystems,\r\n result.skeletons,\r\n result.animationGroups,\r\n result.transformNodes,\r\n result.geometries,\r\n result.lights\r\n );\r\n })\r\n .catch((error) => {\r\n errorHandler(error.message, error);\r\n });\r\n }\r\n },\r\n progressHandler,\r\n errorHandler,\r\n disposeHandler,\r\n pluginExtension,\r\n name\r\n );\r\n }\r\n\r\n /**\r\n * Import meshes into a scene\r\n * @param meshNames an array of mesh names, a single mesh name, or empty string for all meshes that filter what meshes are imported\r\n * @param rootUrl a string that defines the root url for the scene and resources or the concatenation of rootURL and filename (e.g. http://example.com/test.glb)\r\n * @param sceneFilename a string that defines the name of the scene file or starts with \"data:\" following by the stringified version of the scene or a File object (default: empty string)\r\n * @param scene the instance of BABYLON.Scene to append to\r\n * @param onProgress a callback with a progress event for each file being loaded\r\n * @param pluginExtension the extension used to determine the plugin\r\n * @returns The loaded list of imported meshes, particle systems, skeletons, and animation groups\r\n */\r\n public static ImportMeshAsync(\r\n meshNames: any,\r\n rootUrl: string,\r\n sceneFilename: string | File | ArrayBufferView = \"\",\r\n scene: Nullable<Scene> = EngineStore.LastCreatedScene,\r\n onProgress: Nullable<(event: ISceneLoaderProgressEvent) => void> = null,\r\n pluginExtension: Nullable<string> = null,\r\n name: string = \"\"\r\n ): Promise<ISceneLoaderAsyncResult> {\r\n return new Promise((resolve, reject) => {\r\n SceneLoader.ImportMesh(\r\n meshNames,\r\n rootUrl,\r\n sceneFilename,\r\n scene,\r\n (meshes, particleSystems, skeletons, animationGroups, transformNodes, geometries, lights) => {\r\n resolve({\r\n meshes: meshes,\r\n particleSystems: particleSystems,\r\n skeletons: skeletons,\r\n animationGroups: animationGroups,\r\n transformNodes: transformNodes,\r\n geometries: geometries,\r\n lights: lights,\r\n });\r\n },\r\n onProgress,\r\n (scene, message, exception) => {\r\n reject(exception || new Error(message));\r\n },\r\n pluginExtension,\r\n name\r\n );\r\n });\r\n }\r\n\r\n /**\r\n * Load a scene\r\n * @param rootUrl a string that defines the root url for the scene and resources or the concatenation of rootURL and filename (e.g. http://example.com/test.glb)\r\n * @param sceneFilename a string that defines the name of the scene file or starts with \"data:\" following by the stringified version of the scene or a File object (default: empty string)\r\n * @param engine is the instance of BABYLON.Engine to use to create the scene\r\n * @param onSuccess a callback with the scene when import succeeds\r\n * @param onProgress a callback with a progress event for each file being loaded\r\n * @param onError a callback with the scene, a message, and possibly an exception when import fails\r\n * @param pluginExtension the extension used to determine the plugin\r\n * @returns The loaded plugin\r\n */\r\n public static Load(\r\n rootUrl: string,\r\n sceneFilename: string | File | ArrayBufferView = \"\",\r\n engine: Nullable<Engine> = EngineStore.LastCreatedEngine,\r\n onSuccess: Nullable<(scene: Scene) => void> = null,\r\n onProgress: Nullable<(event: ISceneLoaderProgressEvent) => void> = null,\r\n onError: Nullable<(scene: Scene, message: string, exception?: any) => void> = null,\r\n pluginExtension: Nullable<string> = null,\r\n name: string = \"\"\r\n ): Nullable<ISceneLoaderPlugin | ISceneLoaderPluginAsync> {\r\n if (!engine) {\r\n Tools.Error(\"No engine available\");\r\n return null;\r\n }\r\n\r\n return SceneLoader.Append(rootUrl, sceneFilename, new Scene(engine), onSuccess, onProgress, onError, pluginExtension, name);\r\n }\r\n\r\n /**\r\n * Load a scene\r\n * @param rootUrl a string that defines the root url for the scene and resources or the concatenation of rootURL and filename (e.g. http://example.com/test.glb)\r\n * @param sceneFilename a string that defines the name of the scene file or starts with \"data:\" following by the stringified version of the scene or a File object (default: empty string)\r\n * @param engine is the instance of BABYLON.Engine to use to create the scene\r\n * @param onProgress a callback with a progress event for each file being loaded\r\n * @param pluginExtension the extension used to determine the plugin\r\n * @returns The loaded scene\r\n */\r\n public static LoadAsync(\r\n rootUrl: string,\r\n sceneFilename: string | File | ArrayBufferView = \"\",\r\n engine: Nullable<Engine> = EngineStore.LastCreatedEngine,\r\n onProgress: Nullable<(event: ISceneLoaderProgressEvent) => void> = null,\r\n pluginExtension: Nullable<string> = null,\r\n name: string = \"\"\r\n ): Promise<Scene> {\r\n return new Promise((resolve, reject) => {\r\n SceneLoader.Load(\r\n rootUrl,\r\n sceneFilename,\r\n engine,\r\n (scene) => {\r\n resolve(scene);\r\n },\r\n onProgress,\r\n (scene, message, exception) => {\r\n reject(exception || new Error(message));\r\n },\r\n pluginExtension,\r\n name\r\n );\r\n });\r\n }\r\n\r\n /**\r\n * Append a scene\r\n * @param rootUrl a string that defines the root url for the scene and resources or the concatenation of rootURL and filename (e.g. http://example.com/test.glb)\r\n * @param sceneFilename a string that defines the name of the scene file or starts with \"data:\" following by the stringified version of the scene or a File object (default: empty string)\r\n * @param scene is the instance of BABYLON.Scene to append to\r\n * @param onSuccess a callback with the scene when import succeeds\r\n * @param onProgress a callback with a progress event for each file being loaded\r\n * @param onError a callback with the scene, a message, and possibly an exception when import fails\r\n * @param pluginExtension the extension used to determine the plugin\r\n * @returns The loaded plugin\r\n */\r\n public static Append(\r\n rootUrl: string,\r\n sceneFilename: string | File | ArrayBufferView = \"\",\r\n scene: Nullable<Scene> = EngineStore.LastCreatedScene,\r\n onSuccess: Nullable<(scene: Scene) => void> = null,\r\n onProgress: Nullable<(event: ISceneLoaderProgressEvent) => void> = null,\r\n onError: Nullable<(scene: Scene, message: string, exception?: any) => void> = null,\r\n pluginExtension: Nullable<string> = null,\r\n name: string = \"\"\r\n ): Nullable<ISceneLoaderPlugin | ISceneLoaderPluginAsync> {\r\n if (!scene) {\r\n Logger.Error(\"No scene available to append to\");\r\n return null;\r\n }\r\n\r\n const fileInfo = SceneLoader._GetFileInfo(rootUrl, sceneFilename);\r\n if (!fileInfo) {\r\n return null;\r\n }\r\n\r\n const loadingToken = {};\r\n scene.addPendingData(loadingToken);\r\n\r\n const disposeHandler = () => {\r\n scene.removePendingData(loadingToken);\r\n };\r\n\r\n if (SceneLoader.ShowLoadingScreen && !this._ShowingLoadingScreen) {\r\n this._ShowingLoadingScreen = true;\r\n scene.getEngine().displayLoadingUI();\r\n scene.executeWhenReady(() => {\r\n scene.getEngine().hideLoadingUI();\r\n this._ShowingLoadingScreen = false;\r\n });\r\n }\r\n\r\n const errorHandler = (message?: string, exception?: any) => {\r\n const errorMessage = SceneLoader._FormatErrorMessage(fileInfo, message, exception);\r\n\r\n if (onError) {\r\n onError(scene, errorMessage, new RuntimeError(errorMessage, ErrorCodes.SceneLoaderError, exception));\r\n } else {\r\n Logger.Error(errorMessage);\r\n // should the exception be thrown?\r\n }\r\n\r\n disposeHandler();\r\n };\r\n\r\n const progressHandler = onProgress\r\n ? (event: ISceneLoaderProgressEvent) => {\r\n try {\r\n onProgress(event);\r\n } catch (e) {\r\n errorHandler(\"Error in onProgress callback\", e);\r\n }\r\n }\r\n : undefined;\r\n\r\n const successHandler = () => {\r\n if (onSuccess) {\r\n try {\r\n onSuccess(scene);\r\n } catch (e) {\r\n errorHandler(\"Error in onSuccess callback\", e);\r\n }\r\n }\r\n\r\n scene.removePendingData(loadingToken);\r\n };\r\n\r\n return SceneLoader._LoadData(\r\n fileInfo,\r\n scene,\r\n (plugin, data) => {\r\n if ((<any>plugin).load) {\r\n const syncedPlugin = <ISceneLoaderPlugin>plugin;\r\n if (!syncedPlugin.load(scene, data, fileInfo.rootUrl, errorHandler)) {\r\n return;\r\n }\r\n\r\n scene.loadingPluginName = plugin.name;\r\n successHandler();\r\n } else {\r\n const asyncedPlugin = <ISceneLoaderPluginAsync>plugin;\r\n asyncedPlugin\r\n .loadAsync(scene, data, fileInfo.rootUrl, progressHandler, fileInfo.name)\r\n .then(() => {\r\n scene.loadingPluginName = plugin.name;\r\n successHandler();\r\n })\r\n .catch((error) => {\r\n errorHandler(error.message, error);\r\n });\r\n }\r\n },\r\n progressHandler,\r\n errorHandler,\r\n disposeHandler,\r\n pluginExtension,\r\n name\r\n );\r\n }\r\n\r\n /**\r\n * Append a scene\r\n * @param rootUrl a string that defines the root url for the scene and resources or the concatenation of rootURL and filename (e.g. http://example.com/test.glb)\r\n * @param sceneFilename a string that defines the name of the scene file or starts with \"data:\" following by the stringified version of the scene or a File object (default: empty string)\r\n * @param scene is the instance of BABYLON.Scene to append to\r\n * @param onProgress a callback with a progress event for each file being loaded\r\n * @param pluginExtension the extension used to determine the plugin\r\n * @returns The given scene\r\n */\r\n public static AppendAsync(\r\n rootUrl: string,\r\n sceneFilename: string | File | ArrayBufferView = \"\",\r\n scene: Nullable<Scene> = EngineStore.LastCreatedScene,\r\n onProgress: Nullable<(event: ISceneLoaderProgressEvent) => void> = null,\r\n pluginExtension: Nullable<string> = null,\r\n name: string = \"\"\r\n ): Promise<Scene> {\r\n return new Promise((resolve, reject) => {\r\n SceneLoader.Append(\r\n rootUrl,\r\n sceneFilename,\r\n scene,\r\n (scene) => {\r\n resolve(scene);\r\n },\r\n onProgress,\r\n (scene, message, exception) => {\r\n reject(exception || new Error(message));\r\n },\r\n pluginExtension,\r\n name\r\n );\r\n });\r\n }\r\n\r\n /**\r\n * Load a scene into an asset container\r\n * @param rootUrl a string that defines the root url for the scene and resources or the concatenation of rootURL and filename (e.g. http://example.com/test.glb)\r\n * @param sceneFilename a string that defines the name of the scene file or starts with \"data:\" following by the stringified version of the scene or a File object (default: empty string)\r\n * @param scene is the instance of BABYLON.Scene to append to (default: last created scene)\r\n * @param onSuccess a callback with the scene when import succeeds\r\n * @param onProgress a callback with a progress event for each file being loaded\r\n * @param onError a callback with the scene, a message, and possibly an exception when import fails\r\n * @param pluginExtension the extension used to determine the plugin\r\n * @returns The loaded plugin\r\n */\r\n public static LoadAssetContainer(\r\n rootUrl: string,\r\n sceneFilename: string | File | ArrayBufferView = \"\",\r\n scene: Nullable<Scene> = EngineStore.LastCreatedScene,\r\n onSuccess: Nullable<(assets: AssetContainer) => void> = null,\r\n onProgress: Nullable<(event: ISceneLoaderProgressEvent) => void> = null,\r\n onError: Nullable<(scene: Scene, message: string, exception?: any) => void> = null,\r\n pluginExtension: Nullable<string> = null,\r\n name: string = \"\"\r\n ): Nullable<ISceneLoaderPlugin | ISceneLoaderPluginAsync> {\r\n if (!scene) {\r\n Logger.Error(\"No scene available to load asset container to\");\r\n return null;\r\n }\r\n\r\n const fileInfo = SceneLoader._GetFileInfo(rootUrl, sceneFilename);\r\n if (!fileInfo) {\r\n return null;\r\n }\r\n\r\n const loadingToken = {};\r\n scene.addPendingData(loadingToken);\r\n\r\n const disposeHandler = () => {\r\n scene.removePendingData(loadingToken);\r\n };\r\n\r\n const errorHandler = (message?: string, exception?: any) => {\r\n const errorMessage = SceneLoader._FormatErrorMessage(fileInfo, message, exception);\r\n\r\n if (onError) {\r\n onError(scene, errorMessage, new RuntimeError(errorMessage, ErrorCodes.SceneLoaderError, exception));\r\n } else {\r\n Logger.Error(errorMessage);\r\n // should the exception be thrown?\r\n }\r\n\r\n disposeHandler();\r\n };\r\n\r\n const progressHandler = onProgress\r\n ? (event: ISceneLoaderProgressEvent) => {\r\n try {\r\n onProgress(event);\r\n } catch (e) {\r\n errorHandler(\"Error in onProgress callback\", e);\r\n }\r\n }\r\n : undefined;\r\n\r\n const successHandler = (assets: AssetContainer) => {\r\n if (onSuccess) {\r\n try {\r\n onSuccess(assets);\r\n } catch (e) {\r\n errorHandler(\"Error in onSuccess callback\", e);\r\n }\r\n }\r\n\r\n scene.removePendingData(loadingToken);\r\n };\r\n\r\n return SceneLoader._LoadData(\r\n fileInfo,\r\n scene,\r\n (plugin, data) => {\r\n if ((<any>plugin).loadAssetContainer) {\r\n const syncedPlugin = <ISceneLoaderPlugin>plugin;\r\n const assetContainer = syncedPlugin.loadAssetContainer(scene, data, fileInfo.rootUrl, errorHandler);\r\n if (!assetContainer) {\r\n return;\r\n }\r\n assetContainer.populateRootNodes();\r\n scene.loadingPluginName = plugin.name;\r\n successHandler(assetContainer);\r\n } else if ((<any>plugin).loadAssetContainerAsync) {\r\n const asyncedPlugin = <ISceneLoaderPluginAsync>plugin;\r\n asyncedPlugin\r\n .loadAssetContainerAsync(scene, data, fileInfo.rootUrl, progressHandler, fileInfo.name)\r\n .then((assetContainer) => {\r\n assetContainer.populateRootNodes();\r\n scene.loadingPluginName = plugin.name;\r\n successHandler(assetContainer);\r\n })\r\n .catch((error) => {\r\n errorHandler(error.message, error);\r\n });\r\n } else {\r\n errorHandler(\"LoadAssetContainer is not supported by this plugin. Plugin did not provide a loadAssetContainer or loadAssetContainerAsync method.\");\r\n }\r\n },\r\n progressHandler,\r\n errorHandler,\r\n disposeHandler,\r\n pluginExtension,\r\n name\r\n );\r\n }\r\n\r\n /**\r\n * Load a scene into an asset container\r\n * @param rootUrl a string that defines the root url for the scene and resources or the concatenation of rootURL and filename (e.g. http://example.com/test.glb)\r\n * @param sceneFilename a string that defines the name of the scene file or starts with \"data:\" following by the stringified version of the scene (default: empty string)\r\n * @param scene is the instance of Scene to append to\r\n * @param onProgress a callback with a progress event for each file being loaded\r\n * @param pluginExtension the extension used to determine the plugin\r\n * @returns The loaded asset container\r\n */\r\n public static LoadAssetContainerAsync(\r\n rootUrl: string,\r\n sceneFilename: string | File = \"\",\r\n scene: Nullable<Scene> = EngineStore.LastCreatedScene,\r\n onProgress: Nullable<(event: ISceneLoaderProgressEvent) => void> = null,\r\n pluginExtension: Nullable<string> = null\r\n ): Promise<AssetContainer> {\r\n return new Promise((resolve, reject) => {\r\n SceneLoader.LoadAssetContainer(\r\n rootUrl,\r\n sceneFilename,\r\n scene,\r\n (assetContainer) => {\r\n resolve(assetContainer);\r\n },\r\n onProgress,\r\n (scene, message, exception) => {\r\n reject(exception || new Error(message));\r\n },\r\n pluginExtension\r\n );\r\n });\r\n }\r\n\r\n /**\r\n * Import animations from a file into a scene\r\n * @param rootUrl a string that defines the root url for the scene and resources or the concatenation of rootURL and filename (e.g. http://example.com/test.glb)\r\n * @param sceneFilename a string that defines the name of the scene file or starts with \"data:\" following by the stringified version of the scene or a File object (default: empty string)\r\n * @param scene is the instance of BABYLON.Scene to append to (default: last created scene)\r\n * @param overwriteAnimations when true, animations are cleaned before importing new ones. Animations are appended otherwise\r\n * @param animationGroupLoadingMode defines how to handle old animations groups before importing new ones\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 onSuccess a callback with the scene when import succeeds\r\n * @param onProgress a callback with a progress event for each file being loaded\r\n * @param onError a callback with the scene, a message, and possibly an exception when import fails\r\n * @param pluginExtension the extension used to determine the plugin\r\n */\r\n public static ImportAnimations(\r\n rootUrl: string,\r\n sceneFilename: string | File = \"\",\r\n scene: Nullable<Scene> = EngineStore.LastCreatedScene,\r\n overwriteAnimations = true,\r\n animationGroupLoadingMode = SceneLoaderAnimationGroupLoadingMode.Clean,\r\n targetConverter: Nullable<(target: any) => any> = null,\r\n onSuccess: Nullable<(scene: Scene) => void> = null,\r\n onProgress: Nullable<(event: ISceneLoaderProgressEvent) => void> = null,\r\n onError: Nullable<(scene: Scene, message: string, exception?: any) => void> = null,\r\n pluginExtension: Nullable<string> = null\r\n ): void {\r\n if (!scene) {\r\n Logger.Error(\"No scene available to load animations to\");\r\n return;\r\n }\r\n\r\n if (overwriteAnimations) {\r\n // Reset, stop and dispose all animations before loading new ones\r\n for (const animatable of scene.animatables) {\r\n animatable.reset();\r\n }\r\n scene.stopAllAnimations();\r\n scene.animationGroups.slice().forEach((animationGroup) => {\r\n animationGroup.dispose();\r\n });\r\n const nodes = scene.getNodes();\r\n nodes.forEach((node) => {\r\n if (node.animations) {\r\n node.animations = [];\r\n }\r\n });\r\n } else {\r\n switch (animationGroupLoadingMode) {\r\n case SceneLoaderAnimationGroupLoadingMode.Clean:\r\n scene.animationGroups.slice().forEach((animationGroup) => {\r\n animationGroup.dispose();\r\n });\r\n break;\r\n case SceneLoaderAnimationGroupLoadingMode.Stop:\r\n scene.animationGroups.forEach((animationGroup) => {\r\n animationGroup.stop();\r\n });\r\n break;\r\n case SceneLoaderAnimationGroupLoadingMode.Sync:\r\n scene.animationGroups.forEach((animationGroup) => {\r\n animationGroup.reset();\r\n animationGroup.restart();\r\n });\r\n break;\r\n case SceneLoaderAnimationGroupLoadingMode.NoSync:\r\n // nothing to do\r\n break;\r\n default:\r\n Logger.Error(\"Unknown animation group loading mode value '\" + animationGroupLoadingMode + \"'\");\r\n return;\r\n }\r\n }\r\n\r\n const startingIndexForNewAnimatables = scene.animatables.length;\r\n\r\n const onAssetContainerLoaded = (container: AssetContainer) => {\r\n container.mergeAnimationsTo(scene, scene.animatables.slice(startingIndexForNewAnimatables), targetConverter);\r\n\r\n container.dispose();\r\n\r\n scene.onAnimationFileImportedObservable.notifyObservers(scene);\r\n\r\n if (onSuccess) {\r\n onSuccess(scene);\r\n }\r\n };\r\n\r\n this.LoadAssetContainer(rootUrl, sceneFilename, scene, onAssetContainerLoaded, onProgress, onError, pluginExtension);\r\n }\r\n\r\n /**\r\n * Import animations from a file into a scene\r\n * @param rootUrl a string that defines the root url for the scene and resources or the concatenation of rootURL and filename (e.g. http://example.com/test.glb)\r\n * @param sceneFilename a string that defines the name of the scene file or starts with \"data:\" following by the stringified version of the scene or a File object (default: empty string)\r\n * @param scene is the instance of BABYLON.Scene to append to (default: last created scene)\r\n * @param overwriteAnimations when true, animations are cleaned before importing new ones. Animations are appended otherwise\r\n * @param animationGroupLoadingMode defines how to handle old animations groups before importing new ones\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 onSuccess a callback with the scene when import succeeds\r\n * @param onProgress a callback with a progress event for each file being loaded\r\n * @param onError a callback with the scene, a message, and possibly an exception when import fails\r\n * @param pluginExtension the extension used to determine the plugin\r\n * @returns the updated scene with imported animations\r\n */\r\n public static ImportAnimationsAsync(\r\n rootUrl: string,\r\n sceneFilename: string | File = \"\",\r\n scene: Nullable<Scene> = EngineStore.LastCreatedScene,\r\n overwriteAnimations = true,\r\n animationGroupLoadingMode = SceneLoaderAnimationGroupLoadingMode.Clean,\r\n targetConverter: Nullable<(target: any) => any> = null,\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n onSuccess: Nullable<(scene: Scene) => void> = null,\r\n onProgress: Nullable<(event: ISceneLoaderProgressEvent) => void> = null,\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n onError: Nullable<(scene: Scene, message: string, exception?: any) => void> = null,\r\n pluginExtension: Nullable<string> = null\r\n ): Promise<Scene> {\r\n return new Promise((resolve, reject) => {\r\n SceneLoader.ImportAnimations(\r\n rootUrl,\r\n sceneFilename,\r\n scene,\r\n overwriteAnimations,\r\n animationGroupLoadingMode,\r\n targetConverter,\r\n (_scene: Scene) => {\r\n resolve(_scene);\r\n },\r\n onProgress,\r\n (_scene: Scene, message: string, exception: any) => {\r\n reject(exception || new Error(message));\r\n },\r\n pluginExtension\r\n );\r\n });\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"sceneLoader.js","sourceRoot":"","sources":["../../../../dev/core/src/Loading/sceneLoader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAEhD,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACjC,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAMrD,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAItD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAIpD,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAyQzD;;GAEG;AACH,MAAM,CAAN,IAAY,oCAoBX;AApBD,WAAY,oCAAoC;IAC5C;;OAEG;IACH,iGAAS,CAAA;IAET;;OAEG;IACH,+FAAQ,CAAA;IAER;;OAEG;IACH,+FAAQ,CAAA;IAER;;OAEG;IACH,mGAAU,CAAA;AACd,CAAC,EApBW,oCAAoC,KAApC,oCAAoC,QAoB/C;AA2CD;;;GAGG;AACH,MAAM,OAAO,WAAW;IAqBpB;;OAEG;IACI,MAAM,KAAK,mCAAmC;QACjD,OAAO,gBAAgB,CAAC,mCAAmC,CAAC;IAChE,CAAC;IAEM,MAAM,KAAK,mCAAmC,CAAC,KAAc;QAChE,gBAAgB,CAAC,mCAAmC,GAAG,KAAK,CAAC;IACjE,CAAC;IAED;;OAEG;IACI,MAAM,KAAK,iBAAiB;QAC/B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EAAE,EAAE;gBACd,OAAO,CAAC,MAAM,CAAC,CAAC;YACpB,CAAC,EACD,UAAU,EACV,CAAC,MAAa,EAAE,OAAe,EAAE,SAAc,EAAE,EAAE;gBAC/C,MAAM,CAAC,SAAS,IAAI,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;YAC5C,CAAC,EACD,eAAe,CAClB,CAAC;QACN,CAAC,CAAC,CAAC;IACP,CAAC;;AAxgCD;;GAEG;AACoB,sBAAU,GAAG,SAAS,CAAC,sBAAsB,CAAC;AAErE;;GAEG;AACoB,2BAAe,GAAG,SAAS,CAAC,2BAA2B,CAAC;AAE/E;;GAEG;AACoB,2BAAe,GAAG,SAAS,CAAC,2BAA2B,CAAC;AAE/E;;GAEG;AACoB,4BAAgB,GAAG,SAAS,CAAC,4BAA4B,CAAC;AAiDjF,UAAU;AAEV;;GAEG;AACW,uCAA2B,GAAG,IAAI,UAAU,EAAgD,CAAC;AAE5F,8BAAkB,GAA+C,EAAE,CAAC;AAEpE,iCAAqB,GAAG,KAAK,CAAC","sourcesContent":["import { Tools } from \"../Misc/tools\";\r\nimport { Observable } from \"../Misc/observable\";\r\nimport type { Nullable } from \"../types\";\r\nimport { Scene } from \"../scene\";\r\nimport { Engine } from \"../Engines/engine\";\r\nimport { EngineStore } from \"../Engines/engineStore\";\r\nimport type { AbstractMesh } from \"../Meshes/abstractMesh\";\r\nimport type { AnimationGroup } from \"../Animations/animationGroup\";\r\nimport type { AssetContainer } from \"../assetContainer\";\r\nimport type { IParticleSystem } from \"../Particles/IParticleSystem\";\r\nimport type { Skeleton } from \"../Bones/skeleton\";\r\nimport { Logger } from \"../Misc/logger\";\r\nimport { Constants } from \"../Engines/constants\";\r\nimport { SceneLoaderFlags } from \"./sceneLoaderFlags\";\r\nimport type { IFileRequest } from \"../Misc/fileRequest\";\r\nimport type { WebRequest } from \"../Misc/webRequest\";\r\nimport type { LoadFileError } from \"../Misc/fileTools\";\r\nimport { IsBase64DataUrl } from \"../Misc/fileTools\";\r\nimport type { TransformNode } from \"../Meshes/transformNode\";\r\nimport type { Geometry } from \"../Meshes/geometry\";\r\nimport type { Light } from \"../Lights/light\";\r\nimport { RuntimeError, ErrorCodes } from \"../Misc/error\";\r\n\r\n/**\r\n * Type used for the success callback of ImportMesh\r\n */\r\nexport type SceneLoaderSuccessCallback = (\r\n meshes: AbstractMesh[],\r\n particleSystems: IParticleSystem[],\r\n skeletons: Skeleton[],\r\n animationGroups: AnimationGroup[],\r\n transformNodes: TransformNode[],\r\n geometries: Geometry[],\r\n lights: Light[]\r\n) => void;\r\n\r\n/**\r\n * Interface used for the result of ImportMeshAsync\r\n */\r\nexport interface ISceneLoaderAsyncResult {\r\n /**\r\n * The array of loaded meshes\r\n */\r\n readonly meshes: AbstractMesh[];\r\n\r\n /**\r\n * The array of loaded particle systems\r\n */\r\n readonly particleSystems: IParticleSystem[];\r\n\r\n /**\r\n * The array of loaded skeletons\r\n */\r\n readonly skeletons: Skeleton[];\r\n\r\n /**\r\n * The array of loaded animation groups\r\n */\r\n readonly animationGroups: AnimationGroup[];\r\n\r\n /**\r\n * The array of loaded transform nodes\r\n */\r\n readonly transformNodes: TransformNode[];\r\n\r\n /**\r\n * The array of loaded geometries\r\n */\r\n readonly geometries: Geometry[];\r\n\r\n /**\r\n * The array of loaded lights\r\n */\r\n readonly lights: Light[];\r\n}\r\n\r\n/**\r\n * Interface used to represent data loading progression\r\n */\r\nexport interface ISceneLoaderProgressEvent {\r\n /**\r\n * Defines if data length to load can be evaluated\r\n */\r\n readonly lengthComputable: boolean;\r\n\r\n /**\r\n * Defines the loaded data length\r\n */\r\n readonly loaded: number;\r\n\r\n /**\r\n * Defines the data length to load\r\n */\r\n readonly total: number;\r\n}\r\n\r\n/**\r\n * Interface used by SceneLoader plugins to define supported file extensions\r\n */\r\nexport interface ISceneLoaderPluginExtensions {\r\n /**\r\n * Defines the list of supported extensions\r\n */\r\n [extension: string]: {\r\n isBinary: boolean;\r\n };\r\n}\r\n\r\n/**\r\n * Interface used by SceneLoader plugin factory\r\n */\r\nexport interface ISceneLoaderPluginFactory {\r\n /**\r\n * Defines the name of the factory\r\n */\r\n name: string;\r\n\r\n /**\r\n * Function called to create a new plugin\r\n * @returns the new plugin\r\n */\r\n createPlugin(): ISceneLoaderPlugin | ISceneLoaderPluginAsync;\r\n\r\n /**\r\n * The callback that returns true if the data can be directly loaded.\r\n * @param data string containing the file data\r\n * @returns if the data can be loaded directly\r\n */\r\n canDirectLoad?(data: string): boolean;\r\n}\r\n\r\n/**\r\n * Interface used to define the base of ISceneLoaderPlugin and ISceneLoaderPluginAsync\r\n */\r\nexport interface ISceneLoaderPluginBase {\r\n /**\r\n * The friendly name of this plugin.\r\n */\r\n name: string;\r\n\r\n /**\r\n * The file extensions supported by this plugin.\r\n */\r\n extensions: string | ISceneLoaderPluginExtensions;\r\n\r\n /**\r\n * The callback called when loading from a url.\r\n * @param scene scene loading this url\r\n * @param fileOrUrl file or url to load\r\n * @param rootUrl root url to use to load assets\r\n * @param onSuccess callback called when the file successfully loads\r\n * @param onProgress callback called while file is loading (if the server supports this mode)\r\n * @param useArrayBuffer defines a boolean indicating that date must be returned as ArrayBuffer\r\n * @param onError callback called when the file fails to load\r\n * @param name defines the name of the file when loading a binary file\r\n * @returns a file request object\r\n */\r\n loadFile?(\r\n scene: Scene,\r\n fileOrUrl: File | string | ArrayBufferView,\r\n rootUrl: string,\r\n onSuccess: (data: any, responseURL?: string) => void,\r\n onProgress?: (ev: ISceneLoaderProgressEvent) => void,\r\n useArrayBuffer?: boolean,\r\n onError?: (request?: WebRequest, exception?: LoadFileError) => void,\r\n name?: string\r\n ): Nullable<IFileRequest>;\r\n\r\n /**\r\n * The callback that returns true if the data can be directly loaded.\r\n * @param data string containing the file data\r\n * @returns if the data can be loaded directly\r\n */\r\n canDirectLoad?(data: string): boolean;\r\n\r\n /**\r\n * The callback that returns the data to pass to the plugin if the data can be directly loaded.\r\n * @param scene scene loading this data\r\n * @param data string containing the data\r\n * @returns data to pass to the plugin\r\n */\r\n directLoad?(scene: Scene, data: string): any;\r\n\r\n /**\r\n * The callback that allows custom handling of the root url based on the response url.\r\n * @param rootUrl the original root url\r\n * @param responseURL the response url if available\r\n * @returns the new root url\r\n */\r\n rewriteRootURL?(rootUrl: string, responseURL?: string): string;\r\n}\r\n\r\n/**\r\n * Interface used to define a SceneLoader plugin\r\n */\r\nexport interface ISceneLoaderPlugin extends ISceneLoaderPluginBase {\r\n /**\r\n * Import meshes into a scene.\r\n * @param meshesNames An array of mesh names, a single mesh name, or empty string for all meshes that filter what meshes are imported\r\n * @param scene The scene to import into\r\n * @param data The data to import\r\n * @param rootUrl The root url for scene and resources\r\n * @param meshes The meshes array to import into\r\n * @param particleSystems The particle systems array to import into\r\n * @param skeletons The skeletons array to import into\r\n * @param onError The callback when import fails\r\n * @returns True if successful or false otherwise\r\n */\r\n importMesh(\r\n meshesNames: any,\r\n scene: Scene,\r\n data: any,\r\n rootUrl: string,\r\n meshes: AbstractMesh[],\r\n particleSystems: IParticleSystem[],\r\n skeletons: Skeleton[],\r\n onError?: (message: string, exception?: any) => void\r\n ): boolean;\r\n\r\n /**\r\n * Load into a scene.\r\n * @param scene The scene to load into\r\n * @param data The data to import\r\n * @param rootUrl The root url for scene and resources\r\n * @param onError The callback when import fails\r\n * @returns True if successful or false otherwise\r\n */\r\n load(scene: Scene, data: any, rootUrl: string, onError?: (message: string, exception?: any) => void): boolean;\r\n\r\n /**\r\n * Load into an asset container.\r\n * @param scene The scene to load into\r\n * @param data The data to import\r\n * @param rootUrl The root url for scene and resources\r\n * @param onError The callback when import fails\r\n * @returns The loaded asset container\r\n */\r\n loadAssetContainer(scene: Scene, data: any, rootUrl: string, onError?: (message: string, exception?: any) => void): AssetContainer;\r\n}\r\n\r\n/**\r\n * Interface used to define an async SceneLoader plugin\r\n */\r\nexport interface ISceneLoaderPluginAsync extends ISceneLoaderPluginBase {\r\n /**\r\n * Import meshes into a scene.\r\n * @param meshesNames An array of mesh names, a single mesh name, or empty string for all meshes that filter what meshes are imported\r\n * @param scene The scene to import into\r\n * @param data The data to import\r\n * @param rootUrl The root url for scene and resources\r\n * @param onProgress The callback when the load progresses\r\n * @param fileName Defines the name of the file to load\r\n * @returns The loaded objects (e.g. meshes, particle systems, skeletons, animation groups, etc.)\r\n */\r\n importMeshAsync(\r\n meshesNames: any,\r\n scene: Scene,\r\n data: any,\r\n rootUrl: string,\r\n onProgress?: (event: ISceneLoaderProgressEvent) => void,\r\n fileName?: string\r\n ): Promise<ISceneLoaderAsyncResult>;\r\n\r\n /**\r\n * Load into a scene.\r\n * @param scene The scene to load into\r\n * @param data The data to import\r\n * @param rootUrl The root url for scene and resources\r\n * @param onProgress The callback when the load progresses\r\n * @param fileName Defines the name of the file to load\r\n * @returns Nothing\r\n */\r\n loadAsync(scene: Scene, data: any, rootUrl: string, onProgress?: (event: ISceneLoaderProgressEvent) => void, fileName?: string): Promise<void>;\r\n\r\n /**\r\n * Load into an asset container.\r\n * @param scene The scene to load into\r\n * @param data The data to import\r\n * @param rootUrl The root url for scene and resources\r\n * @param onProgress The callback when the load progresses\r\n * @param fileName Defines the name of the file to load\r\n * @returns The loaded asset container\r\n */\r\n loadAssetContainerAsync(scene: Scene, data: any, rootUrl: string, onProgress?: (event: ISceneLoaderProgressEvent) => void, fileName?: string): Promise<AssetContainer>;\r\n}\r\n\r\n/**\r\n * Mode that determines how to handle old animation groups before loading new ones.\r\n */\r\nexport enum SceneLoaderAnimationGroupLoadingMode {\r\n /**\r\n * Reset all old animations to initial state then dispose them.\r\n */\r\n Clean = 0,\r\n\r\n /**\r\n * Stop all old animations.\r\n */\r\n Stop = 1,\r\n\r\n /**\r\n * Restart old animations from first frame.\r\n */\r\n Sync = 2,\r\n\r\n /**\r\n * Old animations remains untouched.\r\n */\r\n NoSync = 3,\r\n}\r\n\r\n/**\r\n * Defines a plugin registered by the SceneLoader\r\n */\r\ninterface IRegisteredPlugin {\r\n /**\r\n * Defines the plugin to use\r\n */\r\n plugin: ISceneLoaderPlugin | ISceneLoaderPluginAsync | ISceneLoaderPluginFactory;\r\n /**\r\n * Defines if the plugin supports binary data\r\n */\r\n isBinary: boolean;\r\n}\r\n\r\n/**\r\n * Defines file information\r\n */\r\ninterface IFileInfo {\r\n /**\r\n * Gets the file url\r\n */\r\n url: string;\r\n /**\r\n * Gets the root url\r\n */\r\n rootUrl: string;\r\n /**\r\n * Gets filename\r\n */\r\n name: string;\r\n /**\r\n * Gets the file\r\n */\r\n file: Nullable<File>;\r\n\r\n /**\r\n * Gets raw binary data.\r\n */\r\n rawData: Nullable<ArrayBufferView>;\r\n}\r\n\r\n/**\r\n * Class used to load scene from various file formats using registered plugins\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/importers/loadingFileTypes\r\n */\r\nexport class SceneLoader {\r\n /**\r\n * No logging while loading\r\n */\r\n public static readonly NO_LOGGING = Constants.SCENELOADER_NO_LOGGING;\r\n\r\n /**\r\n * Minimal logging while loading\r\n */\r\n public static readonly MINIMAL_LOGGING = Constants.SCENELOADER_MINIMAL_LOGGING;\r\n\r\n /**\r\n * Summary logging while loading\r\n */\r\n public static readonly SUMMARY_LOGGING = Constants.SCENELOADER_SUMMARY_LOGGING;\r\n\r\n /**\r\n * Detailed logging while loading\r\n */\r\n public static readonly DETAILED_LOGGING = Constants.SCENELOADER_DETAILED_LOGGING;\r\n\r\n /**\r\n * Gets or sets a boolean indicating if entire scene must be loaded even if scene contains incremental data\r\n */\r\n public static get ForceFullSceneLoadingForIncremental() {\r\n return SceneLoaderFlags.ForceFullSceneLoadingForIncremental;\r\n }\r\n\r\n public static set ForceFullSceneLoadingForIncremental(value: boolean) {\r\n SceneLoaderFlags.ForceFullSceneLoadingForIncremental = value;\r\n }\r\n\r\n /**\r\n * Gets or sets a boolean indicating if loading screen must be displayed while loading a scene\r\n */\r\n public static get ShowLoadingScreen(): boolean {\r\n return SceneLoaderFlags.ShowLoadingScreen;\r\n }\r\n\r\n public static set ShowLoadingScreen(value: boolean) {\r\n SceneLoaderFlags.ShowLoadingScreen = value;\r\n }\r\n\r\n /**\r\n * Defines the current logging level (while loading the scene)\r\n * @ignorenaming\r\n */\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n public static get loggingLevel(): number {\r\n return SceneLoaderFlags.loggingLevel;\r\n }\r\n\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n public static set loggingLevel(value: number) {\r\n SceneLoaderFlags.loggingLevel = value;\r\n }\r\n\r\n /**\r\n * Gets or set a boolean indicating if matrix weights must be cleaned upon loading\r\n */\r\n public static get CleanBoneMatrixWeights(): boolean {\r\n return SceneLoaderFlags.CleanBoneMatrixWeights;\r\n }\r\n\r\n public static set CleanBoneMatrixWeights(value: boolean) {\r\n SceneLoaderFlags.CleanBoneMatrixWeights = value;\r\n }\r\n\r\n // Members\r\n\r\n /**\r\n * Event raised when a plugin is used to load a scene\r\n */\r\n public static OnPluginActivatedObservable = new Observable<ISceneLoaderPlugin | ISceneLoaderPluginAsync>();\r\n\r\n private static _RegisteredPlugins: { [extension: string]: IRegisteredPlugin } = {};\r\n\r\n private static _ShowingLoadingScreen = false;\r\n\r\n /**\r\n * Gets the default plugin (used to load Babylon files)\r\n * @returns the .babylon plugin\r\n */\r\n public static GetDefaultPlugin(): IRegisteredPlugin {\r\n return SceneLoader._RegisteredPlugins[\".babylon\"];\r\n }\r\n\r\n private static _GetPluginForExtension(extension: string): IRegisteredPlugin {\r\n const registeredPlugin = SceneLoader._RegisteredPlugins[extension];\r\n if (registeredPlugin) {\r\n return registeredPlugin;\r\n }\r\n Logger.Warn(\r\n \"Unable to find a plugin to load \" +\r\n extension +\r\n \" files. Trying to use .babylon default plugin. To load from a specific filetype (eg. gltf) see: https://doc.babylonjs.com/features/featuresDeepDive/importers/loadingFileTypes\"\r\n );\r\n return SceneLoader.GetDefaultPlugin();\r\n }\r\n\r\n private static _GetPluginForDirectLoad(data: string): IRegisteredPlugin {\r\n for (const extension in SceneLoader._RegisteredPlugins) {\r\n const plugin = SceneLoader._RegisteredPlugins[extension].plugin;\r\n\r\n if (plugin.canDirectLoad && plugin.canDirectLoad(data)) {\r\n return SceneLoader._RegisteredPlugins[extension];\r\n }\r\n }\r\n\r\n return SceneLoader.GetDefaultPlugin();\r\n }\r\n\r\n private static _GetPluginForFilename(sceneFilename: string): IRegisteredPlugin {\r\n const queryStringPosition = sceneFilename.indexOf(\"?\");\r\n\r\n if (queryStringPosition !== -1) {\r\n sceneFilename = sceneFilename.substring(0, queryStringPosition);\r\n }\r\n\r\n const dotPosition = sceneFilename.lastIndexOf(\".\");\r\n\r\n const extension = sceneFilename.substring(dotPosition, sceneFilename.length).toLowerCase();\r\n return SceneLoader._GetPluginForExtension(extension);\r\n }\r\n\r\n private static _GetDirectLoad(sceneFilename: string): Nullable<string> {\r\n if (sceneFilename.substr(0, 5) === \"data:\") {\r\n return sceneFilename.substr(5);\r\n }\r\n\r\n return null;\r\n }\r\n\r\n private static _FormatErrorMessage(fileInfo: IFileInfo, message?: string, exception?: any): string {\r\n const fromLoad = fileInfo.rawData ? \"binary data\" : fileInfo.url;\r\n let errorMessage = \"Unable to load from \" + fromLoad;\r\n\r\n if (message) {\r\n errorMessage += `: ${message}`;\r\n } else if (exception) {\r\n errorMessage += `: ${exception}`;\r\n }\r\n\r\n return errorMessage;\r\n }\r\n\r\n private static _LoadData(\r\n fileInfo: IFileInfo,\r\n scene: Scene,\r\n onSuccess: (plugin: ISceneLoaderPlugin | ISceneLoaderPluginAsync, data: any, responseURL?: string) => void,\r\n onProgress: ((event: ISceneLoaderProgressEvent) => void) | undefined,\r\n onError: (message?: string, exception?: any) => void,\r\n onDispose: () => void,\r\n pluginExtension: Nullable<string>,\r\n name: string\r\n ): Nullable<ISceneLoaderPlugin | ISceneLoaderPluginAsync> {\r\n const directLoad = SceneLoader._GetDirectLoad(fileInfo.url);\r\n\r\n if (fileInfo.rawData && !pluginExtension) {\r\n throw \"When using ArrayBufferView to load data the file extension must be provided.\";\r\n }\r\n\r\n const registeredPlugin = pluginExtension\r\n ? SceneLoader._GetPluginForExtension(pluginExtension)\r\n : directLoad\r\n ? SceneLoader._GetPluginForDirectLoad(fileInfo.url)\r\n : SceneLoader._GetPluginForFilename(fileInfo.url);\r\n\r\n if (fileInfo.rawData && !registeredPlugin.isBinary) {\r\n throw \"Loading from ArrayBufferView can not be used with plugins that don't support binary loading.\";\r\n }\r\n\r\n let plugin: ISceneLoaderPlugin | ISceneLoaderPluginAsync;\r\n\r\n if ((registeredPlugin.plugin as ISceneLoaderPluginFactory).createPlugin !== undefined) {\r\n plugin = (registeredPlugin.plugin as ISceneLoaderPluginFactory).createPlugin();\r\n } else {\r\n plugin = <any>registeredPlugin.plugin;\r\n }\r\n\r\n if (!plugin) {\r\n throw \"The loader plugin corresponding to the file type you are trying to load has not been found. If using es6, please import the plugin you wish to use before.\";\r\n }\r\n\r\n SceneLoader.OnPluginActivatedObservable.notifyObservers(plugin);\r\n\r\n // Check if we have a direct load url. If the plugin is registered to handle\r\n // it or it's not a base64 data url, then pass it through the direct load path.\r\n if (directLoad && ((plugin.canDirectLoad && plugin.canDirectLoad(fileInfo.url)) || !IsBase64DataUrl(fileInfo.url))) {\r\n if (plugin.directLoad) {\r\n const result = plugin.directLoad(scene, directLoad);\r\n if (result.then) {\r\n result\r\n .then((data: any) => {\r\n onSuccess(plugin, data);\r\n })\r\n .catch((error: any) => {\r\n onError(\"Error in directLoad of _loadData: \" + error, error);\r\n });\r\n } else {\r\n onSuccess(plugin, result);\r\n }\r\n } else {\r\n onSuccess(plugin, directLoad);\r\n }\r\n return plugin;\r\n }\r\n\r\n const useArrayBuffer = registeredPlugin.isBinary;\r\n\r\n const dataCallback = (data: any, responseURL?: string) => {\r\n if (scene.isDisposed) {\r\n onError(\"Scene has been disposed\");\r\n return;\r\n }\r\n\r\n onSuccess(plugin, data, responseURL);\r\n };\r\n\r\n let request: Nullable<IFileRequest> = null;\r\n let pluginDisposed = false;\r\n const onDisposeObservable = (plugin as any).onDisposeObservable as Observable<ISceneLoaderPlugin | ISceneLoaderPluginAsync>;\r\n if (onDisposeObservable) {\r\n onDisposeObservable.add(() => {\r\n pluginDisposed = true;\r\n\r\n if (request) {\r\n request.abort();\r\n request = null;\r\n }\r\n\r\n onDispose();\r\n });\r\n }\r\n\r\n const manifestChecked = () => {\r\n if (pluginDisposed) {\r\n return;\r\n }\r\n\r\n const errorCallback = (request?: WebRequest, exception?: LoadFileError) => {\r\n onError(request?.statusText, exception);\r\n };\r\n\r\n if (!plugin.loadFile && fileInfo.rawData) {\r\n throw \"Plugin does not support loading ArrayBufferView.\";\r\n }\r\n\r\n request = plugin.loadFile\r\n ? plugin.loadFile(scene, fileInfo.rawData || fileInfo.file || fileInfo.url, fileInfo.rootUrl, dataCallback, onProgress, useArrayBuffer, errorCallback, name)\r\n : scene._loadFile(fileInfo.file || fileInfo.url, dataCallback, onProgress, true, useArrayBuffer, errorCallback);\r\n };\r\n\r\n const engine = scene.getEngine();\r\n let canUseOfflineSupport = engine.enableOfflineSupport;\r\n if (canUseOfflineSupport) {\r\n // Also check for exceptions\r\n let exceptionFound = false;\r\n for (const regex of scene.disableOfflineSupportExceptionRules) {\r\n if (regex.test(fileInfo.url)) {\r\n exceptionFound = true;\r\n break;\r\n }\r\n }\r\n\r\n canUseOfflineSupport = !exceptionFound;\r\n }\r\n\r\n if (canUseOfflineSupport && Engine.OfflineProviderFactory) {\r\n // Checking if a manifest file has been set for this scene and if offline mode has been requested\r\n scene.offlineProvider = Engine.OfflineProviderFactory(fileInfo.url, manifestChecked, engine.disableManifestCheck);\r\n } else {\r\n manifestChecked();\r\n }\r\n\r\n return plugin;\r\n }\r\n\r\n private static _GetFileInfo(rootUrl: string, sceneFilename: string | File | ArrayBufferView): Nullable<IFileInfo> {\r\n let url: string;\r\n let name: string;\r\n let file: Nullable<File> = null;\r\n let rawData: Nullable<ArrayBufferView> = null;\r\n\r\n if (!sceneFilename) {\r\n url = rootUrl;\r\n name = Tools.GetFilename(rootUrl);\r\n rootUrl = Tools.GetFolderPath(rootUrl);\r\n } else if ((sceneFilename as File).name) {\r\n const sceneFile = sceneFilename as File;\r\n url = `file:${sceneFile.name}`;\r\n name = sceneFile.name;\r\n file = sceneFile;\r\n } else if (ArrayBuffer.isView(sceneFilename)) {\r\n url = \"\";\r\n name = \"arrayBuffer\";\r\n rawData = sceneFilename as ArrayBufferView;\r\n } else if (typeof sceneFilename === \"string\" && sceneFilename.startsWith(\"data:\")) {\r\n url = sceneFilename;\r\n name = \"\";\r\n } else {\r\n const filename = sceneFilename as string;\r\n if (filename.substr(0, 1) === \"/\") {\r\n Tools.Error(\"Wrong sceneFilename parameter\");\r\n return null;\r\n }\r\n\r\n url = rootUrl + filename;\r\n name = filename;\r\n }\r\n\r\n return {\r\n url: url,\r\n rootUrl: rootUrl,\r\n name: name,\r\n file: file,\r\n rawData,\r\n };\r\n }\r\n\r\n // Public functions\r\n\r\n /**\r\n * Gets a plugin that can load the given extension\r\n * @param extension defines the extension to load\r\n * @returns a plugin or null if none works\r\n */\r\n public static GetPluginForExtension(extension: string): ISceneLoaderPlugin | ISceneLoaderPluginAsync | ISceneLoaderPluginFactory {\r\n return SceneLoader._GetPluginForExtension(extension).plugin;\r\n }\r\n\r\n /**\r\n * Gets a boolean indicating that the given extension can be loaded\r\n * @param extension defines the extension to load\r\n * @returns true if the extension is supported\r\n */\r\n public static IsPluginForExtensionAvailable(extension: string): boolean {\r\n return !!SceneLoader._RegisteredPlugins[extension];\r\n }\r\n\r\n /**\r\n * Adds a new plugin to the list of registered plugins\r\n * @param plugin defines the plugin to add\r\n */\r\n public static RegisterPlugin(plugin: ISceneLoaderPlugin | ISceneLoaderPluginAsync): void {\r\n if (typeof plugin.extensions === \"string\") {\r\n const extension = <string>plugin.extensions;\r\n SceneLoader._RegisteredPlugins[extension.toLowerCase()] = {\r\n plugin: plugin,\r\n isBinary: false,\r\n };\r\n } else {\r\n const extensions = <ISceneLoaderPluginExtensions>plugin.extensions;\r\n Object.keys(extensions).forEach((extension) => {\r\n SceneLoader._RegisteredPlugins[extension.toLowerCase()] = {\r\n plugin: plugin,\r\n isBinary: extensions[extension].isBinary,\r\n };\r\n });\r\n }\r\n }\r\n\r\n /**\r\n * Import meshes into a scene\r\n * @param meshNames an array of mesh names, a single mesh name, or empty string for all meshes that filter what meshes are imported\r\n * @param rootUrl a string that defines the root url for the scene and resources or the concatenation of rootURL and filename (e.g. http://example.com/test.glb)\r\n * @param sceneFilename a string that defines the name of the scene file or starts with \"data:\" following by the stringified version of the scene or a File object (default: empty string)\r\n * @param scene the instance of BABYLON.Scene to append to\r\n * @param onSuccess a callback with a list of imported meshes, particleSystems, skeletons, and animationGroups when import succeeds\r\n * @param onProgress a callback with a progress event for each file being loaded\r\n * @param onError a callback with the scene, a message, and possibly an exception when import fails\r\n * @param pluginExtension the extension used to determine the plugin\r\n * @param name defines the name of the file, if the data is binary\r\n * @returns The loaded plugin\r\n */\r\n public static ImportMesh(\r\n meshNames: any,\r\n rootUrl: string,\r\n sceneFilename: string | File | ArrayBufferView = \"\",\r\n scene: Nullable<Scene> = EngineStore.LastCreatedScene,\r\n onSuccess: Nullable<SceneLoaderSuccessCallback> = null,\r\n onProgress: Nullable<(event: ISceneLoaderProgressEvent) => void> = null,\r\n onError: Nullable<(scene: Scene, message: string, exception?: any) => void> = null,\r\n pluginExtension: Nullable<string> = null,\r\n name: string = \"\"\r\n ): Nullable<ISceneLoaderPlugin | ISceneLoaderPluginAsync> {\r\n if (!scene) {\r\n Logger.Error(\"No scene available to import mesh to\");\r\n return null;\r\n }\r\n\r\n const fileInfo = SceneLoader._GetFileInfo(rootUrl, sceneFilename);\r\n if (!fileInfo) {\r\n return null;\r\n }\r\n\r\n const loadingToken = {};\r\n scene.addPendingData(loadingToken);\r\n\r\n const disposeHandler = () => {\r\n scene.removePendingData(loadingToken);\r\n };\r\n\r\n const errorHandler = (message?: string, exception?: any) => {\r\n const errorMessage = SceneLoader._FormatErrorMessage(fileInfo, message, exception);\r\n\r\n if (onError) {\r\n onError(scene, errorMessage, new RuntimeError(errorMessage, ErrorCodes.SceneLoaderError, exception));\r\n } else {\r\n Logger.Error(errorMessage);\r\n // should the exception be thrown?\r\n }\r\n\r\n disposeHandler();\r\n };\r\n\r\n const progressHandler = onProgress\r\n ? (event: ISceneLoaderProgressEvent) => {\r\n try {\r\n onProgress(event);\r\n } catch (e) {\r\n errorHandler(\"Error in onProgress callback: \" + e, e);\r\n }\r\n }\r\n : undefined;\r\n\r\n const successHandler: SceneLoaderSuccessCallback = (meshes, particleSystems, skeletons, animationGroups, transformNodes, geometries, lights) => {\r\n scene.importedMeshesFiles.push(fileInfo.url);\r\n\r\n if (onSuccess) {\r\n try {\r\n onSuccess(meshes, particleSystems, skeletons, animationGroups, transformNodes, geometries, lights);\r\n } catch (e) {\r\n errorHandler(\"Error in onSuccess callback: \" + e, e);\r\n }\r\n }\r\n\r\n scene.removePendingData(loadingToken);\r\n };\r\n\r\n return SceneLoader._LoadData(\r\n fileInfo,\r\n scene,\r\n (plugin, data, responseURL) => {\r\n if (plugin.rewriteRootURL) {\r\n fileInfo.rootUrl = plugin.rewriteRootURL(fileInfo.rootUrl, responseURL);\r\n }\r\n\r\n if ((<any>plugin).importMesh) {\r\n const syncedPlugin = <ISceneLoaderPlugin>plugin;\r\n const meshes: AbstractMesh[] = [];\r\n const particleSystems: IParticleSystem[] = [];\r\n const skeletons: Skeleton[] = [];\r\n\r\n if (!syncedPlugin.importMesh(meshNames, scene, data, fileInfo.rootUrl, meshes, particleSystems, skeletons, errorHandler)) {\r\n return;\r\n }\r\n\r\n scene.loadingPluginName = plugin.name;\r\n successHandler(meshes, particleSystems, skeletons, [], [], [], []);\r\n } else {\r\n const asyncedPlugin = <ISceneLoaderPluginAsync>plugin;\r\n asyncedPlugin\r\n .importMeshAsync(meshNames, scene, data, fileInfo.rootUrl, progressHandler, fileInfo.name)\r\n .then((result) => {\r\n scene.loadingPluginName = plugin.name;\r\n successHandler(\r\n result.meshes,\r\n result.particleSystems,\r\n result.skeletons,\r\n result.animationGroups,\r\n result.transformNodes,\r\n result.geometries,\r\n result.lights\r\n );\r\n })\r\n .catch((error) => {\r\n errorHandler(error.message, error);\r\n });\r\n }\r\n },\r\n progressHandler,\r\n errorHandler,\r\n disposeHandler,\r\n pluginExtension,\r\n name\r\n );\r\n }\r\n\r\n /**\r\n * Import meshes into a scene\r\n * @param meshNames an array of mesh names, a single mesh name, or empty string for all meshes that filter what meshes are imported\r\n * @param rootUrl a string that defines the root url for the scene and resources or the concatenation of rootURL and filename (e.g. http://example.com/test.glb)\r\n * @param sceneFilename a string that defines the name of the scene file or starts with \"data:\" following by the stringified version of the scene or a File object (default: empty string)\r\n * @param scene the instance of BABYLON.Scene to append to\r\n * @param onProgress a callback with a progress event for each file being loaded\r\n * @param pluginExtension the extension used to determine the plugin\r\n * @param name defines the name of the file\r\n * @returns The loaded list of imported meshes, particle systems, skeletons, and animation groups\r\n */\r\n public static ImportMeshAsync(\r\n meshNames: any,\r\n rootUrl: string,\r\n sceneFilename: string | File | ArrayBufferView = \"\",\r\n scene: Nullable<Scene> = EngineStore.LastCreatedScene,\r\n onProgress: Nullable<(event: ISceneLoaderProgressEvent) => void> = null,\r\n pluginExtension: Nullable<string> = null,\r\n name: string = \"\"\r\n ): Promise<ISceneLoaderAsyncResult> {\r\n return new Promise((resolve, reject) => {\r\n SceneLoader.ImportMesh(\r\n meshNames,\r\n rootUrl,\r\n sceneFilename,\r\n scene,\r\n (meshes, particleSystems, skeletons, animationGroups, transformNodes, geometries, lights) => {\r\n resolve({\r\n meshes: meshes,\r\n particleSystems: particleSystems,\r\n skeletons: skeletons,\r\n animationGroups: animationGroups,\r\n transformNodes: transformNodes,\r\n geometries: geometries,\r\n lights: lights,\r\n });\r\n },\r\n onProgress,\r\n (scene, message, exception) => {\r\n reject(exception || new Error(message));\r\n },\r\n pluginExtension,\r\n name\r\n );\r\n });\r\n }\r\n\r\n /**\r\n * Load a scene\r\n * @param rootUrl a string that defines the root url for the scene and resources or the concatenation of rootURL and filename (e.g. http://example.com/test.glb)\r\n * @param sceneFilename a string that defines the name of the scene file or starts with \"data:\" following by the stringified version of the scene or a File object (default: empty string)\r\n * @param engine is the instance of BABYLON.Engine to use to create the scene\r\n * @param onSuccess a callback with the scene when import succeeds\r\n * @param onProgress a callback with a progress event for each file being loaded\r\n * @param onError a callback with the scene, a message, and possibly an exception when import fails\r\n * @param pluginExtension the extension used to determine the plugin\r\n * @param name defines the filename, if the data is binary\r\n * @returns The loaded plugin\r\n */\r\n public static Load(\r\n rootUrl: string,\r\n sceneFilename: string | File | ArrayBufferView = \"\",\r\n engine: Nullable<Engine> = EngineStore.LastCreatedEngine,\r\n onSuccess: Nullable<(scene: Scene) => void> = null,\r\n onProgress: Nullable<(event: ISceneLoaderProgressEvent) => void> = null,\r\n onError: Nullable<(scene: Scene, message: string, exception?: any) => void> = null,\r\n pluginExtension: Nullable<string> = null,\r\n name: string = \"\"\r\n ): Nullable<ISceneLoaderPlugin | ISceneLoaderPluginAsync> {\r\n if (!engine) {\r\n Tools.Error(\"No engine available\");\r\n return null;\r\n }\r\n\r\n return SceneLoader.Append(rootUrl, sceneFilename, new Scene(engine), onSuccess, onProgress, onError, pluginExtension, name);\r\n }\r\n\r\n /**\r\n * Load a scene\r\n * @param rootUrl a string that defines the root url for the scene and resources or the concatenation of rootURL and filename (e.g. http://example.com/test.glb)\r\n * @param sceneFilename a string that defines the name of the scene file or starts with \"data:\" following by the stringified version of the scene or a File object (default: empty string)\r\n * @param engine is the instance of BABYLON.Engine to use to create the scene\r\n * @param onProgress a callback with a progress event for each file being loaded\r\n * @param pluginExtension the extension used to determine the plugin\r\n * @param name defines the filename, if the data is binary\r\n * @returns The loaded scene\r\n */\r\n public static LoadAsync(\r\n rootUrl: string,\r\n sceneFilename: string | File | ArrayBufferView = \"\",\r\n engine: Nullable<Engine> = EngineStore.LastCreatedEngine,\r\n onProgress: Nullable<(event: ISceneLoaderProgressEvent) => void> = null,\r\n pluginExtension: Nullable<string> = null,\r\n name: string = \"\"\r\n ): Promise<Scene> {\r\n return new Promise((resolve, reject) => {\r\n SceneLoader.Load(\r\n rootUrl,\r\n sceneFilename,\r\n engine,\r\n (scene) => {\r\n resolve(scene);\r\n },\r\n onProgress,\r\n (scene, message, exception) => {\r\n reject(exception || new Error(message));\r\n },\r\n pluginExtension,\r\n name\r\n );\r\n });\r\n }\r\n\r\n /**\r\n * Append a scene\r\n * @param rootUrl a string that defines the root url for the scene and resources or the concatenation of rootURL and filename (e.g. http://example.com/test.glb)\r\n * @param sceneFilename a string that defines the name of the scene file or starts with \"data:\" following by the stringified version of the scene or a File object (default: empty string)\r\n * @param scene is the instance of BABYLON.Scene to append to\r\n * @param onSuccess a callback with the scene when import succeeds\r\n * @param onProgress a callback with a progress event for each file being loaded\r\n * @param onError a callback with the scene, a message, and possibly an exception when import fails\r\n * @param pluginExtension the extension used to determine the plugin\r\n * @param name defines the name of the file, if the data is binary\r\n * @returns The loaded plugin\r\n */\r\n public static Append(\r\n rootUrl: string,\r\n sceneFilename: string | File | ArrayBufferView = \"\",\r\n scene: Nullable<Scene> = EngineStore.LastCreatedScene,\r\n onSuccess: Nullable<(scene: Scene) => void> = null,\r\n onProgress: Nullable<(event: ISceneLoaderProgressEvent) => void> = null,\r\n onError: Nullable<(scene: Scene, message: string, exception?: any) => void> = null,\r\n pluginExtension: Nullable<string> = null,\r\n name: string = \"\"\r\n ): Nullable<ISceneLoaderPlugin | ISceneLoaderPluginAsync> {\r\n if (!scene) {\r\n Logger.Error(\"No scene available to append to\");\r\n return null;\r\n }\r\n\r\n const fileInfo = SceneLoader._GetFileInfo(rootUrl, sceneFilename);\r\n if (!fileInfo) {\r\n return null;\r\n }\r\n\r\n const loadingToken = {};\r\n scene.addPendingData(loadingToken);\r\n\r\n const disposeHandler = () => {\r\n scene.removePendingData(loadingToken);\r\n };\r\n\r\n if (SceneLoader.ShowLoadingScreen && !this._ShowingLoadingScreen) {\r\n this._ShowingLoadingScreen = true;\r\n scene.getEngine().displayLoadingUI();\r\n scene.executeWhenReady(() => {\r\n scene.getEngine().hideLoadingUI();\r\n this._ShowingLoadingScreen = false;\r\n });\r\n }\r\n\r\n const errorHandler = (message?: string, exception?: any) => {\r\n const errorMessage = SceneLoader._FormatErrorMessage(fileInfo, message, exception);\r\n\r\n if (onError) {\r\n onError(scene, errorMessage, new RuntimeError(errorMessage, ErrorCodes.SceneLoaderError, exception));\r\n } else {\r\n Logger.Error(errorMessage);\r\n // should the exception be thrown?\r\n }\r\n\r\n disposeHandler();\r\n };\r\n\r\n const progressHandler = onProgress\r\n ? (event: ISceneLoaderProgressEvent) => {\r\n try {\r\n onProgress(event);\r\n } catch (e) {\r\n errorHandler(\"Error in onProgress callback\", e);\r\n }\r\n }\r\n : undefined;\r\n\r\n const successHandler = () => {\r\n if (onSuccess) {\r\n try {\r\n onSuccess(scene);\r\n } catch (e) {\r\n errorHandler(\"Error in onSuccess callback\", e);\r\n }\r\n }\r\n\r\n scene.removePendingData(loadingToken);\r\n };\r\n\r\n return SceneLoader._LoadData(\r\n fileInfo,\r\n scene,\r\n (plugin, data) => {\r\n if ((<any>plugin).load) {\r\n const syncedPlugin = <ISceneLoaderPlugin>plugin;\r\n if (!syncedPlugin.load(scene, data, fileInfo.rootUrl, errorHandler)) {\r\n return;\r\n }\r\n\r\n scene.loadingPluginName = plugin.name;\r\n successHandler();\r\n } else {\r\n const asyncedPlugin = <ISceneLoaderPluginAsync>plugin;\r\n asyncedPlugin\r\n .loadAsync(scene, data, fileInfo.rootUrl, progressHandler, fileInfo.name)\r\n .then(() => {\r\n scene.loadingPluginName = plugin.name;\r\n successHandler();\r\n })\r\n .catch((error) => {\r\n errorHandler(error.message, error);\r\n });\r\n }\r\n },\r\n progressHandler,\r\n errorHandler,\r\n disposeHandler,\r\n pluginExtension,\r\n name\r\n );\r\n }\r\n\r\n /**\r\n * Append a scene\r\n * @param rootUrl a string that defines the root url for the scene and resources or the concatenation of rootURL and filename (e.g. http://example.com/test.glb)\r\n * @param sceneFilename a string that defines the name of the scene file or starts with \"data:\" following by the stringified version of the scene or a File object (default: empty string)\r\n * @param scene is the instance of BABYLON.Scene to append to\r\n * @param onProgress a callback with a progress event for each file being loaded\r\n * @param pluginExtension the extension used to determine the plugin\r\n * @param name defines the name of the file, if the data is binary\r\n * @returns The given scene\r\n */\r\n public static AppendAsync(\r\n rootUrl: string,\r\n sceneFilename: string | File | ArrayBufferView = \"\",\r\n scene: Nullable<Scene> = EngineStore.LastCreatedScene,\r\n onProgress: Nullable<(event: ISceneLoaderProgressEvent) => void> = null,\r\n pluginExtension: Nullable<string> = null,\r\n name: string = \"\"\r\n ): Promise<Scene> {\r\n return new Promise((resolve, reject) => {\r\n SceneLoader.Append(\r\n rootUrl,\r\n sceneFilename,\r\n scene,\r\n (scene) => {\r\n resolve(scene);\r\n },\r\n onProgress,\r\n (scene, message, exception) => {\r\n reject(exception || new Error(message));\r\n },\r\n pluginExtension,\r\n name\r\n );\r\n });\r\n }\r\n\r\n /**\r\n * Load a scene into an asset container\r\n * @param rootUrl a string that defines the root url for the scene and resources or the concatenation of rootURL and filename (e.g. http://example.com/test.glb)\r\n * @param sceneFilename a string that defines the name of the scene file or starts with \"data:\" following by the stringified version of the scene or a File object (default: empty string)\r\n * @param scene is the instance of BABYLON.Scene to append to (default: last created scene)\r\n * @param onSuccess a callback with the scene when import succeeds\r\n * @param onProgress a callback with a progress event for each file being loaded\r\n * @param onError a callback with the scene, a message, and possibly an exception when import fails\r\n * @param pluginExtension the extension used to determine the plugin\r\n * @param name defines the filename, if the data is binary\r\n * @returns The loaded plugin\r\n */\r\n public static LoadAssetContainer(\r\n rootUrl: string,\r\n sceneFilename: string | File | ArrayBufferView = \"\",\r\n scene: Nullable<Scene> = EngineStore.LastCreatedScene,\r\n onSuccess: Nullable<(assets: AssetContainer) => void> = null,\r\n onProgress: Nullable<(event: ISceneLoaderProgressEvent) => void> = null,\r\n onError: Nullable<(scene: Scene, message: string, exception?: any) => void> = null,\r\n pluginExtension: Nullable<string> = null,\r\n name: string = \"\"\r\n ): Nullable<ISceneLoaderPlugin | ISceneLoaderPluginAsync> {\r\n if (!scene) {\r\n Logger.Error(\"No scene available to load asset container to\");\r\n return null;\r\n }\r\n\r\n const fileInfo = SceneLoader._GetFileInfo(rootUrl, sceneFilename);\r\n if (!fileInfo) {\r\n return null;\r\n }\r\n\r\n const loadingToken = {};\r\n scene.addPendingData(loadingToken);\r\n\r\n const disposeHandler = () => {\r\n scene.removePendingData(loadingToken);\r\n };\r\n\r\n const errorHandler = (message?: string, exception?: any) => {\r\n const errorMessage = SceneLoader._FormatErrorMessage(fileInfo, message, exception);\r\n\r\n if (onError) {\r\n onError(scene, errorMessage, new RuntimeError(errorMessage, ErrorCodes.SceneLoaderError, exception));\r\n } else {\r\n Logger.Error(errorMessage);\r\n // should the exception be thrown?\r\n }\r\n\r\n disposeHandler();\r\n };\r\n\r\n const progressHandler = onProgress\r\n ? (event: ISceneLoaderProgressEvent) => {\r\n try {\r\n onProgress(event);\r\n } catch (e) {\r\n errorHandler(\"Error in onProgress callback\", e);\r\n }\r\n }\r\n : undefined;\r\n\r\n const successHandler = (assets: AssetContainer) => {\r\n if (onSuccess) {\r\n try {\r\n onSuccess(assets);\r\n } catch (e) {\r\n errorHandler(\"Error in onSuccess callback\", e);\r\n }\r\n }\r\n\r\n scene.removePendingData(loadingToken);\r\n };\r\n\r\n return SceneLoader._LoadData(\r\n fileInfo,\r\n scene,\r\n (plugin, data) => {\r\n if ((<any>plugin).loadAssetContainer) {\r\n const syncedPlugin = <ISceneLoaderPlugin>plugin;\r\n const assetContainer = syncedPlugin.loadAssetContainer(scene, data, fileInfo.rootUrl, errorHandler);\r\n if (!assetContainer) {\r\n return;\r\n }\r\n assetContainer.populateRootNodes();\r\n scene.loadingPluginName = plugin.name;\r\n successHandler(assetContainer);\r\n } else if ((<any>plugin).loadAssetContainerAsync) {\r\n const asyncedPlugin = <ISceneLoaderPluginAsync>plugin;\r\n asyncedPlugin\r\n .loadAssetContainerAsync(scene, data, fileInfo.rootUrl, progressHandler, fileInfo.name)\r\n .then((assetContainer) => {\r\n assetContainer.populateRootNodes();\r\n scene.loadingPluginName = plugin.name;\r\n successHandler(assetContainer);\r\n })\r\n .catch((error) => {\r\n errorHandler(error.message, error);\r\n });\r\n } else {\r\n errorHandler(\"LoadAssetContainer is not supported by this plugin. Plugin did not provide a loadAssetContainer or loadAssetContainerAsync method.\");\r\n }\r\n },\r\n progressHandler,\r\n errorHandler,\r\n disposeHandler,\r\n pluginExtension,\r\n name\r\n );\r\n }\r\n\r\n /**\r\n * Load a scene into an asset container\r\n * @param rootUrl a string that defines the root url for the scene and resources or the concatenation of rootURL and filename (e.g. http://example.com/test.glb)\r\n * @param sceneFilename a string that defines the name of the scene file or starts with \"data:\" following by the stringified version of the scene (default: empty string)\r\n * @param scene is the instance of Scene to append to\r\n * @param onProgress a callback with a progress event for each file being loaded\r\n * @param pluginExtension the extension used to determine the plugin\r\n * @returns The loaded asset container\r\n */\r\n public static LoadAssetContainerAsync(\r\n rootUrl: string,\r\n sceneFilename: string | File = \"\",\r\n scene: Nullable<Scene> = EngineStore.LastCreatedScene,\r\n onProgress: Nullable<(event: ISceneLoaderProgressEvent) => void> = null,\r\n pluginExtension: Nullable<string> = null\r\n ): Promise<AssetContainer> {\r\n return new Promise((resolve, reject) => {\r\n SceneLoader.LoadAssetContainer(\r\n rootUrl,\r\n sceneFilename,\r\n scene,\r\n (assetContainer) => {\r\n resolve(assetContainer);\r\n },\r\n onProgress,\r\n (scene, message, exception) => {\r\n reject(exception || new Error(message));\r\n },\r\n pluginExtension\r\n );\r\n });\r\n }\r\n\r\n /**\r\n * Import animations from a file into a scene\r\n * @param rootUrl a string that defines the root url for the scene and resources or the concatenation of rootURL and filename (e.g. http://example.com/test.glb)\r\n * @param sceneFilename a string that defines the name of the scene file or starts with \"data:\" following by the stringified version of the scene or a File object (default: empty string)\r\n * @param scene is the instance of BABYLON.Scene to append to (default: last created scene)\r\n * @param overwriteAnimations when true, animations are cleaned before importing new ones. Animations are appended otherwise\r\n * @param animationGroupLoadingMode defines how to handle old animations groups before importing new ones\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 onSuccess a callback with the scene when import succeeds\r\n * @param onProgress a callback with a progress event for each file being loaded\r\n * @param onError a callback with the scene, a message, and possibly an exception when import fails\r\n * @param pluginExtension the extension used to determine the plugin\r\n */\r\n public static ImportAnimations(\r\n rootUrl: string,\r\n sceneFilename: string | File = \"\",\r\n scene: Nullable<Scene> = EngineStore.LastCreatedScene,\r\n overwriteAnimations = true,\r\n animationGroupLoadingMode = SceneLoaderAnimationGroupLoadingMode.Clean,\r\n targetConverter: Nullable<(target: any) => any> = null,\r\n onSuccess: Nullable<(scene: Scene) => void> = null,\r\n onProgress: Nullable<(event: ISceneLoaderProgressEvent) => void> = null,\r\n onError: Nullable<(scene: Scene, message: string, exception?: any) => void> = null,\r\n pluginExtension: Nullable<string> = null\r\n ): void {\r\n if (!scene) {\r\n Logger.Error(\"No scene available to load animations to\");\r\n return;\r\n }\r\n\r\n if (overwriteAnimations) {\r\n // Reset, stop and dispose all animations before loading new ones\r\n for (const animatable of scene.animatables) {\r\n animatable.reset();\r\n }\r\n scene.stopAllAnimations();\r\n scene.animationGroups.slice().forEach((animationGroup) => {\r\n animationGroup.dispose();\r\n });\r\n const nodes = scene.getNodes();\r\n nodes.forEach((node) => {\r\n if (node.animations) {\r\n node.animations = [];\r\n }\r\n });\r\n } else {\r\n switch (animationGroupLoadingMode) {\r\n case SceneLoaderAnimationGroupLoadingMode.Clean:\r\n scene.animationGroups.slice().forEach((animationGroup) => {\r\n animationGroup.dispose();\r\n });\r\n break;\r\n case SceneLoaderAnimationGroupLoadingMode.Stop:\r\n scene.animationGroups.forEach((animationGroup) => {\r\n animationGroup.stop();\r\n });\r\n break;\r\n case SceneLoaderAnimationGroupLoadingMode.Sync:\r\n scene.animationGroups.forEach((animationGroup) => {\r\n animationGroup.reset();\r\n animationGroup.restart();\r\n });\r\n break;\r\n case SceneLoaderAnimationGroupLoadingMode.NoSync:\r\n // nothing to do\r\n break;\r\n default:\r\n Logger.Error(\"Unknown animation group loading mode value '\" + animationGroupLoadingMode + \"'\");\r\n return;\r\n }\r\n }\r\n\r\n const startingIndexForNewAnimatables = scene.animatables.length;\r\n\r\n const onAssetContainerLoaded = (container: AssetContainer) => {\r\n container.mergeAnimationsTo(scene, scene.animatables.slice(startingIndexForNewAnimatables), targetConverter);\r\n\r\n container.dispose();\r\n\r\n scene.onAnimationFileImportedObservable.notifyObservers(scene);\r\n\r\n if (onSuccess) {\r\n onSuccess(scene);\r\n }\r\n };\r\n\r\n this.LoadAssetContainer(rootUrl, sceneFilename, scene, onAssetContainerLoaded, onProgress, onError, pluginExtension);\r\n }\r\n\r\n /**\r\n * Import animations from a file into a scene\r\n * @param rootUrl a string that defines the root url for the scene and resources or the concatenation of rootURL and filename (e.g. http://example.com/test.glb)\r\n * @param sceneFilename a string that defines the name of the scene file or starts with \"data:\" following by the stringified version of the scene or a File object (default: empty string)\r\n * @param scene is the instance of BABYLON.Scene to append to (default: last created scene)\r\n * @param overwriteAnimations when true, animations are cleaned before importing new ones. Animations are appended otherwise\r\n * @param animationGroupLoadingMode defines how to handle old animations groups before importing new ones\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 onSuccess a callback with the scene when import succeeds\r\n * @param onProgress a callback with a progress event for each file being loaded\r\n * @param onError a callback with the scene, a message, and possibly an exception when import fails\r\n * @param pluginExtension the extension used to determine the plugin\r\n * @returns the updated scene with imported animations\r\n */\r\n public static ImportAnimationsAsync(\r\n rootUrl: string,\r\n sceneFilename: string | File = \"\",\r\n scene: Nullable<Scene> = EngineStore.LastCreatedScene,\r\n overwriteAnimations = true,\r\n animationGroupLoadingMode = SceneLoaderAnimationGroupLoadingMode.Clean,\r\n targetConverter: Nullable<(target: any) => any> = null,\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n onSuccess: Nullable<(scene: Scene) => void> = null,\r\n onProgress: Nullable<(event: ISceneLoaderProgressEvent) => void> = null,\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n onError: Nullable<(scene: Scene, message: string, exception?: any) => void> = null,\r\n pluginExtension: Nullable<string> = null\r\n ): Promise<Scene> {\r\n return new Promise((resolve, reject) => {\r\n SceneLoader.ImportAnimations(\r\n rootUrl,\r\n sceneFilename,\r\n scene,\r\n overwriteAnimations,\r\n animationGroupLoadingMode,\r\n targetConverter,\r\n (_scene: Scene) => {\r\n resolve(_scene);\r\n },\r\n onProgress,\r\n (_scene: Scene, message: string, exception: any) => {\r\n reject(exception || new Error(message));\r\n },\r\n pluginExtension\r\n );\r\n });\r\n }\r\n}\r\n"]}
|
|
@@ -83,7 +83,7 @@ export interface IGreasedLineMaterial {
|
|
|
83
83
|
*/
|
|
84
84
|
setColor(value: Nullable<Color3>, doNotMarkDirty?: boolean): void;
|
|
85
85
|
/**
|
|
86
|
-
*
|
|
86
|
+
* Set the colors
|
|
87
87
|
* @param colors colors array
|
|
88
88
|
* @param lazy if true the colors texture will not be updated
|
|
89
89
|
* @param forceNewTexture forces to create a new colors texture
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"greasedLineMaterialInterfaces.js","sourceRoot":"","sources":["../../../../../dev/core/src/Materials/GreasedLine/greasedLineMaterialInterfaces.ts"],"names":[],"mappings":"AAiHA;;;GAGG;AACH,MAAM,CAAN,IAAY,2BAaX;AAbD,WAAY,2BAA2B;IACnC;;OAEG;IACH,iHAA0B,CAAA;IAC1B;;OAEG;IACH,uGAAqB,CAAA;IACrB;;OAEG;IACH,6GAAwB,CAAA;AAC5B,CAAC,EAbW,2BAA2B,KAA3B,2BAA2B,QAatC;AAED;;;GAGG;AACH,MAAM,CAAN,IAAY,wBAaX;AAbD,WAAY,wBAAwB;IAChC;;OAEG;IACH,2FAAkB,CAAA;IAClB;;OAEG;IACH,2FAAkB,CAAA;IAClB;;OAEG;IACH,qGAAuB,CAAA;AAC3B,CAAC,EAbW,wBAAwB,KAAxB,wBAAwB,QAanC;AAED;;;;GAIG;AACH,MAAM,CAAN,IAAY,oCASX;AATD,WAAY,oCAAoC;IAC5C;;OAEG;IACH,qJAAmC,CAAA;IACnC;;OAEG;IACH,+IAAgC,CAAA;AACpC,CAAC,EATW,oCAAoC,KAApC,oCAAoC,QAS/C","sourcesContent":["import type { RawTexture } from \"../Textures/rawTexture\";\r\nimport type { Vector2 } from \"../../Maths/math.vector\";\r\nimport type { Nullable } from \"../../types\";\r\nimport type { Color3 } from \"../../Maths/math.color\";\r\n/**\r\n * Interface which defines the available methods for a GreasedLineMaterial\r\n */\r\nexport interface IGreasedLineMaterial {\r\n /**\r\n * Normalized value of how much of the line will be visible\r\n * 0 - 0% of the line will be visible\r\n * 1 - 100% of the line will be visible\r\n */\r\n visibility: number;\r\n\r\n /**\r\n * Line base width. At each point the line width is calculated by widths[pointIndex] * width\r\n */\r\n width: number;\r\n\r\n /**\r\n * Turns on/off dash mode\r\n */\r\n useDash: boolean;\r\n\r\n /**\r\n * @see GreasedLinePluginMaterial.setDashCount\r\n * Number of dashes in the line.\r\n * Defaults to 1.\r\n */\r\n dashCount: number;\r\n\r\n /**\r\n * Dash offset\r\n */\r\n dashOffset: number;\r\n\r\n /**\r\n * Length of the dash. 0 to 1. 0.5 means half empty, half drawn.\r\n */\r\n dashRatio: number;\r\n\r\n /**\r\n * Whether to use the colors option to colorize the line\r\n */\r\n useColors: boolean;\r\n\r\n /**\r\n * The mixing mode of the color paramater. Default value is GreasedLineMeshColorMode.SET.\r\n * MATERIAL_TYPE_SIMPLE mixes the color and colors of the greased line material.\r\n * MATERIAL_TYPE_STANDARD and MATERIAL_TYPE_PBR mixes the color from the base material with the color and/or colors of the greased line material.\r\n * @see GreasedLineMeshColorMode\r\n */\r\n colorMode: GreasedLineMeshColorMode;\r\n\r\n /**\r\n * Colors of the line segments.\r\n * Defaults to empty.\r\n */\r\n colors: Nullable<Color3[]>;\r\n\r\n /**\r\n * If false then width units = scene units. If true then line will width be reduced.\r\n * Defaults to false.\r\n */\r\n sizeAttenuation: boolean;\r\n\r\n /**\r\n * Color of the line. Applies to all line segments.\r\n * Defaults to White.\r\n */\r\n color: Nullable<Color3>;\r\n\r\n /**\r\n * The method used to distribute the colors along the line.\r\n * You can use segment distribution when each segment will use on color from the color table.\r\n * Or you can use line distribution when the colors are distributed evenly along the line ignoring the segments.\r\n */\r\n colorsDistributionType: GreasedLineMeshColorDistributionType;\r\n\r\n /**\r\n * Defaults to engine.getRenderWidth() and engine.getRenderHeight()\r\n * Rendering resolution\r\n */\r\n resolution: Vector2;\r\n\r\n /**\r\n * You can provide a colorsTexture to use instead of one generated from the 'colors' option\r\n */\r\n colorsTexture: Nullable<RawTexture>;\r\n\r\n /**\r\n * Allows to change the color without marking the material dirty.\r\n * MATERIAL_TYPE_STANDARD and MATERIAL_TYPE_PBR material's shaders will get recompiled if there was no color set and you set a color or when there was a color set and you set it to null.\r\n * @param value the color\r\n * @param doNotMarkDirty the flag\r\n */\r\n setColor(value: Nullable<Color3>, doNotMarkDirty?: boolean): void;\r\n\r\n /**\r\n
|
|
1
|
+
{"version":3,"file":"greasedLineMaterialInterfaces.js","sourceRoot":"","sources":["../../../../../dev/core/src/Materials/GreasedLine/greasedLineMaterialInterfaces.ts"],"names":[],"mappings":"AAiHA;;;GAGG;AACH,MAAM,CAAN,IAAY,2BAaX;AAbD,WAAY,2BAA2B;IACnC;;OAEG;IACH,iHAA0B,CAAA;IAC1B;;OAEG;IACH,uGAAqB,CAAA;IACrB;;OAEG;IACH,6GAAwB,CAAA;AAC5B,CAAC,EAbW,2BAA2B,KAA3B,2BAA2B,QAatC;AAED;;;GAGG;AACH,MAAM,CAAN,IAAY,wBAaX;AAbD,WAAY,wBAAwB;IAChC;;OAEG;IACH,2FAAkB,CAAA;IAClB;;OAEG;IACH,2FAAkB,CAAA;IAClB;;OAEG;IACH,qGAAuB,CAAA;AAC3B,CAAC,EAbW,wBAAwB,KAAxB,wBAAwB,QAanC;AAED;;;;GAIG;AACH,MAAM,CAAN,IAAY,oCASX;AATD,WAAY,oCAAoC;IAC5C;;OAEG;IACH,qJAAmC,CAAA;IACnC;;OAEG;IACH,+IAAgC,CAAA;AACpC,CAAC,EATW,oCAAoC,KAApC,oCAAoC,QAS/C","sourcesContent":["import type { RawTexture } from \"../Textures/rawTexture\";\r\nimport type { Vector2 } from \"../../Maths/math.vector\";\r\nimport type { Nullable } from \"../../types\";\r\nimport type { Color3 } from \"../../Maths/math.color\";\r\n/**\r\n * Interface which defines the available methods for a GreasedLineMaterial\r\n */\r\nexport interface IGreasedLineMaterial {\r\n /**\r\n * Normalized value of how much of the line will be visible\r\n * 0 - 0% of the line will be visible\r\n * 1 - 100% of the line will be visible\r\n */\r\n visibility: number;\r\n\r\n /**\r\n * Line base width. At each point the line width is calculated by widths[pointIndex] * width\r\n */\r\n width: number;\r\n\r\n /**\r\n * Turns on/off dash mode\r\n */\r\n useDash: boolean;\r\n\r\n /**\r\n * @see GreasedLinePluginMaterial.setDashCount\r\n * Number of dashes in the line.\r\n * Defaults to 1.\r\n */\r\n dashCount: number;\r\n\r\n /**\r\n * Dash offset\r\n */\r\n dashOffset: number;\r\n\r\n /**\r\n * Length of the dash. 0 to 1. 0.5 means half empty, half drawn.\r\n */\r\n dashRatio: number;\r\n\r\n /**\r\n * Whether to use the colors option to colorize the line\r\n */\r\n useColors: boolean;\r\n\r\n /**\r\n * The mixing mode of the color paramater. Default value is GreasedLineMeshColorMode.SET.\r\n * MATERIAL_TYPE_SIMPLE mixes the color and colors of the greased line material.\r\n * MATERIAL_TYPE_STANDARD and MATERIAL_TYPE_PBR mixes the color from the base material with the color and/or colors of the greased line material.\r\n * @see GreasedLineMeshColorMode\r\n */\r\n colorMode: GreasedLineMeshColorMode;\r\n\r\n /**\r\n * Colors of the line segments.\r\n * Defaults to empty.\r\n */\r\n colors: Nullable<Color3[]>;\r\n\r\n /**\r\n * If false then width units = scene units. If true then line will width be reduced.\r\n * Defaults to false.\r\n */\r\n sizeAttenuation: boolean;\r\n\r\n /**\r\n * Color of the line. Applies to all line segments.\r\n * Defaults to White.\r\n */\r\n color: Nullable<Color3>;\r\n\r\n /**\r\n * The method used to distribute the colors along the line.\r\n * You can use segment distribution when each segment will use on color from the color table.\r\n * Or you can use line distribution when the colors are distributed evenly along the line ignoring the segments.\r\n */\r\n colorsDistributionType: GreasedLineMeshColorDistributionType;\r\n\r\n /**\r\n * Defaults to engine.getRenderWidth() and engine.getRenderHeight()\r\n * Rendering resolution\r\n */\r\n resolution: Vector2;\r\n\r\n /**\r\n * You can provide a colorsTexture to use instead of one generated from the 'colors' option\r\n */\r\n colorsTexture: Nullable<RawTexture>;\r\n\r\n /**\r\n * Allows to change the color without marking the material dirty.\r\n * MATERIAL_TYPE_STANDARD and MATERIAL_TYPE_PBR material's shaders will get recompiled if there was no color set and you set a color or when there was a color set and you set it to null.\r\n * @param value the color\r\n * @param doNotMarkDirty the flag\r\n */\r\n setColor(value: Nullable<Color3>, doNotMarkDirty?: boolean): void;\r\n\r\n /**\r\n * Set the colors\r\n * @param colors colors array\r\n * @param lazy if true the colors texture will not be updated\r\n * @param forceNewTexture forces to create a new colors texture\r\n */\r\n setColors(colors: Nullable<Color3[]>, lazy: boolean, forceNewTexture?: boolean): void;\r\n\r\n /**\r\n * Creates and sets the colors texture from the colors array which was created in lazy mode\r\n */\r\n updateLazy(): void;\r\n}\r\n\r\n/**\r\n * Material types for GreasedLine\r\n * {@link https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/param/greased_line#materialtype}\r\n */\r\nexport enum GreasedLineMeshMaterialType {\r\n /**\r\n * StandardMaterial\r\n */\r\n MATERIAL_TYPE_STANDARD = 0,\r\n /**\r\n * PBR Material\r\n */\r\n MATERIAL_TYPE_PBR = 1,\r\n /**\r\n * Simple and fast shader material not supporting lightning nor textures\r\n */\r\n MATERIAL_TYPE_SIMPLE = 2,\r\n}\r\n\r\n/**\r\n * Color blending mode of the @see GreasedLineMaterial and the base material\r\n * {@link https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/param/greased_line#colormode}\r\n */\r\nexport enum GreasedLineMeshColorMode {\r\n /**\r\n * Color blending mode SET\r\n */\r\n COLOR_MODE_SET = 0,\r\n /**\r\n * Color blending mode ADD\r\n */\r\n COLOR_MODE_ADD = 1,\r\n /**\r\n * Color blending mode ADD\r\n */\r\n COLOR_MODE_MULTIPLY = 2,\r\n}\r\n\r\n/**\r\n * Color distribution type of the @see colors.\r\n * {@link https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/param/greased_line#colordistributiontype}\r\n *\r\n */\r\nexport enum GreasedLineMeshColorDistributionType {\r\n /**\r\n * Colors distributed between segments of the line\r\n */\r\n COLOR_DISTRIBUTION_TYPE_SEGMENT = 0,\r\n /**\r\n * Colors distributed along the line ingoring the segments\r\n */\r\n COLOR_DISTRIBUTION_TYPE_LINE = 1,\r\n}\r\n\r\n/**\r\n * Options for GreasedLineMaterial\r\n */\r\nexport interface GreasedLineMaterialOptions {\r\n /**\r\n * Line width. If sizeAttenuation os false scene units will be used for width.\r\n * Defaults to 0.1 if @see sizeAttenuation is false, or to 1 if it's true.\r\n */\r\n width?: number;\r\n /**\r\n * If false then width units = scene units. If true then line will width be reduced.\r\n * Defaults to false.\r\n */\r\n sizeAttenuation?: boolean;\r\n /**\r\n * Type of the material to use to render the line.\r\n * Defaults to StandardMaterial.\r\n */\r\n materialType?: GreasedLineMeshMaterialType;\r\n /**\r\n * Color of the line. Applies to all line segments.\r\n * Defaults to White.\r\n */\r\n color?: Color3;\r\n /**\r\n * Color mode of the line. Applies to all line segments.\r\n * The pixel color from the material shader will be modified with the value of @see color using the colorMode.\r\n * Defaults to @see GreasedLineMeshColorMode.SET\r\n */\r\n colorMode?: GreasedLineMeshColorMode;\r\n /**\r\n * Colors of the line segments.\r\n * Defaults to empty.\r\n */\r\n colors?: Color3[];\r\n /**\r\n * If true, @see colors are used, otherwise they're ignored.\r\n * Defaults to false.\r\n */\r\n useColors?: boolean;\r\n /**\r\n * Sampling type of the colors texture\r\n * Defaults to NEAREST_NEAREST.\r\n */\r\n colorsSampling?: number;\r\n /**\r\n * The method used to distribute the colors along the line.\r\n * You can use segment distribution when each segment will use on color from the color table.\r\n * Or you can use line distribution when the colors are distributed evenly along the line ignoring the segments.\r\n */\r\n colorDistributionType?: GreasedLineMeshColorDistributionType;\r\n /**\r\n * If true, dashing is used.\r\n * Defaults to false.\r\n */\r\n useDash?: boolean;\r\n /**\r\n * @see GreasedLinePluginMaterial.setDashCount\r\n * Number of dashes in the line.\r\n * Defaults to 1.\r\n */\r\n dashCount?: number;\r\n /**\r\n * Offset of the dashes along the line. 0 to 1.\r\n * Defaults to 0.\r\n * @see GreasedLinePluginMaterial.setDashOffset\r\n */\r\n dashOffset?: number;\r\n /**\r\n * Length of the dash. 0 to 1. 0.5 means half empty, half drawn.\r\n * Defaults to 0.5.\r\n * @see GreasedLinePluginMaterial.setDashRatio\r\n */\r\n dashRatio?: number;\r\n /**\r\n * Sets the line length visibility.\r\n * 0 - 0% of the line will be visible.\r\n * 1 - 100% of the line will be visible.\r\n * @see GreasedLinePluginMaterial.setVisibility\r\n */\r\n visibility?: number;\r\n /**\r\n * Defaults to engine.getRenderWidth() and engine.getRenderHeight()\r\n * Rendering resolution\r\n */\r\n resolution?: Vector2;\r\n /**\r\n * Whether to use camera facing for the line.\r\n * Defaults to true.\r\n */\r\n cameraFacing?: boolean;\r\n /**\r\n * You can provide a colorsTexture to use instead of one generated from the 'colors' option\r\n */\r\n colorsTexture?: RawTexture;\r\n}\r\n"]}
|
|
@@ -114,7 +114,7 @@ export declare class GreasedLinePluginMaterial extends MaterialPluginBase implem
|
|
|
114
114
|
getSamplers(samplers: string[]): void;
|
|
115
115
|
/**
|
|
116
116
|
* Get the shader textures
|
|
117
|
-
* @param activeTextures
|
|
117
|
+
* @param activeTextures array which will be filled with the textures
|
|
118
118
|
*/
|
|
119
119
|
getActiveTextures(activeTextures: BaseTexture[]): void;
|
|
120
120
|
/**
|
|
@@ -212,6 +212,7 @@ export declare class GreasedLinePluginMaterial extends MaterialPluginBase implem
|
|
|
212
212
|
/**
|
|
213
213
|
* Sets the color of the line. If set the whole line will be mixed with this color according to the colorMode option.
|
|
214
214
|
* @param value color
|
|
215
|
+
* @param doNotMarkDirty if true, the material will not be marked as dirty
|
|
215
216
|
*/
|
|
216
217
|
setColor(value: Nullable<Color3>, doNotMarkDirty?: boolean): void;
|
|
217
218
|
/**
|
|
@@ -126,7 +126,7 @@ export class GreasedLinePluginMaterial extends MaterialPluginBase {
|
|
|
126
126
|
}
|
|
127
127
|
/**
|
|
128
128
|
* Get the shader textures
|
|
129
|
-
* @param activeTextures
|
|
129
|
+
* @param activeTextures array which will be filled with the textures
|
|
130
130
|
*/
|
|
131
131
|
getActiveTextures(activeTextures) {
|
|
132
132
|
if (this.colorsTexture) {
|
|
@@ -485,6 +485,7 @@ export class GreasedLinePluginMaterial extends MaterialPluginBase {
|
|
|
485
485
|
/**
|
|
486
486
|
* Sets the color of the line. If set the whole line will be mixed with this color according to the colorMode option.
|
|
487
487
|
* @param value color
|
|
488
|
+
* @param doNotMarkDirty if true, the material will not be marked as dirty
|
|
488
489
|
*/
|
|
489
490
|
setColor(value, doNotMarkDirty = false) {
|
|
490
491
|
if ((this._color === null && value !== null) || (this._color !== null && value === null)) {
|