@onerjs/core 9.0.2 → 9.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Buffers/buffer.pure.js +4 -0
- package/Buffers/buffer.pure.js.map +1 -1
- package/Cameras/camera.pure.d.ts +14 -0
- package/Cameras/camera.pure.js +15 -0
- package/Cameras/camera.pure.js.map +1 -1
- package/Compute/computeShader.pure.d.ts +2 -1
- package/Compute/computeShader.pure.js +29 -10
- package/Compute/computeShader.pure.js.map +1 -1
- package/Culling/ray.core.js +22 -9
- package/Culling/ray.core.js.map +1 -1
- package/Engines/IDrawContext.d.ts +2 -0
- package/Engines/IDrawContext.js.map +1 -1
- package/Engines/Native/nativeInterfaces.d.ts +55 -4
- package/Engines/Native/nativeInterfaces.js.map +1 -1
- package/Engines/Native/nativeRenderTargetWrapper.d.ts +1 -0
- package/Engines/Native/nativeRenderTargetWrapper.js +5 -1
- package/Engines/Native/nativeRenderTargetWrapper.js.map +1 -1
- package/Engines/Processors/shaderCodeInliner.d.ts +2 -0
- package/Engines/Processors/shaderCodeInliner.js +251 -6
- package/Engines/Processors/shaderCodeInliner.js.map +1 -1
- package/Engines/Processors/shaderProcessor.js +10 -1
- package/Engines/Processors/shaderProcessor.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.debugging.pure.js +12 -0
- package/Engines/WebGPU/Extensions/engine.debugging.pure.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.multiRender.pure.js +0 -1
- package/Engines/WebGPU/Extensions/engine.multiRender.pure.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.query.pure.js +5 -0
- package/Engines/WebGPU/Extensions/engine.query.pure.js.map +1 -1
- package/Engines/WebGPU/webgpuBufferManager.js +7 -0
- package/Engines/WebGPU/webgpuBufferManager.js.map +1 -1
- package/Engines/WebGPU/webgpuCacheTextureView.d.ts +1 -1
- package/Engines/WebGPU/webgpuCacheTextureView.js +20 -8
- package/Engines/WebGPU/webgpuCacheTextureView.js.map +1 -1
- package/Engines/WebGPU/webgpuDrawContext.d.ts +2 -0
- package/Engines/WebGPU/webgpuDrawContext.js +6 -0
- package/Engines/WebGPU/webgpuDrawContext.js.map +1 -1
- package/Engines/WebGPU/webgpuQuerySet.d.ts +3 -3
- package/Engines/WebGPU/webgpuQuerySet.js +23 -9
- package/Engines/WebGPU/webgpuQuerySet.js.map +1 -1
- package/Engines/WebGPU/webgpuRenderPassCommandStream.d.ts +156 -0
- package/Engines/WebGPU/webgpuRenderPassCommandStream.js +323 -0
- package/Engines/WebGPU/webgpuRenderPassCommandStream.js.map +1 -0
- package/Engines/WebGPU/webgpuTextureManager.d.ts +1 -1
- package/Engines/WebGPU/webgpuTextureManager.js +4 -3
- package/Engines/WebGPU/webgpuTextureManager.js.map +1 -1
- package/Engines/WebGPU/webgpuTimestampQuery.d.ts +3 -1
- package/Engines/WebGPU/webgpuTimestampQuery.js +9 -6
- package/Engines/WebGPU/webgpuTimestampQuery.js.map +1 -1
- package/Engines/abstractEngine.pure.d.ts +2 -0
- package/Engines/abstractEngine.pure.js +14 -5
- package/Engines/abstractEngine.pure.js.map +1 -1
- package/Engines/constants.d.ts +6 -0
- package/Engines/constants.js +6 -0
- package/Engines/constants.js.map +1 -1
- package/Engines/engine.d.ts +198 -24
- package/Engines/pure.d.ts +1 -0
- package/Engines/pure.js +1 -0
- package/Engines/pure.js.map +1 -1
- package/Engines/renderCommandBatcher.pure.d.ts +16 -0
- package/Engines/renderCommandBatcher.pure.js +24 -0
- package/Engines/renderCommandBatcher.pure.js.map +1 -0
- package/Engines/thinEngine.functions.js +3 -2
- package/Engines/thinEngine.functions.js.map +1 -1
- package/Engines/thinEngine.pure.js +18 -2
- package/Engines/thinEngine.pure.js.map +1 -1
- package/Engines/thinNativeEngine.pure.d.ts +10 -7
- package/Engines/thinNativeEngine.pure.js +117 -46
- package/Engines/thinNativeEngine.pure.js.map +1 -1
- package/Engines/thinWebGPUEngine.d.ts +8 -0
- package/Engines/thinWebGPUEngine.js +11 -0
- package/Engines/thinWebGPUEngine.js.map +1 -1
- package/Engines/webgpuEngine.pure.d.ts +60 -1
- package/Engines/webgpuEngine.pure.js +238 -42
- package/Engines/webgpuEngine.pure.js.map +1 -1
- package/FlowGraph/Blocks/Data/Audio/flowGraphGetSoundVolumeBlock.pure.d.ts +3 -3
- package/FlowGraph/Blocks/Data/Audio/flowGraphGetSoundVolumeBlock.pure.js +2 -1
- package/FlowGraph/Blocks/Data/Audio/flowGraphGetSoundVolumeBlock.pure.js.map +1 -1
- package/FlowGraph/Blocks/Data/Audio/flowGraphIsSoundPlayingBlock.pure.d.ts +3 -3
- package/FlowGraph/Blocks/Data/Audio/flowGraphIsSoundPlayingBlock.pure.js +2 -1
- package/FlowGraph/Blocks/Data/Audio/flowGraphIsSoundPlayingBlock.pure.js.map +1 -1
- package/FlowGraph/Blocks/Event/flowGraphMeshIntersectionEventBlock.d.ts +5 -0
- package/FlowGraph/Blocks/Event/flowGraphMeshIntersectionEventBlock.js +8 -0
- package/FlowGraph/Blocks/Event/flowGraphMeshIntersectionEventBlock.js.map +1 -0
- package/FlowGraph/Blocks/Event/flowGraphMeshIntersectionEventBlock.pure.d.ts +77 -0
- package/FlowGraph/Blocks/Event/flowGraphMeshIntersectionEventBlock.pure.js +141 -0
- package/FlowGraph/Blocks/Event/flowGraphMeshIntersectionEventBlock.pure.js.map +1 -0
- package/FlowGraph/Blocks/Event/flowGraphSoundEndedEventBlock.pure.d.ts +5 -3
- package/FlowGraph/Blocks/Event/flowGraphSoundEndedEventBlock.pure.js +38 -7
- package/FlowGraph/Blocks/Event/flowGraphSoundEndedEventBlock.pure.js.map +1 -1
- package/FlowGraph/Blocks/Event/index.d.ts +1 -0
- package/FlowGraph/Blocks/Event/index.js +1 -0
- package/FlowGraph/Blocks/Event/index.js.map +1 -1
- package/FlowGraph/Blocks/Event/pure.d.ts +1 -0
- package/FlowGraph/Blocks/Event/pure.js +1 -0
- package/FlowGraph/Blocks/Event/pure.js.map +1 -1
- package/FlowGraph/Blocks/Execution/Audio/flowGraphPauseSoundBlock.pure.d.ts +3 -3
- package/FlowGraph/Blocks/Execution/Audio/flowGraphPauseSoundBlock.pure.js +2 -1
- package/FlowGraph/Blocks/Execution/Audio/flowGraphPauseSoundBlock.pure.js.map +1 -1
- package/FlowGraph/Blocks/Execution/Audio/flowGraphPlaySoundBlock.pure.d.ts +3 -3
- package/FlowGraph/Blocks/Execution/Audio/flowGraphPlaySoundBlock.pure.js +2 -1
- package/FlowGraph/Blocks/Execution/Audio/flowGraphPlaySoundBlock.pure.js.map +1 -1
- package/FlowGraph/Blocks/Execution/Audio/flowGraphSetSoundVolumeBlock.pure.d.ts +3 -3
- package/FlowGraph/Blocks/Execution/Audio/flowGraphSetSoundVolumeBlock.pure.js +2 -1
- package/FlowGraph/Blocks/Execution/Audio/flowGraphSetSoundVolumeBlock.pure.js.map +1 -1
- package/FlowGraph/Blocks/Execution/Audio/flowGraphStopSoundBlock.pure.d.ts +3 -3
- package/FlowGraph/Blocks/Execution/Audio/flowGraphStopSoundBlock.pure.js +2 -1
- package/FlowGraph/Blocks/Execution/Audio/flowGraphStopSoundBlock.pure.js.map +1 -1
- package/FlowGraph/Blocks/allBlocks.pure.js +2 -0
- package/FlowGraph/Blocks/allBlocks.pure.js.map +1 -1
- package/FlowGraph/Blocks/flowGraphBlockFactory.js +2 -0
- package/FlowGraph/Blocks/flowGraphBlockFactory.js.map +1 -1
- package/FlowGraph/Blocks/flowGraphBlockNames.d.ts +1 -0
- package/FlowGraph/Blocks/flowGraphBlockNames.js +1 -0
- package/FlowGraph/Blocks/flowGraphBlockNames.js.map +1 -1
- package/FlowGraph/flowGraph.d.ts +12 -1
- package/FlowGraph/flowGraph.js +38 -0
- package/FlowGraph/flowGraph.js.map +1 -1
- package/FlowGraph/flowGraphCoordinator.d.ts +44 -0
- package/FlowGraph/flowGraphCoordinator.js +141 -0
- package/FlowGraph/flowGraphCoordinator.js.map +1 -1
- package/FlowGraph/flowGraphDataConnection.pure.js +41 -14
- package/FlowGraph/flowGraphDataConnection.pure.js.map +1 -1
- package/FlowGraph/flowGraphParser.js +105 -5
- package/FlowGraph/flowGraphParser.js.map +1 -1
- package/FlowGraph/flowGraphSoundAssets.d.ts +40 -0
- package/FlowGraph/flowGraphSoundAssets.js +33 -0
- package/FlowGraph/flowGraphSoundAssets.js.map +1 -0
- package/FlowGraph/index.d.ts +1 -0
- package/FlowGraph/index.js +1 -0
- package/FlowGraph/index.js.map +1 -1
- package/FlowGraph/pure.d.ts +1 -0
- package/FlowGraph/pure.js +1 -0
- package/FlowGraph/pure.js.map +1 -1
- package/FlowGraph/serialization.d.ts +8 -0
- package/FlowGraph/serialization.js +31 -12
- package/FlowGraph/serialization.js.map +1 -1
- package/FlowGraph/typeDefinitions.d.ts +25 -0
- package/FlowGraph/typeDefinitions.js.map +1 -1
- package/FrameGraph/Tasks/PostProcesses/taaTask.js +2 -0
- package/FrameGraph/Tasks/PostProcesses/taaTask.js.map +1 -1
- package/Instrumentation/engineInstrumentation.d.ts +1 -0
- package/Instrumentation/engineInstrumentation.js +25 -6
- package/Instrumentation/engineInstrumentation.js.map +1 -1
- package/Lights/Clustered/clusteredLightContainer.pure.js +2 -0
- package/Lights/Clustered/clusteredLightContainer.pure.js.map +1 -1
- package/Lights/Shadows/cascadedShadowGenerator.pure.d.ts +36 -1
- package/Lights/Shadows/cascadedShadowGenerator.pure.js +202 -27
- package/Lights/Shadows/cascadedShadowGenerator.pure.js.map +1 -1
- package/Lights/directionalLight.pure.d.ts +24 -10
- package/Lights/directionalLight.pure.js +29 -11
- package/Lights/directionalLight.pure.js.map +1 -1
- package/Materials/GaussianSplatting/gaussianSplattingMaterial.pure.js +4 -4
- package/Materials/GaussianSplatting/gaussianSplattingMaterial.pure.js.map +1 -1
- package/Materials/Node/Blocks/Dual/lightBlock.pure.js +1 -1
- package/Materials/Node/Blocks/Dual/lightBlock.pure.js.map +1 -1
- package/Materials/Node/Blocks/Input/inputBlock.pure.js +4 -0
- package/Materials/Node/Blocks/Input/inputBlock.pure.js.map +1 -1
- package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.pure.d.ts +9 -0
- package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.pure.js +23 -3
- package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.pure.js.map +1 -1
- package/Materials/PBR/openpbrMaterial.pure.js +1 -1
- package/Materials/PBR/openpbrMaterial.pure.js.map +1 -1
- package/Materials/PBR/pbrBaseMaterial.pure.d.ts +9 -0
- package/Materials/PBR/pbrBaseMaterial.pure.js +60 -1
- package/Materials/PBR/pbrBaseMaterial.pure.js.map +1 -1
- package/Materials/PBR/pbrBaseSimpleMaterial.d.ts +11 -0
- package/Materials/PBR/pbrBaseSimpleMaterial.js +21 -2
- package/Materials/PBR/pbrBaseSimpleMaterial.js.map +1 -1
- package/Materials/PBR/pbrMaterial.pure.d.ts +12 -0
- package/Materials/PBR/pbrMaterial.pure.js +23 -3
- package/Materials/PBR/pbrMaterial.pure.js.map +1 -1
- package/Materials/Textures/Filtering/hdrIrradianceFiltering.d.ts +1 -0
- package/Materials/Textures/Filtering/hdrIrradianceFiltering.js +10 -0
- package/Materials/Textures/Filtering/hdrIrradianceFiltering.js.map +1 -1
- package/Materials/Textures/HTML/htmlInCanvasPolyfill.d.ts +5 -0
- package/Materials/Textures/HTML/htmlInCanvasPolyfill.js +7 -0
- package/Materials/Textures/HTML/htmlInCanvasPolyfill.js.map +1 -1
- package/Materials/Textures/HTML/htmlInteractionManager.d.ts +9 -3
- package/Materials/Textures/HTML/htmlInteractionManager.js +64 -5
- package/Materials/Textures/HTML/htmlInteractionManager.js.map +1 -1
- package/Materials/Textures/HTML/htmlTexture.d.ts +11 -11
- package/Materials/Textures/HTML/htmlTexture.js +106 -65
- package/Materials/Textures/HTML/htmlTexture.js.map +1 -1
- package/Materials/Textures/Loaders/internalTextureLoader.d.ts +2 -1
- package/Materials/Textures/Loaders/internalTextureLoader.js.map +1 -1
- package/Materials/Textures/Loaders/ktxTextureLoader.d.ts +2 -1
- package/Materials/Textures/Loaders/ktxTextureLoader.js +4 -50
- package/Materials/Textures/Loaders/ktxTextureLoader.js.map +1 -1
- package/Materials/Textures/Procedurals/proceduralTexture.pure.js +10 -0
- package/Materials/Textures/Procedurals/proceduralTexture.pure.js.map +1 -1
- package/Materials/Textures/dynamicTexture.pure.js +6 -0
- package/Materials/Textures/dynamicTexture.pure.js.map +1 -1
- package/Materials/Textures/ktx2encoderTypes.d.ts +51 -0
- package/Materials/Textures/ktx2encoderTypes.js +2 -0
- package/Materials/Textures/ktx2encoderTypes.js.map +1 -0
- package/Materials/Textures/renderTargetTexture.pure.js +10 -2
- package/Materials/Textures/renderTargetTexture.pure.js.map +1 -1
- package/Materials/Textures/textureMerger.d.ts +11 -0
- package/Materials/Textures/textureMerger.js +34 -19
- package/Materials/Textures/textureMerger.js.map +1 -1
- package/Materials/Textures/textureProcessor.d.ts +145 -0
- package/Materials/Textures/textureProcessor.js +445 -45
- package/Materials/Textures/textureProcessor.js.map +1 -1
- package/Materials/Textures/textureSampling.functions.d.ts +41 -0
- package/Materials/Textures/textureSampling.functions.js +82 -0
- package/Materials/Textures/textureSampling.functions.js.map +1 -0
- package/Materials/drawWrapper.d.ts +8 -0
- package/Materials/drawWrapper.js +19 -0
- package/Materials/drawWrapper.js.map +1 -1
- package/Materials/effect.pure.d.ts +6 -0
- package/Materials/effect.pure.js +28 -6
- package/Materials/effect.pure.js.map +1 -1
- package/Materials/effect.webgl.functions.pure.js +1 -1
- package/Materials/effect.webgl.functions.pure.js.map +1 -1
- package/Materials/material.pure.d.ts +5 -0
- package/Materials/material.pure.js +9 -2
- package/Materials/material.pure.js.map +1 -1
- package/Materials/materialFlags.d.ts +6 -0
- package/Materials/materialFlags.js +14 -0
- package/Materials/materialFlags.js.map +1 -1
- package/Materials/materialHelper.functions.d.ts +2 -1
- package/Materials/materialHelper.functions.js +36 -2
- package/Materials/materialHelper.functions.js.map +1 -1
- package/Materials/materialHelper.geometryrendering.js +19 -16
- package/Materials/materialHelper.geometryrendering.js.map +1 -1
- package/Materials/materialPluginManager.pure.js +12 -8
- package/Materials/materialPluginManager.pure.js.map +1 -1
- package/Materials/prePassConfiguration.js +19 -16
- package/Materials/prePassConfiguration.js.map +1 -1
- package/Materials/shaderMaterial.pure.js +19 -6
- package/Materials/shaderMaterial.pure.js.map +1 -1
- package/Materials/shadowDepthWrapper.d.ts +6 -0
- package/Materials/shadowDepthWrapper.js +17 -0
- package/Materials/shadowDepthWrapper.js.map +1 -1
- package/Meshes/Compression/dracoCodec.d.ts +14 -0
- package/Meshes/Compression/dracoCodec.js +22 -0
- package/Meshes/Compression/dracoCodec.js.map +1 -1
- package/Meshes/Compression/dracoDecoder.d.ts +1 -0
- package/Meshes/Compression/dracoDecoder.js +27 -0
- package/Meshes/Compression/dracoDecoder.js.map +1 -1
- package/Meshes/Compression/dracoEncoder.d.ts +1 -0
- package/Meshes/Compression/dracoEncoder.js +8 -0
- package/Meshes/Compression/dracoEncoder.js.map +1 -1
- package/Meshes/Compression/meshoptCompression.d.ts +1 -0
- package/Meshes/Compression/meshoptCompression.js +9 -0
- package/Meshes/Compression/meshoptCompression.js.map +1 -1
- package/Meshes/GaussianSplatting/gaussianSplattingGpuSorter.d.ts +415 -0
- package/Meshes/GaussianSplatting/gaussianSplattingGpuSorter.js +912 -0
- package/Meshes/GaussianSplatting/gaussianSplattingGpuSorter.js.map +1 -0
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.pure.d.ts +3 -0
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.pure.js +40 -9
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.pure.js.map +1 -1
- package/Meshes/GaussianSplatting/gaussianSplattingMeshBase.pure.d.ts +112 -8
- package/Meshes/GaussianSplatting/gaussianSplattingMeshBase.pure.js +696 -74
- package/Meshes/GaussianSplatting/gaussianSplattingMeshBase.pure.js.map +1 -1
- package/Meshes/abstractMesh.pure.js +12 -4
- package/Meshes/abstractMesh.pure.js.map +1 -1
- package/Meshes/geometry.d.ts +5 -0
- package/Meshes/geometry.js +25 -0
- package/Meshes/geometry.js.map +1 -1
- package/Meshes/index.d.ts +1 -0
- package/Meshes/index.js +1 -0
- package/Meshes/index.js.map +1 -1
- package/Meshes/mesh.pure.d.ts +7 -0
- package/Meshes/mesh.pure.js +18 -13
- package/Meshes/mesh.pure.js.map +1 -1
- package/Meshes/pure.d.ts +1 -0
- package/Meshes/pure.js +1 -0
- package/Meshes/pure.js.map +1 -1
- package/Meshes/subMesh.pure.d.ts +3 -0
- package/Meshes/subMesh.pure.js +26 -0
- package/Meshes/subMesh.pure.js.map +1 -1
- package/Meshes/thinInstanceMesh.pure.js +5 -3
- package/Meshes/thinInstanceMesh.pure.js.map +1 -1
- package/Misc/index.d.ts +1 -0
- package/Misc/index.js +1 -0
- package/Misc/index.js.map +1 -1
- package/Misc/khronosTextureContainer2.d.ts +3 -2
- package/Misc/khronosTextureContainer2.js +24 -6
- package/Misc/khronosTextureContainer2.js.map +1 -1
- package/Misc/khronosTextureContainer2Encoder.d.ts +166 -0
- package/Misc/khronosTextureContainer2Encoder.js +556 -0
- package/Misc/khronosTextureContainer2Encoder.js.map +1 -0
- package/Misc/khronosTextureContainer2EncoderWorker.d.ts +61 -0
- package/Misc/khronosTextureContainer2EncoderWorker.js +55 -0
- package/Misc/khronosTextureContainer2EncoderWorker.js.map +1 -0
- package/Misc/pure.d.ts +1 -0
- package/Misc/pure.js +1 -0
- package/Misc/pure.js.map +1 -1
- package/Misc/textureFormat.functions.d.ts +6 -0
- package/Misc/textureFormat.functions.js +54 -0
- package/Misc/textureFormat.functions.js.map +1 -0
- package/Misc/textureTools.d.ts +6 -2
- package/Misc/textureTools.js +100 -42
- package/Misc/textureTools.js.map +1 -1
- package/Misc/tools.pure.js +1 -1
- package/Misc/tools.pure.js.map +1 -1
- package/Particles/Node/Blocks/systemBlock.pure.d.ts +1 -1
- package/Particles/Node/Blocks/systemBlock.pure.js +6 -3
- package/Particles/Node/Blocks/systemBlock.pure.js.map +1 -1
- package/Particles/computeShaderParticleSystem.pure.js +5 -0
- package/Particles/computeShaderParticleSystem.pure.js.map +1 -1
- package/Particles/gpuParticleSystem.pure.d.ts +2 -0
- package/Particles/gpuParticleSystem.pure.js +25 -1
- package/Particles/gpuParticleSystem.pure.js.map +1 -1
- package/Particles/solidParticle.d.ts +5 -0
- package/Particles/solidParticle.js +5 -0
- package/Particles/solidParticle.js.map +1 -1
- package/Particles/solidParticleSystem.d.ts +10 -0
- package/Particles/solidParticleSystem.js +72 -13
- package/Particles/solidParticleSystem.js.map +1 -1
- package/Particles/thinParticleSystem.pure.js +4 -0
- package/Particles/thinParticleSystem.pure.js.map +1 -1
- package/PostProcesses/RenderPipeline/Pipelines/taaMaterialManager.pure.d.ts +27 -6
- package/PostProcesses/RenderPipeline/Pipelines/taaMaterialManager.pure.js +60 -5
- package/PostProcesses/RenderPipeline/Pipelines/taaMaterialManager.pure.js.map +1 -1
- package/PostProcesses/thinTAAPostProcess.d.ts +1 -0
- package/PostProcesses/thinTAAPostProcess.js +17 -1
- package/PostProcesses/thinTAAPostProcess.js.map +1 -1
- package/PostProcesses/volumetricLightScatteringPostProcess.pure.d.ts +2 -1
- package/PostProcesses/volumetricLightScatteringPostProcess.pure.js +6 -5
- package/PostProcesses/volumetricLightScatteringPostProcess.pure.js.map +1 -1
- package/Rendering/boundingBoxRenderer.pure.js +2 -3
- package/Rendering/boundingBoxRenderer.pure.js.map +1 -1
- package/Rendering/geometryBufferRenderer.pure.js +8 -2
- package/Rendering/geometryBufferRenderer.pure.js.map +1 -1
- package/Rendering/objectRenderer.d.ts +1 -0
- package/Rendering/objectRenderer.js +14 -0
- package/Rendering/objectRenderer.js.map +1 -1
- package/Shaders/ShadersInclude/bumpFragmentMainFunctions.js +2 -2
- package/Shaders/ShadersInclude/bumpFragmentMainFunctions.js.map +1 -1
- package/Shaders/ShadersInclude/bumpVertex.js +1 -1
- package/Shaders/ShadersInclude/bumpVertex.js.map +1 -1
- package/Shaders/ShadersInclude/bumpVertexDeclaration.js +1 -1
- package/Shaders/ShadersInclude/bumpVertexDeclaration.js.map +1 -1
- package/Shaders/ShadersInclude/hdrFilteringFunctions.js +5 -1
- package/Shaders/ShadersInclude/hdrFilteringFunctions.js.map +1 -1
- package/Shaders/ShadersInclude/helperFunctions.js +2 -2
- package/Shaders/ShadersInclude/helperFunctions.js.map +1 -1
- package/Shaders/ShadersInclude/openpbrBackgroundTransmission.js +1 -1
- package/Shaders/ShadersInclude/openpbrBackgroundTransmission.js.map +1 -1
- package/Shaders/ShadersInclude/openpbrVertexDeclaration.js +6 -0
- package/Shaders/ShadersInclude/openpbrVertexDeclaration.js.map +1 -1
- package/Shaders/ShadersInclude/pbrBlockFinalLitComponents.js +11 -1
- package/Shaders/ShadersInclude/pbrBlockFinalLitComponents.js.map +1 -1
- package/Shaders/ShadersInclude/pbrBlockNormalFinal.js +9 -0
- package/Shaders/ShadersInclude/pbrBlockNormalFinal.js.map +1 -1
- package/Shaders/ShadersInclude/pbrBlockReflectance.js +1 -1
- package/Shaders/ShadersInclude/pbrBlockReflectance.js.map +1 -1
- package/Shaders/ShadersInclude/pbrClusteredLightingFunctions.js +1 -1
- package/Shaders/ShadersInclude/pbrClusteredLightingFunctions.js.map +1 -1
- package/Shaders/ShadersInclude/pbrFragmentDeclaration.js +7 -1
- package/Shaders/ShadersInclude/pbrFragmentDeclaration.js.map +1 -1
- package/Shaders/ShadersInclude/pbrFragmentSamplersDeclaration.js +1 -0
- package/Shaders/ShadersInclude/pbrFragmentSamplersDeclaration.js.map +1 -1
- package/Shaders/ShadersInclude/pbrIBLFunctions.js +12 -0
- package/Shaders/ShadersInclude/pbrIBLFunctions.js.map +1 -1
- package/Shaders/ShadersInclude/pbrUboDeclaration.js +1 -1
- package/Shaders/ShadersInclude/pbrUboDeclaration.js.map +1 -1
- package/Shaders/ShadersInclude/pbrVertexDeclaration.js +3 -0
- package/Shaders/ShadersInclude/pbrVertexDeclaration.js.map +1 -1
- package/Shaders/geometry.vertex.js +6 -6
- package/Shaders/geometry.vertex.js.map +1 -1
- package/Shaders/gpuUpdateParticles.vertex.js +1 -1
- package/Shaders/gpuUpdateParticles.vertex.js.map +1 -1
- package/Shaders/lod.fragment.js +15 -2
- package/Shaders/lod.fragment.js.map +1 -1
- package/Shaders/lod3D.fragment.js +15 -2
- package/Shaders/lod3D.fragment.js.map +1 -1
- package/Shaders/lodCube.fragment.js +15 -2
- package/Shaders/lodCube.fragment.js.map +1 -1
- package/Shaders/openpbr.vertex.js +2 -0
- package/Shaders/openpbr.vertex.js.map +1 -1
- package/Shaders/pbr.fragment.js +12 -1
- package/Shaders/pbr.fragment.js.map +1 -1
- package/Shaders/pbr.vertex.js +2 -0
- package/Shaders/pbr.vertex.js.map +1 -1
- package/Shaders/textureMerger.fragment.js +28 -0
- package/Shaders/textureMerger.fragment.js.map +1 -1
- package/Shaders/textureProcessor.fragment.js +26 -4
- package/Shaders/textureProcessor.fragment.js.map +1 -1
- package/Shaders/volumetricLightScattering.fragment.js +1 -1
- package/Shaders/volumetricLightScattering.fragment.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/bumpFragmentMainFunctions.js +2 -2
- package/ShadersWGSL/ShadersInclude/bumpFragmentMainFunctions.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/bumpVertex.js +1 -1
- package/ShadersWGSL/ShadersInclude/bumpVertex.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/bumpVertexDeclaration.js +1 -1
- package/ShadersWGSL/ShadersInclude/bumpVertexDeclaration.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/hdrFilteringFunctions.js +1 -1
- package/ShadersWGSL/ShadersInclude/hdrFilteringFunctions.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/helperFunctions.js +2 -2
- package/ShadersWGSL/ShadersInclude/helperFunctions.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/lightFragment.js +44 -2
- package/ShadersWGSL/ShadersInclude/lightFragment.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/lightUboDeclaration.js +17 -3
- package/ShadersWGSL/ShadersInclude/lightUboDeclaration.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/lightVxUboDeclaration.js +12 -1
- package/ShadersWGSL/ShadersInclude/lightVxUboDeclaration.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/openpbrBackgroundTransmission.js +1 -1
- package/ShadersWGSL/ShadersInclude/openpbrBackgroundTransmission.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/pbrBlockFinalLitComponents.js +11 -1
- package/ShadersWGSL/ShadersInclude/pbrBlockFinalLitComponents.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/pbrBlockNormalFinal.js +9 -0
- package/ShadersWGSL/ShadersInclude/pbrBlockNormalFinal.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/pbrBlockReflectance.js +1 -1
- package/ShadersWGSL/ShadersInclude/pbrBlockReflectance.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/pbrClusteredLightingFunctions.js +1 -1
- package/ShadersWGSL/ShadersInclude/pbrClusteredLightingFunctions.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/pbrDirectLightingSetupFunctions.js +1 -1
- package/ShadersWGSL/ShadersInclude/pbrDirectLightingSetupFunctions.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/pbrFragmentSamplersDeclaration.js +1 -0
- package/ShadersWGSL/ShadersInclude/pbrFragmentSamplersDeclaration.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/pbrIBLFunctions.js +8 -0
- package/ShadersWGSL/ShadersInclude/pbrIBLFunctions.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/pbrUboDeclaration.js +1 -1
- package/ShadersWGSL/ShadersInclude/pbrUboDeclaration.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/prePassVertex.js +2 -2
- package/ShadersWGSL/ShadersInclude/prePassVertex.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/prePassVertexDeclaration.js +1 -1
- package/ShadersWGSL/ShadersInclude/prePassVertexDeclaration.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/sceneUboDeclaration.js +3 -1
- package/ShadersWGSL/ShadersInclude/sceneUboDeclaration.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/shadowsVertex.js +16 -0
- package/ShadersWGSL/ShadersInclude/shadowsVertex.js.map +1 -1
- package/ShadersWGSL/default.fragment.js +4 -4
- package/ShadersWGSL/default.fragment.js.map +1 -1
- package/ShadersWGSL/default.vertex.js +1 -1
- package/ShadersWGSL/default.vertex.js.map +1 -1
- package/ShadersWGSL/gaussianSplatting.vertex.js +3 -3
- package/ShadersWGSL/gaussianSplatting.vertex.js.map +1 -1
- package/ShadersWGSL/gpuUpdateParticles.compute.js +1 -1
- package/ShadersWGSL/gpuUpdateParticles.compute.js.map +1 -1
- package/ShadersWGSL/gsSortCount.compute.d.ts +5 -0
- package/ShadersWGSL/gsSortCount.compute.js +19 -0
- package/ShadersWGSL/gsSortCount.compute.js.map +1 -0
- package/ShadersWGSL/gsSortKeys.compute.d.ts +5 -0
- package/ShadersWGSL/gsSortKeys.compute.js +49 -0
- package/ShadersWGSL/gsSortKeys.compute.js.map +1 -0
- package/ShadersWGSL/gsSortOutput.compute.d.ts +5 -0
- package/ShadersWGSL/gsSortOutput.compute.js +28 -0
- package/ShadersWGSL/gsSortOutput.compute.js.map +1 -0
- package/ShadersWGSL/gsSortScanLocal.compute.d.ts +5 -0
- package/ShadersWGSL/gsSortScanLocal.compute.js +23 -0
- package/ShadersWGSL/gsSortScanLocal.compute.js.map +1 -0
- package/ShadersWGSL/gsSortScanSums.compute.d.ts +5 -0
- package/ShadersWGSL/gsSortScanSums.compute.js +19 -0
- package/ShadersWGSL/gsSortScanSums.compute.js.map +1 -0
- package/ShadersWGSL/gsSortScatter.compute.d.ts +5 -0
- package/ShadersWGSL/gsSortScatter.compute.js +33 -0
- package/ShadersWGSL/gsSortScatter.compute.js.map +1 -0
- package/ShadersWGSL/lod.fragment.js +14 -2
- package/ShadersWGSL/lod.fragment.js.map +1 -1
- package/ShadersWGSL/lod3D.fragment.js +14 -2
- package/ShadersWGSL/lod3D.fragment.js.map +1 -1
- package/ShadersWGSL/lodCube.fragment.js +14 -2
- package/ShadersWGSL/lodCube.fragment.js.map +1 -1
- package/ShadersWGSL/openpbr.vertex.js +3 -1
- package/ShadersWGSL/openpbr.vertex.js.map +1 -1
- package/ShadersWGSL/pbr.fragment.js +11 -0
- package/ShadersWGSL/pbr.fragment.js.map +1 -1
- package/ShadersWGSL/pbr.vertex.js +3 -1
- package/ShadersWGSL/pbr.vertex.js.map +1 -1
- package/ShadersWGSL/textureMerger.fragment.js +40 -4
- package/ShadersWGSL/textureMerger.fragment.js.map +1 -1
- package/ShadersWGSL/textureProcessor.fragment.js +26 -4
- package/ShadersWGSL/textureProcessor.fragment.js.map +1 -1
- package/Sprites/spriteRenderer.js +15 -5
- package/Sprites/spriteRenderer.js.map +1 -1
- package/package.json +1 -1
- package/scene.pure.d.ts +23 -1
- package/scene.pure.js +83 -1
- package/scene.pure.js.map +1 -1
|
@@ -3,16 +3,16 @@ import { type IFlowGraphBlockConfiguration } from "../../../flowGraphBlock.js";
|
|
|
3
3
|
import { type FlowGraphContext } from "../../../flowGraphContext.js";
|
|
4
4
|
import { type FlowGraphDataConnection } from "../../../flowGraphDataConnection.pure.js";
|
|
5
5
|
import { FlowGraphCachedOperationBlock } from "../flowGraphCachedOperationBlock.js";
|
|
6
|
-
import { type
|
|
6
|
+
import { type FlowGraphSoundReference } from "../../../flowGraphSoundAssets.js";
|
|
7
7
|
/**
|
|
8
8
|
* @experimental
|
|
9
9
|
* A data block that reads the current volume of an Audio V2 sound.
|
|
10
10
|
*/
|
|
11
11
|
export declare class FlowGraphGetSoundVolumeBlock extends FlowGraphCachedOperationBlock<number> {
|
|
12
12
|
/**
|
|
13
|
-
* Input connection: The sound to read the volume from.
|
|
13
|
+
* Input connection: The sound to read the volume from. Accepts an Audio V2 sound or the name of a sound asset declared on the coordinator.
|
|
14
14
|
*/
|
|
15
|
-
readonly sound: FlowGraphDataConnection<
|
|
15
|
+
readonly sound: FlowGraphDataConnection<FlowGraphSoundReference>;
|
|
16
16
|
/**
|
|
17
17
|
* Constructs a new FlowGraphGetSoundVolumeBlock.
|
|
18
18
|
* @param config - optional configuration for the block
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/** This file must only contain pure code and pure imports */
|
|
2
2
|
import { RichTypeAny, RichTypeNumber } from "../../../flowGraphRichTypes.pure.js";
|
|
3
3
|
import { FlowGraphCachedOperationBlock } from "../flowGraphCachedOperationBlock.js";
|
|
4
|
+
import { ResolveFlowGraphSound } from "../../../flowGraphSoundAssets.js";
|
|
4
5
|
import { RegisterClass } from "../../../../Misc/typeStore.js";
|
|
5
6
|
/**
|
|
6
7
|
* @experimental
|
|
@@ -19,7 +20,7 @@ export class FlowGraphGetSoundVolumeBlock extends FlowGraphCachedOperationBlock
|
|
|
19
20
|
* @internal
|
|
20
21
|
*/
|
|
21
22
|
_doOperation(context) {
|
|
22
|
-
const soundValue = this.sound.getValue(context);
|
|
23
|
+
const soundValue = ResolveFlowGraphSound(context, this.sound.getValue(context));
|
|
23
24
|
if (!soundValue) {
|
|
24
25
|
return undefined;
|
|
25
26
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flowGraphGetSoundVolumeBlock.pure.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FlowGraph/Blocks/Data/Audio/flowGraphGetSoundVolumeBlock.pure.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAK7D,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAE/E,OAAO,EAAE,6BAA6B,EAAE,MAAM,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"flowGraphGetSoundVolumeBlock.pure.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FlowGraph/Blocks/Data/Audio/flowGraphGetSoundVolumeBlock.pure.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAK7D,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAE/E,OAAO,EAAE,6BAA6B,EAAE,MAAM,kCAAkC,CAAC;AACjF,OAAO,EAAgC,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AACpG,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAE3D;;;GAGG;AACH,MAAM,OAAO,4BAA6B,SAAQ,6BAAqC;IAMnF;;;OAGG;IACH,YAAmB,MAAqC;QACpD,KAAK,CAAC,cAAc,EAAE,MAAM,CAAC,CAAC;QAC9B,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,iBAAiB,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;IAC9D,CAAC;IAED;;OAEG;IACa,YAAY,CAAC,OAAyB;QAClD,MAAM,UAAU,GAAG,qBAAqB,CAAC,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC;QAChF,IAAI,CAAC,UAAU,EAAE,CAAC;YACd,OAAO,SAAS,CAAC;QACrB,CAAC;QACD,OAAO,UAAU,CAAC,MAAM,CAAC;IAC7B,CAAC;IAED;;OAEG;IACa,YAAY;QACxB,+EAA0C;IAC9C,CAAC;CACJ;AAED,IAAI,WAAW,GAAG,KAAK,CAAC;AACxB;;;GAGG;AACH,MAAM,UAAU,oCAAoC;IAChD,IAAI,WAAW,EAAE,CAAC;QACd,OAAO;IACX,CAAC;IACD,WAAW,GAAG,IAAI,CAAC;IAEnB,aAAa,0EAAqC,4BAA4B,CAAC,CAAC;AACpF,CAAC","sourcesContent":["/** This file must only contain pure code and pure imports */\n\nimport { type IFlowGraphBlockConfiguration } from \"../../../flowGraphBlock\";\nimport { type FlowGraphContext } from \"../../../flowGraphContext\";\nimport { type FlowGraphDataConnection } from \"../../../flowGraphDataConnection.pure\";\nimport { RichTypeAny, RichTypeNumber } from \"../../../flowGraphRichTypes.pure\";\nimport { FlowGraphBlockNames } from \"../../flowGraphBlockNames\";\nimport { FlowGraphCachedOperationBlock } from \"../flowGraphCachedOperationBlock\";\nimport { type FlowGraphSoundReference, ResolveFlowGraphSound } from \"../../../flowGraphSoundAssets\";\nimport { RegisterClass } from \"../../../../Misc/typeStore\";\n\n/**\n * @experimental\n * A data block that reads the current volume of an Audio V2 sound.\n */\nexport class FlowGraphGetSoundVolumeBlock extends FlowGraphCachedOperationBlock<number> {\n /**\n * Input connection: The sound to read the volume from. Accepts an Audio V2 sound or the name of a sound asset declared on the coordinator.\n */\n public readonly sound: FlowGraphDataConnection<FlowGraphSoundReference>;\n\n /**\n * Constructs a new FlowGraphGetSoundVolumeBlock.\n * @param config - optional configuration for the block\n */\n public constructor(config?: IFlowGraphBlockConfiguration) {\n super(RichTypeNumber, config);\n this.sound = this.registerDataInput(\"sound\", RichTypeAny);\n }\n\n /**\n * @internal\n */\n public override _doOperation(context: FlowGraphContext): number | undefined {\n const soundValue = ResolveFlowGraphSound(context, this.sound.getValue(context));\n if (!soundValue) {\n return undefined;\n }\n return soundValue.volume;\n }\n\n /**\n * @returns class name of the block.\n */\n public override getClassName(): string {\n return FlowGraphBlockNames.AudioGetVolume;\n }\n}\n\nlet _Registered = false;\n/**\n * Register side effects for flowGraphGetSoundVolumeBlock.\n * Safe to call multiple times; only the first call has an effect.\n */\nexport function RegisterFlowGraphGetSoundVolumeBlock(): void {\n if (_Registered) {\n return;\n }\n _Registered = true;\n\n RegisterClass(FlowGraphBlockNames.AudioGetVolume, FlowGraphGetSoundVolumeBlock);\n}\n"]}
|
|
@@ -3,16 +3,16 @@ import { type IFlowGraphBlockConfiguration } from "../../../flowGraphBlock.js";
|
|
|
3
3
|
import { type FlowGraphContext } from "../../../flowGraphContext.js";
|
|
4
4
|
import { type FlowGraphDataConnection } from "../../../flowGraphDataConnection.pure.js";
|
|
5
5
|
import { FlowGraphCachedOperationBlock } from "../flowGraphCachedOperationBlock.js";
|
|
6
|
-
import { type
|
|
6
|
+
import { type FlowGraphSoundReference } from "../../../flowGraphSoundAssets.js";
|
|
7
7
|
/**
|
|
8
8
|
* @experimental
|
|
9
9
|
* A data block that checks whether an Audio V2 sound is currently playing.
|
|
10
10
|
*/
|
|
11
11
|
export declare class FlowGraphIsSoundPlayingBlock extends FlowGraphCachedOperationBlock<boolean> {
|
|
12
12
|
/**
|
|
13
|
-
* Input connection: The sound to check.
|
|
13
|
+
* Input connection: The sound to check. Accepts an Audio V2 sound or the name of a sound asset declared on the coordinator.
|
|
14
14
|
*/
|
|
15
|
-
readonly sound: FlowGraphDataConnection<
|
|
15
|
+
readonly sound: FlowGraphDataConnection<FlowGraphSoundReference>;
|
|
16
16
|
/**
|
|
17
17
|
* Constructs a new FlowGraphIsSoundPlayingBlock.
|
|
18
18
|
* @param config - optional configuration for the block
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/** This file must only contain pure code and pure imports */
|
|
2
2
|
import { RichTypeAny, RichTypeBoolean } from "../../../flowGraphRichTypes.pure.js";
|
|
3
3
|
import { FlowGraphCachedOperationBlock } from "../flowGraphCachedOperationBlock.js";
|
|
4
|
+
import { ResolveFlowGraphSound } from "../../../flowGraphSoundAssets.js";
|
|
4
5
|
import { RegisterClass } from "../../../../Misc/typeStore.js";
|
|
5
6
|
/**
|
|
6
7
|
* @experimental
|
|
@@ -19,7 +20,7 @@ export class FlowGraphIsSoundPlayingBlock extends FlowGraphCachedOperationBlock
|
|
|
19
20
|
* @internal
|
|
20
21
|
*/
|
|
21
22
|
_doOperation(context) {
|
|
22
|
-
const soundValue = this.sound.getValue(context);
|
|
23
|
+
const soundValue = ResolveFlowGraphSound(context, this.sound.getValue(context));
|
|
23
24
|
if (!soundValue) {
|
|
24
25
|
return undefined;
|
|
25
26
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flowGraphIsSoundPlayingBlock.pure.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FlowGraph/Blocks/Data/Audio/flowGraphIsSoundPlayingBlock.pure.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAK7D,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAEhF,OAAO,EAAE,6BAA6B,EAAE,MAAM,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"flowGraphIsSoundPlayingBlock.pure.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FlowGraph/Blocks/Data/Audio/flowGraphIsSoundPlayingBlock.pure.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAK7D,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAEhF,OAAO,EAAE,6BAA6B,EAAE,MAAM,kCAAkC,CAAC;AACjF,OAAO,EAAgC,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAEpG,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAE3D;;;GAGG;AACH,MAAM,OAAO,4BAA6B,SAAQ,6BAAsC;IAMpF;;;OAGG;IACH,YAAmB,MAAqC;QACpD,KAAK,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC;QAC/B,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,iBAAiB,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;IAC9D,CAAC;IAED;;OAEG;IACa,YAAY,CAAC,OAAyB;QAClD,MAAM,UAAU,GAAG,qBAAqB,CAAC,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC;QAChF,IAAI,CAAC,UAAU,EAAE,CAAC;YACd,OAAO,SAAS,CAAC;QACrB,CAAC;QACD,OAAO,UAAU,CAAC,KAAK,+BAAuB,IAAI,UAAU,CAAC,KAAK,gCAAwB,CAAC;IAC/F,CAAC;IAED;;OAEG;IACa,YAAY;QACxB,oFAA+C;IACnD,CAAC;CACJ;AAED,IAAI,WAAW,GAAG,KAAK,CAAC;AACxB;;;GAGG;AACH,MAAM,UAAU,oCAAoC;IAChD,IAAI,WAAW,EAAE,CAAC;QACd,OAAO;IACX,CAAC;IACD,WAAW,GAAG,IAAI,CAAC;IAEnB,aAAa,+EAA0C,4BAA4B,CAAC,CAAC;AACzF,CAAC","sourcesContent":["/** This file must only contain pure code and pure imports */\n\nimport { type IFlowGraphBlockConfiguration } from \"../../../flowGraphBlock\";\nimport { type FlowGraphContext } from \"../../../flowGraphContext\";\nimport { type FlowGraphDataConnection } from \"../../../flowGraphDataConnection.pure\";\nimport { RichTypeAny, RichTypeBoolean } from \"../../../flowGraphRichTypes.pure\";\nimport { FlowGraphBlockNames } from \"../../flowGraphBlockNames\";\nimport { FlowGraphCachedOperationBlock } from \"../flowGraphCachedOperationBlock\";\nimport { type FlowGraphSoundReference, ResolveFlowGraphSound } from \"../../../flowGraphSoundAssets\";\nimport { SoundState } from \"../../../../AudioV2/soundState\";\nimport { RegisterClass } from \"../../../../Misc/typeStore\";\n\n/**\n * @experimental\n * A data block that checks whether an Audio V2 sound is currently playing.\n */\nexport class FlowGraphIsSoundPlayingBlock extends FlowGraphCachedOperationBlock<boolean> {\n /**\n * Input connection: The sound to check. Accepts an Audio V2 sound or the name of a sound asset declared on the coordinator.\n */\n public readonly sound: FlowGraphDataConnection<FlowGraphSoundReference>;\n\n /**\n * Constructs a new FlowGraphIsSoundPlayingBlock.\n * @param config - optional configuration for the block\n */\n public constructor(config?: IFlowGraphBlockConfiguration) {\n super(RichTypeBoolean, config);\n this.sound = this.registerDataInput(\"sound\", RichTypeAny);\n }\n\n /**\n * @internal\n */\n public override _doOperation(context: FlowGraphContext): boolean | undefined {\n const soundValue = ResolveFlowGraphSound(context, this.sound.getValue(context));\n if (!soundValue) {\n return undefined;\n }\n return soundValue.state === SoundState.Started || soundValue.state === SoundState.Starting;\n }\n\n /**\n * @returns class name of the block.\n */\n public override getClassName(): string {\n return FlowGraphBlockNames.AudioIsSoundPlaying;\n }\n}\n\nlet _Registered = false;\n/**\n * Register side effects for flowGraphIsSoundPlayingBlock.\n * Safe to call multiple times; only the first call has an effect.\n */\nexport function RegisterFlowGraphIsSoundPlayingBlock(): void {\n if (_Registered) {\n return;\n }\n _Registered = true;\n\n RegisterClass(FlowGraphBlockNames.AudioIsSoundPlaying, FlowGraphIsSoundPlayingBlock);\n}\n"]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Re-exports pure implementation and applies runtime side effects.
|
|
3
|
+
* Import flowGraphMeshIntersectionEventBlock.pure for tree-shakeable, side-effect-free usage.
|
|
4
|
+
*/
|
|
5
|
+
export * from "./flowGraphMeshIntersectionEventBlock.pure.js";
|
|
6
|
+
import { RegisterFlowGraphMeshIntersectionEventBlock } from "./flowGraphMeshIntersectionEventBlock.pure.js";
|
|
7
|
+
RegisterFlowGraphMeshIntersectionEventBlock();
|
|
8
|
+
//# sourceMappingURL=flowGraphMeshIntersectionEventBlock.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flowGraphMeshIntersectionEventBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FlowGraph/Blocks/Event/flowGraphMeshIntersectionEventBlock.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,cAAc,4CAA4C,CAAC;AAE3D,OAAO,EAAE,2CAA2C,EAAE,MAAM,4CAA4C,CAAC;AACzG,2CAA2C,EAAE,CAAC","sourcesContent":["/**\n * Re-exports pure implementation and applies runtime side effects.\n * Import flowGraphMeshIntersectionEventBlock.pure for tree-shakeable, side-effect-free usage.\n */\nexport * from \"./flowGraphMeshIntersectionEventBlock.pure\";\n\nimport { RegisterFlowGraphMeshIntersectionEventBlock } from \"./flowGraphMeshIntersectionEventBlock.pure\";\nRegisterFlowGraphMeshIntersectionEventBlock();\n"]}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/** This file must only contain pure code and pure imports */
|
|
2
|
+
import { type AbstractMesh } from "../../../Meshes/abstractMesh.pure.js";
|
|
3
|
+
import { FlowGraphEventBlock } from "../../flowGraphEventBlock.js";
|
|
4
|
+
import { type FlowGraphContext } from "../../flowGraphContext.js";
|
|
5
|
+
import { type IFlowGraphBlockConfiguration } from "../../flowGraphBlock.js";
|
|
6
|
+
import { type FlowGraphSignalConnection } from "../../flowGraphSignalConnection.pure.js";
|
|
7
|
+
import { type FlowGraphDataConnection } from "../../flowGraphDataConnection.pure.js";
|
|
8
|
+
import { FlowGraphEventType } from "../../flowGraphEventType.js";
|
|
9
|
+
/**
|
|
10
|
+
* @experimental
|
|
11
|
+
* An event block that fires when a source mesh starts or stops intersecting one of a list of target meshes.
|
|
12
|
+
* The intersection is checked before each frame using the meshes' bounding volumes, so no physics engine is required.
|
|
13
|
+
* The `onEnter` signal fires when a target starts intersecting the source and `onExit` fires when it stops.
|
|
14
|
+
* The `out` and `done` signals fire on both transitions; use `isIntersecting` to tell them apart.
|
|
15
|
+
* Disabled or disposed meshes are treated as not intersecting.
|
|
16
|
+
*/
|
|
17
|
+
export declare class FlowGraphMeshIntersectionEventBlock extends FlowGraphEventBlock {
|
|
18
|
+
/**
|
|
19
|
+
* Input connection: The mesh to check for intersections.
|
|
20
|
+
*/
|
|
21
|
+
readonly sourceMesh: FlowGraphDataConnection<AbstractMesh>;
|
|
22
|
+
/**
|
|
23
|
+
* Input connection: The mesh, or array of meshes, checked against the source mesh.
|
|
24
|
+
*/
|
|
25
|
+
readonly targetMeshes: FlowGraphDataConnection<AbstractMesh | AbstractMesh[]>;
|
|
26
|
+
/**
|
|
27
|
+
* Input connection: Whether to use the oriented bounding boxes instead of the axis-aligned ones. Defaults to false.
|
|
28
|
+
*/
|
|
29
|
+
readonly usePreciseIntersection: FlowGraphDataConnection<boolean>;
|
|
30
|
+
/**
|
|
31
|
+
* Output connection: The target mesh that started or stopped intersecting the source mesh.
|
|
32
|
+
*/
|
|
33
|
+
readonly otherMesh: FlowGraphDataConnection<AbstractMesh>;
|
|
34
|
+
/**
|
|
35
|
+
* Output connection: True if the last transition was an enter, false if it was an exit.
|
|
36
|
+
*/
|
|
37
|
+
readonly isIntersecting: FlowGraphDataConnection<boolean>;
|
|
38
|
+
/**
|
|
39
|
+
* Output signal: Fires when a target mesh starts intersecting the source mesh.
|
|
40
|
+
*/
|
|
41
|
+
readonly onEnter: FlowGraphSignalConnection;
|
|
42
|
+
/**
|
|
43
|
+
* Output signal: Fires when a target mesh stops intersecting the source mesh.
|
|
44
|
+
*/
|
|
45
|
+
readonly onExit: FlowGraphSignalConnection;
|
|
46
|
+
readonly type: FlowGraphEventType;
|
|
47
|
+
/** @returns the mesh intersection event key */
|
|
48
|
+
get eventKey(): string;
|
|
49
|
+
/**
|
|
50
|
+
* Constructs a new FlowGraphMeshIntersectionEventBlock.
|
|
51
|
+
* @param config - optional configuration for the block
|
|
52
|
+
*/
|
|
53
|
+
constructor(config?: IFlowGraphBlockConfiguration);
|
|
54
|
+
/**
|
|
55
|
+
* @internal
|
|
56
|
+
*/
|
|
57
|
+
_preparePendingTasks(_context: FlowGraphContext): void;
|
|
58
|
+
/**
|
|
59
|
+
* @internal
|
|
60
|
+
*/
|
|
61
|
+
_executeEvent(context: FlowGraphContext, _payload: any): boolean;
|
|
62
|
+
private _checkTarget;
|
|
63
|
+
private _fireTransition;
|
|
64
|
+
/**
|
|
65
|
+
* @internal
|
|
66
|
+
*/
|
|
67
|
+
_cancelPendingTasks(context: FlowGraphContext): void;
|
|
68
|
+
/**
|
|
69
|
+
* @returns class name of the block.
|
|
70
|
+
*/
|
|
71
|
+
getClassName(): string;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Register side effects for flowGraphMeshIntersectionEventBlock.
|
|
75
|
+
* Safe to call multiple times; only the first call has an effect.
|
|
76
|
+
*/
|
|
77
|
+
export declare function RegisterFlowGraphMeshIntersectionEventBlock(): void;
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
/** This file must only contain pure code and pure imports */
|
|
2
|
+
import { FlowGraphEventBlock } from "../../flowGraphEventBlock.js";
|
|
3
|
+
import { RichTypeAny, RichTypeBoolean } from "../../flowGraphRichTypes.pure.js";
|
|
4
|
+
import { RegisterClass } from "../../../Misc/typeStore.js";
|
|
5
|
+
/** Event source key used to build this block's event reference. */
|
|
6
|
+
const EventKey = "meshIntersection";
|
|
7
|
+
function IsCheckableMesh(value) {
|
|
8
|
+
return !!value && typeof value.intersectsMesh === "function" && !value.isDisposed() && value.isEnabled();
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* @experimental
|
|
12
|
+
* An event block that fires when a source mesh starts or stops intersecting one of a list of target meshes.
|
|
13
|
+
* The intersection is checked before each frame using the meshes' bounding volumes, so no physics engine is required.
|
|
14
|
+
* The `onEnter` signal fires when a target starts intersecting the source and `onExit` fires when it stops.
|
|
15
|
+
* The `out` and `done` signals fire on both transitions; use `isIntersecting` to tell them apart.
|
|
16
|
+
* Disabled or disposed meshes are treated as not intersecting.
|
|
17
|
+
*/
|
|
18
|
+
export class FlowGraphMeshIntersectionEventBlock extends FlowGraphEventBlock {
|
|
19
|
+
/** @returns the mesh intersection event key */
|
|
20
|
+
get eventKey() {
|
|
21
|
+
return EventKey;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Constructs a new FlowGraphMeshIntersectionEventBlock.
|
|
25
|
+
* @param config - optional configuration for the block
|
|
26
|
+
*/
|
|
27
|
+
constructor(config) {
|
|
28
|
+
super(config);
|
|
29
|
+
this.type = "SceneBeforeRender" /* FlowGraphEventType.SceneBeforeRender */;
|
|
30
|
+
this.sourceMesh = this.registerDataInput("sourceMesh", RichTypeAny);
|
|
31
|
+
this.targetMeshes = this.registerDataInput("targetMeshes", RichTypeAny);
|
|
32
|
+
this.usePreciseIntersection = this.registerDataInput("usePreciseIntersection", RichTypeBoolean, false);
|
|
33
|
+
this.otherMesh = this.registerDataOutput("otherMesh", RichTypeAny);
|
|
34
|
+
this.isIntersecting = this.registerDataOutput("isIntersecting", RichTypeBoolean, false);
|
|
35
|
+
this.onEnter = this._registerSignalOutput("onEnter");
|
|
36
|
+
this.onExit = this._registerSignalOutput("onExit");
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* @internal
|
|
40
|
+
*/
|
|
41
|
+
_preparePendingTasks(_context) {
|
|
42
|
+
// The intersection state is created lazily on the first check.
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* @internal
|
|
46
|
+
*/
|
|
47
|
+
_executeEvent(context, _payload) {
|
|
48
|
+
let state = context._getExecutionVariable(this, "_intersectionState", null);
|
|
49
|
+
if (!state) {
|
|
50
|
+
state = { intersecting: [], intersectingSet: new Set(), scratch: [], scratchSet: new Set(), visited: new Set() };
|
|
51
|
+
context._setExecutionVariable(this, "_intersectionState", state);
|
|
52
|
+
}
|
|
53
|
+
const previous = state.intersecting;
|
|
54
|
+
const previousSet = state.intersectingSet;
|
|
55
|
+
const current = state.scratch;
|
|
56
|
+
const currentSet = state.scratchSet;
|
|
57
|
+
current.length = 0;
|
|
58
|
+
currentSet.clear();
|
|
59
|
+
state.visited.clear();
|
|
60
|
+
// The check is not triggered by a signal, so start a new execution frame to refresh cached data blocks feeding the inputs.
|
|
61
|
+
context._increaseExecutionId();
|
|
62
|
+
const source = this.sourceMesh.getValue(context);
|
|
63
|
+
if (IsCheckableMesh(source)) {
|
|
64
|
+
const targets = this.targetMeshes.getValue(context);
|
|
65
|
+
const precise = !!this.usePreciseIntersection.getValue(context);
|
|
66
|
+
// Before-render runs before the frame's render id advances, so a cached world matrix can miss in-place transform changes.
|
|
67
|
+
source.computeWorldMatrix(true);
|
|
68
|
+
if (Array.isArray(targets)) {
|
|
69
|
+
for (let i = 0; i < targets.length; i++) {
|
|
70
|
+
this._checkTarget(source, targets[i], precise, state);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
this._checkTarget(source, targets, precise, state);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
// Swap the lists before firing signals so re-entrant checks see a consistent state.
|
|
78
|
+
state.intersecting = current;
|
|
79
|
+
state.intersectingSet = currentSet;
|
|
80
|
+
state.scratch = previous;
|
|
81
|
+
state.scratchSet = previousSet;
|
|
82
|
+
for (let i = 0; i < previous.length; i++) {
|
|
83
|
+
if (!currentSet.has(previous[i])) {
|
|
84
|
+
this._fireTransition(context, previous[i], false);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
for (let i = 0; i < current.length; i++) {
|
|
88
|
+
if (!previousSet.has(current[i])) {
|
|
89
|
+
this._fireTransition(context, current[i], true);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
return true;
|
|
93
|
+
}
|
|
94
|
+
_checkTarget(source, target, precise, state) {
|
|
95
|
+
if (target === source || state.visited.has(target)) {
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
state.visited.add(target);
|
|
99
|
+
if (!IsCheckableMesh(target)) {
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
target.computeWorldMatrix(true);
|
|
103
|
+
if (source.intersectsMesh(target, precise)) {
|
|
104
|
+
state.scratch.push(target);
|
|
105
|
+
state.scratchSet.add(target);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
_fireTransition(context, other, entered) {
|
|
109
|
+
this.otherMesh.setValue(other, context);
|
|
110
|
+
this.isIntersecting.setValue(entered, context);
|
|
111
|
+
context._notifyExecuteNode(this);
|
|
112
|
+
(entered ? this.onEnter : this.onExit)._activateSignal(context);
|
|
113
|
+
this.done._activateSignal(context);
|
|
114
|
+
this.out._activateSignal(context);
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* @internal
|
|
118
|
+
*/
|
|
119
|
+
_cancelPendingTasks(context) {
|
|
120
|
+
context._setExecutionVariable(this, "_intersectionState", null);
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* @returns class name of the block.
|
|
124
|
+
*/
|
|
125
|
+
getClassName() {
|
|
126
|
+
return "FlowGraphMeshIntersectionEventBlock" /* FlowGraphBlockNames.MeshIntersectionEvent */;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
let _Registered = false;
|
|
130
|
+
/**
|
|
131
|
+
* Register side effects for flowGraphMeshIntersectionEventBlock.
|
|
132
|
+
* Safe to call multiple times; only the first call has an effect.
|
|
133
|
+
*/
|
|
134
|
+
export function RegisterFlowGraphMeshIntersectionEventBlock() {
|
|
135
|
+
if (_Registered) {
|
|
136
|
+
return;
|
|
137
|
+
}
|
|
138
|
+
_Registered = true;
|
|
139
|
+
RegisterClass("FlowGraphMeshIntersectionEventBlock" /* FlowGraphBlockNames.MeshIntersectionEvent */, FlowGraphMeshIntersectionEventBlock);
|
|
140
|
+
}
|
|
141
|
+
//# sourceMappingURL=flowGraphMeshIntersectionEventBlock.pure.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flowGraphMeshIntersectionEventBlock.pure.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FlowGraph/Blocks/Event/flowGraphMeshIntersectionEventBlock.pure.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAG7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAMhE,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAG7E,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAExD,mEAAmE;AACnE,MAAM,QAAQ,GAAG,kBAAkB,CAAC;AAepC,SAAS,eAAe,CAAC,KAAU;IAC/B,OAAO,CAAC,CAAC,KAAK,IAAI,OAAO,KAAK,CAAC,cAAc,KAAK,UAAU,IAAI,CAAC,KAAK,CAAC,UAAU,EAAE,IAAI,KAAK,CAAC,SAAS,EAAE,CAAC;AAC7G,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,OAAO,mCAAoC,SAAQ,mBAAmB;IAsCxE,+CAA+C;IAC/C,IAAoB,QAAQ;QACxB,OAAO,QAAQ,CAAC;IACpB,CAAC;IAED;;;OAGG;IACH,YAAmB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,CAAC;YAC3B,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QACjC,CAAC;IACL,CAAC;IAEO,eAAe,CAAC,OAAyB,EAAE,KAAmB,EAAE,OAAgB;QACpF,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;QACxC,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAC/C,OAAO,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC;QACjC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;QAChE,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;QACnC,IAAI,CAAC,GAAG,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;IACtC,CAAC;IAED;;OAEG;IACa,mBAAmB,CAAC,OAAyB;QACzD,OAAO,CAAC,qBAAqB,CAAC,IAAI,EAAE,oBAAoB,EAAE,IAAI,CAAC,CAAC;IACpE,CAAC;IAED;;OAEG;IACa,YAAY;QACxB,6FAAiD;IACrD,CAAC;CACJ;AAED,IAAI,WAAW,GAAG,KAAK,CAAC;AACxB;;;GAGG;AACH,MAAM,UAAU,2CAA2C;IACvD,IAAI,WAAW,EAAE,CAAC;QACd,OAAO;IACX,CAAC;IACD,WAAW,GAAG,IAAI,CAAC;IAEnB,aAAa,wFAA4C,mCAAmC,CAAC,CAAC;AAClG,CAAC","sourcesContent":["/** This file must only contain pure code and pure imports */\n\nimport { type AbstractMesh } from \"../../../Meshes/abstractMesh.pure\";\nimport { FlowGraphEventBlock } from \"../../flowGraphEventBlock\";\nimport { type FlowGraphContext } from \"../../flowGraphContext\";\nimport { type IFlowGraphBlockConfiguration } from \"../../flowGraphBlock\";\nimport { type FlowGraphSignalConnection } from \"../../flowGraphSignalConnection.pure\";\nimport { FlowGraphBlockNames } from \"../flowGraphBlockNames\";\nimport { type FlowGraphDataConnection } from \"../../flowGraphDataConnection.pure\";\nimport { RichTypeAny, RichTypeBoolean } from \"../../flowGraphRichTypes.pure\";\nimport { FlowGraphEventType } from \"../../flowGraphEventType\";\nimport { type Nullable } from \"../../../types\";\nimport { RegisterClass } from \"../../../Misc/typeStore\";\n\n/** Event source key used to build this block's event reference. */\nconst EventKey = \"meshIntersection\";\n\ninterface IIntersectionState {\n /** The target meshes intersecting the source mesh after the last check, in target order. */\n intersecting: AbstractMesh[];\n /** Membership set of `intersecting`. */\n intersectingSet: Set<AbstractMesh>;\n /** Reused list that collects the intersecting meshes during a check. */\n scratch: AbstractMesh[];\n /** Membership set of `scratch`. */\n scratchSet: Set<AbstractMesh>;\n /** Reused set of the targets already checked during a check, used to skip duplicate targets. */\n visited: Set<unknown>;\n}\n\nfunction IsCheckableMesh(value: any): value is AbstractMesh {\n return !!value && typeof value.intersectsMesh === \"function\" && !value.isDisposed() && value.isEnabled();\n}\n\n/**\n * @experimental\n * An event block that fires when a source mesh starts or stops intersecting one of a list of target meshes.\n * The intersection is checked before each frame using the meshes' bounding volumes, so no physics engine is required.\n * The `onEnter` signal fires when a target starts intersecting the source and `onExit` fires when it stops.\n * The `out` and `done` signals fire on both transitions; use `isIntersecting` to tell them apart.\n * Disabled or disposed meshes are treated as not intersecting.\n */\nexport class FlowGraphMeshIntersectionEventBlock extends FlowGraphEventBlock {\n /**\n * Input connection: The mesh to check for intersections.\n */\n public readonly sourceMesh: FlowGraphDataConnection<AbstractMesh>;\n\n /**\n * Input connection: The mesh, or array of meshes, checked against the source mesh.\n */\n public readonly targetMeshes: FlowGraphDataConnection<AbstractMesh | AbstractMesh[]>;\n\n /**\n * Input connection: Whether to use the oriented bounding boxes instead of the axis-aligned ones. Defaults to false.\n */\n public readonly usePreciseIntersection: FlowGraphDataConnection<boolean>;\n\n /**\n * Output connection: The target mesh that started or stopped intersecting the source mesh.\n */\n public readonly otherMesh: FlowGraphDataConnection<AbstractMesh>;\n\n /**\n * Output connection: True if the last transition was an enter, false if it was an exit.\n */\n public readonly isIntersecting: FlowGraphDataConnection<boolean>;\n\n /**\n * Output signal: Fires when a target mesh starts intersecting the source mesh.\n */\n public readonly onEnter: FlowGraphSignalConnection;\n\n /**\n * Output signal: Fires when a target mesh stops intersecting the source mesh.\n */\n public readonly onExit: FlowGraphSignalConnection;\n\n public override readonly type: FlowGraphEventType = FlowGraphEventType.SceneBeforeRender;\n\n /** @returns the mesh intersection event key */\n public override get eventKey(): string {\n return EventKey;\n }\n\n /**\n * Constructs a new FlowGraphMeshIntersectionEventBlock.\n * @param config - optional configuration for the block\n */\n public constructor(config?: IFlowGraphBlockConfiguration) {\n super(config);\n this.sourceMesh = this.registerDataInput(\"sourceMesh\", RichTypeAny);\n this.targetMeshes = this.registerDataInput(\"targetMeshes\", RichTypeAny);\n this.usePreciseIntersection = this.registerDataInput(\"usePreciseIntersection\", RichTypeBoolean, false);\n this.otherMesh = this.registerDataOutput(\"otherMesh\", RichTypeAny);\n this.isIntersecting = this.registerDataOutput(\"isIntersecting\", RichTypeBoolean, false);\n this.onEnter = this._registerSignalOutput(\"onEnter\");\n this.onExit = this._registerSignalOutput(\"onExit\");\n }\n\n /**\n * @internal\n */\n public override _preparePendingTasks(_context: FlowGraphContext): void {\n // The intersection state is created lazily on the first check.\n }\n\n /**\n * @internal\n */\n public override _executeEvent(context: FlowGraphContext, _payload: any): boolean {\n let state = context._getExecutionVariable<Nullable<IIntersectionState>>(this, \"_intersectionState\", null);\n if (!state) {\n state = { intersecting: [], intersectingSet: new Set(), scratch: [], scratchSet: new Set(), visited: new Set() };\n context._setExecutionVariable(this, \"_intersectionState\", state);\n }\n\n const previous = state.intersecting;\n const previousSet = state.intersectingSet;\n const current = state.scratch;\n const currentSet = state.scratchSet;\n current.length = 0;\n currentSet.clear();\n state.visited.clear();\n\n // The check is not triggered by a signal, so start a new execution frame to refresh cached data blocks feeding the inputs.\n context._increaseExecutionId();\n const source = this.sourceMesh.getValue(context);\n if (IsCheckableMesh(source)) {\n const targets = this.targetMeshes.getValue(context);\n const precise = !!this.usePreciseIntersection.getValue(context);\n // Before-render runs before the frame's render id advances, so a cached world matrix can miss in-place transform changes.\n source.computeWorldMatrix(true);\n if (Array.isArray(targets)) {\n for (let i = 0; i < targets.length; i++) {\n this._checkTarget(source, targets[i], precise, state);\n }\n } else {\n this._checkTarget(source, targets, precise, state);\n }\n }\n\n // Swap the lists before firing signals so re-entrant checks see a consistent state.\n state.intersecting = current;\n state.intersectingSet = currentSet;\n state.scratch = previous;\n state.scratchSet = previousSet;\n\n for (let i = 0; i < previous.length; i++) {\n if (!currentSet.has(previous[i])) {\n this._fireTransition(context, previous[i], false);\n }\n }\n for (let i = 0; i < current.length; i++) {\n if (!previousSet.has(current[i])) {\n this._fireTransition(context, current[i], true);\n }\n }\n return true;\n }\n\n private _checkTarget(source: AbstractMesh, target: unknown, precise: boolean, state: IIntersectionState): void {\n if (target === source || state.visited.has(target)) {\n return;\n }\n state.visited.add(target);\n if (!IsCheckableMesh(target)) {\n return;\n }\n target.computeWorldMatrix(true);\n if (source.intersectsMesh(target, precise)) {\n state.scratch.push(target);\n state.scratchSet.add(target);\n }\n }\n\n private _fireTransition(context: FlowGraphContext, other: AbstractMesh, entered: boolean): void {\n this.otherMesh.setValue(other, context);\n this.isIntersecting.setValue(entered, context);\n context._notifyExecuteNode(this);\n (entered ? this.onEnter : this.onExit)._activateSignal(context);\n this.done._activateSignal(context);\n this.out._activateSignal(context);\n }\n\n /**\n * @internal\n */\n public override _cancelPendingTasks(context: FlowGraphContext): void {\n context._setExecutionVariable(this, \"_intersectionState\", null);\n }\n\n /**\n * @returns class name of the block.\n */\n public override getClassName(): string {\n return FlowGraphBlockNames.MeshIntersectionEvent;\n }\n}\n\nlet _Registered = false;\n/**\n * Register side effects for flowGraphMeshIntersectionEventBlock.\n * Safe to call multiple times; only the first call has an effect.\n */\nexport function RegisterFlowGraphMeshIntersectionEventBlock(): void {\n if (_Registered) {\n return;\n }\n _Registered = true;\n\n RegisterClass(FlowGraphBlockNames.MeshIntersectionEvent, FlowGraphMeshIntersectionEventBlock);\n}\n"]}
|
|
@@ -3,7 +3,7 @@ import { FlowGraphEventBlock } from "../../flowGraphEventBlock.js";
|
|
|
3
3
|
import { type FlowGraphContext } from "../../flowGraphContext.js";
|
|
4
4
|
import { type IFlowGraphBlockConfiguration } from "../../flowGraphBlock.js";
|
|
5
5
|
import { type FlowGraphDataConnection } from "../../flowGraphDataConnection.pure.js";
|
|
6
|
-
import { type
|
|
6
|
+
import { type FlowGraphSoundReference } from "../../flowGraphSoundAssets.js";
|
|
7
7
|
/**
|
|
8
8
|
* @experimental
|
|
9
9
|
* An event block that fires when an Audio V2 sound stops or ends.
|
|
@@ -14,9 +14,9 @@ import { type AbstractSound } from "../../../AudioV2/abstractAudio/abstractSound
|
|
|
14
14
|
*/
|
|
15
15
|
export declare class FlowGraphSoundEndedEventBlock extends FlowGraphEventBlock {
|
|
16
16
|
/**
|
|
17
|
-
* Input connection: The sound to monitor for when playback stops or ends.
|
|
17
|
+
* Input connection: The sound to monitor for when playback stops or ends. Accepts an Audio V2 sound or the name of a sound asset declared on the coordinator.
|
|
18
18
|
*/
|
|
19
|
-
readonly sound: FlowGraphDataConnection<
|
|
19
|
+
readonly sound: FlowGraphDataConnection<FlowGraphSoundReference>;
|
|
20
20
|
/**
|
|
21
21
|
* Constructs a new FlowGraphSoundEndedEventBlock.
|
|
22
22
|
* @param config - optional configuration for the block
|
|
@@ -26,6 +26,8 @@ export declare class FlowGraphSoundEndedEventBlock extends FlowGraphEventBlock {
|
|
|
26
26
|
* @internal
|
|
27
27
|
*/
|
|
28
28
|
_preparePendingTasks(context: FlowGraphContext): void;
|
|
29
|
+
private _subscribeToSound;
|
|
30
|
+
private _unsubscribeFromSound;
|
|
29
31
|
/**
|
|
30
32
|
* @internal
|
|
31
33
|
*/
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/** This file must only contain pure code and pure imports */
|
|
2
2
|
import { FlowGraphEventBlock } from "../../flowGraphEventBlock.js";
|
|
3
3
|
import { RichTypeAny } from "../../flowGraphRichTypes.pure.js";
|
|
4
|
+
import { GetFlowGraphSoundAssetName, ResolveFlowGraphSound } from "../../flowGraphSoundAssets.js";
|
|
4
5
|
import { RegisterClass } from "../../../Misc/typeStore.js";
|
|
5
6
|
/**
|
|
6
7
|
* @experimental
|
|
@@ -23,11 +24,31 @@ export class FlowGraphSoundEndedEventBlock extends FlowGraphEventBlock {
|
|
|
23
24
|
* @internal
|
|
24
25
|
*/
|
|
25
26
|
_preparePendingTasks(context) {
|
|
26
|
-
const
|
|
27
|
+
const reference = this.sound.getValue(context);
|
|
28
|
+
const assetName = GetFlowGraphSoundAssetName(reference);
|
|
29
|
+
if (assetName !== null) {
|
|
30
|
+
// Follow the named asset so that replacing or loading it rebinds the subscription.
|
|
31
|
+
const coordinator = context.configuration.coordinator;
|
|
32
|
+
const assetObserver = coordinator.onSoundAssetChangedObservable.add((name) => {
|
|
33
|
+
if (name === assetName) {
|
|
34
|
+
this._subscribeToSound(context, coordinator.getSoundAsset(name));
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
context._setExecutionVariable(this, "_soundAssetObserver", assetObserver);
|
|
38
|
+
context._setExecutionVariable(this, "_soundAssetCoordinator", coordinator);
|
|
39
|
+
}
|
|
40
|
+
const soundValue = ResolveFlowGraphSound(context, reference);
|
|
27
41
|
if (!soundValue) {
|
|
28
42
|
this._reportError(context, "No sound provided for sound-ended event");
|
|
29
43
|
return;
|
|
30
44
|
}
|
|
45
|
+
this._subscribeToSound(context, soundValue);
|
|
46
|
+
}
|
|
47
|
+
_subscribeToSound(context, soundValue) {
|
|
48
|
+
this._unsubscribeFromSound(context);
|
|
49
|
+
if (!soundValue) {
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
31
52
|
const observer = soundValue.onEndedObservable.add(() => {
|
|
32
53
|
this._execute(context);
|
|
33
54
|
});
|
|
@@ -35,6 +56,15 @@ export class FlowGraphSoundEndedEventBlock extends FlowGraphEventBlock {
|
|
|
35
56
|
context._setExecutionVariable(this, "_soundEndedObserver", observer);
|
|
36
57
|
context._setExecutionVariable(this, "_subscribedSound", soundValue);
|
|
37
58
|
}
|
|
59
|
+
_unsubscribeFromSound(context) {
|
|
60
|
+
const observer = context._getExecutionVariable(this, "_soundEndedObserver", null);
|
|
61
|
+
const subscribedSound = context._getExecutionVariable(this, "_subscribedSound", null);
|
|
62
|
+
if (observer && subscribedSound) {
|
|
63
|
+
subscribedSound.onEndedObservable.remove(observer);
|
|
64
|
+
}
|
|
65
|
+
context._setExecutionVariable(this, "_soundEndedObserver", null);
|
|
66
|
+
context._setExecutionVariable(this, "_subscribedSound", null);
|
|
67
|
+
}
|
|
38
68
|
/**
|
|
39
69
|
* @internal
|
|
40
70
|
*/
|
|
@@ -47,13 +77,14 @@ export class FlowGraphSoundEndedEventBlock extends FlowGraphEventBlock {
|
|
|
47
77
|
* @internal
|
|
48
78
|
*/
|
|
49
79
|
_cancelPendingTasks(context) {
|
|
50
|
-
|
|
51
|
-
const
|
|
52
|
-
|
|
53
|
-
|
|
80
|
+
this._unsubscribeFromSound(context);
|
|
81
|
+
const assetObserver = context._getExecutionVariable(this, "_soundAssetObserver", null);
|
|
82
|
+
const coordinator = context._getExecutionVariable(this, "_soundAssetCoordinator", null);
|
|
83
|
+
if (assetObserver && coordinator) {
|
|
84
|
+
coordinator.onSoundAssetChangedObservable.remove(assetObserver);
|
|
54
85
|
}
|
|
55
|
-
context._setExecutionVariable(this, "
|
|
56
|
-
context._setExecutionVariable(this, "
|
|
86
|
+
context._setExecutionVariable(this, "_soundAssetObserver", null);
|
|
87
|
+
context._setExecutionVariable(this, "_soundAssetCoordinator", null);
|
|
57
88
|
}
|
|
58
89
|
/**
|
|
59
90
|
* @returns class name of the block.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flowGraphSoundEndedEventBlock.pure.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FlowGraph/Blocks/Event/flowGraphSoundEndedEventBlock.pure.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAE7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAKhE,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"flowGraphSoundEndedEventBlock.pure.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FlowGraph/Blocks/Event/flowGraphSoundEndedEventBlock.pure.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAE7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAKhE,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAE5D,OAAO,EAAgC,0BAA0B,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAI7H,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAExD;;;;;;;GAOG;AACH,MAAM,OAAO,6BAA8B,SAAQ,mBAAmB;IAMlE;;;OAGG;IACH,YAAmB,MAAqC;QACpD,KAAK,CAAC,MAAM,CAAC,CAAC;QACd,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,iBAAiB,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;IAC9D,CAAC;IAED;;OAEG;IACa,oBAAoB,CAAC,OAAyB;QAC1D,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QAC/C,MAAM,SAAS,GAAG,0BAA0B,CAAC,SAAS,CAAC,CAAC;QACxD,IAAI,SAAS,KAAK,IAAI,EAAE,CAAC;YACrB,mFAAmF;YACnF,MAAM,WAAW,GAAG,OAAO,CAAC,aAAa,CAAC,WAAW,CAAC;YACtD,MAAM,aAAa,GAAG,WAAW,CAAC,6BAA6B,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;gBACzE,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I,CAAC;IAEnB,aAAa,iFAA2C,6BAA6B,CAAC,CAAC;AAC3F,CAAC","sourcesContent":["/** This file must only contain pure code and pure imports */\n\nimport { FlowGraphEventBlock } from \"../../flowGraphEventBlock\";\nimport { type FlowGraphContext } from \"../../flowGraphContext\";\nimport { type IFlowGraphBlockConfiguration } from \"../../flowGraphBlock\";\nimport { FlowGraphBlockNames } from \"../flowGraphBlockNames\";\nimport { type FlowGraphDataConnection } from \"../../flowGraphDataConnection.pure\";\nimport { RichTypeAny } from \"../../flowGraphRichTypes.pure\";\nimport { type AbstractSound } from \"../../../AudioV2/abstractAudio/abstractSound\";\nimport { type FlowGraphSoundReference, GetFlowGraphSoundAssetName, ResolveFlowGraphSound } from \"../../flowGraphSoundAssets\";\nimport { type FlowGraphCoordinator } from \"../../flowGraphCoordinator\";\nimport { type Observer } from \"../../../Misc/observable.pure\";\nimport { type Nullable } from \"../../../types\";\nimport { RegisterClass } from \"../../../Misc/typeStore\";\n\n/**\n * @experimental\n * An event block that fires when an Audio V2 sound stops or ends.\n * Subscribes to the sound's onEndedObservable, which fires when playback\n * stops for any reason (natural completion or a manual call to stop()).\n * Does not fire when a looping sound naturally restarts, but will still\n * fire if a looping sound is explicitly stopped.\n */\nexport class FlowGraphSoundEndedEventBlock extends FlowGraphEventBlock {\n /**\n * Input connection: The sound to monitor for when playback stops or ends. Accepts an Audio V2 sound or the name of a sound asset declared on the coordinator.\n */\n public readonly sound: FlowGraphDataConnection<FlowGraphSoundReference>;\n\n /**\n * Constructs a new FlowGraphSoundEndedEventBlock.\n * @param config - optional configuration for the block\n */\n public constructor(config?: IFlowGraphBlockConfiguration) {\n super(config);\n this.sound = this.registerDataInput(\"sound\", RichTypeAny);\n }\n\n /**\n * @internal\n */\n public override _preparePendingTasks(context: FlowGraphContext): void {\n const reference = this.sound.getValue(context);\n const assetName = GetFlowGraphSoundAssetName(reference);\n if (assetName !== null) {\n // Follow the named asset so that replacing or loading it rebinds the subscription.\n const coordinator = context.configuration.coordinator;\n const assetObserver = coordinator.onSoundAssetChangedObservable.add((name) => {\n if (name === assetName) {\n this._subscribeToSound(context, coordinator.getSoundAsset(name));\n }\n });\n context._setExecutionVariable(this, \"_soundAssetObserver\", assetObserver);\n context._setExecutionVariable(this, \"_soundAssetCoordinator\", coordinator);\n }\n const soundValue = ResolveFlowGraphSound(context, reference);\n if (!soundValue) {\n this._reportError(context, \"No sound provided for sound-ended event\");\n return;\n }\n this._subscribeToSound(context, soundValue);\n }\n\n private _subscribeToSound(context: FlowGraphContext, soundValue: Nullable<AbstractSound>): void {\n this._unsubscribeFromSound(context);\n if (!soundValue) {\n return;\n }\n const observer = soundValue.onEndedObservable.add(() => {\n this._execute(context);\n });\n // Store observer and subscribed sound per-context for safe multi-context usage\n context._setExecutionVariable(this, \"_soundEndedObserver\", observer);\n context._setExecutionVariable(this, \"_subscribedSound\", soundValue);\n }\n\n private _unsubscribeFromSound(context: FlowGraphContext): void {\n const observer = context._getExecutionVariable<Nullable<Observer<AbstractSound>>>(this, \"_soundEndedObserver\", null);\n const subscribedSound = context._getExecutionVariable<Nullable<AbstractSound>>(this, \"_subscribedSound\", null);\n if (observer && subscribedSound) {\n subscribedSound.onEndedObservable.remove(observer);\n }\n context._setExecutionVariable(this, \"_soundEndedObserver\", null);\n context._setExecutionVariable(this, \"_subscribedSound\", null);\n }\n\n /**\n * @internal\n */\n public override _executeEvent(_context: FlowGraphContext, _payload: any): boolean {\n // This block manages its own observable subscription, so the\n // central event coordinator does not dispatch to it.\n return true;\n }\n\n /**\n * @internal\n */\n public override _cancelPendingTasks(context: FlowGraphContext): void {\n this._unsubscribeFromSound(context);\n const assetObserver = context._getExecutionVariable<Nullable<Observer<string>>>(this, \"_soundAssetObserver\", null);\n const coordinator = context._getExecutionVariable<Nullable<FlowGraphCoordinator>>(this, \"_soundAssetCoordinator\", null);\n if (assetObserver && coordinator) {\n coordinator.onSoundAssetChangedObservable.remove(assetObserver);\n }\n context._setExecutionVariable(this, \"_soundAssetObserver\", null);\n context._setExecutionVariable(this, \"_soundAssetCoordinator\", null);\n }\n\n /**\n * @returns class name of the block.\n */\n public override getClassName(): string {\n return FlowGraphBlockNames.AudioSoundEndedEvent;\n }\n}\n\nlet _Registered = false;\n/**\n * Register side effects for flowGraphSoundEndedEventBlock.\n * Safe to call multiple times; only the first call has an effect.\n */\nexport function RegisterFlowGraphSoundEndedEventBlock(): void {\n if (_Registered) {\n return;\n }\n _Registered = true;\n\n RegisterClass(FlowGraphBlockNames.AudioSoundEndedEvent, FlowGraphSoundEndedEventBlock);\n}\n"]}
|
|
@@ -6,6 +6,7 @@ export * from "./flowGraphSendCustomEventBlock.js";
|
|
|
6
6
|
export * from "./flowGraphSceneTickEventBlock.js";
|
|
7
7
|
export * from "./flowGraphPointerOutEventBlock.js";
|
|
8
8
|
export * from "./flowGraphPointerOverEventBlock.js";
|
|
9
|
+
export * from "./flowGraphMeshIntersectionEventBlock.js";
|
|
9
10
|
export * from "./flowGraphPhysicsCollisionEventBlock.js";
|
|
10
11
|
export * from "./flowGraphSoundEndedEventBlock.js";
|
|
11
12
|
export * from "./flowGraphKeyboardEventBlock.js";
|
|
@@ -6,6 +6,7 @@ export * from "./flowGraphSendCustomEventBlock.js";
|
|
|
6
6
|
export * from "./flowGraphSceneTickEventBlock.js";
|
|
7
7
|
export * from "./flowGraphPointerOutEventBlock.js";
|
|
8
8
|
export * from "./flowGraphPointerOverEventBlock.js";
|
|
9
|
+
export * from "./flowGraphMeshIntersectionEventBlock.js";
|
|
9
10
|
export * from "./flowGraphPhysicsCollisionEventBlock.js";
|
|
10
11
|
export * from "./flowGraphSoundEndedEventBlock.js";
|
|
11
12
|
export * from "./flowGraphKeyboardEventBlock.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FlowGraph/Blocks/Event/index.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAC;AAC9C,cAAc,iCAAiC,CAAC;AAChD,cAAc,oCAAoC,CAAC;AACnD,cAAc,sCAAsC,CAAC;AACrD,cAAc,iCAAiC,CAAC;AAChD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,iCAAiC,CAAC;AAChD,cAAc,kCAAkC,CAAC;AACjD,cAAc,uCAAuC,CAAC;AACtD,cAAc,iCAAiC,CAAC;AAChD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,4BAA4B,CAAC","sourcesContent":["export * from \"./flowGraphMeshPickEventBlock\";\r\nexport * from \"./flowGraphSceneReadyEventBlock\";\r\nexport * from \"./flowGraphReceiveCustomEventBlock\";\r\nexport * from \"./flowGraphStopEventPropagationBlock\";\r\nexport * from \"./flowGraphSendCustomEventBlock\";\r\nexport * from \"./flowGraphSceneTickEventBlock\";\r\nexport * from \"./flowGraphPointerOutEventBlock\";\r\nexport * from \"./flowGraphPointerOverEventBlock\";\r\nexport * from \"./flowGraphPhysicsCollisionEventBlock\";\r\nexport * from \"./flowGraphSoundEndedEventBlock\";\r\nexport * from \"./flowGraphKeyboardEventBlock\";\r\nexport * from \"./flowGraphKeyDownEventBlock\";\r\nexport * from \"./flowGraphKeyUpEventBlock\";\r\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FlowGraph/Blocks/Event/index.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAC;AAC9C,cAAc,iCAAiC,CAAC;AAChD,cAAc,oCAAoC,CAAC;AACnD,cAAc,sCAAsC,CAAC;AACrD,cAAc,iCAAiC,CAAC;AAChD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,iCAAiC,CAAC;AAChD,cAAc,kCAAkC,CAAC;AACjD,cAAc,uCAAuC,CAAC;AACtD,cAAc,uCAAuC,CAAC;AACtD,cAAc,iCAAiC,CAAC;AAChD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,4BAA4B,CAAC","sourcesContent":["export * from \"./flowGraphMeshPickEventBlock\";\r\nexport * from \"./flowGraphSceneReadyEventBlock\";\r\nexport * from \"./flowGraphReceiveCustomEventBlock\";\r\nexport * from \"./flowGraphStopEventPropagationBlock\";\r\nexport * from \"./flowGraphSendCustomEventBlock\";\r\nexport * from \"./flowGraphSceneTickEventBlock\";\r\nexport * from \"./flowGraphPointerOutEventBlock\";\r\nexport * from \"./flowGraphPointerOverEventBlock\";\r\nexport * from \"./flowGraphMeshIntersectionEventBlock\";\r\nexport * from \"./flowGraphPhysicsCollisionEventBlock\";\r\nexport * from \"./flowGraphSoundEndedEventBlock\";\r\nexport * from \"./flowGraphKeyboardEventBlock\";\r\nexport * from \"./flowGraphKeyDownEventBlock\";\r\nexport * from \"./flowGraphKeyUpEventBlock\";\r\n"]}
|
|
@@ -7,6 +7,7 @@ export * from "./flowGraphSendCustomEventBlock.pure.js";
|
|
|
7
7
|
export * from "./flowGraphSceneTickEventBlock.pure.js";
|
|
8
8
|
export * from "./flowGraphPointerOutEventBlock.pure.js";
|
|
9
9
|
export * from "./flowGraphPointerOverEventBlock.pure.js";
|
|
10
|
+
export * from "./flowGraphMeshIntersectionEventBlock.pure.js";
|
|
10
11
|
export * from "./flowGraphPhysicsCollisionEventBlock.pure.js";
|
|
11
12
|
export * from "./flowGraphSoundEndedEventBlock.pure.js";
|
|
12
13
|
export * from "./flowGraphKeyboardEventBlock.js";
|
|
@@ -7,6 +7,7 @@ export * from "./flowGraphSendCustomEventBlock.pure.js";
|
|
|
7
7
|
export * from "./flowGraphSceneTickEventBlock.pure.js";
|
|
8
8
|
export * from "./flowGraphPointerOutEventBlock.pure.js";
|
|
9
9
|
export * from "./flowGraphPointerOverEventBlock.pure.js";
|
|
10
|
+
export * from "./flowGraphMeshIntersectionEventBlock.pure.js";
|
|
10
11
|
export * from "./flowGraphPhysicsCollisionEventBlock.pure.js";
|
|
11
12
|
export * from "./flowGraphSoundEndedEventBlock.pure.js";
|
|
12
13
|
export * from "./flowGraphKeyboardEventBlock.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pure.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FlowGraph/Blocks/Event/pure.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAC7D,cAAc,oCAAoC,CAAC;AACnD,cAAc,sCAAsC,CAAC;AACrD,cAAc,yCAAyC,CAAC;AACxD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,sCAAsC,CAAC;AACrD,cAAc,qCAAqC,CAAC;AACpD,cAAc,sCAAsC,CAAC;AACrD,cAAc,uCAAuC,CAAC;AACtD,cAAc,4CAA4C,CAAC;AAC3D,cAAc,sCAAsC,CAAC;AACrD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,mCAAmC,CAAC;AAClD,cAAc,iCAAiC,CAAC;AAChD,cAAc,uCAAuC,CAAC;AACtD,cAAc,uCAAuC,CAAC;AACtD,cAAc,qCAAqC,CAAC","sourcesContent":["/** Pure barrel — re-exports only side-effect-free modules */\nexport * from \"./flowGraphMeshPickEventBlock.pure\";\nexport * from \"./flowGraphSceneReadyEventBlock.pure\";\nexport * from \"./flowGraphReceiveCustomEventBlock.pure\";\nexport * from \"./flowGraphStopEventPropagationBlock.pure\";\nexport * from \"./flowGraphSendCustomEventBlock.pure\";\nexport * from \"./flowGraphSceneTickEventBlock.pure\";\nexport * from \"./flowGraphPointerOutEventBlock.pure\";\nexport * from \"./flowGraphPointerOverEventBlock.pure\";\nexport * from \"./flowGraphPhysicsCollisionEventBlock.pure\";\nexport * from \"./flowGraphSoundEndedEventBlock.pure\";\nexport * from \"./flowGraphKeyboardEventBlock\";\nexport * from \"./flowGraphKeyDownEventBlock.pure\";\nexport * from \"./flowGraphKeyUpEventBlock.pure\";\nexport * from \"./flowGraphPointerDownEventBlock.pure\";\nexport * from \"./flowGraphPointerMoveEventBlock.pure\";\nexport * from \"./flowGraphPointerUpEventBlock.pure\";\n"]}
|
|
1
|
+
{"version":3,"file":"pure.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FlowGraph/Blocks/Event/pure.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAC7D,cAAc,oCAAoC,CAAC;AACnD,cAAc,sCAAsC,CAAC;AACrD,cAAc,yCAAyC,CAAC;AACxD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,sCAAsC,CAAC;AACrD,cAAc,qCAAqC,CAAC;AACpD,cAAc,sCAAsC,CAAC;AACrD,cAAc,uCAAuC,CAAC;AACtD,cAAc,4CAA4C,CAAC;AAC3D,cAAc,4CAA4C,CAAC;AAC3D,cAAc,sCAAsC,CAAC;AACrD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,mCAAmC,CAAC;AAClD,cAAc,iCAAiC,CAAC;AAChD,cAAc,uCAAuC,CAAC;AACtD,cAAc,uCAAuC,CAAC;AACtD,cAAc,qCAAqC,CAAC","sourcesContent":["/** Pure barrel — re-exports only side-effect-free modules */\nexport * from \"./flowGraphMeshPickEventBlock.pure\";\nexport * from \"./flowGraphSceneReadyEventBlock.pure\";\nexport * from \"./flowGraphReceiveCustomEventBlock.pure\";\nexport * from \"./flowGraphStopEventPropagationBlock.pure\";\nexport * from \"./flowGraphSendCustomEventBlock.pure\";\nexport * from \"./flowGraphSceneTickEventBlock.pure\";\nexport * from \"./flowGraphPointerOutEventBlock.pure\";\nexport * from \"./flowGraphPointerOverEventBlock.pure\";\nexport * from \"./flowGraphMeshIntersectionEventBlock.pure\";\nexport * from \"./flowGraphPhysicsCollisionEventBlock.pure\";\nexport * from \"./flowGraphSoundEndedEventBlock.pure\";\nexport * from \"./flowGraphKeyboardEventBlock\";\nexport * from \"./flowGraphKeyDownEventBlock.pure\";\nexport * from \"./flowGraphKeyUpEventBlock.pure\";\nexport * from \"./flowGraphPointerDownEventBlock.pure\";\nexport * from \"./flowGraphPointerMoveEventBlock.pure\";\nexport * from \"./flowGraphPointerUpEventBlock.pure\";\n"]}
|
|
@@ -4,16 +4,16 @@ import { type FlowGraphDataConnection } from "../../../flowGraphDataConnection.p
|
|
|
4
4
|
import { FlowGraphExecutionBlockWithOutSignal } from "../../../flowGraphExecutionBlockWithOutSignal.js";
|
|
5
5
|
import { type FlowGraphSignalConnection } from "../../../flowGraphSignalConnection.pure.js";
|
|
6
6
|
import { type IFlowGraphBlockConfiguration } from "../../../flowGraphBlock.js";
|
|
7
|
-
import { type
|
|
7
|
+
import { type FlowGraphSoundReference } from "../../../flowGraphSoundAssets.js";
|
|
8
8
|
/**
|
|
9
9
|
* @experimental
|
|
10
10
|
* A block that pauses an Audio V2 sound. If the sound is already paused, resumes it.
|
|
11
11
|
*/
|
|
12
12
|
export declare class FlowGraphPauseSoundBlock extends FlowGraphExecutionBlockWithOutSignal {
|
|
13
13
|
/**
|
|
14
|
-
* Input connection: The sound to pause or resume.
|
|
14
|
+
* Input connection: The sound to pause or resume. Accepts an Audio V2 sound or the name of a sound asset declared on the coordinator.
|
|
15
15
|
*/
|
|
16
|
-
readonly sound: FlowGraphDataConnection<
|
|
16
|
+
readonly sound: FlowGraphDataConnection<FlowGraphSoundReference>;
|
|
17
17
|
/**
|
|
18
18
|
* Constructs a new FlowGraphPauseSoundBlock.
|
|
19
19
|
* @param config - optional configuration for the block
|