@babylonjs/core 8.8.0 → 8.8.1
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/actionManager.js +2 -0
- package/Actions/actionManager.js.map +1 -1
- package/Animations/animatable.core.js +1 -1
- package/Animations/animatable.core.js.map +1 -1
- package/Animations/animation.js +4 -2
- package/Animations/animation.js.map +1 -1
- package/Audio/audioEngine.d.ts +1 -1
- package/Audio/audioEngine.js +20 -10
- package/Audio/audioEngine.js.map +1 -1
- package/Audio/audioSceneComponent.js +2 -0
- package/Audio/audioSceneComponent.js.map +1 -1
- package/Audio/sound.js +2 -0
- package/Audio/sound.js.map +1 -1
- package/AudioV2/abstractAudio/audioEngineV2.js +8 -1
- package/AudioV2/abstractAudio/audioEngineV2.js.map +1 -1
- package/AudioV2/abstractAudio/streamingSound.js +3 -1
- package/AudioV2/abstractAudio/streamingSound.js.map +1 -1
- package/AudioV2/abstractAudio/subNodes/abstractAudioSubGraph.js +6 -2
- package/AudioV2/abstractAudio/subNodes/abstractAudioSubGraph.js.map +1 -1
- package/AudioV2/abstractAudio/subProperties/audioAnalyzer.js +3 -0
- package/AudioV2/abstractAudio/subProperties/audioAnalyzer.js.map +1 -1
- package/AudioV2/abstractAudio/subProperties/spatialAudio.js +1 -0
- package/AudioV2/abstractAudio/subProperties/spatialAudio.js.map +1 -1
- package/AudioV2/webAudio/webAudioEngine.js +5 -1
- package/AudioV2/webAudio/webAudioEngine.js.map +1 -1
- package/AudioV2/webAudio/webAudioStaticSound.js +2 -0
- package/AudioV2/webAudio/webAudioStaticSound.js.map +1 -1
- package/AudioV2/webAudio/webAudioStreamingSound.js +3 -0
- package/AudioV2/webAudio/webAudioStreamingSound.js.map +1 -1
- package/AudioV2/webAudio/webAudioUnmuteUI.js +1 -0
- package/AudioV2/webAudio/webAudioUnmuteUI.js.map +1 -1
- package/BakedVertexAnimation/vertexAnimationBaker.d.ts +1 -0
- package/BakedVertexAnimation/vertexAnimationBaker.js +3 -1
- package/BakedVertexAnimation/vertexAnimationBaker.js.map +1 -1
- package/Buffers/buffer.nonFloatVertexBuffers.js +1 -0
- package/Buffers/buffer.nonFloatVertexBuffers.js.map +1 -1
- package/Buffers/storageBuffer.js +1 -1
- package/Buffers/storageBuffer.js.map +1 -1
- package/Cameras/Inputs/arcRotateCameraVRDeviceOrientationInput.js +2 -0
- package/Cameras/Inputs/arcRotateCameraVRDeviceOrientationInput.js.map +1 -1
- package/Cameras/Inputs/freeCameraDeviceOrientationInput.js +6 -1
- package/Cameras/Inputs/freeCameraDeviceOrientationInput.js.map +1 -1
- package/Cameras/VR/vrExperienceHelper.js +2 -0
- package/Cameras/VR/vrExperienceHelper.js.map +1 -1
- package/Collisions/gpuPicker.js +9 -6
- package/Collisions/gpuPicker.js.map +1 -1
- package/Compute/computeShader.js +1 -1
- package/Compute/computeShader.js.map +1 -1
- package/Culling/Helper/boundingInfoHelper.js +3 -3
- package/Culling/Helper/boundingInfoHelper.js.map +1 -1
- package/Culling/Helper/computeShaderBoundingHelper.js +3 -1
- package/Culling/Helper/computeShaderBoundingHelper.js.map +1 -1
- package/Culling/Helper/transformFeedbackBoundingHelper.js +3 -0
- package/Culling/Helper/transformFeedbackBoundingHelper.js.map +1 -1
- package/Debug/debugLayer.js +1 -1
- package/Debug/debugLayer.js.map +1 -1
- package/Engines/AbstractEngine/abstractEngine.cubeTexture.js +1 -0
- package/Engines/AbstractEngine/abstractEngine.cubeTexture.js.map +1 -1
- package/Engines/Extensions/engine.prefilteredCubeTexture.js +1 -0
- package/Engines/Extensions/engine.prefilteredCubeTexture.js.map +1 -1
- package/Engines/Extensions/engine.readTexture.js +1 -0
- package/Engines/Extensions/engine.readTexture.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.computeShader.js +1 -0
- package/Engines/WebGPU/Extensions/engine.computeShader.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.readTexture.js +1 -0
- package/Engines/WebGPU/Extensions/engine.readTexture.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.videoTexture.js +2 -0
- package/Engines/WebGPU/Extensions/engine.videoTexture.js.map +1 -1
- package/Engines/WebGPU/webgpuBufferManager.js +3 -1
- package/Engines/WebGPU/webgpuBufferManager.js.map +1 -1
- package/Engines/WebGPU/webgpuOcclusionQuery.js +1 -0
- package/Engines/WebGPU/webgpuOcclusionQuery.js.map +1 -1
- package/Engines/WebGPU/webgpuQuerySet.js +15 -9
- package/Engines/WebGPU/webgpuQuerySet.js.map +1 -1
- package/Engines/WebGPU/webgpuTextureManager.js +1 -0
- package/Engines/WebGPU/webgpuTextureManager.js.map +1 -1
- package/Engines/WebGPU/webgpuTimestampQuery.js +4 -2
- package/Engines/WebGPU/webgpuTimestampQuery.js.map +1 -1
- package/Engines/WebGPU/webgpuTintWASM.js +1 -0
- package/Engines/WebGPU/webgpuTintWASM.js.map +1 -1
- package/Engines/abstractEngine.js +5 -2
- package/Engines/abstractEngine.js.map +1 -1
- package/Engines/engine.common.js +7 -1
- package/Engines/engine.common.js.map +1 -1
- package/Engines/engine.js +5 -3
- package/Engines/engine.js.map +1 -1
- package/Engines/engineFactory.js +1 -1
- package/Engines/engineFactory.js.map +1 -1
- package/Engines/nativeEngine.js +19 -11
- package/Engines/nativeEngine.js.map +1 -1
- package/Engines/webgpuEngine.js +30 -11
- package/Engines/webgpuEngine.js.map +1 -1
- package/FlowGraph/flowGraphParser.js +2 -2
- package/FlowGraph/flowGraphParser.js.map +1 -1
- package/FrameGraph/Node/nodeRenderGraph.js +5 -1
- package/FrameGraph/Node/nodeRenderGraph.js.map +1 -1
- package/FrameGraph/Node/nodeRenderGraphBlock.js +1 -1
- package/FrameGraph/Node/nodeRenderGraphBlock.js.map +1 -1
- package/FrameGraph/frameGraph.js +1 -1
- package/FrameGraph/frameGraph.js.map +1 -1
- package/Helpers/sceneHelpers.js +1 -3
- package/Helpers/sceneHelpers.js.map +1 -1
- package/Helpers/videoDome.js +1 -0
- package/Helpers/videoDome.js.map +1 -1
- package/Layers/thinEffectLayer.js +1 -0
- package/Layers/thinEffectLayer.js.map +1 -1
- package/LensFlares/lensFlareSystem.js +1 -0
- package/LensFlares/lensFlareSystem.js.map +1 -1
- package/Lights/Shadows/shadowGenerator.js +3 -2
- package/Lights/Shadows/shadowGenerator.js.map +1 -1
- package/Lights/areaLight.js +2 -0
- package/Lights/areaLight.js.map +1 -1
- package/Loading/sceneLoader.js +56 -22
- package/Loading/sceneLoader.js.map +1 -1
- package/Materials/GaussianSplatting/gaussianSplattingMaterial.d.ts +15 -1
- package/Materials/GaussianSplatting/gaussianSplattingMaterial.js +34 -7
- package/Materials/GaussianSplatting/gaussianSplattingMaterial.js.map +1 -1
- package/Materials/Node/Blocks/Dual/clipPlanesBlock.js +1 -0
- package/Materials/Node/Blocks/Dual/clipPlanesBlock.js.map +1 -1
- package/Materials/Node/Blocks/Dual/fogBlock.js +1 -0
- package/Materials/Node/Blocks/Dual/fogBlock.js.map +1 -1
- package/Materials/Node/Blocks/Dual/lightBlock.js +1 -0
- package/Materials/Node/Blocks/Dual/lightBlock.js.map +1 -1
- package/Materials/Node/Blocks/Dual/reflectionTextureBaseBlock.js +1 -0
- package/Materials/Node/Blocks/Dual/reflectionTextureBaseBlock.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/imageProcessingBlock.js +1 -0
- package/Materials/Node/Blocks/Fragment/imageProcessingBlock.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/perturbNormalBlock.js +1 -0
- package/Materials/Node/Blocks/Fragment/perturbNormalBlock.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/shadowMapBlock.js +1 -0
- package/Materials/Node/Blocks/Fragment/shadowMapBlock.js.map +1 -1
- package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.js +1 -0
- package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.js.map +1 -1
- package/Materials/Node/Blocks/Vertex/bonesBlock.js +1 -0
- package/Materials/Node/Blocks/Vertex/bonesBlock.js.map +1 -1
- package/Materials/Node/Blocks/Vertex/morphTargetsBlock.js +1 -0
- package/Materials/Node/Blocks/Vertex/morphTargetsBlock.js.map +1 -1
- package/Materials/Node/nodeMaterial.js +11 -3
- package/Materials/Node/nodeMaterial.js.map +1 -1
- package/Materials/Node/nodeMaterialBuildState.js +1 -0
- package/Materials/Node/nodeMaterialBuildState.js.map +1 -1
- package/Materials/Textures/Filtering/hdrIrradianceFiltering.js +1 -0
- package/Materials/Textures/Filtering/hdrIrradianceFiltering.js.map +1 -1
- package/Materials/Textures/Loaders/basisTextureLoader.js +4 -0
- package/Materials/Textures/Loaders/basisTextureLoader.js.map +1 -1
- package/Materials/Textures/Loaders/envTextureLoader.js +1 -0
- package/Materials/Textures/Loaders/envTextureLoader.js.map +1 -1
- package/Materials/Textures/Loaders/exrTextureLoader.js +2 -0
- package/Materials/Textures/Loaders/exrTextureLoader.js.map +1 -1
- package/Materials/Textures/Loaders/ktxTextureLoader.js +1 -0
- package/Materials/Textures/Loaders/ktxTextureLoader.js.map +1 -1
- package/Materials/Textures/Loaders/textureLoaderManager.js +9 -9
- package/Materials/Textures/Loaders/textureLoaderManager.js.map +1 -1
- package/Materials/Textures/Packer/packer.js +3 -1
- package/Materials/Textures/Packer/packer.js.map +1 -1
- package/Materials/Textures/Procedurals/proceduralTexture.js +1 -0
- package/Materials/Textures/Procedurals/proceduralTexture.js.map +1 -1
- package/Materials/Textures/baseTexture.polynomial.js +1 -0
- package/Materials/Textures/baseTexture.polynomial.js.map +1 -1
- package/Materials/Textures/hdrCubeTexture.js +1 -0
- package/Materials/Textures/hdrCubeTexture.js.map +1 -1
- package/Materials/Textures/internalTexture.js +1 -0
- package/Materials/Textures/internalTexture.js.map +1 -1
- package/Materials/Textures/rawCubeTexture.js +3 -0
- package/Materials/Textures/rawCubeTexture.js.map +1 -1
- package/Materials/Textures/renderTargetTexture.js +2 -0
- package/Materials/Textures/renderTargetTexture.js.map +1 -1
- package/Materials/Textures/videoTexture.js +6 -0
- package/Materials/Textures/videoTexture.js.map +1 -1
- package/Materials/effect.js +2 -1
- package/Materials/effect.js.map +1 -1
- package/Materials/effect.webgl.functions.js +3 -1
- package/Materials/effect.webgl.functions.js.map +1 -1
- package/Materials/effectRenderer.js +1 -0
- package/Materials/effectRenderer.js.map +1 -1
- package/Materials/material.js +2 -1
- package/Materials/material.js.map +1 -1
- package/Materials/shaderMaterial.js +4 -2
- package/Materials/shaderMaterial.js.map +1 -1
- package/Meshes/Compression/dracoCodec.js +5 -1
- package/Meshes/Compression/dracoCodec.js.map +1 -1
- package/Meshes/Compression/dracoCompression.js +4 -3
- package/Meshes/Compression/dracoCompression.js.map +1 -1
- package/Meshes/Compression/dracoCompressionWorker.js +5 -2
- package/Meshes/Compression/dracoCompressionWorker.js.map +1 -1
- package/Meshes/Compression/dracoDecoder.js +5 -1
- package/Meshes/Compression/dracoDecoder.js.map +1 -1
- package/Meshes/Compression/dracoEncoder.js +3 -2
- package/Meshes/Compression/dracoEncoder.js.map +1 -1
- package/Meshes/Compression/meshoptCompression.js +18 -18
- package/Meshes/Compression/meshoptCompression.js.map +1 -1
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.js +14 -15
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.js.map +1 -1
- package/Meshes/Node/Blocks/Textures/geometryTextureBlock.js +20 -10
- package/Meshes/Node/Blocks/Textures/geometryTextureBlock.js.map +1 -1
- package/Meshes/Node/Blocks/booleanGeometryBlock.js +1 -0
- package/Meshes/Node/Blocks/booleanGeometryBlock.js.map +1 -1
- package/Meshes/Node/nodeGeometry.js +5 -1
- package/Meshes/Node/nodeGeometry.js.map +1 -1
- package/Meshes/mesh.js +2 -2
- package/Meshes/mesh.js.map +1 -1
- package/Meshes/meshUVSpaceRenderer.js +1 -0
- package/Meshes/meshUVSpaceRenderer.js.map +1 -1
- package/Misc/HighDynamicRange/cubemapToSphericalPolynomial.js +1 -0
- package/Misc/HighDynamicRange/cubemapToSphericalPolynomial.js.map +1 -1
- package/Misc/assetsManager.js +2 -1
- package/Misc/assetsManager.js.map +1 -1
- package/Misc/asyncLock.js +5 -2
- package/Misc/asyncLock.js.map +1 -1
- package/Misc/basis.js +9 -2
- package/Misc/basis.js.map +1 -1
- package/Misc/basisWorker.js +3 -1
- package/Misc/basisWorker.js.map +1 -1
- package/Misc/copyTextureToTexture.js +1 -0
- package/Misc/copyTextureToTexture.js.map +1 -1
- package/Misc/coroutine.js +2 -1
- package/Misc/coroutine.js.map +1 -1
- package/Misc/dataReader.js +3 -4
- package/Misc/dataReader.js.map +1 -1
- package/Misc/dumpTools.js +7 -1
- package/Misc/dumpTools.js.map +1 -1
- package/Misc/environmentTextureTools.d.ts +0 -2
- package/Misc/environmentTextureTools.js +20 -7
- package/Misc/environmentTextureTools.js.map +1 -1
- package/Misc/equirectangularCapture.js +2 -1
- package/Misc/equirectangularCapture.js.map +1 -1
- package/Misc/fileTools.js +2 -0
- package/Misc/fileTools.js.map +1 -1
- package/Misc/filesInput.js +5 -1
- package/Misc/filesInput.js.map +1 -1
- package/Misc/khronosTextureContainer2.js +10 -3
- package/Misc/khronosTextureContainer2.js.map +1 -1
- package/Misc/khronosTextureContainer2Worker.js +4 -1
- package/Misc/khronosTextureContainer2Worker.js.map +1 -1
- package/Misc/minMaxReducer.js +1 -0
- package/Misc/minMaxReducer.js.map +1 -1
- package/Misc/observable.extensions.js +3 -1
- package/Misc/observable.extensions.js.map +1 -1
- package/Misc/observable.js +2 -0
- package/Misc/observable.js.map +1 -1
- package/Misc/observableCoroutine.js +1 -0
- package/Misc/observableCoroutine.js.map +1 -1
- package/Misc/reflector.js +1 -0
- package/Misc/reflector.js.map +1 -1
- package/Misc/rgbdTextureTools.js +2 -1
- package/Misc/rgbdTextureTools.js.map +1 -1
- package/Misc/sceneSerializer.js +2 -2
- package/Misc/sceneSerializer.js.map +1 -1
- package/Misc/screenshotTools.js +9 -4
- package/Misc/screenshotTools.js.map +1 -1
- package/Misc/textureTools.js +2 -0
- package/Misc/textureTools.js.map +1 -1
- package/Misc/tools.internals.js +2 -1
- package/Misc/tools.internals.js.map +1 -1
- package/Misc/tools.js +9 -3
- package/Misc/tools.js.map +1 -1
- package/Misc/videoRecorder.js +1 -0
- package/Misc/videoRecorder.js.map +1 -1
- package/Misc/webRequest.fetch.js +2 -1
- package/Misc/webRequest.fetch.js.map +1 -1
- package/Misc/workerPool.js +3 -0
- package/Misc/workerPool.js.map +1 -1
- package/Particles/flowMap.js +1 -1
- package/Particles/flowMap.js.map +1 -1
- package/Particles/particleHelper.js +7 -0
- package/Particles/particleHelper.js.map +1 -1
- package/Particles/pointsCloudSystem.js +7 -7
- package/Particles/pointsCloudSystem.js.map +1 -1
- package/Particles/thinParticleSystem.js +2 -0
- package/Particles/thinParticleSystem.js.map +1 -1
- package/Physics/physicsHelper.js +2 -2
- package/Physics/physicsHelper.js.map +1 -1
- package/Physics/v1/Plugins/oimoJSPlugin.js +1 -1
- package/Physics/v1/Plugins/oimoJSPlugin.js.map +1 -1
- package/PostProcesses/RenderPipeline/Pipelines/standardRenderingPipeline.js +1 -0
- package/PostProcesses/RenderPipeline/Pipelines/standardRenderingPipeline.js.map +1 -1
- package/Rendering/GlobalIllumination/giRSMManager.js +1 -0
- package/Rendering/GlobalIllumination/giRSMManager.js.map +1 -1
- package/Rendering/IBLShadows/iblShadowsVoxelRenderer.js +1 -0
- package/Rendering/IBLShadows/iblShadowsVoxelRenderer.js.map +1 -1
- package/Rendering/depthRenderer.js +1 -0
- package/Rendering/depthRenderer.js.map +1 -1
- package/Rendering/fluidRenderer/fluidRenderingTargetRenderer.js +3 -1
- package/Rendering/fluidRenderer/fluidRenderingTargetRenderer.js.map +1 -1
- package/Rendering/fluidRenderer/fluidRenderingTextures.js.map +1 -1
- package/Rendering/geometryBufferRenderer.js +1 -0
- package/Rendering/geometryBufferRenderer.js.map +1 -1
- package/Rendering/iblCdfGenerator.js +4 -1
- package/Rendering/iblCdfGenerator.js.map +1 -1
- package/Sprites/spriteManager.js +5 -1
- package/Sprites/spriteManager.js.map +1 -1
- package/Sprites/spriteRenderer.js +1 -0
- package/Sprites/spriteRenderer.js.map +1 -1
- package/XR/features/WebXRAnchorSystem.js +4 -3
- package/XR/features/WebXRAnchorSystem.js.map +1 -1
- package/XR/features/WebXRDepthSensing.js +1 -1
- package/XR/features/WebXRDepthSensing.js.map +1 -1
- package/XR/features/WebXRHandTracking.js +4 -1
- package/XR/features/WebXRHandTracking.js.map +1 -1
- package/XR/features/WebXRHitTest.js +4 -1
- package/XR/features/WebXRHitTest.js.map +1 -1
- package/XR/features/WebXRHitTestLegacy.js +6 -5
- package/XR/features/WebXRHitTestLegacy.js.map +1 -1
- package/XR/features/WebXRImageTracking.js +2 -1
- package/XR/features/WebXRImageTracking.js.map +1 -1
- package/XR/features/WebXRLightEstimation.js +3 -0
- package/XR/features/WebXRLightEstimation.js.map +1 -1
- package/XR/features/WebXRNearInteraction.js +2 -0
- package/XR/features/WebXRNearInteraction.js.map +1 -1
- package/XR/features/WebXRPlaneDetector.js +2 -2
- package/XR/features/WebXRPlaneDetector.js.map +1 -1
- package/XR/motionController/webXRAbstractMotionController.js +3 -2
- package/XR/motionController/webXRAbstractMotionController.js.map +1 -1
- package/XR/motionController/webXRMicrosoftMixedRealityController.js +6 -6
- package/XR/motionController/webXRMicrosoftMixedRealityController.js.map +1 -1
- package/XR/motionController/webXRMotionControllerManager.js +15 -9
- package/XR/motionController/webXRMotionControllerManager.js.map +1 -1
- package/XR/motionController/webXRProfiledMotionController.js +1 -1
- package/XR/motionController/webXRProfiledMotionController.js.map +1 -1
- package/XR/native/nativeXRFrame.js +1 -0
- package/XR/native/nativeXRFrame.js.map +1 -1
- package/XR/webXRDefaultExperience.js +10 -12
- package/XR/webXRDefaultExperience.js.map +1 -1
- package/XR/webXREnterExitUI.js +2 -1
- package/XR/webXREnterExitUI.js.map +1 -1
- package/XR/webXRExperienceHelper.js +5 -2
- package/XR/webXRExperienceHelper.js.map +1 -1
- package/XR/webXRFeaturesManager.js +1 -0
- package/XR/webXRFeaturesManager.js.map +1 -1
- package/XR/webXRInput.js +1 -0
- package/XR/webXRInput.js.map +1 -1
- package/XR/webXRInputSource.js +2 -0
- package/XR/webXRInputSource.js.map +1 -1
- package/XR/webXRManagedOutputCanvas.js +5 -1
- package/XR/webXRManagedOutputCanvas.js.map +1 -1
- package/XR/webXRSessionManager.js +56 -60
- package/XR/webXRSessionManager.js.map +1 -1
- package/assetContainer.js +28 -28
- package/assetContainer.js.map +1 -1
- package/package.json +1 -1
- package/scene.js +5 -4
- package/scene.js.map +1 -1
package/Lights/areaLight.js
CHANGED
|
@@ -20,6 +20,7 @@ function CreateSceneLTCTextures(scene) {
|
|
|
20
20
|
scene._ltcTextures.LTC2.wrapV = Texture.CLAMP_ADDRESSMODE;
|
|
21
21
|
scene.useDelayedTextureLoading = useDelayedTextureLoading;
|
|
22
22
|
DecodeLTCTextureDataAsync()
|
|
23
|
+
// eslint-disable-next-line github/no-then
|
|
23
24
|
.then((textureData) => {
|
|
24
25
|
if (scene._ltcTextures) {
|
|
25
26
|
const ltc1 = scene._ltcTextures?.LTC1;
|
|
@@ -32,6 +33,7 @@ function CreateSceneLTCTextures(scene) {
|
|
|
32
33
|
});
|
|
33
34
|
}
|
|
34
35
|
})
|
|
36
|
+
// eslint-disable-next-line github/no-then
|
|
35
37
|
.catch((error) => {
|
|
36
38
|
Logger.Error(`Area Light fail to get LTC textures data. Error: ${error}`);
|
|
37
39
|
});
|
package/Lights/areaLight.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"areaLight.js","sourceRoot":"","sources":["../../../../dev/core/src/Lights/areaLight.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,4CAA2C;AAChE,OAAO,EAAE,OAAO,EAAE,yCAAwC;AAC1D,OAAO,EAAE,SAAS,EAAE,gCAA+B;AACnD,OAAO,EAAE,KAAK,EAAE,mBAA0B;AAG1C,OAAO,EAAE,yBAAyB,EAAE,gCAAuC;AAE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AAsB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACxC,CAAC;IACL,CAAC;IAEe,wBAAwB,CAAC,MAAc;QACnD,IAAI,IAAI,CAAC,MAAM,CAAC,YAAY,EAAE,CAAC;YAC3B,MAAM,CAAC,UAAU,CAAC,uBAAuB,EAAE,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;YAC1E,MAAM,CAAC,UAAU,CAAC,uBAAuB,EAAE,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;QAC9E,CAAC;QACD,OAAO,IAAI,CAAC;IAChB,CAAC;IAED;;;;OAIG;IACI,2BAA2B,CAAC,OAAY,EAAE,UAAkB;QAC/D,OAAO,CAAC,WAAW,GAAG,UAAU,CAAC,GAAG,IAAI,CAAC;QACzC,OAAO,CAAC,eAAe,CAAC,GAAG,IAAI,CAAC;IACpC,CAAC;IAEe,QAAQ;QACpB,IAAI,IAAI,CAAC,MAAM,CAAC,YAAY,EAAE,CAAC;YAC3B,OAAO,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;QAC9F,CAAC;QAED,OAAO,KAAK,CAAC;IACjB,CAAC;CACJ","sourcesContent":["import type { Vector3 } from \"core/Maths/math.vector\";\r\nimport { RawTexture } from \"core/Materials/Textures/rawTexture\";\r\nimport { Texture } from \"core/Materials/Textures/texture\";\r\nimport { Constants } from \"core/Engines/constants\";\r\nimport { Light } from \"core/Lights/light\";\r\nimport type { Effect } from \"core/Materials/effect\";\r\nimport type { ILTCTextures } from \"core/Lights/LTC/ltcTextureTool\";\r\nimport { DecodeLTCTextureDataAsync } from \"core/Lights/LTC/ltcTextureTool\";\r\nimport type { Scene } from \"core/scene\";\r\nimport { Logger } from \"core/Misc/logger\";\r\n\r\ndeclare module \"../scene\" {\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n export interface Scene {\r\n /**\r\n * @internal\r\n */\r\n _ltcTextures?: ILTCTextures;\r\n }\r\n}\r\n\r\nfunction CreateSceneLTCTextures(scene: Scene): void {\r\n const useDelayedTextureLoading = scene.useDelayedTextureLoading;\r\n scene.useDelayedTextureLoading = false;\r\n\r\n const previousState = scene._blockEntityCollection;\r\n scene._blockEntityCollection = false;\r\n\r\n scene._ltcTextures = {\r\n LTC1: RawTexture.CreateRGBATexture(null, 64, 64, scene.getEngine(), false, false, Constants.TEXTURE_LINEAR_LINEAR, Constants.TEXTURETYPE_HALF_FLOAT, 0, false, true),\r\n LTC2: RawTexture.CreateRGBATexture(null, 64, 64, scene.getEngine(), false, false, Constants.TEXTURE_LINEAR_LINEAR, Constants.TEXTURETYPE_HALF_FLOAT, 0, false, true),\r\n };\r\n\r\n scene._blockEntityCollection = previousState;\r\n\r\n scene._ltcTextures.LTC1.wrapU = Texture.CLAMP_ADDRESSMODE;\r\n scene._ltcTextures.LTC1.wrapV = Texture.CLAMP_ADDRESSMODE;\r\n\r\n scene._ltcTextures.LTC2.wrapU = Texture.CLAMP_ADDRESSMODE;\r\n scene._ltcTextures.LTC2.wrapV = Texture.CLAMP_ADDRESSMODE;\r\n\r\n scene.useDelayedTextureLoading = useDelayedTextureLoading;\r\n\r\n DecodeLTCTextureDataAsync()\r\n // eslint-disable-next-line github/no-then\r\n .then((textureData) => {\r\n if (scene._ltcTextures) {\r\n const ltc1 = scene._ltcTextures?.LTC1 as RawTexture;\r\n ltc1.update(textureData[0]);\r\n\r\n const ltc2 = scene._ltcTextures?.LTC2 as RawTexture;\r\n ltc2.update(textureData[1]);\r\n\r\n scene.onDisposeObservable.addOnce(() => {\r\n scene._ltcTextures?.LTC1.dispose();\r\n scene._ltcTextures?.LTC2.dispose();\r\n });\r\n }\r\n })\r\n // eslint-disable-next-line github/no-then\r\n .catch((error) => {\r\n Logger.Error(`Area Light fail to get LTC textures data. Error: ${error}`);\r\n });\r\n}\r\n\r\n/**\r\n * Abstract Area Light class that servers as parent for all Area Lights implementations.\r\n * The light is emitted from the area in the -Z direction.\r\n */\r\nexport abstract class AreaLight extends Light {\r\n /**\r\n * Area Light position.\r\n */\r\n public position: Vector3;\r\n\r\n /**\r\n * Creates a area light object.\r\n * Documentation : https://doc.babylonjs.com/features/featuresDeepDive/lights/lights_introduction\r\n * @param name The friendly name of the light\r\n * @param position The position of the area light.\r\n * @param scene The scene the light belongs to\r\n */\r\n constructor(name: string, position: Vector3, scene?: Scene) {\r\n super(name, scene);\r\n this.position = position;\r\n\r\n if (!this._scene._ltcTextures) {\r\n CreateSceneLTCTextures(this._scene);\r\n }\r\n }\r\n\r\n public override transferTexturesToEffect(effect: Effect): Light {\r\n if (this._scene._ltcTextures) {\r\n effect.setTexture(\"areaLightsLTC1Sampler\", this._scene._ltcTextures.LTC1);\r\n effect.setTexture(\"areaLightsLTC2Sampler\", this._scene._ltcTextures.LTC2);\r\n }\r\n return this;\r\n }\r\n\r\n /**\r\n * Prepares the list of defines specific to the light type.\r\n * @param defines the list of defines\r\n * @param lightIndex defines the index of the light for the effect\r\n */\r\n public prepareLightSpecificDefines(defines: any, lightIndex: number): void {\r\n defines[\"AREALIGHT\" + lightIndex] = true;\r\n defines[\"AREALIGHTUSED\"] = true;\r\n }\r\n\r\n public override _isReady(): boolean {\r\n if (this._scene._ltcTextures) {\r\n return this._scene._ltcTextures.LTC1.isReady() && this._scene._ltcTextures.LTC2.isReady();\r\n }\r\n\r\n return false;\r\n }\r\n}\r\n"]}
|
package/Loading/sceneLoader.js
CHANGED
|
@@ -119,6 +119,7 @@ async function loadDataAsync(fileInfo, scene, onSuccess, onProgress, onError, on
|
|
|
119
119
|
const response = await _FetchAsync(fileInfo.url, { method: "HEAD", responseHeaders: ["Content-Type"] });
|
|
120
120
|
const mimeType = response.headerValues ? response.headerValues["Content-Type"] : "";
|
|
121
121
|
if (mimeType) {
|
|
122
|
+
// eslint-disable-next-line require-atomic-updates
|
|
122
123
|
registeredPlugin = getPluginForMimeType(mimeType);
|
|
123
124
|
}
|
|
124
125
|
}
|
|
@@ -144,6 +145,7 @@ async function loadDataAsync(fileInfo, scene, onSuccess, onProgress, onError, on
|
|
|
144
145
|
const pluginFactory = registeredPlugin.plugin;
|
|
145
146
|
const partialPlugin = pluginFactory.createPlugin(pluginOptions ?? {});
|
|
146
147
|
if (partialPlugin instanceof Promise) {
|
|
148
|
+
// eslint-disable-next-line github/no-then
|
|
147
149
|
partialPlugin.then(callback).catch((error) => {
|
|
148
150
|
onError("Error instantiating plugin.", error);
|
|
149
151
|
});
|
|
@@ -174,9 +176,11 @@ async function loadDataAsync(fileInfo, scene, onSuccess, onProgress, onError, on
|
|
|
174
176
|
const result = plugin.directLoad(scene, directLoad);
|
|
175
177
|
if (result instanceof Promise) {
|
|
176
178
|
result
|
|
179
|
+
// eslint-disable-next-line github/no-then
|
|
177
180
|
.then((data) => {
|
|
178
181
|
onSuccess(plugin, data);
|
|
179
182
|
})
|
|
183
|
+
// eslint-disable-next-line github/no-then
|
|
180
184
|
.catch((error) => {
|
|
181
185
|
onError("Error in directLoad of _loadData: " + error, error);
|
|
182
186
|
});
|
|
@@ -346,7 +350,7 @@ export function GetRegisteredSceneLoaderPluginMetadata() {
|
|
|
346
350
|
*/
|
|
347
351
|
export async function ImportMeshAsync(source, scene, options) {
|
|
348
352
|
const { meshNames, rootUrl = "", onProgress, pluginExtension, name, pluginOptions } = options ?? {};
|
|
349
|
-
return importMeshAsyncCoreAsync(meshNames, rootUrl, source, scene, onProgress, pluginExtension, name, pluginOptions);
|
|
353
|
+
return await importMeshAsyncCoreAsync(meshNames, rootUrl, source, scene, onProgress, pluginExtension, name, pluginOptions);
|
|
350
354
|
}
|
|
351
355
|
async function importMeshAsync(meshNames, rootUrl, sceneFilename = "", scene = EngineStore.LastCreatedScene, onSuccess = null, onProgress = null, onError = null, pluginExtension = null, name = "", pluginOptions = {}) {
|
|
352
356
|
if (!scene) {
|
|
@@ -414,10 +418,12 @@ async function importMeshAsync(meshNames, rootUrl, sceneFilename = "", scene = E
|
|
|
414
418
|
const asyncedPlugin = plugin;
|
|
415
419
|
asyncedPlugin
|
|
416
420
|
.importMeshAsync(meshNames, scene, data, fileInfo.rootUrl, progressHandler, fileInfo.name)
|
|
421
|
+
// eslint-disable-next-line github/no-then
|
|
417
422
|
.then((result) => {
|
|
418
423
|
scene.loadingPluginName = plugin.name;
|
|
419
424
|
successHandler(result.meshes, result.particleSystems, result.skeletons, result.animationGroups, result.transformNodes, result.geometries, result.lights, result.spriteManagers);
|
|
420
425
|
})
|
|
426
|
+
// eslint-disable-next-line github/no-then
|
|
421
427
|
.catch((error) => {
|
|
422
428
|
errorHandler(error.message, error);
|
|
423
429
|
});
|
|
@@ -425,7 +431,7 @@ async function importMeshAsync(meshNames, rootUrl, sceneFilename = "", scene = E
|
|
|
425
431
|
}, progressHandler, errorHandler, disposeHandler, pluginExtension, name, pluginOptions);
|
|
426
432
|
}
|
|
427
433
|
async function importMeshAsyncCoreAsync(meshNames, rootUrl, sceneFilename, scene, onProgress, pluginExtension, name, pluginOptions) {
|
|
428
|
-
return new Promise((resolve, reject) => {
|
|
434
|
+
return await new Promise((resolve, reject) => {
|
|
429
435
|
try {
|
|
430
436
|
importMeshAsync(meshNames, rootUrl, sceneFilename, scene, (meshes, particleSystems, skeletons, animationGroups, transformNodes, geometries, lights, spriteManagers) => {
|
|
431
437
|
resolve({
|
|
@@ -439,10 +445,14 @@ async function importMeshAsyncCoreAsync(meshNames, rootUrl, sceneFilename, scene
|
|
|
439
445
|
spriteManagers: spriteManagers,
|
|
440
446
|
});
|
|
441
447
|
}, onProgress, (scene, message, exception) => {
|
|
448
|
+
// eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors
|
|
442
449
|
reject(exception || new Error(message));
|
|
443
|
-
}, pluginExtension, name, pluginOptions
|
|
450
|
+
}, pluginExtension, name, pluginOptions
|
|
451
|
+
// eslint-disable-next-line github/no-then
|
|
452
|
+
).catch(reject);
|
|
444
453
|
}
|
|
445
454
|
catch (error) {
|
|
455
|
+
// eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors
|
|
446
456
|
reject(error);
|
|
447
457
|
}
|
|
448
458
|
});
|
|
@@ -464,7 +474,7 @@ async function loadSceneImplAsync(rootUrl, sceneFilename = "", engine = EngineSt
|
|
|
464
474
|
*/
|
|
465
475
|
export async function LoadSceneAsync(source, engine, options) {
|
|
466
476
|
const { rootUrl = "", onProgress, pluginExtension, name, pluginOptions } = options ?? {};
|
|
467
|
-
return loadSceneSharedAsync(rootUrl, source, engine, onProgress, pluginExtension, name, pluginOptions);
|
|
477
|
+
return await loadSceneSharedAsync(rootUrl, source, engine, onProgress, pluginExtension, name, pluginOptions);
|
|
468
478
|
}
|
|
469
479
|
/**
|
|
470
480
|
* Load a scene
|
|
@@ -475,14 +485,16 @@ export async function LoadSceneAsync(source, engine, options) {
|
|
|
475
485
|
* @returns The loaded scene
|
|
476
486
|
*/
|
|
477
487
|
export async function loadSceneAsync(source, engine, options) {
|
|
478
|
-
return LoadSceneAsync(source, engine, options);
|
|
488
|
+
return await LoadSceneAsync(source, engine, options);
|
|
479
489
|
}
|
|
480
490
|
// This function is shared between the new module level loadSceneAsync and the legacy SceneLoader.LoadAsync
|
|
481
491
|
async function loadSceneSharedAsync(rootUrl, sceneFilename, engine, onProgress, pluginExtension, name, pluginOptions) {
|
|
482
|
-
return new Promise((resolve, reject) => {
|
|
492
|
+
return await new Promise((resolve, reject) => {
|
|
493
|
+
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
483
494
|
loadSceneImplAsync(rootUrl, sceneFilename, engine, (scene) => {
|
|
484
495
|
resolve(scene);
|
|
485
496
|
}, onProgress, (scene, message, exception) => {
|
|
497
|
+
// eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors
|
|
486
498
|
reject(exception || new Error(message));
|
|
487
499
|
}, pluginExtension, name, pluginOptions);
|
|
488
500
|
});
|
|
@@ -555,10 +567,12 @@ async function appendSceneImplAsync(rootUrl, sceneFilename = "", scene = EngineS
|
|
|
555
567
|
const asyncedPlugin = plugin;
|
|
556
568
|
asyncedPlugin
|
|
557
569
|
.loadAsync(scene, data, fileInfo.rootUrl, progressHandler, fileInfo.name)
|
|
570
|
+
// eslint-disable-next-line github/no-then
|
|
558
571
|
.then(() => {
|
|
559
572
|
scene.loadingPluginName = plugin.name;
|
|
560
573
|
successHandler();
|
|
561
574
|
})
|
|
575
|
+
// eslint-disable-next-line github/no-then
|
|
562
576
|
.catch((error) => {
|
|
563
577
|
errorHandler(error.message, error);
|
|
564
578
|
});
|
|
@@ -585,19 +599,23 @@ export async function AppendSceneAsync(source, scene, options) {
|
|
|
585
599
|
* @returns A promise that resolves when the scene is appended
|
|
586
600
|
*/
|
|
587
601
|
export async function appendSceneAsync(source, scene, options) {
|
|
588
|
-
return AppendSceneAsync(source, scene, options);
|
|
602
|
+
return await AppendSceneAsync(source, scene, options);
|
|
589
603
|
}
|
|
590
604
|
// This function is shared between the new module level appendSceneAsync and the legacy SceneLoader.AppendAsync
|
|
591
605
|
async function appendSceneSharedAsync(rootUrl, sceneFilename, scene, onProgress, pluginExtension, name, pluginOptions) {
|
|
592
|
-
return new Promise((resolve, reject) => {
|
|
606
|
+
return await new Promise((resolve, reject) => {
|
|
593
607
|
try {
|
|
594
608
|
appendSceneImplAsync(rootUrl, sceneFilename, scene, (scene) => {
|
|
595
609
|
resolve(scene);
|
|
596
610
|
}, onProgress, (scene, message, exception) => {
|
|
611
|
+
// eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors
|
|
597
612
|
reject(exception || new Error(message));
|
|
598
|
-
}, pluginExtension, name, pluginOptions
|
|
613
|
+
}, pluginExtension, name, pluginOptions
|
|
614
|
+
// eslint-disable-next-line github/no-then
|
|
615
|
+
).catch(reject);
|
|
599
616
|
}
|
|
600
617
|
catch (error) {
|
|
618
|
+
// eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors
|
|
601
619
|
reject(error);
|
|
602
620
|
}
|
|
603
621
|
});
|
|
@@ -664,11 +682,13 @@ async function loadAssetContainerImplAsync(rootUrl, sceneFilename = "", scene =
|
|
|
664
682
|
const asyncedPlugin = plugin;
|
|
665
683
|
asyncedPlugin
|
|
666
684
|
.loadAssetContainerAsync(scene, data, fileInfo.rootUrl, progressHandler, fileInfo.name)
|
|
685
|
+
// eslint-disable-next-line github/no-then
|
|
667
686
|
.then((assetContainer) => {
|
|
668
687
|
assetContainer.populateRootNodes();
|
|
669
688
|
scene.loadingPluginName = plugin.name;
|
|
670
689
|
successHandler(assetContainer);
|
|
671
690
|
})
|
|
691
|
+
// eslint-disable-next-line github/no-then
|
|
672
692
|
.catch((error) => {
|
|
673
693
|
errorHandler(error.message, error);
|
|
674
694
|
});
|
|
@@ -687,7 +707,7 @@ async function loadAssetContainerImplAsync(rootUrl, sceneFilename = "", scene =
|
|
|
687
707
|
*/
|
|
688
708
|
export async function LoadAssetContainerAsync(source, scene, options) {
|
|
689
709
|
const { rootUrl = "", onProgress, pluginExtension, name, pluginOptions } = options ?? {};
|
|
690
|
-
return loadAssetContainerSharedAsync(rootUrl, source, scene, onProgress, pluginExtension, name, pluginOptions);
|
|
710
|
+
return await loadAssetContainerSharedAsync(rootUrl, source, scene, onProgress, pluginExtension, name, pluginOptions);
|
|
691
711
|
}
|
|
692
712
|
/**
|
|
693
713
|
* Load a scene into an asset container
|
|
@@ -698,19 +718,23 @@ export async function LoadAssetContainerAsync(source, scene, options) {
|
|
|
698
718
|
* @returns The loaded asset container
|
|
699
719
|
*/
|
|
700
720
|
export async function loadAssetContainerAsync(source, scene, options) {
|
|
701
|
-
return LoadAssetContainerAsync(source, scene, options);
|
|
721
|
+
return await LoadAssetContainerAsync(source, scene, options);
|
|
702
722
|
}
|
|
703
723
|
// This function is shared between the new module level loadAssetContainerAsync and the legacy SceneLoader.LoadAssetContainerAsync
|
|
704
724
|
async function loadAssetContainerSharedAsync(rootUrl, sceneFilename, scene, onProgress, pluginExtension, name, pluginOptions) {
|
|
705
|
-
return new Promise((resolve, reject) => {
|
|
725
|
+
return await new Promise((resolve, reject) => {
|
|
706
726
|
try {
|
|
707
727
|
loadAssetContainerImplAsync(rootUrl, sceneFilename, scene, (assets) => {
|
|
708
728
|
resolve(assets);
|
|
709
729
|
}, onProgress, (scene, message, exception) => {
|
|
730
|
+
// eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors
|
|
710
731
|
reject(exception || new Error(message));
|
|
711
|
-
}, pluginExtension, name, pluginOptions
|
|
732
|
+
}, pluginExtension, name, pluginOptions
|
|
733
|
+
// eslint-disable-next-line github/no-then
|
|
734
|
+
).catch(reject);
|
|
712
735
|
}
|
|
713
736
|
catch (error) {
|
|
737
|
+
// eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors
|
|
714
738
|
reject(error);
|
|
715
739
|
}
|
|
716
740
|
});
|
|
@@ -796,19 +820,23 @@ export async function ImportAnimationsAsync(source, scene, options) {
|
|
|
796
820
|
* @returns A promise that resolves when the animations are imported
|
|
797
821
|
*/
|
|
798
822
|
export async function importAnimationsAsync(source, scene, options) {
|
|
799
|
-
return ImportAnimationsAsync(source, scene, options);
|
|
823
|
+
return await ImportAnimationsAsync(source, scene, options);
|
|
800
824
|
}
|
|
801
825
|
// This function is shared between the new module level importAnimationsAsync and the legacy SceneLoader.ImportAnimationsAsync
|
|
802
826
|
async function importAnimationsSharedAsync(rootUrl, sceneFilename, scene, overwriteAnimations, animationGroupLoadingMode, targetConverter, onProgress, pluginExtension, name, pluginOptions) {
|
|
803
|
-
return new Promise((resolve, reject) => {
|
|
827
|
+
return await new Promise((resolve, reject) => {
|
|
804
828
|
try {
|
|
805
829
|
importAnimationsImplAsync(rootUrl, sceneFilename, scene, overwriteAnimations, animationGroupLoadingMode, targetConverter, (scene) => {
|
|
806
830
|
resolve(scene);
|
|
807
831
|
}, onProgress, (scene, message, exception) => {
|
|
832
|
+
// eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors
|
|
808
833
|
reject(exception || new Error(message));
|
|
809
|
-
}, pluginExtension, name, pluginOptions
|
|
834
|
+
}, pluginExtension, name, pluginOptions
|
|
835
|
+
// eslint-disable-next-line github/no-then
|
|
836
|
+
).catch(reject);
|
|
810
837
|
}
|
|
811
838
|
catch (error) {
|
|
839
|
+
// eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors
|
|
812
840
|
reject(error);
|
|
813
841
|
}
|
|
814
842
|
});
|
|
@@ -904,6 +932,7 @@ export class SceneLoader {
|
|
|
904
932
|
* @deprecated Please use the module level {@link ImportMeshAsync} instead
|
|
905
933
|
*/
|
|
906
934
|
static ImportMesh(meshNames, rootUrl, sceneFilename, scene, onSuccess, onProgress, onError, pluginExtension, name) {
|
|
935
|
+
// eslint-disable-next-line github/no-then
|
|
907
936
|
importMeshAsync(meshNames, rootUrl, sceneFilename, scene, onSuccess, onProgress, onError, pluginExtension, name).catch((error) => onError?.(EngineStore.LastCreatedScene, error?.message, error));
|
|
908
937
|
}
|
|
909
938
|
/**
|
|
@@ -919,7 +948,7 @@ export class SceneLoader {
|
|
|
919
948
|
* @deprecated Please use the module level {@link ImportMeshAsync} instead
|
|
920
949
|
*/
|
|
921
950
|
static async ImportMeshAsync(meshNames, rootUrl, sceneFilename, scene, onProgress, pluginExtension, name) {
|
|
922
|
-
return importMeshAsyncCoreAsync(meshNames, rootUrl, sceneFilename, scene, onProgress, pluginExtension, name);
|
|
951
|
+
return await importMeshAsyncCoreAsync(meshNames, rootUrl, sceneFilename, scene, onProgress, pluginExtension, name);
|
|
923
952
|
}
|
|
924
953
|
/**
|
|
925
954
|
* Load a scene
|
|
@@ -934,6 +963,7 @@ export class SceneLoader {
|
|
|
934
963
|
* @deprecated Please use the module level {@link LoadSceneAsync} instead
|
|
935
964
|
*/
|
|
936
965
|
static Load(rootUrl, sceneFilename, engine, onSuccess, onProgress, onError, pluginExtension, name) {
|
|
966
|
+
// eslint-disable-next-line github/no-then
|
|
937
967
|
loadSceneImplAsync(rootUrl, sceneFilename, engine, onSuccess, onProgress, onError, pluginExtension, name).catch((error) => onError?.(EngineStore.LastCreatedScene, error?.message, error));
|
|
938
968
|
}
|
|
939
969
|
/**
|
|
@@ -948,7 +978,7 @@ export class SceneLoader {
|
|
|
948
978
|
* @deprecated Please use the module level {@link LoadSceneAsync} instead
|
|
949
979
|
*/
|
|
950
980
|
static async LoadAsync(rootUrl, sceneFilename, engine, onProgress, pluginExtension, name) {
|
|
951
|
-
return loadSceneSharedAsync(rootUrl, sceneFilename, engine, onProgress, pluginExtension, name);
|
|
981
|
+
return await loadSceneSharedAsync(rootUrl, sceneFilename, engine, onProgress, pluginExtension, name);
|
|
952
982
|
}
|
|
953
983
|
/**
|
|
954
984
|
* Append a scene
|
|
@@ -963,6 +993,7 @@ export class SceneLoader {
|
|
|
963
993
|
* @deprecated Please use the module level {@link AppendSceneAsync} instead
|
|
964
994
|
*/
|
|
965
995
|
static Append(rootUrl, sceneFilename, scene, onSuccess, onProgress, onError, pluginExtension, name) {
|
|
996
|
+
// eslint-disable-next-line github/no-then
|
|
966
997
|
appendSceneImplAsync(rootUrl, sceneFilename, scene, onSuccess, onProgress, onError, pluginExtension, name).catch((error) => onError?.((scene ?? EngineStore.LastCreatedScene), error?.message, error));
|
|
967
998
|
}
|
|
968
999
|
/**
|
|
@@ -977,7 +1008,7 @@ export class SceneLoader {
|
|
|
977
1008
|
* @deprecated Please use the module level {@link AppendSceneAsync} instead
|
|
978
1009
|
*/
|
|
979
1010
|
static async AppendAsync(rootUrl, sceneFilename, scene, onProgress, pluginExtension, name) {
|
|
980
|
-
return appendSceneSharedAsync(rootUrl, sceneFilename, scene, onProgress, pluginExtension, name);
|
|
1011
|
+
return await appendSceneSharedAsync(rootUrl, sceneFilename, scene, onProgress, pluginExtension, name);
|
|
981
1012
|
}
|
|
982
1013
|
/**
|
|
983
1014
|
* Load a scene into an asset container
|
|
@@ -992,6 +1023,7 @@ export class SceneLoader {
|
|
|
992
1023
|
* @deprecated Please use the module level {@link LoadAssetContainerAsync} instead
|
|
993
1024
|
*/
|
|
994
1025
|
static LoadAssetContainer(rootUrl, sceneFilename, scene, onSuccess, onProgress, onError, pluginExtension, name) {
|
|
1026
|
+
// eslint-disable-next-line github/no-then
|
|
995
1027
|
loadAssetContainerImplAsync(rootUrl, sceneFilename, scene, onSuccess, onProgress, onError, pluginExtension, name).catch((error) => onError?.((scene ?? EngineStore.LastCreatedScene), error?.message, error));
|
|
996
1028
|
}
|
|
997
1029
|
/**
|
|
@@ -1006,7 +1038,7 @@ export class SceneLoader {
|
|
|
1006
1038
|
* @deprecated Please use the module level {@link LoadAssetContainerAsync} instead
|
|
1007
1039
|
*/
|
|
1008
1040
|
static async LoadAssetContainerAsync(rootUrl, sceneFilename, scene, onProgress, pluginExtension, name) {
|
|
1009
|
-
return loadAssetContainerSharedAsync(rootUrl, sceneFilename, scene, onProgress, pluginExtension, name);
|
|
1041
|
+
return await loadAssetContainerSharedAsync(rootUrl, sceneFilename, scene, onProgress, pluginExtension, name);
|
|
1010
1042
|
}
|
|
1011
1043
|
/**
|
|
1012
1044
|
* Import animations from a file into a scene
|
|
@@ -1024,7 +1056,9 @@ export class SceneLoader {
|
|
|
1024
1056
|
* @deprecated Please use the module level {@link ImportAnimationsAsync} instead
|
|
1025
1057
|
*/
|
|
1026
1058
|
static ImportAnimations(rootUrl, sceneFilename, scene, overwriteAnimations, animationGroupLoadingMode, targetConverter, onSuccess, onProgress, onError, pluginExtension, name) {
|
|
1027
|
-
importAnimationsImplAsync(rootUrl, sceneFilename, scene, overwriteAnimations, animationGroupLoadingMode, targetConverter, onSuccess, onProgress, onError, pluginExtension, name
|
|
1059
|
+
importAnimationsImplAsync(rootUrl, sceneFilename, scene, overwriteAnimations, animationGroupLoadingMode, targetConverter, onSuccess, onProgress, onError, pluginExtension, name
|
|
1060
|
+
// eslint-disable-next-line github/no-then
|
|
1061
|
+
).catch((error) => onError?.((scene ?? EngineStore.LastCreatedScene), error?.message, error));
|
|
1028
1062
|
}
|
|
1029
1063
|
/**
|
|
1030
1064
|
* Import animations from a file into a scene
|
|
@@ -1047,7 +1081,7 @@ export class SceneLoader {
|
|
|
1047
1081
|
onSuccess, onProgress,
|
|
1048
1082
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
1049
1083
|
onError, pluginExtension, name) {
|
|
1050
|
-
return importAnimationsSharedAsync(rootUrl, sceneFilename, scene, overwriteAnimations, animationGroupLoadingMode, targetConverter, onProgress, pluginExtension, name);
|
|
1084
|
+
return await importAnimationsSharedAsync(rootUrl, sceneFilename, scene, overwriteAnimations, animationGroupLoadingMode, targetConverter, onProgress, pluginExtension, name);
|
|
1051
1085
|
}
|
|
1052
1086
|
}
|
|
1053
1087
|
/**
|