@babylonjs/core 7.11.4 → 7.13.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/Actions/abstractActionManager.d.ts +1 -1
- package/Actions/abstractActionManager.js +1 -1
- package/Actions/abstractActionManager.js.map +1 -1
- package/Animations/animation.js +1 -2
- package/Animations/animation.js.map +1 -1
- package/Animations/animationGroupMask.d.ts +1 -1
- package/Animations/animationGroupMask.js +2 -2
- package/Animations/animationGroupMask.js.map +1 -1
- package/Animations/animationKey.d.ts +1 -1
- package/Animations/animationKey.js.map +1 -1
- package/Behaviors/Meshes/handConstraintBehavior.d.ts +3 -3
- package/Behaviors/Meshes/handConstraintBehavior.js +16 -17
- package/Behaviors/Meshes/handConstraintBehavior.js.map +1 -1
- package/Behaviors/Meshes/sixDofDragBehavior.js +2 -3
- package/Behaviors/Meshes/sixDofDragBehavior.js.map +1 -1
- package/Bones/bone.js +31 -32
- package/Bones/bone.js.map +1 -1
- package/Bones/boneIKController.js +5 -6
- package/Bones/boneIKController.js.map +1 -1
- package/Bones/boneLookController.js +13 -13
- package/Bones/boneLookController.js.map +1 -1
- package/Cameras/Inputs/freeCameraMouseWheelInput.js +5 -6
- package/Cameras/Inputs/freeCameraMouseWheelInput.js.map +1 -1
- package/Cameras/Inputs/freeCameraVirtualJoystickInput.js +5 -5
- package/Cameras/Inputs/freeCameraVirtualJoystickInput.js.map +1 -1
- package/Cameras/VR/vrExperienceHelper.js +8 -10
- package/Cameras/VR/vrExperienceHelper.js.map +1 -1
- package/Compute/computeEffect.js +2 -3
- package/Compute/computeEffect.js.map +1 -1
- package/Compute/computeShader.js +19 -20
- package/Compute/computeShader.js.map +1 -1
- package/Culling/Helper/IBoundingInfoHelperPlatform.d.ts +4 -0
- package/Culling/Helper/IBoundingInfoHelperPlatform.js.map +1 -1
- package/Culling/Helper/boundingInfoHelper.d.ts +26 -4
- package/Culling/Helper/boundingInfoHelper.js +41 -10
- package/Culling/Helper/boundingInfoHelper.js.map +1 -1
- package/Culling/Helper/computeShaderBoundingHelper.d.ts +12 -3
- package/Culling/Helper/computeShaderBoundingHelper.js +164 -76
- package/Culling/Helper/computeShaderBoundingHelper.js.map +1 -1
- package/Culling/Helper/transformFeedbackBoundingHelper.d.ts +11 -0
- package/Culling/Helper/transformFeedbackBoundingHelper.js +46 -14
- package/Culling/Helper/transformFeedbackBoundingHelper.js.map +1 -1
- package/Debug/debugLayer.d.ts +1 -1
- package/Debug/debugLayer.js.map +1 -1
- package/Decorators/nodeDecorator.d.ts +1 -1
- package/Decorators/nodeDecorator.js +1 -1
- package/Decorators/nodeDecorator.js.map +1 -1
- package/DeviceInput/InputDevices/deviceEnums.d.ts +5 -5
- package/DeviceInput/InputDevices/deviceEnums.js.map +1 -1
- package/DeviceInput/eventFactory.js +3 -3
- package/DeviceInput/eventFactory.js.map +1 -1
- package/Engines/AbstractEngine/abstractEngine.cubeTexture.js +2 -2
- package/Engines/AbstractEngine/abstractEngine.cubeTexture.js.map +1 -1
- package/Engines/Extensions/engine.computeShader.d.ts +1 -1
- package/Engines/Extensions/engine.computeShader.js.map +1 -1
- package/Engines/Extensions/engine.cubeTexture.js +2 -2
- package/Engines/Extensions/engine.cubeTexture.js.map +1 -1
- package/Engines/Extensions/engine.dynamicTexture.js +2 -2
- package/Engines/Extensions/engine.dynamicTexture.js.map +1 -1
- package/Engines/Extensions/engine.multiRender.js +3 -3
- package/Engines/Extensions/engine.multiRender.js.map +1 -1
- package/Engines/Extensions/engine.multiview.js +2 -2
- package/Engines/Extensions/engine.multiview.js.map +1 -1
- package/Engines/Extensions/engine.prefilteredCubeTexture.js +3 -3
- package/Engines/Extensions/engine.prefilteredCubeTexture.js.map +1 -1
- package/Engines/Extensions/engine.rawTexture.js +4 -4
- package/Engines/Extensions/engine.rawTexture.js.map +1 -1
- package/Engines/Extensions/engine.renderTarget.js +3 -3
- package/Engines/Extensions/engine.renderTarget.js.map +1 -1
- package/Engines/Extensions/engine.renderTargetCube.js +2 -2
- package/Engines/Extensions/engine.renderTargetCube.js.map +1 -1
- package/Engines/Native/nativeShaderProcessors.js +1 -2
- package/Engines/Native/nativeShaderProcessors.js.map +1 -1
- package/Engines/Processors/shaderProcessor.js +2 -3
- package/Engines/Processors/shaderProcessor.js.map +1 -1
- package/Engines/WebGL/webGL2ShaderProcessors.js +1 -2
- package/Engines/WebGL/webGL2ShaderProcessors.js.map +1 -1
- package/Engines/WebGL/webGLShaderProcessors.js +1 -2
- package/Engines/WebGL/webGLShaderProcessors.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.computeShader.js +1 -2
- package/Engines/WebGPU/Extensions/engine.computeShader.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.cubeTexture.js +2 -2
- package/Engines/WebGPU/Extensions/engine.cubeTexture.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.dynamicTexture.js +2 -2
- package/Engines/WebGPU/Extensions/engine.dynamicTexture.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.multiRender.js +2 -2
- package/Engines/WebGPU/Extensions/engine.multiRender.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.rawTexture.js +5 -5
- package/Engines/WebGPU/Extensions/engine.rawTexture.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.renderTarget.js +3 -3
- package/Engines/WebGPU/Extensions/engine.renderTarget.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.renderTargetCube.js +2 -2
- package/Engines/WebGPU/Extensions/engine.renderTargetCube.js.map +1 -1
- package/Engines/WebGPU/webgpuBufferManager.js +1 -1
- package/Engines/WebGPU/webgpuBufferManager.js.map +1 -1
- package/Engines/WebGPU/webgpuCacheRenderPipeline.js +81 -82
- package/Engines/WebGPU/webgpuCacheRenderPipeline.js.map +1 -1
- package/Engines/WebGPU/webgpuCacheSampler.js +60 -64
- package/Engines/WebGPU/webgpuCacheSampler.js.map +1 -1
- package/Engines/WebGPU/webgpuClearQuad.js +1 -2
- package/Engines/WebGPU/webgpuClearQuad.js.map +1 -1
- package/Engines/WebGPU/webgpuComputeContext.js +13 -15
- package/Engines/WebGPU/webgpuComputeContext.js.map +1 -1
- package/Engines/WebGPU/webgpuConstants.d.ts +39 -39
- package/Engines/WebGPU/webgpuConstants.js.map +1 -1
- package/Engines/WebGPU/webgpuHardwareTexture.js +6 -8
- package/Engines/WebGPU/webgpuHardwareTexture.js.map +1 -1
- package/Engines/WebGPU/webgpuOcclusionQuery.js +1 -2
- package/Engines/WebGPU/webgpuOcclusionQuery.js.map +1 -1
- package/Engines/WebGPU/webgpuQuerySet.js +3 -3
- package/Engines/WebGPU/webgpuQuerySet.js.map +1 -1
- package/Engines/WebGPU/webgpuShaderProcessor.js +15 -19
- package/Engines/WebGPU/webgpuShaderProcessor.js.map +1 -1
- package/Engines/WebGPU/webgpuShaderProcessorsGLSL.js +8 -10
- package/Engines/WebGPU/webgpuShaderProcessorsGLSL.js.map +1 -1
- package/Engines/WebGPU/webgpuShaderProcessorsWGSL.js +26 -28
- package/Engines/WebGPU/webgpuShaderProcessorsWGSL.js.map +1 -1
- package/Engines/WebGPU/webgpuTextureHelper.js +413 -416
- package/Engines/WebGPU/webgpuTextureHelper.js.map +1 -1
- package/Engines/WebGPU/webgpuTextureManager.js +50 -51
- package/Engines/WebGPU/webgpuTextureManager.js.map +1 -1
- package/Engines/WebGPU/webgpuTimestampQuery.js +1 -2
- package/Engines/WebGPU/webgpuTimestampQuery.js.map +1 -1
- package/Engines/abstractEngine.js +4 -4
- package/Engines/abstractEngine.js.map +1 -1
- package/Engines/engine.js +2 -2
- package/Engines/engine.js.map +1 -1
- package/Engines/nativeEngine.js +9 -9
- package/Engines/nativeEngine.js.map +1 -1
- package/Engines/nullEngine.js +5 -5
- package/Engines/nullEngine.js.map +1 -1
- package/Engines/renderTargetWrapper.js +1 -2
- package/Engines/renderTargetWrapper.js.map +1 -1
- package/Engines/shaderStore.js +6 -7
- package/Engines/shaderStore.js.map +1 -1
- package/Engines/thinEngine.js +4 -5
- package/Engines/thinEngine.js.map +1 -1
- package/Engines/webgpuEngine.d.ts +11 -0
- package/Engines/webgpuEngine.js +91 -72
- package/Engines/webgpuEngine.js.map +1 -1
- package/Events/deviceInputEvents.d.ts +1 -1
- package/Events/deviceInputEvents.js.map +1 -1
- package/FlowGraph/flowGraph.d.ts +1 -1
- package/FlowGraph/flowGraph.js +5 -5
- package/FlowGraph/flowGraph.js.map +1 -1
- package/FlowGraph/flowGraphBlock.js +2 -3
- package/FlowGraph/flowGraphBlock.js.map +1 -1
- package/FlowGraph/flowGraphConnection.d.ts +1 -1
- package/FlowGraph/flowGraphConnection.js.map +1 -1
- package/FlowGraph/flowGraphDataConnection.js +3 -3
- package/FlowGraph/flowGraphDataConnection.js.map +1 -1
- package/FlowGraph/flowGraphExecutionBlock.js +2 -3
- package/FlowGraph/flowGraphExecutionBlock.js.map +1 -1
- package/FlowGraph/flowGraphSignalConnection.js +3 -3
- package/FlowGraph/flowGraphSignalConnection.js.map +1 -1
- package/Gamepads/dualShockGamepad.d.ts +2 -2
- package/Gamepads/dualShockGamepad.js +14 -14
- package/Gamepads/dualShockGamepad.js.map +1 -1
- package/Gamepads/xboxGamepad.d.ts +2 -2
- package/Gamepads/xboxGamepad.js +14 -14
- package/Gamepads/xboxGamepad.js.map +1 -1
- package/Gizmos/gizmo.d.ts +2 -2
- package/Gizmos/gizmo.js +4 -4
- package/Gizmos/gizmo.js.map +1 -1
- package/Gizmos/gizmoManager.js +2 -2
- package/Gizmos/gizmoManager.js.map +1 -1
- package/Gizmos/scaleGizmo.js +3 -3
- package/Gizmos/scaleGizmo.js.map +1 -1
- package/Loading/sceneLoader.d.ts +1 -1
- package/Loading/sceneLoader.js +6 -6
- package/Loading/sceneLoader.js.map +1 -1
- package/Materials/GreasedLine/greasedLineMaterialInterfaces.d.ts +3 -3
- package/Materials/GreasedLine/greasedLineMaterialInterfaces.js.map +1 -1
- package/Materials/GreasedLine/greasedLinePluginMaterial.js +10 -11
- package/Materials/GreasedLine/greasedLinePluginMaterial.js.map +1 -1
- package/Materials/GreasedLine/greasedLineSimpleMaterial.js +8 -9
- package/Materials/GreasedLine/greasedLineSimpleMaterial.js.map +1 -1
- package/Materials/Node/Blocks/Dual/currentScreenBlock.js +3 -4
- package/Materials/Node/Blocks/Dual/currentScreenBlock.js.map +1 -1
- package/Materials/Node/Blocks/Dual/fogBlock.js +2 -3
- package/Materials/Node/Blocks/Dual/fogBlock.js.map +1 -1
- package/Materials/Node/Blocks/Dual/imageSourceBlock.js +1 -2
- package/Materials/Node/Blocks/Dual/imageSourceBlock.js.map +1 -1
- package/Materials/Node/Blocks/Dual/lightBlock.js +5 -6
- package/Materials/Node/Blocks/Dual/lightBlock.js.map +1 -1
- package/Materials/Node/Blocks/Dual/reflectionTextureBaseBlock.js +4 -5
- package/Materials/Node/Blocks/Dual/reflectionTextureBaseBlock.js.map +1 -1
- package/Materials/Node/Blocks/Dual/sceneDepthBlock.js +7 -8
- package/Materials/Node/Blocks/Dual/sceneDepthBlock.js.map +1 -1
- package/Materials/Node/Blocks/Dual/textureBlock.js +4 -6
- package/Materials/Node/Blocks/Dual/textureBlock.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/TBNBlock.js +2 -4
- package/Materials/Node/Blocks/Fragment/TBNBlock.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/derivativeBlock.js +1 -2
- package/Materials/Node/Blocks/Fragment/derivativeBlock.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/fragCoordBlock.js +1 -2
- package/Materials/Node/Blocks/Fragment/fragCoordBlock.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/fragDepthBlock.js +1 -2
- package/Materials/Node/Blocks/Fragment/fragDepthBlock.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/fragmentOutputBlock.js +5 -6
- package/Materials/Node/Blocks/Fragment/fragmentOutputBlock.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/frontFacingBlock.js +1 -2
- package/Materials/Node/Blocks/Fragment/frontFacingBlock.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/heightToNormalBlock.js +5 -6
- package/Materials/Node/Blocks/Fragment/heightToNormalBlock.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/imageProcessingBlock.js +3 -4
- package/Materials/Node/Blocks/Fragment/imageProcessingBlock.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/perturbNormalBlock.js +7 -9
- package/Materials/Node/Blocks/Fragment/perturbNormalBlock.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/screenSizeBlock.js +1 -2
- package/Materials/Node/Blocks/Fragment/screenSizeBlock.js.map +1 -1
- package/Materials/Node/Blocks/Input/inputBlock.js +19 -21
- package/Materials/Node/Blocks/Input/inputBlock.js.map +1 -1
- package/Materials/Node/Blocks/Input/prePassTextureBlock.js +3 -4
- package/Materials/Node/Blocks/Input/prePassTextureBlock.js.map +1 -1
- package/Materials/Node/Blocks/PBR/anisotropyBlock.js +2 -3
- package/Materials/Node/Blocks/PBR/anisotropyBlock.js.map +1 -1
- package/Materials/Node/Blocks/PBR/clearCoatBlock.js +4 -5
- package/Materials/Node/Blocks/PBR/clearCoatBlock.js.map +1 -1
- package/Materials/Node/Blocks/PBR/iridescenceBlock.js +1 -2
- package/Materials/Node/Blocks/PBR/iridescenceBlock.js.map +1 -1
- package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.js +28 -29
- package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.js.map +1 -1
- package/Materials/Node/Blocks/PBR/reflectionBlock.js +4 -5
- package/Materials/Node/Blocks/PBR/reflectionBlock.js.map +1 -1
- package/Materials/Node/Blocks/PBR/refractionBlock.js +5 -6
- package/Materials/Node/Blocks/PBR/refractionBlock.js.map +1 -1
- package/Materials/Node/Blocks/PBR/sheenBlock.js +4 -5
- package/Materials/Node/Blocks/PBR/sheenBlock.js.map +1 -1
- package/Materials/Node/Blocks/PBR/subSurfaceBlock.js +2 -3
- package/Materials/Node/Blocks/PBR/subSurfaceBlock.js.map +1 -1
- package/Materials/Node/Blocks/Vertex/instancesBlock.js +1 -2
- package/Materials/Node/Blocks/Vertex/instancesBlock.js.map +1 -1
- package/Materials/Node/Blocks/Vertex/lightInformationBlock.js +1 -2
- package/Materials/Node/Blocks/Vertex/lightInformationBlock.js.map +1 -1
- package/Materials/Node/Blocks/Vertex/morphTargetsBlock.js +1 -2
- package/Materials/Node/Blocks/Vertex/morphTargetsBlock.js.map +1 -1
- package/Materials/Node/Blocks/Vertex/vertexOutputBlock.js +1 -2
- package/Materials/Node/Blocks/Vertex/vertexOutputBlock.js.map +1 -1
- package/Materials/Node/Blocks/arcTan2Block.js +1 -2
- package/Materials/Node/Blocks/arcTan2Block.js.map +1 -1
- package/Materials/Node/Blocks/biPlanarBlock.js +3 -4
- package/Materials/Node/Blocks/biPlanarBlock.js.map +1 -1
- package/Materials/Node/Blocks/clampBlock.js +4 -5
- package/Materials/Node/Blocks/clampBlock.js.map +1 -1
- package/Materials/Node/Blocks/cloudBlock.js +3 -4
- package/Materials/Node/Blocks/cloudBlock.js.map +1 -1
- package/Materials/Node/Blocks/curveBlock.js +1 -2
- package/Materials/Node/Blocks/curveBlock.js.map +1 -1
- package/Materials/Node/Blocks/customBlock.js +1 -2
- package/Materials/Node/Blocks/customBlock.js.map +1 -1
- package/Materials/Node/Blocks/matrixBuilderBlock.js +1 -2
- package/Materials/Node/Blocks/matrixBuilderBlock.js.map +1 -1
- package/Materials/Node/Blocks/meshAttributeExistsBlock.d.ts +1 -1
- package/Materials/Node/Blocks/meshAttributeExistsBlock.js +35 -35
- package/Materials/Node/Blocks/meshAttributeExistsBlock.js.map +1 -1
- package/Materials/Node/Blocks/modBlock.js +1 -2
- package/Materials/Node/Blocks/modBlock.js.map +1 -1
- package/Materials/Node/Blocks/remapBlock.js +3 -3
- package/Materials/Node/Blocks/remapBlock.js.map +1 -1
- package/Materials/Node/Blocks/simplexPerlin3DBlock.js +1 -2
- package/Materials/Node/Blocks/simplexPerlin3DBlock.js.map +1 -1
- package/Materials/Node/Blocks/transformBlock.js +1 -2
- package/Materials/Node/Blocks/transformBlock.js.map +1 -1
- package/Materials/Node/Blocks/triPlanarBlock.js +10 -12
- package/Materials/Node/Blocks/triPlanarBlock.js.map +1 -1
- package/Materials/Node/Blocks/voronoiNoiseBlock.js +3 -4
- package/Materials/Node/Blocks/voronoiNoiseBlock.js.map +1 -1
- package/Materials/Node/Blocks/waveBlock.d.ts +1 -1
- package/Materials/Node/Blocks/waveBlock.js +4 -4
- package/Materials/Node/Blocks/waveBlock.js.map +1 -1
- package/Materials/Node/Blocks/worleyNoise3DBlock.js +3 -4
- package/Materials/Node/Blocks/worleyNoise3DBlock.js.map +1 -1
- package/Materials/Node/Enums/nodeMaterialBlockConnectionPointMode.d.ts +1 -1
- package/Materials/Node/Enums/nodeMaterialBlockConnectionPointMode.js.map +1 -1
- package/Materials/Node/nodeMaterial.js +3 -4
- package/Materials/Node/nodeMaterial.js.map +1 -1
- package/Materials/Node/nodeMaterialBlock.js +5 -6
- package/Materials/Node/nodeMaterialBlock.js.map +1 -1
- package/Materials/Node/nodeMaterialBlockConnectionPoint.d.ts +2 -2
- package/Materials/Node/nodeMaterialBlockConnectionPoint.js +10 -10
- package/Materials/Node/nodeMaterialBlockConnectionPoint.js.map +1 -1
- package/Materials/Node/nodeMaterialBuildState.js +18 -19
- package/Materials/Node/nodeMaterialBuildState.js.map +1 -1
- package/Materials/Node/nodeMaterialConnectionPointCustomObject.js +3 -3
- package/Materials/Node/nodeMaterialConnectionPointCustomObject.js.map +1 -1
- package/Materials/PBR/pbrBaseMaterial.js +3 -4
- package/Materials/PBR/pbrBaseMaterial.js.map +1 -1
- package/Materials/Textures/internalTexture.d.ts +1 -1
- package/Materials/Textures/internalTexture.js +13 -13
- package/Materials/Textures/internalTexture.js.map +1 -1
- package/Materials/Textures/ktx2decoderTypes.d.ts +1 -1
- package/Materials/Textures/ktx2decoderTypes.js.map +1 -1
- package/Materials/Textures/rawCubeTexture.js +1 -2
- package/Materials/Textures/rawCubeTexture.js.map +1 -1
- package/Materials/effect.functions.js +2 -3
- package/Materials/effect.functions.js.map +1 -1
- package/Materials/effect.js +3 -4
- package/Materials/effect.js.map +1 -1
- package/Materials/effect.webgl.functions.js +1 -2
- package/Materials/effect.webgl.functions.js.map +1 -1
- package/Materials/material.js +7 -9
- package/Materials/material.js.map +1 -1
- package/Materials/materialPluginEvent.d.ts +1 -1
- package/Materials/materialPluginEvent.js.map +1 -1
- package/Materials/materialPluginManager.js +9 -11
- package/Materials/materialPluginManager.js.map +1 -1
- package/Materials/meshDebugPluginMaterial.d.ts +1 -1
- package/Materials/meshDebugPluginMaterial.js +2 -2
- package/Materials/meshDebugPluginMaterial.js.map +1 -1
- package/Materials/shaderLanguage.d.ts +1 -1
- package/Materials/shaderLanguage.js.map +1 -1
- package/Materials/shadowDepthWrapper.js +1 -2
- package/Materials/shadowDepthWrapper.js.map +1 -1
- package/Materials/standardMaterial.js +2 -3
- package/Materials/standardMaterial.js.map +1 -1
- package/Maths/math.axis.d.ts +2 -2
- package/Maths/math.axis.js.map +1 -1
- package/Maths/math.path.d.ts +1 -1
- package/Maths/math.path.js +3 -3
- package/Maths/math.path.js.map +1 -1
- package/Meshes/Builders/greasedLineBuilder.d.ts +2 -2
- package/Meshes/Builders/greasedLineBuilder.js +21 -23
- package/Meshes/Builders/greasedLineBuilder.js.map +1 -1
- package/Meshes/GreasedLine/greasedLineBaseMesh.d.ts +3 -3
- package/Meshes/GreasedLine/greasedLineBaseMesh.js.map +1 -1
- package/Meshes/GreasedLine/greasedLineRibbonMesh.js +14 -14
- package/Meshes/GreasedLine/greasedLineRibbonMesh.js.map +1 -1
- package/Meshes/Node/Blocks/Instances/instantiateBaseBlock.js +2 -2
- package/Meshes/Node/Blocks/Instances/instantiateBaseBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Instances/instantiateOnFacesBlock.js +2 -2
- package/Meshes/Node/Blocks/Instances/instantiateOnFacesBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Instances/instantiateOnVerticesBlock.js +3 -3
- package/Meshes/Node/Blocks/Instances/instantiateOnVerticesBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Instances/instantiateOnVolumeBlock.js +3 -3
- package/Meshes/Node/Blocks/Instances/instantiateOnVolumeBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Set/setColorsBlock.js +2 -2
- package/Meshes/Node/Blocks/Set/setColorsBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Set/setMaterialIDBlock.js +2 -2
- package/Meshes/Node/Blocks/Set/setMaterialIDBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Set/setNormalsBlock.js +2 -2
- package/Meshes/Node/Blocks/Set/setNormalsBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Set/setPositionsBlock.js +2 -2
- package/Meshes/Node/Blocks/Set/setPositionsBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Set/setTangentsBlock.js +2 -2
- package/Meshes/Node/Blocks/Set/setTangentsBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Set/setUVsBlock.js +3 -3
- package/Meshes/Node/Blocks/Set/setUVsBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Sources/boxBlock.js +2 -2
- package/Meshes/Node/Blocks/Sources/boxBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Sources/capsuleBlock.js +2 -2
- package/Meshes/Node/Blocks/Sources/capsuleBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Sources/cylinderBlock.js +2 -2
- package/Meshes/Node/Blocks/Sources/cylinderBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Sources/discBlock.js +2 -2
- package/Meshes/Node/Blocks/Sources/discBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Sources/gridBlock.js +2 -2
- package/Meshes/Node/Blocks/Sources/gridBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Sources/icoSphereBlock.js +2 -2
- package/Meshes/Node/Blocks/Sources/icoSphereBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Sources/meshBlock.js +2 -2
- package/Meshes/Node/Blocks/Sources/meshBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Sources/planeBlock.js +2 -2
- package/Meshes/Node/Blocks/Sources/planeBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Sources/sphereBlock.js +2 -2
- package/Meshes/Node/Blocks/Sources/sphereBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Sources/torusBlock.js +2 -2
- package/Meshes/Node/Blocks/Sources/torusBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Textures/geometryTextureBlock.js +2 -2
- package/Meshes/Node/Blocks/Textures/geometryTextureBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Textures/geometryTextureFetchBlock.js +2 -2
- package/Meshes/Node/Blocks/Textures/geometryTextureFetchBlock.js.map +1 -1
- package/Meshes/Node/Blocks/booleanGeometryBlock.js +3 -3
- package/Meshes/Node/Blocks/booleanGeometryBlock.js.map +1 -1
- package/Meshes/Node/Blocks/conditionBlock.js +2 -2
- package/Meshes/Node/Blocks/conditionBlock.js.map +1 -1
- package/Meshes/Node/Blocks/geometryClampBlock.js +3 -3
- package/Meshes/Node/Blocks/geometryClampBlock.js.map +1 -1
- package/Meshes/Node/Blocks/geometryCollectionBlock.js +2 -2
- package/Meshes/Node/Blocks/geometryCollectionBlock.js.map +1 -1
- package/Meshes/Node/Blocks/geometryCurveBlock.js +2 -2
- package/Meshes/Node/Blocks/geometryCurveBlock.js.map +1 -1
- package/Meshes/Node/Blocks/geometryOptimizeBlock.js +3 -3
- package/Meshes/Node/Blocks/geometryOptimizeBlock.js.map +1 -1
- package/Meshes/Node/Blocks/geometryTransformBlock.js +2 -2
- package/Meshes/Node/Blocks/geometryTransformBlock.js.map +1 -1
- package/Meshes/Node/Blocks/geometryTrigonometryBlock.js +2 -2
- package/Meshes/Node/Blocks/geometryTrigonometryBlock.js.map +1 -1
- package/Meshes/Node/Blocks/mappingBlock.js +2 -2
- package/Meshes/Node/Blocks/mappingBlock.js.map +1 -1
- package/Meshes/Node/Blocks/mathBlock.js +2 -2
- package/Meshes/Node/Blocks/mathBlock.js.map +1 -1
- package/Meshes/Node/Blocks/mergeGeometryBlock.js +2 -2
- package/Meshes/Node/Blocks/mergeGeometryBlock.js.map +1 -1
- package/Meshes/Node/Blocks/randomBlock.js +2 -2
- package/Meshes/Node/Blocks/randomBlock.js.map +1 -1
- package/Meshes/Node/nodeGeometryBlock.js +3 -3
- package/Meshes/Node/nodeGeometryBlock.js.map +1 -1
- package/Meshes/Node/nodeGeometryBlockConnectionPoint.d.ts +2 -2
- package/Meshes/Node/nodeGeometryBlockConnectionPoint.js +7 -7
- package/Meshes/Node/nodeGeometryBlockConnectionPoint.js.map +1 -1
- package/Meshes/abstractMesh.js +4 -5
- package/Meshes/abstractMesh.js.map +1 -1
- package/Meshes/mesh.js +1 -2
- package/Meshes/mesh.js.map +1 -1
- package/Meshes/meshSimplification.d.ts +1 -1
- package/Meshes/meshSimplification.js +1 -1
- package/Meshes/meshSimplification.js.map +1 -1
- package/Meshes/meshSimplificationSceneComponent.js +2 -2
- package/Meshes/meshSimplificationSceneComponent.js.map +1 -1
- package/Meshes/transformNode.js +7 -8
- package/Meshes/transformNode.js.map +1 -1
- package/Misc/assetsManager.d.ts +1 -1
- package/Misc/assetsManager.js +9 -9
- package/Misc/assetsManager.js.map +1 -1
- package/Misc/basis.js +2 -2
- package/Misc/basis.js.map +1 -1
- package/Misc/copyTextureToTexture.d.ts +1 -1
- package/Misc/copyTextureToTexture.js +1 -1
- package/Misc/copyTextureToTexture.js.map +1 -1
- package/Misc/environmentTextureTools.js +3 -3
- package/Misc/environmentTextureTools.js.map +1 -1
- package/Misc/iInspectable.d.ts +1 -1
- package/Misc/iInspectable.js.map +1 -1
- package/Misc/khronosTextureContainer2.js +2 -2
- package/Misc/khronosTextureContainer2.js.map +1 -1
- package/Misc/timer.d.ts +1 -1
- package/Misc/timer.js +5 -5
- package/Misc/timer.js.map +1 -1
- package/Misc/virtualJoystick.d.ts +1 -1
- package/Misc/virtualJoystick.js +16 -16
- package/Misc/virtualJoystick.js.map +1 -1
- package/Particles/particleSystem.js +3 -3
- package/Particles/particleSystem.js.map +1 -1
- package/Particles/particleSystemComponent.js +1 -2
- package/Particles/particleSystemComponent.js.map +1 -1
- package/Particles/pointsCloudSystem.d.ts +1 -1
- package/Particles/pointsCloudSystem.js +14 -14
- package/Particles/pointsCloudSystem.js.map +1 -1
- package/Particles/subEmitter.d.ts +1 -1
- package/Particles/subEmitter.js +1 -1
- package/Particles/subEmitter.js.map +1 -1
- package/Physics/physicsHelper.d.ts +2 -2
- package/Physics/physicsHelper.js +6 -7
- package/Physics/physicsHelper.js.map +1 -1
- package/Physics/v1/physicsImpostor.js +4 -5
- package/Physics/v1/physicsImpostor.js.map +1 -1
- package/Physics/v2/IPhysicsEnginePlugin.d.ts +16 -8
- package/Physics/v2/IPhysicsEnginePlugin.js +9 -0
- package/Physics/v2/IPhysicsEnginePlugin.js.map +1 -1
- package/Physics/v2/Plugins/havokPlugin.js +96 -79
- package/Physics/v2/Plugins/havokPlugin.js.map +1 -1
- package/Physics/v2/physicsAggregate.js +8 -9
- package/Physics/v2/physicsAggregate.js.map +1 -1
- package/Physics/v2/physicsBody.d.ts +14 -2
- package/Physics/v2/physicsBody.js +30 -11
- package/Physics/v2/physicsBody.js.map +1 -1
- package/Physics/v2/physicsConstraint.js +8 -9
- package/Physics/v2/physicsConstraint.js.map +1 -1
- package/Physics/v2/physicsMaterial.d.ts +1 -1
- package/Physics/v2/physicsMaterial.js.map +1 -1
- package/Physics/v2/physicsShape.js +9 -10
- package/Physics/v2/physicsShape.js.map +1 -1
- package/Physics/v2/ragdoll.js +11 -12
- package/Physics/v2/ragdoll.js.map +1 -1
- package/PostProcesses/RenderPipeline/Pipelines/defaultRenderingPipeline.js +2 -2
- package/PostProcesses/RenderPipeline/Pipelines/defaultRenderingPipeline.js.map +1 -1
- package/PostProcesses/depthOfFieldEffect.d.ts +1 -1
- package/PostProcesses/depthOfFieldEffect.js +3 -3
- package/PostProcesses/depthOfFieldEffect.js.map +1 -1
- package/PostProcesses/postProcess.js +2 -3
- package/PostProcesses/postProcess.js.map +1 -1
- package/PostProcesses/tonemapPostProcess.d.ts +1 -1
- package/PostProcesses/tonemapPostProcess.js +4 -4
- package/PostProcesses/tonemapPostProcess.js.map +1 -1
- package/Rendering/fluidRenderer/fluidRenderingTargetRenderer.d.ts +1 -1
- package/Rendering/fluidRenderer/fluidRenderingTargetRenderer.js +10 -10
- package/Rendering/fluidRenderer/fluidRenderingTargetRenderer.js.map +1 -1
- package/Shaders/spriteMap.fragment.js +3 -2
- package/Shaders/spriteMap.fragment.js.map +1 -1
- package/ShadersWGSL/boundingInfo.compute.js +8 -8
- package/ShadersWGSL/boundingInfo.compute.js.map +1 -1
- package/XR/features/WebXRDepthSensing.js +2 -2
- package/XR/features/WebXRDepthSensing.js.map +1 -1
- package/XR/features/WebXRHandTracking.d.ts +2 -2
- package/XR/features/WebXRHandTracking.js +76 -76
- package/XR/features/WebXRHandTracking.js.map +1 -1
- package/XR/features/WebXRLightEstimation.js +2 -2
- package/XR/features/WebXRLightEstimation.js.map +1 -1
- package/XR/features/WebXRNearInteraction.d.ts +1 -1
- package/XR/features/WebXRNearInteraction.js +5 -5
- package/XR/features/WebXRNearInteraction.js.map +1 -1
- package/XR/features/WebXRRawCameraAccess.js +2 -2
- package/XR/features/WebXRRawCameraAccess.js.map +1 -1
- package/XR/motionController/webXRProfiledMotionController.js +2 -2
- package/XR/motionController/webXRProfiledMotionController.js.map +1 -1
- package/XR/webXRCamera.js +3 -4
- package/XR/webXRCamera.js.map +1 -1
- package/XR/webXREnterExitUI.js +3 -4
- package/XR/webXREnterExitUI.js.map +1 -1
- package/XR/webXRExperienceHelper.js +12 -13
- package/XR/webXRExperienceHelper.js.map +1 -1
- package/XR/webXRManagedOutputCanvas.d.ts +1 -1
- package/XR/webXRManagedOutputCanvas.js +15 -6
- package/XR/webXRManagedOutputCanvas.js.map +1 -1
- package/XR/webXRRenderTargetTextureProvider.js +2 -2
- package/XR/webXRRenderTargetTextureProvider.js.map +1 -1
- package/XR/webXRTypes.d.ts +2 -2
- package/XR/webXRTypes.js.map +1 -1
- package/package.json +1 -1
- package/scene.d.ts +1 -1
- package/scene.js +4 -4
- package/scene.js.map +1 -1
package/Loading/sceneLoader.js
CHANGED
|
@@ -689,7 +689,7 @@ export class SceneLoader {
|
|
|
689
689
|
* @param onError a callback with the scene, a message, and possibly an exception when import fails
|
|
690
690
|
* @param pluginExtension the extension used to determine the plugin
|
|
691
691
|
*/
|
|
692
|
-
static ImportAnimations(rootUrl, sceneFilename = "", scene = EngineStore.LastCreatedScene, overwriteAnimations = true, animationGroupLoadingMode = SceneLoaderAnimationGroupLoadingMode.Clean
|
|
692
|
+
static ImportAnimations(rootUrl, sceneFilename = "", scene = EngineStore.LastCreatedScene, overwriteAnimations = true, animationGroupLoadingMode = 0 /* SceneLoaderAnimationGroupLoadingMode.Clean */, targetConverter = null, onSuccess = null, onProgress = null, onError = null, pluginExtension = null) {
|
|
693
693
|
if (!scene) {
|
|
694
694
|
Logger.Error("No scene available to load animations to");
|
|
695
695
|
return;
|
|
@@ -712,23 +712,23 @@ export class SceneLoader {
|
|
|
712
712
|
}
|
|
713
713
|
else {
|
|
714
714
|
switch (animationGroupLoadingMode) {
|
|
715
|
-
case SceneLoaderAnimationGroupLoadingMode.Clean
|
|
715
|
+
case 0 /* SceneLoaderAnimationGroupLoadingMode.Clean */:
|
|
716
716
|
scene.animationGroups.slice().forEach((animationGroup) => {
|
|
717
717
|
animationGroup.dispose();
|
|
718
718
|
});
|
|
719
719
|
break;
|
|
720
|
-
case SceneLoaderAnimationGroupLoadingMode.Stop
|
|
720
|
+
case 1 /* SceneLoaderAnimationGroupLoadingMode.Stop */:
|
|
721
721
|
scene.animationGroups.forEach((animationGroup) => {
|
|
722
722
|
animationGroup.stop();
|
|
723
723
|
});
|
|
724
724
|
break;
|
|
725
|
-
case SceneLoaderAnimationGroupLoadingMode.Sync
|
|
725
|
+
case 2 /* SceneLoaderAnimationGroupLoadingMode.Sync */:
|
|
726
726
|
scene.animationGroups.forEach((animationGroup) => {
|
|
727
727
|
animationGroup.reset();
|
|
728
728
|
animationGroup.restart();
|
|
729
729
|
});
|
|
730
730
|
break;
|
|
731
|
-
case SceneLoaderAnimationGroupLoadingMode.NoSync
|
|
731
|
+
case 3 /* SceneLoaderAnimationGroupLoadingMode.NoSync */:
|
|
732
732
|
// nothing to do
|
|
733
733
|
break;
|
|
734
734
|
default:
|
|
@@ -761,7 +761,7 @@ export class SceneLoader {
|
|
|
761
761
|
* @param pluginExtension the extension used to determine the plugin
|
|
762
762
|
* @returns the updated scene with imported animations
|
|
763
763
|
*/
|
|
764
|
-
static ImportAnimationsAsync(rootUrl, sceneFilename = "", scene = EngineStore.LastCreatedScene, overwriteAnimations = true, animationGroupLoadingMode = SceneLoaderAnimationGroupLoadingMode.Clean
|
|
764
|
+
static ImportAnimationsAsync(rootUrl, sceneFilename = "", scene = EngineStore.LastCreatedScene, overwriteAnimations = true, animationGroupLoadingMode = 0 /* SceneLoaderAnimationGroupLoadingMode.Clean */, targetConverter = null,
|
|
765
765
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
766
766
|
onSuccess = null, onProgress = null,
|
|
767
767
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
@@ -1 +1 @@
|
|
|
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,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAMrD,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,M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AAgB,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 { 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\nimport type { ISpriteManager } from \"../Sprites/spriteManager\";\r\nimport { RandomGUID } from \"../Misc/guid\";\r\nimport { Engine } from \"../Engines/engine\";\r\nimport type { AbstractEngine } from \"../Engines/abstractEngine\";\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 spriteManagers: ISpriteManager[]\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 * The array of loaded sprite managers\r\n */\r\n readonly spriteManagers: ISpriteManager[];\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: unknown, 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): unknown | Promise<unknown>;\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: string | readonly string[] | null | undefined,\r\n scene: Scene,\r\n data: unknown,\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: unknown, 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: unknown, 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: string | readonly string[] | null | undefined,\r\n scene: Scene,\r\n data: unknown,\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: unknown, 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: unknown, 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 internal only plugin members.\r\n */\r\ninterface ISceneLoaderPluginInternal {\r\n /**\r\n * An optional observable to notify when the plugin is disposed\r\n */\r\n readonly onDisposeObservable: Observable<void>;\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) & Partial<ISceneLoaderPluginFactory> & Partial<ISceneLoaderPluginInternal>;\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: unknown, 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 // eslint-disable-next-line no-throw-literal\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 // eslint-disable-next-line no-throw-literal\r\n throw \"Loading from ArrayBufferView can not be used with plugins that don't support binary loading.\";\r\n }\r\n\r\n const plugin: IRegisteredPlugin[\"plugin\"] = registeredPlugin.plugin.createPlugin?.() ?? registeredPlugin.plugin;\r\n if (!plugin) {\r\n // eslint-disable-next-line no-throw-literal\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 instanceof Promise) {\r\n result\r\n .then((data: unknown) => {\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: unknown, 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 plugin.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 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 // eslint-disable-next-line no-throw-literal\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 = RandomGUID();\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: string | readonly string[] | null | undefined,\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, spriteManagers) => {\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, spriteManagers);\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 ((plugin as ISceneLoaderPlugin).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 result.spriteManagers\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: string | readonly string[] | null | undefined,\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, spriteManagers) => {\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 spriteManagers: spriteManagers,\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<AbstractEngine> = 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<AbstractEngine> = 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 ((plugin as ISceneLoaderPlugin).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 ((plugin as ISceneLoaderPlugin).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 ((plugin as ISceneLoaderPluginAsync).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,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;AAEzD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAgR3C;;GAEG;AACH,MAAM,CAAN,IAAkB,oCAoBjB;AApBD,WAAkB,oCAAoC;IAClD;;OAEG;IACH,iGAA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,6DAA6D;IAC7D,UAA8E,IAAI,EAClF,kBAAoC,IAAI;QAExC,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YACnC,WAAW,CAAC,gBAAgB,CACxB,OAAO,EACP,aAAa,EACb,KAAK,EACL,mBAAmB,EACnB,yBAAyB,EACzB,eAAe,EACf,CAAC,MAAa,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;;AApgCD;;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 { 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\nimport type { ISpriteManager } from \"../Sprites/spriteManager\";\r\nimport { RandomGUID } from \"../Misc/guid\";\r\nimport { Engine } from \"../Engines/engine\";\r\nimport type { AbstractEngine } from \"../Engines/abstractEngine\";\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 spriteManagers: ISpriteManager[]\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 * The array of loaded sprite managers\r\n */\r\n readonly spriteManagers: ISpriteManager[];\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: unknown, 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): unknown | Promise<unknown>;\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: string | readonly string[] | null | undefined,\r\n scene: Scene,\r\n data: unknown,\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: unknown, 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: unknown, 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: string | readonly string[] | null | undefined,\r\n scene: Scene,\r\n data: unknown,\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: unknown, 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: unknown, 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 const 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 internal only plugin members.\r\n */\r\ninterface ISceneLoaderPluginInternal {\r\n /**\r\n * An optional observable to notify when the plugin is disposed\r\n */\r\n readonly onDisposeObservable: Observable<void>;\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) & Partial<ISceneLoaderPluginFactory> & Partial<ISceneLoaderPluginInternal>;\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: unknown, 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 // eslint-disable-next-line no-throw-literal\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 // eslint-disable-next-line no-throw-literal\r\n throw \"Loading from ArrayBufferView can not be used with plugins that don't support binary loading.\";\r\n }\r\n\r\n const plugin: IRegisteredPlugin[\"plugin\"] = registeredPlugin.plugin.createPlugin?.() ?? registeredPlugin.plugin;\r\n if (!plugin) {\r\n // eslint-disable-next-line no-throw-literal\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 instanceof Promise) {\r\n result\r\n .then((data: unknown) => {\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: unknown, 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 plugin.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 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 // eslint-disable-next-line no-throw-literal\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 = RandomGUID();\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: string | readonly string[] | null | undefined,\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, spriteManagers) => {\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, spriteManagers);\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 ((plugin as ISceneLoaderPlugin).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 result.spriteManagers\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: string | readonly string[] | null | undefined,\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, spriteManagers) => {\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 spriteManagers: spriteManagers,\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<AbstractEngine> = 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<AbstractEngine> = 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 ((plugin as ISceneLoaderPlugin).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 ((plugin as ISceneLoaderPlugin).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 ((plugin as ISceneLoaderPluginAsync).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"]}
|
|
@@ -98,7 +98,7 @@ export interface IGreasedLineMaterial {
|
|
|
98
98
|
* Material types for GreasedLine
|
|
99
99
|
* {@link https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/param/greased_line#materialtype}
|
|
100
100
|
*/
|
|
101
|
-
export declare enum GreasedLineMeshMaterialType {
|
|
101
|
+
export declare const enum GreasedLineMeshMaterialType {
|
|
102
102
|
/**
|
|
103
103
|
* StandardMaterial
|
|
104
104
|
*/
|
|
@@ -116,7 +116,7 @@ export declare enum GreasedLineMeshMaterialType {
|
|
|
116
116
|
* Color blending mode of the @see GreasedLineMaterial and the base material
|
|
117
117
|
* {@link https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/param/greased_line#colormode}
|
|
118
118
|
*/
|
|
119
|
-
export declare enum GreasedLineMeshColorMode {
|
|
119
|
+
export declare const enum GreasedLineMeshColorMode {
|
|
120
120
|
/**
|
|
121
121
|
* Color blending mode SET
|
|
122
122
|
*/
|
|
@@ -135,7 +135,7 @@ export declare enum GreasedLineMeshColorMode {
|
|
|
135
135
|
* {@link https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/param/greased_line#colordistributiontype}
|
|
136
136
|
*
|
|
137
137
|
*/
|
|
138
|
-
export declare enum GreasedLineMeshColorDistributionType {
|
|
138
|
+
export declare const enum GreasedLineMeshColorDistributionType {
|
|
139
139
|
/**
|
|
140
140
|
* Colors distributed between segments of the line
|
|
141
141
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"greasedLineMaterialInterfaces.js","sourceRoot":"","sources":["../../../../../dev/core/src/Materials/GreasedLine/greasedLineMaterialInterfaces.ts"],"names":[],"mappings":"AAiHA;;;GAGG;AACH,MAAM,CAAN,
|
|
1
|
+
{"version":3,"file":"greasedLineMaterialInterfaces.js","sourceRoot":"","sources":["../../../../../dev/core/src/Materials/GreasedLine/greasedLineMaterialInterfaces.ts"],"names":[],"mappings":"AAiHA;;;GAGG;AACH,MAAM,CAAN,IAAkB,2BAajB;AAbD,WAAkB,2BAA2B;IACzC;;OAEG;IACH,iHAA0B,CAAA;IAC1B;;OAEG;IACH,uGAAqB,CAAA;IACrB;;OAEG;IACH,6GAAwB,CAAA;AAC5B,CAAC,EAbiB,2BAA2B,KAA3B,2BAA2B,QAa5C;AAED;;;GAGG;AACH,MAAM,CAAN,IAAkB,wBAajB;AAbD,WAAkB,wBAAwB;IACtC;;OAEG;IACH,2FAAkB,CAAA;IAClB;;OAEG;IACH,2FAAkB,CAAA;IAClB;;OAEG;IACH,qGAAuB,CAAA;AAC3B,CAAC,EAbiB,wBAAwB,KAAxB,wBAAwB,QAazC;AAED;;;;GAIG;AACH,MAAM,CAAN,IAAkB,oCASjB;AATD,WAAkB,oCAAoC;IAClD;;OAEG;IACH,qJAAmC,CAAA;IACnC;;OAEG;IACH,+IAAgC,CAAA;AACpC,CAAC,EATiB,oCAAoC,KAApC,oCAAoC,QASrD","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 const 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 const 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 const 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"]}
|
|
@@ -3,7 +3,6 @@ import { MaterialPluginBase } from "../materialPluginBase.js";
|
|
|
3
3
|
import { Vector2, TmpVectors } from "../../Maths/math.vector.js";
|
|
4
4
|
import { MaterialDefines } from "../materialDefines.js";
|
|
5
5
|
import { RegisterClass } from "../../Misc/typeStore.js";
|
|
6
|
-
import { GreasedLineMeshColorDistributionType, GreasedLineMeshColorMode } from "./greasedLineMaterialInterfaces.js";
|
|
7
6
|
import { GreasedLineMaterialDefaults } from "./greasedLineMaterialDefaults.js";
|
|
8
7
|
import { GreasedLineTools } from "../../Misc/greasedLineTools.js";
|
|
9
8
|
/**
|
|
@@ -57,7 +56,7 @@ export class GreasedLinePluginMaterial extends MaterialPluginBase {
|
|
|
57
56
|
const defines = new MaterialGreasedLineDefines();
|
|
58
57
|
defines.GREASED_LINE_HAS_COLOR = !!options.color && !options.useColors;
|
|
59
58
|
defines.GREASED_LINE_SIZE_ATTENUATION = options.sizeAttenuation ?? false;
|
|
60
|
-
defines.GREASED_LINE_COLOR_DISTRIBUTION_TYPE_LINE = options.colorDistributionType === GreasedLineMeshColorDistributionType.COLOR_DISTRIBUTION_TYPE_LINE
|
|
59
|
+
defines.GREASED_LINE_COLOR_DISTRIBUTION_TYPE_LINE = options.colorDistributionType === 1 /* GreasedLineMeshColorDistributionType.COLOR_DISTRIBUTION_TYPE_LINE */;
|
|
61
60
|
defines.GREASED_LINE_RIGHT_HANDED_COORDINATE_SYSTEM = (scene ?? material.getScene()).useRightHandedSystem;
|
|
62
61
|
defines.GREASED_LINE_CAMERA_FACING = options.cameraFacing ?? true;
|
|
63
62
|
super(material, GreasedLinePluginMaterial.GREASED_LINE_MATERIAL_NAME, 200, defines);
|
|
@@ -74,10 +73,10 @@ export class GreasedLinePluginMaterial extends MaterialPluginBase {
|
|
|
74
73
|
this.dashOffset = options.dashOffset ?? 0;
|
|
75
74
|
this.width = options.width ? options.width : options.sizeAttenuation ? GreasedLineMaterialDefaults.DEFAULT_WIDTH_ATTENUATED : GreasedLineMaterialDefaults.DEFAULT_WIDTH;
|
|
76
75
|
this._sizeAttenuation = options.sizeAttenuation ?? false;
|
|
77
|
-
this.colorMode = options.colorMode ?? GreasedLineMeshColorMode.COLOR_MODE_SET
|
|
76
|
+
this.colorMode = options.colorMode ?? 0 /* GreasedLineMeshColorMode.COLOR_MODE_SET */;
|
|
78
77
|
this._color = options.color ?? null;
|
|
79
78
|
this.useColors = options.useColors ?? false;
|
|
80
|
-
this._colorsDistributionType = options.colorDistributionType ?? GreasedLineMeshColorDistributionType.COLOR_DISTRIBUTION_TYPE_SEGMENT
|
|
79
|
+
this._colorsDistributionType = options.colorDistributionType ?? 0 /* GreasedLineMeshColorDistributionType.COLOR_DISTRIBUTION_TYPE_SEGMENT */;
|
|
81
80
|
this.colorsSampling = options.colorsSampling ?? RawTexture.NEAREST_NEAREST;
|
|
82
81
|
this._colors = options.colors ?? null;
|
|
83
82
|
this.dashCount = options.dashCount ?? 1; // calculate the _dashArray value, call the setter
|
|
@@ -216,7 +215,7 @@ export class GreasedLinePluginMaterial extends MaterialPluginBase {
|
|
|
216
215
|
prepareDefines(defines, _scene, _mesh) {
|
|
217
216
|
defines.GREASED_LINE_HAS_COLOR = !!this.color && !this.useColors;
|
|
218
217
|
defines.GREASED_LINE_SIZE_ATTENUATION = this._sizeAttenuation;
|
|
219
|
-
defines.GREASED_LINE_COLOR_DISTRIBUTION_TYPE_LINE = this._colorsDistributionType === GreasedLineMeshColorDistributionType.COLOR_DISTRIBUTION_TYPE_LINE
|
|
218
|
+
defines.GREASED_LINE_COLOR_DISTRIBUTION_TYPE_LINE = this._colorsDistributionType === 1 /* GreasedLineMeshColorDistributionType.COLOR_DISTRIBUTION_TYPE_LINE */;
|
|
220
219
|
defines.GREASED_LINE_RIGHT_HANDED_COORDINATE_SYSTEM = _scene.useRightHandedSystem;
|
|
221
220
|
defines.GREASED_LINE_CAMERA_FACING = this._cameraFacing;
|
|
222
221
|
}
|
|
@@ -356,11 +355,11 @@ export class GreasedLinePluginMaterial extends MaterialPluginBase {
|
|
|
356
355
|
}
|
|
357
356
|
|
|
358
357
|
#ifdef GREASED_LINE_HAS_COLOR
|
|
359
|
-
if (grlColorMode == ${GreasedLineMeshColorMode.COLOR_MODE_SET}.) {
|
|
358
|
+
if (grlColorMode == ${0 /* GreasedLineMeshColorMode.COLOR_MODE_SET */}.) {
|
|
360
359
|
gl_FragColor.rgb = grl_singleColor;
|
|
361
|
-
} else if (grlColorMode == ${GreasedLineMeshColorMode.COLOR_MODE_ADD}.) {
|
|
360
|
+
} else if (grlColorMode == ${1 /* GreasedLineMeshColorMode.COLOR_MODE_ADD */}.) {
|
|
362
361
|
gl_FragColor.rgb += grl_singleColor;
|
|
363
|
-
} else if (grlColorMode == ${GreasedLineMeshColorMode.COLOR_MODE_MULTIPLY}.) {
|
|
362
|
+
} else if (grlColorMode == ${2 /* GreasedLineMeshColorMode.COLOR_MODE_MULTIPLY */}.) {
|
|
364
363
|
gl_FragColor.rgb *= grl_singleColor;
|
|
365
364
|
}
|
|
366
365
|
#else
|
|
@@ -371,11 +370,11 @@ export class GreasedLinePluginMaterial extends MaterialPluginBase {
|
|
|
371
370
|
vec2 lookup = vec2(fract(grlColorPointer / grl_textureSize.x), 1.0 - floor(grlColorPointer / grl_textureSize.x) / max(grl_textureSize.y - 1.0, 1.0));
|
|
372
371
|
vec4 grlColor = texture2D(grl_colors, lookup, 0.0);
|
|
373
372
|
#endif
|
|
374
|
-
if (grlColorMode == ${GreasedLineMeshColorMode.COLOR_MODE_SET}.) {
|
|
373
|
+
if (grlColorMode == ${0 /* GreasedLineMeshColorMode.COLOR_MODE_SET */}.) {
|
|
375
374
|
gl_FragColor = grlColor;
|
|
376
|
-
} else if (grlColorMode == ${GreasedLineMeshColorMode.COLOR_MODE_ADD}.) {
|
|
375
|
+
} else if (grlColorMode == ${1 /* GreasedLineMeshColorMode.COLOR_MODE_ADD */}.) {
|
|
377
376
|
gl_FragColor += grlColor;
|
|
378
|
-
} else if (grlColorMode == ${GreasedLineMeshColorMode.COLOR_MODE_MULTIPLY}.) {
|
|
377
|
+
} else if (grlColorMode == ${2 /* GreasedLineMeshColorMode.COLOR_MODE_MULTIPLY */}.) {
|
|
379
378
|
gl_FragColor *= grlColor;
|
|
380
379
|
}
|
|
381
380
|
}
|