@babylonjs/core 6.41.0 → 6.41.2
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/Animations/animatable.js +1 -2
- package/Animations/animatable.js.map +1 -1
- package/Animations/animation.js +4 -6
- package/Animations/animation.js.map +1 -1
- package/Animations/animationGroup.js +3 -3
- package/Animations/animationGroup.js.map +1 -1
- package/Animations/runtimeAnimation.js +1 -1
- package/Animations/runtimeAnimation.js.map +1 -1
- package/Audio/audioEngine.js +3 -5
- package/Audio/audioEngine.js.map +1 -1
- package/Audio/audioSceneComponent.js +1 -2
- package/Audio/audioSceneComponent.js.map +1 -1
- package/Audio/sound.js +48 -74
- package/Audio/sound.js.map +1 -1
- package/Audio/soundTrack.js +6 -12
- package/Audio/soundTrack.js.map +1 -1
- package/BakedVertexAnimation/bakedVertexAnimationManager.js +1 -2
- package/BakedVertexAnimation/bakedVertexAnimationManager.js.map +1 -1
- package/Behaviors/Cameras/autoRotationBehavior.js +1 -1
- package/Behaviors/Cameras/autoRotationBehavior.js.map +1 -1
- package/Behaviors/Meshes/fadeInOutBehavior.js +2 -4
- package/Behaviors/Meshes/fadeInOutBehavior.js.map +1 -1
- package/Behaviors/Meshes/followBehavior.js +1 -2
- package/Behaviors/Meshes/followBehavior.js.map +1 -1
- package/Behaviors/Meshes/handConstraintBehavior.js +2 -2
- package/Behaviors/Meshes/handConstraintBehavior.js.map +1 -1
- package/Bones/bone.js +4 -6
- package/Bones/bone.js.map +1 -1
- package/Bones/skeleton.js +2 -3
- package/Bones/skeleton.js.map +1 -1
- package/Buffers/buffer.align.js +5 -8
- package/Buffers/buffer.align.js.map +1 -1
- package/Buffers/buffer.js +6 -8
- package/Buffers/buffer.js.map +1 -1
- package/Cameras/Inputs/BaseCameraPointersInput.js +3 -4
- package/Cameras/Inputs/BaseCameraPointersInput.js.map +1 -1
- package/Cameras/Inputs/arcRotateCameraMouseWheelInput.js +3 -5
- package/Cameras/Inputs/arcRotateCameraMouseWheelInput.js.map +1 -1
- package/Cameras/Inputs/flyCameraMouseInput.js +2 -2
- package/Cameras/Inputs/flyCameraMouseInput.js.map +1 -1
- package/Cameras/Inputs/freeCameraMouseInput.js +2 -2
- package/Cameras/Inputs/freeCameraMouseInput.js.map +1 -1
- package/Cameras/arcRotateCamera.js +1 -2
- package/Cameras/arcRotateCamera.js.map +1 -1
- package/Cameras/camera.d.ts +5 -0
- package/Cameras/camera.js +18 -11
- package/Cameras/camera.js.map +1 -1
- package/Collisions/pickingInfo.js +1 -1
- package/Collisions/pickingInfo.js.map +1 -1
- package/Compute/computeEffect.js +5 -8
- package/Compute/computeEffect.js.map +1 -1
- package/Compute/computeShader.js +12 -9
- package/Compute/computeShader.js.map +1 -1
- package/Culling/Octrees/octreeSceneComponent.js +1 -2
- package/Culling/Octrees/octreeSceneComponent.js.map +1 -1
- package/Culling/boundingBox.js +2 -3
- package/Culling/boundingBox.js.map +1 -1
- package/Culling/ray.d.ts +6 -1
- package/Culling/ray.js +9 -4
- package/Culling/ray.js.map +1 -1
- package/Debug/debugLayer.js +4 -1
- package/Debug/debugLayer.js.map +1 -1
- package/Debug/directionalLightFrustumViewer.js +7 -9
- package/Debug/directionalLightFrustumViewer.js.map +1 -1
- package/Debug/physicsViewer.js +5 -7
- package/Debug/physicsViewer.js.map +1 -1
- package/Debug/rayHelper.js +1 -2
- package/Debug/rayHelper.js.map +1 -1
- package/Debug/skeletonViewer.js +26 -31
- package/Debug/skeletonViewer.js.map +1 -1
- package/Decorators/nodeDecorator.js +1 -1
- package/Decorators/nodeDecorator.js.map +1 -1
- package/DeviceInput/InputDevices/deviceSourceManager.js +3 -5
- package/DeviceInput/InputDevices/deviceSourceManager.js.map +1 -1
- package/DeviceInput/eventFactory.js +1 -1
- package/DeviceInput/eventFactory.js.map +1 -1
- package/DeviceInput/internalDeviceSourceManager.js +1 -2
- package/DeviceInput/internalDeviceSourceManager.js.map +1 -1
- package/DeviceInput/webDeviceInputSystem.js +9 -12
- package/DeviceInput/webDeviceInputSystem.js.map +1 -1
- package/Engines/Extensions/engine.cubeTexture.js +6 -1
- package/Engines/Extensions/engine.cubeTexture.js.map +1 -1
- package/Engines/Extensions/engine.multiRender.js +3 -4
- package/Engines/Extensions/engine.multiRender.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.readTexture.js +2 -3
- package/Engines/Extensions/engine.readTexture.js.map +1 -1
- package/Engines/Extensions/engine.renderTarget.js +9 -5
- package/Engines/Extensions/engine.renderTarget.js.map +1 -1
- package/Engines/Extensions/engine.renderTargetCube.js +9 -1
- package/Engines/Extensions/engine.renderTargetCube.js.map +1 -1
- package/Engines/Extensions/engine.views.js +1 -2
- package/Engines/Extensions/engine.views.js.map +1 -1
- package/Engines/Processors/shaderCodeNode.js +6 -7
- package/Engines/Processors/shaderCodeNode.js.map +1 -1
- package/Engines/Processors/shaderProcessor.js +6 -11
- package/Engines/Processors/shaderProcessor.js.map +1 -1
- package/Engines/WebGL/webGLHardwareTexture.js +1 -2
- package/Engines/WebGL/webGLHardwareTexture.js.map +1 -1
- package/Engines/WebGL/webGLRenderTargetWrapper.js +3 -5
- package/Engines/WebGL/webGLRenderTargetWrapper.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.cubeTexture.js +9 -2
- package/Engines/WebGPU/Extensions/engine.cubeTexture.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.dynamicTexture.js +1 -2
- package/Engines/WebGPU/Extensions/engine.dynamicTexture.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.multiRender.js +5 -6
- package/Engines/WebGPU/Extensions/engine.multiRender.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.query.js +2 -4
- package/Engines/WebGPU/Extensions/engine.query.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.rawTexture.js +4 -4
- package/Engines/WebGPU/Extensions/engine.rawTexture.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.renderTarget.js +11 -5
- package/Engines/WebGPU/Extensions/engine.renderTarget.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.renderTargetCube.js +11 -3
- package/Engines/WebGPU/Extensions/engine.renderTargetCube.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.storageBuffer.js +2 -3
- package/Engines/WebGPU/Extensions/engine.storageBuffer.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.textureSampler.js +1 -2
- package/Engines/WebGPU/Extensions/engine.textureSampler.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.videoTexture.js +1 -2
- package/Engines/WebGPU/Extensions/engine.videoTexture.js.map +1 -1
- package/Engines/WebGPU/webgpuBufferManager.js +1 -1
- package/Engines/WebGPU/webgpuBufferManager.js.map +1 -1
- package/Engines/WebGPU/webgpuCacheBindGroups.js +6 -7
- package/Engines/WebGPU/webgpuCacheBindGroups.js.map +1 -1
- package/Engines/WebGPU/webgpuCacheRenderPipeline.js +15 -20
- package/Engines/WebGPU/webgpuCacheRenderPipeline.js.map +1 -1
- package/Engines/WebGPU/webgpuCacheSampler.js +10 -5
- package/Engines/WebGPU/webgpuCacheSampler.js.map +1 -1
- package/Engines/WebGPU/webgpuClearQuad.js +2 -3
- package/Engines/WebGPU/webgpuClearQuad.js.map +1 -1
- package/Engines/WebGPU/webgpuComputePipelineContext.js +1 -2
- package/Engines/WebGPU/webgpuComputePipelineContext.js.map +1 -1
- package/Engines/WebGPU/webgpuDepthCullingState.js +2 -2
- package/Engines/WebGPU/webgpuDepthCullingState.js.map +1 -1
- package/Engines/WebGPU/webgpuDrawContext.js +1 -2
- package/Engines/WebGPU/webgpuDrawContext.js.map +1 -1
- package/Engines/WebGPU/webgpuHardwareTexture.js +4 -6
- package/Engines/WebGPU/webgpuHardwareTexture.js.map +1 -1
- package/Engines/WebGPU/webgpuMaterialContext.js +2 -3
- package/Engines/WebGPU/webgpuMaterialContext.js.map +1 -1
- package/Engines/WebGPU/webgpuOcclusionQuery.js +3 -5
- package/Engines/WebGPU/webgpuOcclusionQuery.js.map +1 -1
- package/Engines/WebGPU/webgpuPipelineContext.js +2 -4
- package/Engines/WebGPU/webgpuPipelineContext.js.map +1 -1
- package/Engines/WebGPU/webgpuQuerySet.js +1 -1
- package/Engines/WebGPU/webgpuQuerySet.js.map +1 -1
- package/Engines/WebGPU/webgpuShaderProcessingContext.js +2 -4
- package/Engines/WebGPU/webgpuShaderProcessingContext.js.map +1 -1
- package/Engines/WebGPU/webgpuShaderProcessorsGLSL.js +2 -4
- package/Engines/WebGPU/webgpuShaderProcessorsGLSL.js.map +1 -1
- package/Engines/WebGPU/webgpuShaderProcessorsWGSL.js +5 -4
- package/Engines/WebGPU/webgpuShaderProcessorsWGSL.js.map +1 -1
- package/Engines/WebGPU/webgpuStencilStateComposer.js +1 -2
- package/Engines/WebGPU/webgpuStencilStateComposer.js.map +1 -1
- package/Engines/WebGPU/webgpuTextureManager.js +40 -43
- package/Engines/WebGPU/webgpuTextureManager.js.map +1 -1
- package/Engines/WebGPU/webgpuTimestampQuery.js +12 -7
- package/Engines/WebGPU/webgpuTimestampQuery.js.map +1 -1
- package/Engines/WebGPU/webgpuTintWASM.js +4 -1
- package/Engines/WebGPU/webgpuTintWASM.js.map +1 -1
- package/Engines/engine.js +4 -7
- package/Engines/engine.js.map +1 -1
- package/Engines/nativeEngine.js +16 -22
- package/Engines/nativeEngine.js.map +1 -1
- package/Engines/nullEngine.js +9 -1
- package/Engines/nullEngine.js.map +1 -1
- package/Engines/renderTargetWrapper.js +11 -16
- package/Engines/renderTargetWrapper.js.map +1 -1
- package/Engines/thinEngine.js +32 -44
- package/Engines/thinEngine.js.map +1 -1
- package/Engines/webgpuEngine.js +77 -95
- package/Engines/webgpuEngine.js.map +1 -1
- package/FlowGraph/Blocks/Event/flowGraphMeshPickEventBlock.js +2 -3
- package/FlowGraph/Blocks/Event/flowGraphMeshPickEventBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/Animation/flowGraphPlayAnimationBlock.js +3 -6
- package/FlowGraph/Blocks/Execution/Animation/flowGraphPlayAnimationBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphCounterBlock.js +1 -2
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphCounterBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphMultiGateBlock.js +1 -2
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphMultiGateBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWhileLoopBlock.js +2 -4
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWhileLoopBlock.js.map +1 -1
- package/FlowGraph/flowGraph.js +1 -2
- package/FlowGraph/flowGraph.js.map +1 -1
- package/FlowGraph/flowGraphBlock.js +2 -4
- package/FlowGraph/flowGraphBlock.js.map +1 -1
- package/FlowGraph/flowGraphContext.js +1 -2
- package/FlowGraph/flowGraphContext.js.map +1 -1
- package/FlowGraph/flowGraphCoordinator.js +4 -7
- package/FlowGraph/flowGraphCoordinator.js.map +1 -1
- package/FlowGraph/flowGraphSignalConnection.js +1 -2
- package/FlowGraph/flowGraphSignalConnection.js.map +1 -1
- package/FlowGraph/serialization.js +2 -3
- package/FlowGraph/serialization.js.map +1 -1
- package/Gamepads/gamepadManager.js +1 -1
- package/Gamepads/gamepadManager.js.map +1 -1
- package/Gizmos/axisDragGizmo.js +2 -4
- package/Gizmos/axisDragGizmo.js.map +1 -1
- package/Gizmos/axisScaleGizmo.js +5 -8
- package/Gizmos/axisScaleGizmo.js.map +1 -1
- package/Gizmos/boundingBoxGizmo.js +1 -1
- package/Gizmos/boundingBoxGizmo.js.map +1 -1
- package/Gizmos/cameraGizmo.js +2 -3
- package/Gizmos/cameraGizmo.js.map +1 -1
- package/Gizmos/gizmo.js +4 -7
- package/Gizmos/gizmo.js.map +1 -1
- package/Gizmos/gizmoManager.js +3 -4
- package/Gizmos/gizmoManager.js.map +1 -1
- package/Gizmos/planeDragGizmo.js +2 -4
- package/Gizmos/planeDragGizmo.js.map +1 -1
- package/Gizmos/planeRotationGizmo.js +2 -4
- package/Gizmos/planeRotationGizmo.js.map +1 -1
- package/Helpers/environmentHelper.js +8 -2
- package/Helpers/environmentHelper.js.map +1 -1
- package/Helpers/videoDome.js +1 -2
- package/Helpers/videoDome.js.map +1 -1
- package/Inputs/scene.inputManager.js +8 -10
- package/Inputs/scene.inputManager.js.map +1 -1
- package/Layers/effectLayer.js +16 -10
- package/Layers/effectLayer.js.map +1 -1
- package/Layers/glowLayer.js +16 -6
- package/Layers/glowLayer.js.map +1 -1
- package/Layers/highlightLayer.js +12 -3
- package/Layers/highlightLayer.js.map +1 -1
- package/Layers/layer.js +1 -2
- package/Layers/layer.js.map +1 -1
- package/LensFlares/lensFlareSystem.js +1 -2
- package/LensFlares/lensFlareSystem.js.map +1 -1
- package/Lights/Shadows/cascadedShadowGenerator.js +21 -25
- package/Lights/Shadows/cascadedShadowGenerator.js.map +1 -1
- package/Lights/Shadows/shadowGenerator.js +18 -21
- package/Lights/Shadows/shadowGenerator.js.map +1 -1
- package/Lights/light.js +2 -4
- package/Lights/light.js.map +1 -1
- package/Lights/shadowLight.js +1 -1
- package/Lights/shadowLight.js.map +1 -1
- package/Loading/Plugins/babylonFileLoader.js +1 -2
- package/Loading/Plugins/babylonFileLoader.js.map +1 -1
- package/Loading/sceneLoader.js +1 -1
- package/Loading/sceneLoader.js.map +1 -1
- package/Materials/GreasedLine/greasedLinePluginMaterial.js +26 -32
- package/Materials/GreasedLine/greasedLinePluginMaterial.js.map +1 -1
- package/Materials/GreasedLine/greasedLineSimpleMaterial.js +22 -27
- package/Materials/GreasedLine/greasedLineSimpleMaterial.js.map +1 -1
- package/Materials/Node/Blocks/Dual/clipPlanesBlock.js +6 -7
- package/Materials/Node/Blocks/Dual/clipPlanesBlock.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/reflectionTextureBaseBlock.js +1 -2
- package/Materials/Node/Blocks/Dual/reflectionTextureBaseBlock.js.map +1 -1
- package/Materials/Node/Blocks/Dual/sceneDepthBlock.js +1 -1
- package/Materials/Node/Blocks/Dual/sceneDepthBlock.js.map +1 -1
- package/Materials/Node/Blocks/Dual/textureBlock.js +10 -16
- package/Materials/Node/Blocks/Dual/textureBlock.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/TBNBlock.js +2 -3
- package/Materials/Node/Blocks/Fragment/TBNBlock.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/fragmentOutputBlock.js +1 -2
- package/Materials/Node/Blocks/Fragment/fragmentOutputBlock.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/imageProcessingBlock.js +2 -4
- package/Materials/Node/Blocks/Fragment/imageProcessingBlock.js.map +1 -1
- package/Materials/Node/Blocks/Input/inputBlock.js +1 -2
- package/Materials/Node/Blocks/Input/inputBlock.js.map +1 -1
- package/Materials/Node/Blocks/PBR/clearCoatBlock.js +24 -26
- package/Materials/Node/Blocks/PBR/clearCoatBlock.js.map +1 -1
- package/Materials/Node/Blocks/PBR/iridescenceBlock.js +3 -3
- package/Materials/Node/Blocks/PBR/iridescenceBlock.js.map +1 -1
- package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.js +45 -49
- package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.js.map +1 -1
- package/Materials/Node/Blocks/PBR/reflectionBlock.js +1 -2
- package/Materials/Node/Blocks/PBR/reflectionBlock.js.map +1 -1
- package/Materials/Node/Blocks/PBR/refractionBlock.js +1 -2
- package/Materials/Node/Blocks/PBR/refractionBlock.js.map +1 -1
- package/Materials/Node/Blocks/PBR/sheenBlock.js +13 -13
- package/Materials/Node/Blocks/PBR/sheenBlock.js.map +1 -1
- package/Materials/Node/Blocks/PBR/subSurfaceBlock.js +27 -28
- package/Materials/Node/Blocks/PBR/subSurfaceBlock.js.map +1 -1
- package/Materials/Node/Blocks/Teleport/teleportOutBlock.js +1 -2
- package/Materials/Node/Blocks/Teleport/teleportOutBlock.js.map +1 -1
- package/Materials/Node/Blocks/Vertex/instancesBlock.js +2 -2
- package/Materials/Node/Blocks/Vertex/instancesBlock.js.map +1 -1
- package/Materials/Node/Blocks/Vertex/morphTargetsBlock.js +43 -33
- package/Materials/Node/Blocks/Vertex/morphTargetsBlock.js.map +1 -1
- package/Materials/Node/Blocks/biPlanarBlock.js +1 -2
- package/Materials/Node/Blocks/biPlanarBlock.js.map +1 -1
- package/Materials/Node/Blocks/cloudBlock.js +2 -3
- package/Materials/Node/Blocks/cloudBlock.js.map +1 -1
- package/Materials/Node/Blocks/colorMergerBlock.js +4 -5
- package/Materials/Node/Blocks/colorMergerBlock.js.map +1 -1
- package/Materials/Node/Blocks/customBlock.js +4 -6
- package/Materials/Node/Blocks/customBlock.js.map +1 -1
- package/Materials/Node/Blocks/meshAttributeExistsBlock.js +2 -4
- package/Materials/Node/Blocks/meshAttributeExistsBlock.js.map +1 -1
- package/Materials/Node/Blocks/triPlanarBlock.js +14 -23
- package/Materials/Node/Blocks/triPlanarBlock.js.map +1 -1
- package/Materials/Node/Blocks/vectorMergerBlock.js +4 -5
- package/Materials/Node/Blocks/vectorMergerBlock.js.map +1 -1
- package/Materials/Node/nodeMaterial.js +16 -11
- package/Materials/Node/nodeMaterial.js.map +1 -1
- package/Materials/Node/nodeMaterialBlock.js +3 -4
- package/Materials/Node/nodeMaterialBlock.js.map +1 -1
- package/Materials/Node/nodeMaterialBuildState.js +1 -1
- package/Materials/Node/nodeMaterialBuildState.js.map +1 -1
- package/Materials/PBR/pbrBaseMaterial.js +25 -28
- package/Materials/PBR/pbrBaseMaterial.js.map +1 -1
- package/Materials/PBR/pbrClearCoatConfiguration.js +6 -9
- package/Materials/PBR/pbrClearCoatConfiguration.js.map +1 -1
- package/Materials/PBR/pbrIridescenceConfiguration.js +4 -7
- package/Materials/PBR/pbrIridescenceConfiguration.js.map +1 -1
- package/Materials/PBR/pbrSheenConfiguration.js +4 -7
- package/Materials/PBR/pbrSheenConfiguration.js.map +1 -1
- package/Materials/Textures/Loaders/envTextureLoader.js +2 -2
- package/Materials/Textures/Loaders/envTextureLoader.js.map +1 -1
- package/Materials/Textures/Packer/packer.js +13 -14
- package/Materials/Textures/Packer/packer.js.map +1 -1
- package/Materials/Textures/Procedurals/noiseProceduralTexture.js +1 -2
- package/Materials/Textures/Procedurals/noiseProceduralTexture.js.map +1 -1
- package/Materials/Textures/Procedurals/proceduralTexture.js +19 -11
- package/Materials/Textures/Procedurals/proceduralTexture.js.map +1 -1
- package/Materials/Textures/baseTexture.js +2 -4
- package/Materials/Textures/baseTexture.js.map +1 -1
- package/Materials/Textures/cubeTexture.js +7 -13
- package/Materials/Textures/cubeTexture.js.map +1 -1
- package/Materials/Textures/dynamicTexture.js +1 -2
- package/Materials/Textures/dynamicTexture.js.map +1 -1
- package/Materials/Textures/hdrCubeTexture.js +2 -4
- package/Materials/Textures/hdrCubeTexture.js.map +1 -1
- package/Materials/Textures/htmlElementTexture.js +5 -3
- package/Materials/Textures/htmlElementTexture.js.map +1 -1
- package/Materials/Textures/internalTexture.js +3 -5
- package/Materials/Textures/internalTexture.js.map +1 -1
- package/Materials/Textures/mirrorTexture.js +3 -6
- package/Materials/Textures/mirrorTexture.js.map +1 -1
- package/Materials/Textures/multiRenderTarget.js +5 -8
- package/Materials/Textures/multiRenderTarget.js.map +1 -1
- package/Materials/Textures/rawTexture.js +1 -1
- package/Materials/Textures/rawTexture.js.map +1 -1
- package/Materials/Textures/renderTargetTexture.js +22 -34
- package/Materials/Textures/renderTargetTexture.js.map +1 -1
- package/Materials/Textures/texture.js +16 -21
- package/Materials/Textures/texture.js.map +1 -1
- package/Materials/Textures/thinRenderTargetTexture.js +2 -4
- package/Materials/Textures/thinRenderTargetTexture.js.map +1 -1
- package/Materials/Textures/thinTexture.js +1 -1
- package/Materials/Textures/thinTexture.js.map +1 -1
- package/Materials/Textures/videoTexture.js +12 -10
- package/Materials/Textures/videoTexture.js.map +1 -1
- package/Materials/clipPlaneMaterialHelper.js +18 -21
- package/Materials/clipPlaneMaterialHelper.js.map +1 -1
- package/Materials/drawWrapper.js +2 -4
- package/Materials/drawWrapper.js.map +1 -1
- package/Materials/effect.d.ts +4 -0
- package/Materials/effect.js +18 -18
- package/Materials/effect.js.map +1 -1
- package/Materials/effectRenderer.js +2 -3
- package/Materials/effectRenderer.js.map +1 -1
- package/Materials/material.decalMapConfiguration.js +3 -3
- package/Materials/material.decalMapConfiguration.js.map +1 -1
- package/Materials/material.detailMapConfiguration.js +1 -2
- package/Materials/material.detailMapConfiguration.js.map +1 -1
- package/Materials/material.js +7 -4
- package/Materials/material.js.map +1 -1
- package/Materials/materialDefines.js +5 -6
- package/Materials/materialDefines.js.map +1 -1
- package/Materials/materialHelper.d.ts +1 -1
- package/Materials/materialHelper.js +3 -4
- package/Materials/materialHelper.js.map +1 -1
- package/Materials/materialPluginManager.js +3 -5
- package/Materials/materialPluginManager.js.map +1 -1
- package/Materials/meshDebugPluginMaterial.js +13 -14
- package/Materials/meshDebugPluginMaterial.js.map +1 -1
- package/Materials/multiMaterial.js +1 -2
- package/Materials/multiMaterial.js.map +1 -1
- package/Materials/shaderMaterial.d.ts +1 -1
- package/Materials/shaderMaterial.js +64 -32
- package/Materials/shaderMaterial.js.map +1 -1
- package/Materials/shadowDepthWrapper.js +24 -23
- package/Materials/shadowDepthWrapper.js.map +1 -1
- package/Materials/standardMaterial.js +10 -12
- package/Materials/standardMaterial.js.map +1 -1
- package/Materials/uniformBuffer.js +1 -1
- package/Materials/uniformBuffer.js.map +1 -1
- package/Maths/math.vector.js +1 -2
- package/Maths/math.vector.js.map +1 -1
- package/Meshes/Builders/decalBuilder.js +26 -29
- package/Meshes/Builders/decalBuilder.js.map +1 -1
- package/Meshes/Builders/greasedLineBuilder.js +16 -16
- package/Meshes/Builders/greasedLineBuilder.js.map +1 -1
- package/Meshes/Builders/groundBuilder.d.ts +5 -1
- package/Meshes/Builders/groundBuilder.js +13 -2
- package/Meshes/Builders/groundBuilder.js.map +1 -1
- package/Meshes/Builders/textBuilder.js +2 -3
- package/Meshes/Builders/textBuilder.js.map +1 -1
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.d.ts +9 -1
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.js +141 -12
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.js.map +1 -1
- package/Meshes/GreasedLine/greasedLineBaseMesh.js +8 -11
- package/Meshes/GreasedLine/greasedLineBaseMesh.js.map +1 -1
- package/Meshes/GreasedLine/greasedLineMesh.js +3 -5
- package/Meshes/GreasedLine/greasedLineMesh.js.map +1 -1
- package/Meshes/GreasedLine/greasedLineRibbonMesh.js +13 -18
- package/Meshes/GreasedLine/greasedLineRibbonMesh.js.map +1 -1
- package/Meshes/Node/Blocks/Teleport/teleportOutBlock.js +1 -2
- package/Meshes/Node/Blocks/Teleport/teleportOutBlock.js.map +1 -1
- package/Meshes/Node/Blocks/geometryTrigonometryBlock.d.ts +18 -18
- package/Meshes/Node/Blocks/geometryTrigonometryBlock.js +18 -18
- package/Meshes/Node/Blocks/geometryTrigonometryBlock.js.map +1 -1
- package/Meshes/Node/nodeGeometry.js +6 -3
- package/Meshes/Node/nodeGeometry.js.map +1 -1
- package/Meshes/Node/nodeGeometryBlock.js +1 -1
- package/Meshes/Node/nodeGeometryBlock.js.map +1 -1
- package/Meshes/Node/nodeGeometryBlockConnectionPoint.js +1 -2
- package/Meshes/Node/nodeGeometryBlockConnectionPoint.js.map +1 -1
- package/Meshes/Node/nodeGeometryBuildState.js +1 -2
- package/Meshes/Node/nodeGeometryBuildState.js.map +1 -1
- package/Meshes/abstractMesh.js +6 -10
- package/Meshes/abstractMesh.js.map +1 -1
- package/Meshes/csg.js +1 -2
- package/Meshes/csg.js.map +1 -1
- package/Meshes/geometry.js +1 -1
- package/Meshes/geometry.js.map +1 -1
- package/Meshes/instancedMesh.js +5 -10
- package/Meshes/instancedMesh.js.map +1 -1
- package/Meshes/mesh.js +13 -22
- package/Meshes/mesh.js.map +1 -1
- package/Meshes/mesh.vertexData.js +3 -4
- package/Meshes/mesh.vertexData.js.map +1 -1
- package/Meshes/meshUVSpaceRenderer.js +18 -15
- package/Meshes/meshUVSpaceRenderer.js.map +1 -1
- package/Meshes/subMesh.js +8 -14
- package/Meshes/subMesh.js.map +1 -1
- package/Meshes/thinInstanceMesh.js +12 -18
- package/Meshes/thinInstanceMesh.js.map +1 -1
- package/Meshes/trailMesh.js +2 -3
- package/Meshes/trailMesh.js.map +1 -1
- package/Misc/HighDynamicRange/cubemapToSphericalPolynomial.js +1 -2
- package/Misc/HighDynamicRange/cubemapToSphericalPolynomial.js.map +1 -1
- package/Misc/PerformanceViewer/performanceViewerCollectionStrategies.js +9 -14
- package/Misc/PerformanceViewer/performanceViewerCollectionStrategies.js.map +1 -1
- package/Misc/PerformanceViewer/performanceViewerCollector.js +2 -3
- package/Misc/PerformanceViewer/performanceViewerCollector.js.map +1 -1
- package/Misc/arrayTools.js +1 -1
- package/Misc/arrayTools.js.map +1 -1
- package/Misc/basis.js +2 -3
- package/Misc/basis.js.map +1 -1
- package/Misc/dataStorage.js +1 -1
- package/Misc/dataStorage.js.map +1 -1
- package/Misc/deepCopier.js +1 -1
- package/Misc/deepCopier.js.map +1 -1
- package/Misc/environmentTextureTools.js +3 -4
- package/Misc/environmentTextureTools.js.map +1 -1
- package/Misc/equirectangularCapture.js +2 -3
- package/Misc/equirectangularCapture.js.map +1 -1
- package/Misc/fileTools.js +4 -4
- package/Misc/fileTools.js.map +1 -1
- package/Misc/greasedLineTools.js +3 -5
- package/Misc/greasedLineTools.js.map +1 -1
- package/Misc/logger.js +1 -2
- package/Misc/logger.js.map +1 -1
- package/Misc/minMaxReducer.js +2 -3
- package/Misc/minMaxReducer.js.map +1 -1
- package/Misc/pressureObserverWrapper.js +5 -8
- package/Misc/pressureObserverWrapper.js.map +1 -1
- package/Misc/sceneRecorder.js +1 -1
- package/Misc/sceneRecorder.js.map +1 -1
- package/Misc/screenshotTools.js +1 -1
- package/Misc/screenshotTools.js.map +1 -1
- package/Misc/textureTools.js +5 -5
- package/Misc/textureTools.js.map +1 -1
- package/Misc/timer.js +3 -5
- package/Misc/timer.js.map +1 -1
- package/Misc/tools.d.ts +3 -2
- package/Misc/tools.js +6 -5
- package/Misc/tools.js.map +1 -1
- package/Misc/trajectoryClassifier.js +3 -3
- package/Misc/trajectoryClassifier.js.map +1 -1
- package/Misc/videoRecorder.js +6 -4
- package/Misc/videoRecorder.js.map +1 -1
- package/Misc/virtualJoystick.js +4 -1
- package/Misc/virtualJoystick.js.map +1 -1
- package/Morph/morphTargetManager.js +1 -2
- package/Morph/morphTargetManager.js.map +1 -1
- package/Particles/EmitterTypes/meshParticleEmitter.js +1 -2
- package/Particles/EmitterTypes/meshParticleEmitter.js.map +1 -1
- package/Particles/baseParticleSystem.d.ts +4 -0
- package/Particles/baseParticleSystem.js +4 -0
- package/Particles/baseParticleSystem.js.map +1 -1
- package/Particles/computeShaderParticleSystem.js +3 -6
- package/Particles/computeShaderParticleSystem.js.map +1 -1
- package/Particles/gpuParticleSystem.d.ts +2 -2
- package/Particles/gpuParticleSystem.js +30 -20
- package/Particles/gpuParticleSystem.js.map +1 -1
- package/Particles/particleSystem.d.ts +3 -2
- package/Particles/particleSystem.js +33 -30
- package/Particles/particleSystem.js.map +1 -1
- package/Particles/particleSystemComponent.js +2 -3
- package/Particles/particleSystemComponent.js.map +1 -1
- package/Particles/pointsCloudSystem.js +5 -8
- package/Particles/pointsCloudSystem.js.map +1 -1
- package/Particles/solidParticleSystem.js +5 -7
- package/Particles/solidParticleSystem.js.map +1 -1
- package/Particles/webgl2ParticleSystem.js +1 -2
- package/Particles/webgl2ParticleSystem.js.map +1 -1
- package/Physics/castingResult.js +1 -1
- package/Physics/castingResult.js.map +1 -1
- package/Physics/joinedPhysicsEngineComponent.js +2 -2
- package/Physics/joinedPhysicsEngineComponent.js.map +1 -1
- package/Physics/physicsHelper.js +19 -21
- package/Physics/physicsHelper.js.map +1 -1
- package/Physics/v2/IPhysicsEnginePlugin.d.ts +20 -0
- package/Physics/v2/IPhysicsEnginePlugin.js.map +1 -1
- package/Physics/v2/Plugins/havokPlugin.js +48 -35
- package/Physics/v2/Plugins/havokPlugin.js.map +1 -1
- package/Physics/v2/physicsAggregate.js +10 -12
- package/Physics/v2/physicsAggregate.js.map +1 -1
- package/Physics/v2/physicsBody.js +2 -4
- package/Physics/v2/physicsBody.js.map +1 -1
- package/Physics/v2/physicsShape.js +1 -2
- package/Physics/v2/physicsShape.js.map +1 -1
- package/Physics/v2/ragdoll.js +6 -8
- package/Physics/v2/ragdoll.js.map +1 -1
- package/PostProcesses/RenderPipeline/Pipelines/ssao2RenderingPipeline.js +6 -8
- package/PostProcesses/RenderPipeline/Pipelines/ssao2RenderingPipeline.js.map +1 -1
- package/PostProcesses/RenderPipeline/Pipelines/ssrRenderingPipeline.js +14 -22
- package/PostProcesses/RenderPipeline/Pipelines/ssrRenderingPipeline.js.map +1 -1
- package/PostProcesses/colorCorrectionPostProcess.js +1 -1
- package/PostProcesses/colorCorrectionPostProcess.js.map +1 -1
- package/PostProcesses/postProcess.js +28 -34
- package/PostProcesses/postProcess.js.map +1 -1
- package/PostProcesses/postProcessManager.js +4 -6
- package/PostProcesses/postProcessManager.js.map +1 -1
- package/PostProcesses/screenSpaceReflectionPostProcess.js +2 -2
- package/PostProcesses/screenSpaceReflectionPostProcess.js.map +1 -1
- package/PostProcesses/volumetricLightScatteringPostProcess.js +4 -7
- package/PostProcesses/volumetricLightScatteringPostProcess.js.map +1 -1
- package/PostProcesses/vrMultiviewToSingleviewPostProcess.js +1 -1
- package/PostProcesses/vrMultiviewToSingleviewPostProcess.js.map +1 -1
- package/Probes/reflectionProbe.js +2 -4
- package/Probes/reflectionProbe.js.map +1 -1
- package/Rendering/GlobalIllumination/giRSMManager.js +22 -19
- package/Rendering/GlobalIllumination/giRSMManager.js.map +1 -1
- package/Rendering/boundingBoxRenderer.js +2 -3
- package/Rendering/boundingBoxRenderer.js.map +1 -1
- package/Rendering/depthPeelingRenderer.js +2 -4
- package/Rendering/depthPeelingRenderer.js.map +1 -1
- package/Rendering/depthPeelingSceneComponent.js +2 -4
- package/Rendering/depthPeelingSceneComponent.js.map +1 -1
- package/Rendering/depthRenderer.js +10 -13
- package/Rendering/depthRenderer.js.map +1 -1
- package/Rendering/edgesRenderer.js +8 -11
- package/Rendering/edgesRenderer.js.map +1 -1
- package/Rendering/fluidRenderer/fluidRenderer.js +6 -11
- package/Rendering/fluidRenderer/fluidRenderer.js.map +1 -1
- package/Rendering/fluidRenderer/fluidRenderingObject.js +3 -5
- package/Rendering/fluidRenderer/fluidRenderingObject.js.map +1 -1
- package/Rendering/fluidRenderer/fluidRenderingObjectCustomParticles.js +2 -4
- package/Rendering/fluidRenderer/fluidRenderingObjectCustomParticles.js.map +1 -1
- package/Rendering/fluidRenderer/fluidRenderingTargetRenderer.js +30 -36
- package/Rendering/fluidRenderer/fluidRenderingTargetRenderer.js.map +1 -1
- package/Rendering/fluidRenderer/fluidRenderingTextures.js +5 -7
- package/Rendering/fluidRenderer/fluidRenderingTextures.js.map +1 -1
- package/Rendering/geometryBufferRenderer.js +3 -2
- package/Rendering/geometryBufferRenderer.js.map +1 -1
- package/Rendering/outlineRenderer.js +5 -4
- package/Rendering/outlineRenderer.js.map +1 -1
- package/Rendering/prePassRenderer.js +3 -6
- package/Rendering/prePassRenderer.js.map +1 -1
- package/Rendering/reflectiveShadowMap.d.ts +1 -0
- package/Rendering/reflectiveShadowMap.js +5 -5
- package/Rendering/reflectiveShadowMap.js.map +1 -1
- package/Shaders/color.fragment.d.ts +2 -0
- package/Shaders/color.fragment.js +4 -0
- package/Shaders/color.fragment.js.map +1 -1
- package/Shaders/color.vertex.d.ts +2 -0
- package/Shaders/color.vertex.js +7 -0
- package/Shaders/color.vertex.js.map +1 -1
- package/Shaders/gpuRenderParticles.fragment.d.ts +2 -0
- package/Shaders/gpuRenderParticles.fragment.js +4 -0
- package/Shaders/gpuRenderParticles.fragment.js.map +1 -1
- package/Shaders/gpuRenderParticles.vertex.d.ts +2 -0
- package/Shaders/gpuRenderParticles.vertex.js +5 -1
- package/Shaders/gpuRenderParticles.vertex.js.map +1 -1
- package/Shaders/particles.fragment.d.ts +2 -0
- package/Shaders/particles.fragment.js +4 -0
- package/Shaders/particles.fragment.js.map +1 -1
- package/Shaders/particles.vertex.d.ts +2 -0
- package/Shaders/particles.vertex.js +5 -1
- package/Shaders/particles.vertex.js.map +1 -1
- package/Sprites/spriteManager.js +1 -2
- package/Sprites/spriteManager.js.map +1 -1
- package/Sprites/spriteRenderer.js +5 -7
- package/Sprites/spriteRenderer.js.map +1 -1
- package/States/stencilStateComposer.js +2 -4
- package/States/stencilStateComposer.js.map +1 -1
- package/XR/features/WebXRAbstractFeature.js +6 -2
- package/XR/features/WebXRAbstractFeature.js.map +1 -1
- package/XR/features/WebXRAnchorSystem.js +1 -2
- package/XR/features/WebXRAnchorSystem.js.map +1 -1
- package/XR/features/WebXRControllerMovement.js +6 -7
- package/XR/features/WebXRControllerMovement.js.map +1 -1
- package/XR/features/WebXRControllerPhysics.js +17 -10
- package/XR/features/WebXRControllerPhysics.js.map +1 -1
- package/XR/features/WebXRControllerPointerSelection.js +1 -2
- package/XR/features/WebXRControllerPointerSelection.js.map +1 -1
- package/XR/features/WebXRControllerTeleportation.d.ts +1 -0
- package/XR/features/WebXRControllerTeleportation.js +6 -3
- package/XR/features/WebXRControllerTeleportation.js.map +1 -1
- package/XR/features/WebXRDepthSensing.js +3 -5
- package/XR/features/WebXRDepthSensing.js.map +1 -1
- package/XR/features/WebXRHandTracking.d.ts +1 -0
- package/XR/features/WebXRHandTracking.js +31 -28
- package/XR/features/WebXRHandTracking.js.map +1 -1
- package/XR/features/WebXRLayers.js +9 -11
- package/XR/features/WebXRLayers.js.map +1 -1
- package/XR/features/WebXRLightEstimation.js +3 -6
- package/XR/features/WebXRLightEstimation.js.map +1 -1
- package/XR/features/WebXRMeshDetector.js +2 -4
- package/XR/features/WebXRMeshDetector.js.map +1 -1
- package/XR/features/WebXRNearInteraction.js +21 -18
- package/XR/features/WebXRNearInteraction.js.map +1 -1
- package/XR/features/WebXRPlaneDetector.js +1 -2
- package/XR/features/WebXRPlaneDetector.js.map +1 -1
- package/XR/features/WebXRRawCameraAccess.js +2 -3
- package/XR/features/WebXRRawCameraAccess.js.map +1 -1
- package/XR/features/WebXRSpaceWarp.js +1 -1
- package/XR/features/WebXRSpaceWarp.js.map +1 -1
- package/XR/motionController/webXRAbstractMotionController.js +4 -1
- package/XR/motionController/webXRAbstractMotionController.js.map +1 -1
- package/XR/native/nativeXRFrame.js +1 -2
- package/XR/native/nativeXRFrame.js.map +1 -1
- package/XR/webXRCamera.js +1 -2
- package/XR/webXRCamera.js.map +1 -1
- package/XR/webXRDefaultExperience.js +28 -6
- package/XR/webXRDefaultExperience.js.map +1 -1
- package/XR/webXRExperienceHelper.js +5 -7
- package/XR/webXRExperienceHelper.js.map +1 -1
- package/XR/webXRFeaturesManager.js +4 -1
- package/XR/webXRFeaturesManager.js.map +1 -1
- package/XR/webXRInput.js +6 -1
- package/XR/webXRInput.js.map +1 -1
- package/XR/webXRInputSource.js +1 -2
- package/XR/webXRInputSource.js.map +1 -1
- package/XR/webXRSessionManager.js +16 -29
- package/XR/webXRSessionManager.js.map +1 -1
- package/assetContainer.js +4 -1
- package/assetContainer.js.map +1 -1
- package/package.json +1 -1
- package/scene.js +18 -17
- package/scene.js.map +1 -1
package/Audio/sound.js
CHANGED
|
@@ -28,11 +28,10 @@ export class Sound {
|
|
|
28
28
|
* Gets the current time for the sound.
|
|
29
29
|
*/
|
|
30
30
|
get currentTime() {
|
|
31
|
-
var _a;
|
|
32
31
|
if (this._htmlAudioElement) {
|
|
33
32
|
return this._htmlAudioElement.currentTime;
|
|
34
33
|
}
|
|
35
|
-
if (
|
|
34
|
+
if (Engine.audioEngine?.audioContext && (this.isPlaying || this.isPaused)) {
|
|
36
35
|
// The `_currentTime` member is only updated when the sound is paused. Add the time since the last start
|
|
37
36
|
// to get the actual current time.
|
|
38
37
|
const timeSinceLastStart = this.isPaused ? 0 : Engine.audioEngine.audioContext.currentTime - this._startTime;
|
|
@@ -77,7 +76,6 @@ export class Sound {
|
|
|
77
76
|
* @param options Objects to provide with the current available options: autoplay, loop, volume, spatialSound, maxDistance, rolloffFactor, refDistance, distanceModel, panningModel, streaming
|
|
78
77
|
*/
|
|
79
78
|
constructor(name, urlOrArrayBuffer, scene, readyToPlayCallback = null, options) {
|
|
80
|
-
var _a, _b, _c, _d, _e;
|
|
81
79
|
/**
|
|
82
80
|
* Does the sound autoplay once loaded.
|
|
83
81
|
*/
|
|
@@ -168,18 +166,18 @@ export class Sound {
|
|
|
168
166
|
if (options.volume !== undefined) {
|
|
169
167
|
this._volume = options.volume;
|
|
170
168
|
}
|
|
171
|
-
this._spatialSound =
|
|
172
|
-
this.maxDistance =
|
|
173
|
-
this.useCustomAttenuation =
|
|
169
|
+
this._spatialSound = options.spatialSound ?? false;
|
|
170
|
+
this.maxDistance = options.maxDistance ?? 100;
|
|
171
|
+
this.useCustomAttenuation = options.useCustomAttenuation ?? false;
|
|
174
172
|
this.rolloffFactor = options.rolloffFactor || 1;
|
|
175
173
|
this.refDistance = options.refDistance || 1;
|
|
176
174
|
this.distanceModel = options.distanceModel || "linear";
|
|
177
175
|
this._playbackRate = options.playbackRate || 1;
|
|
178
|
-
this._streaming =
|
|
176
|
+
this._streaming = options.streaming ?? false;
|
|
179
177
|
this._length = options.length;
|
|
180
178
|
this._offset = options.offset;
|
|
181
179
|
}
|
|
182
|
-
if (
|
|
180
|
+
if (Engine.audioEngine?.canUseWebAudio && Engine.audioEngine.audioContext) {
|
|
183
181
|
this._soundGain = Engine.audioEngine.audioContext.createGain();
|
|
184
182
|
this._soundGain.gain.value = this._volume;
|
|
185
183
|
this._inputAudioNode = this._soundGain;
|
|
@@ -347,8 +345,7 @@ export class Sound {
|
|
|
347
345
|
* Release the sound and its associated resources
|
|
348
346
|
*/
|
|
349
347
|
dispose() {
|
|
350
|
-
|
|
351
|
-
if ((_a = Engine.audioEngine) === null || _a === void 0 ? void 0 : _a.canUseWebAudio) {
|
|
348
|
+
if (Engine.audioEngine?.canUseWebAudio) {
|
|
352
349
|
if (this.isPlaying) {
|
|
353
350
|
this.stop();
|
|
354
351
|
}
|
|
@@ -402,8 +399,7 @@ export class Sound {
|
|
|
402
399
|
return "Sound";
|
|
403
400
|
}
|
|
404
401
|
_audioBufferLoaded(buffer) {
|
|
405
|
-
|
|
406
|
-
if (!((_a = Engine.audioEngine) === null || _a === void 0 ? void 0 : _a.audioContext)) {
|
|
402
|
+
if (!Engine.audioEngine?.audioContext) {
|
|
407
403
|
return;
|
|
408
404
|
}
|
|
409
405
|
this._audioBuffer = buffer;
|
|
@@ -416,8 +412,7 @@ export class Sound {
|
|
|
416
412
|
}
|
|
417
413
|
}
|
|
418
414
|
_soundLoaded(audioData) {
|
|
419
|
-
|
|
420
|
-
if (!((_a = Engine.audioEngine) === null || _a === void 0 ? void 0 : _a.audioContext)) {
|
|
415
|
+
if (!Engine.audioEngine?.audioContext) {
|
|
421
416
|
return;
|
|
422
417
|
}
|
|
423
418
|
Engine.audioEngine.audioContext.decodeAudioData(audioData, (buffer) => {
|
|
@@ -431,8 +426,7 @@ export class Sound {
|
|
|
431
426
|
* @param audioBuffer The audioBuffer containing the data
|
|
432
427
|
*/
|
|
433
428
|
setAudioBuffer(audioBuffer) {
|
|
434
|
-
|
|
435
|
-
if ((_a = Engine.audioEngine) === null || _a === void 0 ? void 0 : _a.canUseWebAudio) {
|
|
429
|
+
if (Engine.audioEngine?.canUseWebAudio) {
|
|
436
430
|
this._audioBuffer = audioBuffer;
|
|
437
431
|
this._isReadyToPlay = true;
|
|
438
432
|
}
|
|
@@ -442,19 +436,18 @@ export class Sound {
|
|
|
442
436
|
* @param options A JSON object containing values named as the object properties
|
|
443
437
|
*/
|
|
444
438
|
updateOptions(options) {
|
|
445
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
446
439
|
if (options) {
|
|
447
|
-
this.loop =
|
|
448
|
-
this.maxDistance =
|
|
449
|
-
this.useCustomAttenuation =
|
|
450
|
-
this.rolloffFactor =
|
|
451
|
-
this.refDistance =
|
|
452
|
-
this.distanceModel =
|
|
453
|
-
this._playbackRate =
|
|
454
|
-
this._length =
|
|
455
|
-
this.spatialSound =
|
|
456
|
-
this._setOffset(
|
|
457
|
-
this.setVolume(
|
|
440
|
+
this.loop = options.loop ?? this.loop;
|
|
441
|
+
this.maxDistance = options.maxDistance ?? this.maxDistance;
|
|
442
|
+
this.useCustomAttenuation = options.useCustomAttenuation ?? this.useCustomAttenuation;
|
|
443
|
+
this.rolloffFactor = options.rolloffFactor ?? this.rolloffFactor;
|
|
444
|
+
this.refDistance = options.refDistance ?? this.refDistance;
|
|
445
|
+
this.distanceModel = options.distanceModel ?? this.distanceModel;
|
|
446
|
+
this._playbackRate = options.playbackRate ?? this._playbackRate;
|
|
447
|
+
this._length = options.length ?? undefined;
|
|
448
|
+
this.spatialSound = options.spatialSound ?? this._spatialSound;
|
|
449
|
+
this._setOffset(options.offset ?? undefined);
|
|
450
|
+
this.setVolume(options.volume ?? this._volume);
|
|
458
451
|
this._updateSpatialParameters();
|
|
459
452
|
if (this.isPlaying) {
|
|
460
453
|
if (this._streaming && this._htmlAudioElement) {
|
|
@@ -481,12 +474,11 @@ export class Sound {
|
|
|
481
474
|
}
|
|
482
475
|
}
|
|
483
476
|
_createSpatialParameters() {
|
|
484
|
-
|
|
485
|
-
if (((_a = Engine.audioEngine) === null || _a === void 0 ? void 0 : _a.canUseWebAudio) && Engine.audioEngine.audioContext) {
|
|
477
|
+
if (Engine.audioEngine?.canUseWebAudio && Engine.audioEngine.audioContext) {
|
|
486
478
|
if (this._scene.headphone) {
|
|
487
479
|
this._panningModel = "HRTF";
|
|
488
480
|
}
|
|
489
|
-
this._soundPanner =
|
|
481
|
+
this._soundPanner = this._soundPanner ?? Engine.audioEngine.audioContext.createPanner();
|
|
490
482
|
if (this._soundPanner && this._outputAudioNode) {
|
|
491
483
|
this._updateSpatialParameters();
|
|
492
484
|
this._soundPanner.connect(this._outputAudioNode);
|
|
@@ -495,12 +487,11 @@ export class Sound {
|
|
|
495
487
|
}
|
|
496
488
|
}
|
|
497
489
|
_disableSpatialSound() {
|
|
498
|
-
var _a;
|
|
499
490
|
if (!this._spatialSound) {
|
|
500
491
|
return;
|
|
501
492
|
}
|
|
502
493
|
this._inputAudioNode = this._soundGain;
|
|
503
|
-
|
|
494
|
+
this._soundPanner?.disconnect();
|
|
504
495
|
this._soundPanner = null;
|
|
505
496
|
this._spatialSound = false;
|
|
506
497
|
}
|
|
@@ -548,8 +539,7 @@ export class Sound {
|
|
|
548
539
|
this._switchPanningModel();
|
|
549
540
|
}
|
|
550
541
|
_switchPanningModel() {
|
|
551
|
-
|
|
552
|
-
if (((_a = Engine.audioEngine) === null || _a === void 0 ? void 0 : _a.canUseWebAudio) && this._spatialSound && this._soundPanner) {
|
|
542
|
+
if (Engine.audioEngine?.canUseWebAudio && this._spatialSound && this._soundPanner) {
|
|
553
543
|
this._soundPanner.panningModel = this._panningModel;
|
|
554
544
|
}
|
|
555
545
|
}
|
|
@@ -558,8 +548,7 @@ export class Sound {
|
|
|
558
548
|
* @param soundTrackAudioNode the sound track audio node to connect to
|
|
559
549
|
*/
|
|
560
550
|
connectToSoundTrackAudioNode(soundTrackAudioNode) {
|
|
561
|
-
|
|
562
|
-
if (((_a = Engine.audioEngine) === null || _a === void 0 ? void 0 : _a.canUseWebAudio) && this._outputAudioNode) {
|
|
551
|
+
if (Engine.audioEngine?.canUseWebAudio && this._outputAudioNode) {
|
|
563
552
|
if (this._isOutputConnected) {
|
|
564
553
|
this._outputAudioNode.disconnect();
|
|
565
554
|
}
|
|
@@ -597,14 +586,13 @@ export class Sound {
|
|
|
597
586
|
* Gets or sets the inner angle for the directional cone.
|
|
598
587
|
*/
|
|
599
588
|
set directionalConeInnerAngle(value) {
|
|
600
|
-
var _a;
|
|
601
589
|
if (value != this._coneInnerAngle) {
|
|
602
590
|
if (this._coneOuterAngle < value) {
|
|
603
591
|
Logger.Error("directionalConeInnerAngle: outer angle of the cone must be superior or equal to the inner angle.");
|
|
604
592
|
return;
|
|
605
593
|
}
|
|
606
594
|
this._coneInnerAngle = value;
|
|
607
|
-
if (
|
|
595
|
+
if (Engine.audioEngine?.canUseWebAudio && this._spatialSound && this._soundPanner) {
|
|
608
596
|
this._soundPanner.coneInnerAngle = this._coneInnerAngle;
|
|
609
597
|
}
|
|
610
598
|
}
|
|
@@ -619,14 +607,13 @@ export class Sound {
|
|
|
619
607
|
* Gets or sets the outer angle for the directional cone.
|
|
620
608
|
*/
|
|
621
609
|
set directionalConeOuterAngle(value) {
|
|
622
|
-
var _a;
|
|
623
610
|
if (value != this._coneOuterAngle) {
|
|
624
611
|
if (value < this._coneInnerAngle) {
|
|
625
612
|
Logger.Error("directionalConeOuterAngle: outer angle of the cone must be superior or equal to the inner angle.");
|
|
626
613
|
return;
|
|
627
614
|
}
|
|
628
615
|
this._coneOuterAngle = value;
|
|
629
|
-
if (
|
|
616
|
+
if (Engine.audioEngine?.canUseWebAudio && this._spatialSound && this._soundPanner) {
|
|
630
617
|
this._soundPanner.coneOuterAngle = this._coneOuterAngle;
|
|
631
618
|
}
|
|
632
619
|
}
|
|
@@ -636,12 +623,11 @@ export class Sound {
|
|
|
636
623
|
* @param newPosition Defines the new position
|
|
637
624
|
*/
|
|
638
625
|
setPosition(newPosition) {
|
|
639
|
-
var _a;
|
|
640
626
|
if (newPosition.equals(this._position)) {
|
|
641
627
|
return;
|
|
642
628
|
}
|
|
643
629
|
this._position.copyFrom(newPosition);
|
|
644
|
-
if (
|
|
630
|
+
if (Engine.audioEngine?.canUseWebAudio && this._spatialSound && this._soundPanner && !isNaN(this._position.x) && !isNaN(this._position.y) && !isNaN(this._position.z)) {
|
|
645
631
|
this._soundPanner.positionX.value = this._position.x;
|
|
646
632
|
this._soundPanner.positionY.value = this._position.y;
|
|
647
633
|
this._soundPanner.positionZ.value = this._position.z;
|
|
@@ -652,9 +638,8 @@ export class Sound {
|
|
|
652
638
|
* @param newLocalDirection Defines the new local direction
|
|
653
639
|
*/
|
|
654
640
|
setLocalDirectionToMesh(newLocalDirection) {
|
|
655
|
-
var _a;
|
|
656
641
|
this._localDirection = newLocalDirection;
|
|
657
|
-
if (
|
|
642
|
+
if (Engine.audioEngine?.canUseWebAudio && this._connectedTransformNode && this.isPlaying) {
|
|
658
643
|
this._updateDirection();
|
|
659
644
|
}
|
|
660
645
|
}
|
|
@@ -671,8 +656,7 @@ export class Sound {
|
|
|
671
656
|
}
|
|
672
657
|
/** @internal */
|
|
673
658
|
updateDistanceFromListener() {
|
|
674
|
-
|
|
675
|
-
if (((_a = Engine.audioEngine) === null || _a === void 0 ? void 0 : _a.canUseWebAudio) && this._connectedTransformNode && this.useCustomAttenuation && this._soundGain && this._scene.activeCamera) {
|
|
659
|
+
if (Engine.audioEngine?.canUseWebAudio && this._connectedTransformNode && this.useCustomAttenuation && this._soundGain && this._scene.activeCamera) {
|
|
676
660
|
const distance = this._scene.audioListenerPositionProvider
|
|
677
661
|
? this._connectedTransformNode.position.subtract(this._scene.audioListenerPositionProvider()).length()
|
|
678
662
|
: this._connectedTransformNode.getDistanceToCamera(this._scene.activeCamera);
|
|
@@ -694,11 +678,10 @@ export class Sound {
|
|
|
694
678
|
* @param length (optional) Sound duration (in seconds)
|
|
695
679
|
*/
|
|
696
680
|
play(time, offset, length) {
|
|
697
|
-
|
|
698
|
-
if (this._isReadyToPlay && this._scene.audioEnabled && ((_a = Engine.audioEngine) === null || _a === void 0 ? void 0 : _a.audioContext)) {
|
|
681
|
+
if (this._isReadyToPlay && this._scene.audioEnabled && Engine.audioEngine?.audioContext) {
|
|
699
682
|
try {
|
|
700
683
|
this._clearTimeoutsAndObservers();
|
|
701
|
-
let startTime = time ?
|
|
684
|
+
let startTime = time ? Engine.audioEngine?.audioContext.currentTime + time : Engine.audioEngine?.audioContext.currentTime;
|
|
702
685
|
if (!this._soundSource || !this._streamingSource) {
|
|
703
686
|
if (this._spatialSound && this._soundPanner) {
|
|
704
687
|
if (!isNaN(this._position.x) && !isNaN(this._position.y) && !isNaN(this._position.z)) {
|
|
@@ -737,19 +720,17 @@ export class Sound {
|
|
|
737
720
|
// the audio engine to be unlocked by a user gesture before trying to play
|
|
738
721
|
// an HTML Audio element
|
|
739
722
|
const tryToPlay = () => {
|
|
740
|
-
|
|
741
|
-
if ((_a = Engine.audioEngine) === null || _a === void 0 ? void 0 : _a.unlocked) {
|
|
723
|
+
if (Engine.audioEngine?.unlocked) {
|
|
742
724
|
const playPromise = this._htmlAudioElement.play();
|
|
743
725
|
// In browsers that don’t yet support this functionality,
|
|
744
726
|
// playPromise won’t be defined.
|
|
745
727
|
if (playPromise !== undefined) {
|
|
746
728
|
playPromise.catch(() => {
|
|
747
|
-
var _a, _b;
|
|
748
729
|
// Automatic playback failed.
|
|
749
730
|
// Waiting for the audio engine to be unlocked by user click on unmute
|
|
750
|
-
|
|
731
|
+
Engine.audioEngine?.lock();
|
|
751
732
|
if (this.loop || this.autoplay) {
|
|
752
|
-
this._audioUnlockedObserver =
|
|
733
|
+
this._audioUnlockedObserver = Engine.audioEngine?.onAudioUnlockedObservable.addOnce(() => {
|
|
753
734
|
tryToPlay();
|
|
754
735
|
});
|
|
755
736
|
}
|
|
@@ -758,7 +739,7 @@ export class Sound {
|
|
|
758
739
|
}
|
|
759
740
|
else {
|
|
760
741
|
if (this.loop || this.autoplay) {
|
|
761
|
-
this._audioUnlockedObserver =
|
|
742
|
+
this._audioUnlockedObserver = Engine.audioEngine?.onAudioUnlockedObservable.addOnce(() => {
|
|
762
743
|
tryToPlay();
|
|
763
744
|
});
|
|
764
745
|
}
|
|
@@ -769,8 +750,7 @@ export class Sound {
|
|
|
769
750
|
}
|
|
770
751
|
else {
|
|
771
752
|
const tryToPlay = () => {
|
|
772
|
-
|
|
773
|
-
if ((_a = Engine.audioEngine) === null || _a === void 0 ? void 0 : _a.audioContext) {
|
|
753
|
+
if (Engine.audioEngine?.audioContext) {
|
|
774
754
|
length = length || this._length;
|
|
775
755
|
if (offset !== undefined) {
|
|
776
756
|
this._setOffset(offset);
|
|
@@ -781,7 +761,7 @@ export class Sound {
|
|
|
781
761
|
oldSource.disconnect();
|
|
782
762
|
};
|
|
783
763
|
}
|
|
784
|
-
this._soundSource =
|
|
764
|
+
this._soundSource = Engine.audioEngine?.audioContext.createBufferSource();
|
|
785
765
|
if (this._soundSource && this._inputAudioNode) {
|
|
786
766
|
this._soundSource.buffer = this._audioBuffer;
|
|
787
767
|
this._soundSource.connect(this._inputAudioNode);
|
|
@@ -796,17 +776,16 @@ export class Sound {
|
|
|
796
776
|
this._soundSource.onended = () => {
|
|
797
777
|
this._onended();
|
|
798
778
|
};
|
|
799
|
-
startTime = time ?
|
|
800
|
-
const actualOffset = ((this.isPaused ? this.currentTime : 0) + (
|
|
779
|
+
startTime = time ? Engine.audioEngine?.audioContext.currentTime + time : Engine.audioEngine.audioContext.currentTime;
|
|
780
|
+
const actualOffset = ((this.isPaused ? this.currentTime : 0) + (this._offset ?? 0)) % this._soundSource.buffer.duration;
|
|
801
781
|
this._soundSource.start(startTime, actualOffset, this.loop ? undefined : length);
|
|
802
782
|
}
|
|
803
783
|
}
|
|
804
784
|
};
|
|
805
|
-
if (
|
|
785
|
+
if (Engine.audioEngine?.audioContext.state === "suspended") {
|
|
806
786
|
// Wait a bit for FF as context seems late to be ready.
|
|
807
787
|
this._tryToPlayTimeout = setTimeout(() => {
|
|
808
|
-
|
|
809
|
-
if (((_a = Engine.audioEngine) === null || _a === void 0 ? void 0 : _a.audioContext.state) === "suspended") {
|
|
788
|
+
if (Engine.audioEngine?.audioContext.state === "suspended") {
|
|
810
789
|
// Automatic playback failed.
|
|
811
790
|
// Waiting for the audio engine to be unlocked by user click on unmute
|
|
812
791
|
Engine.audioEngine.lock();
|
|
@@ -848,7 +827,6 @@ export class Sound {
|
|
|
848
827
|
* @param time (optional) Stop the sound after X seconds. Stop immediately (0) by default.
|
|
849
828
|
*/
|
|
850
829
|
stop(time) {
|
|
851
|
-
var _a;
|
|
852
830
|
if (this.isPlaying) {
|
|
853
831
|
this._clearTimeoutsAndObservers();
|
|
854
832
|
if (this._streaming) {
|
|
@@ -864,7 +842,7 @@ export class Sound {
|
|
|
864
842
|
}
|
|
865
843
|
this.isPlaying = false;
|
|
866
844
|
}
|
|
867
|
-
else if (
|
|
845
|
+
else if (Engine.audioEngine?.audioContext && this._soundSource) {
|
|
868
846
|
const stopTime = time ? Engine.audioEngine.audioContext.currentTime + time : undefined;
|
|
869
847
|
this._soundSource.onended = () => {
|
|
870
848
|
this.isPlaying = false;
|
|
@@ -892,7 +870,6 @@ export class Sound {
|
|
|
892
870
|
* Put the sound in pause
|
|
893
871
|
*/
|
|
894
872
|
pause() {
|
|
895
|
-
var _a;
|
|
896
873
|
if (this.isPlaying) {
|
|
897
874
|
this._clearTimeoutsAndObservers();
|
|
898
875
|
if (this._streaming) {
|
|
@@ -905,7 +882,7 @@ export class Sound {
|
|
|
905
882
|
this.isPlaying = false;
|
|
906
883
|
this.isPaused = true;
|
|
907
884
|
}
|
|
908
|
-
else if (
|
|
885
|
+
else if (Engine.audioEngine?.audioContext && this._soundSource) {
|
|
909
886
|
this._soundSource.onended = () => void 0;
|
|
910
887
|
this._soundSource.stop();
|
|
911
888
|
this.isPlaying = false;
|
|
@@ -920,8 +897,7 @@ export class Sound {
|
|
|
920
897
|
* @param time Define time for gradual change to new volume
|
|
921
898
|
*/
|
|
922
899
|
setVolume(newVolume, time) {
|
|
923
|
-
|
|
924
|
-
if (((_a = Engine.audioEngine) === null || _a === void 0 ? void 0 : _a.canUseWebAudio) && this._soundGain) {
|
|
900
|
+
if (Engine.audioEngine?.canUseWebAudio && this._soundGain) {
|
|
925
901
|
if (time && Engine.audioEngine.audioContext) {
|
|
926
902
|
this._soundGain.gain.cancelScheduledValues(Engine.audioEngine.audioContext.currentTime);
|
|
927
903
|
this._soundGain.gain.setValueAtTime(this._soundGain.gain.value, Engine.audioEngine.audioContext.currentTime);
|
|
@@ -997,7 +973,6 @@ export class Sound {
|
|
|
997
973
|
}
|
|
998
974
|
}
|
|
999
975
|
_onRegisterAfterWorldMatrixUpdate(node) {
|
|
1000
|
-
var _a;
|
|
1001
976
|
if (!node.getBoundingInfo) {
|
|
1002
977
|
this.setPosition(node.absolutePosition);
|
|
1003
978
|
}
|
|
@@ -1006,7 +981,7 @@ export class Sound {
|
|
|
1006
981
|
const boundingInfo = mesh.getBoundingInfo();
|
|
1007
982
|
this.setPosition(boundingInfo.boundingSphere.centerWorld);
|
|
1008
983
|
}
|
|
1009
|
-
if (
|
|
984
|
+
if (Engine.audioEngine?.canUseWebAudio && this._isDirectional && this.isPlaying) {
|
|
1010
985
|
this._updateDirection();
|
|
1011
986
|
}
|
|
1012
987
|
}
|
|
@@ -1194,13 +1169,12 @@ export class Sound {
|
|
|
1194
1169
|
this._offset = value;
|
|
1195
1170
|
}
|
|
1196
1171
|
_clearTimeoutsAndObservers() {
|
|
1197
|
-
var _a;
|
|
1198
1172
|
if (this._tryToPlayTimeout) {
|
|
1199
1173
|
clearTimeout(this._tryToPlayTimeout);
|
|
1200
1174
|
this._tryToPlayTimeout = null;
|
|
1201
1175
|
}
|
|
1202
1176
|
if (this._audioUnlockedObserver) {
|
|
1203
|
-
|
|
1177
|
+
Engine.audioEngine?.onAudioUnlockedObservable.remove(this._audioUnlockedObserver);
|
|
1204
1178
|
this._audioUnlockedObserver = null;
|
|
1205
1179
|
}
|
|
1206
1180
|
}
|