@onerjs/core 8.56.4 → 9.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Animations/animatable.core.js +36 -0
- package/Animations/animatable.core.js.map +1 -1
- package/Animations/animationGroup.pure.d.ts +61 -1
- package/Animations/animationGroup.pure.js +191 -2
- package/Animations/animationGroup.pure.js.map +1 -1
- package/Animations/index.d.ts +1 -0
- package/Animations/index.js +1 -0
- package/Animations/index.js.map +1 -1
- package/Animations/pure.d.ts +1 -0
- package/Animations/pure.js +1 -0
- package/Animations/pure.js.map +1 -1
- package/Animations/rootMotion.d.ts +560 -0
- package/Animations/rootMotion.js +1709 -0
- package/Animations/rootMotion.js.map +1 -0
- package/Animations/runtimeAnimation.d.ts +57 -0
- package/Animations/runtimeAnimation.js +127 -3
- package/Animations/runtimeAnimation.js.map +1 -1
- package/Cameras/arcRotateCamera.pure.d.ts +2 -0
- package/Cameras/arcRotateCamera.pure.js +2 -0
- package/Cameras/arcRotateCamera.pure.js.map +1 -1
- package/Cameras/targetCamera.pure.d.ts +2 -0
- package/Cameras/targetCamera.pure.js +13 -2
- package/Cameras/targetCamera.pure.js.map +1 -1
- package/Collisions/gpuPicker.js +5 -5
- package/Collisions/gpuPicker.js.map +1 -1
- package/Engines/AbstractEngine/abstractEngine.query.pure.js +4 -2
- package/Engines/AbstractEngine/abstractEngine.query.pure.js.map +1 -1
- package/Engines/AbstractEngine/abstractEngine.query.types.d.ts +11 -2
- package/Engines/AbstractEngine/abstractEngine.query.types.js.map +1 -1
- package/Engines/AbstractEngine/abstractEngine.renderPass.pure.js +1 -0
- package/Engines/AbstractEngine/abstractEngine.renderPass.pure.js.map +1 -1
- package/Engines/Extensions/engine.multiRender.pure.js +63 -0
- package/Engines/Extensions/engine.multiRender.pure.js.map +1 -1
- package/Engines/Extensions/engine.multiRender.types.d.ts +13 -0
- package/Engines/Extensions/engine.multiRender.types.js.map +1 -1
- package/Engines/Extensions/engine.prefilteredCubeTexture.pure.js +2 -2
- package/Engines/Extensions/engine.prefilteredCubeTexture.pure.js.map +1 -1
- package/Engines/Extensions/engine.prefilteredCubeTexture.types.d.ts +2 -1
- package/Engines/Extensions/engine.prefilteredCubeTexture.types.js.map +1 -1
- package/Engines/Extensions/index.d.ts +1 -0
- package/Engines/Extensions/index.js +1 -0
- package/Engines/Extensions/index.js.map +1 -1
- package/Engines/Extensions/pure.d.ts +1 -1
- package/Engines/Extensions/pure.js +1 -1
- package/Engines/Extensions/pure.js.map +1 -1
- package/Engines/Native/Extensions/nativeEngine.cubeTexture.pure.js +88 -39
- package/Engines/Native/Extensions/nativeEngine.cubeTexture.pure.js.map +1 -1
- package/Engines/Native/Extensions/nativeEngine.cubeTexture.types.d.ts +20 -2
- package/Engines/Native/Extensions/nativeEngine.cubeTexture.types.js.map +1 -1
- package/Engines/Native/nativeHardwareTexture.d.ts +8 -1
- package/Engines/Native/nativeHardwareTexture.js +7 -0
- package/Engines/Native/nativeHardwareTexture.js.map +1 -1
- package/Engines/Native/nativeHelpers.js +56 -1
- package/Engines/Native/nativeHelpers.js.map +1 -1
- package/Engines/Native/nativeInterfaces.d.ts +37 -8
- package/Engines/Native/nativeInterfaces.js.map +1 -1
- package/Engines/Native/nativeRenderTargetWrapper.d.ts +40 -0
- package/Engines/Native/nativeRenderTargetWrapper.js +265 -5
- package/Engines/Native/nativeRenderTargetWrapper.js.map +1 -1
- package/Engines/Processors/shaderCodeCursor.d.ts +1 -0
- package/Engines/Processors/shaderCodeCursor.js +40 -3
- package/Engines/Processors/shaderCodeCursor.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.multiRender.pure.js +4 -0
- package/Engines/WebGPU/Extensions/engine.multiRender.pure.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.multiRender.types.d.ts +13 -0
- package/Engines/WebGPU/Extensions/engine.multiRender.types.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.query.pure.js +11 -3
- package/Engines/WebGPU/Extensions/engine.query.pure.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.renderTarget.pure.js +1 -0
- package/Engines/WebGPU/Extensions/engine.renderTarget.pure.js.map +1 -1
- package/Engines/WebGPU/Extensions/index.d.ts +1 -0
- package/Engines/WebGPU/Extensions/index.js +1 -0
- package/Engines/WebGPU/Extensions/index.js.map +1 -1
- package/Engines/WebGPU/Extensions/pure.d.ts +1 -1
- package/Engines/WebGPU/Extensions/pure.js +1 -1
- package/Engines/WebGPU/Extensions/pure.js.map +1 -1
- package/Engines/WebGPU/webgpuBundleList.d.ts +2 -0
- package/Engines/WebGPU/webgpuBundleList.js +4 -0
- package/Engines/WebGPU/webgpuBundleList.js.map +1 -1
- package/Engines/WebGPU/webgpuCacheRenderPipeline.js +5 -2
- package/Engines/WebGPU/webgpuCacheRenderPipeline.js.map +1 -1
- package/Engines/WebGPU/webgpuHardwareTexture.js +3 -1
- package/Engines/WebGPU/webgpuHardwareTexture.js.map +1 -1
- package/Engines/WebGPU/webgpuOcclusionQuery.js +1 -1
- package/Engines/WebGPU/webgpuOcclusionQuery.js.map +1 -1
- package/Engines/WebGPU/webgpuSnapshotRendering.d.ts +4 -0
- package/Engines/WebGPU/webgpuSnapshotRendering.js +40 -7
- package/Engines/WebGPU/webgpuSnapshotRendering.js.map +1 -1
- package/Engines/WebGPU/webgpuTextureHelper.d.ts +1 -1
- package/Engines/WebGPU/webgpuTextureHelper.js +2 -2
- package/Engines/WebGPU/webgpuTextureHelper.js.map +1 -1
- package/Engines/WebGPU/webgpuTextureManager.d.ts +2 -0
- package/Engines/WebGPU/webgpuTextureManager.js +286 -13
- package/Engines/WebGPU/webgpuTextureManager.js.map +1 -1
- package/Engines/abstractEngine.pure.d.ts +17 -1
- package/Engines/abstractEngine.pure.js +17 -5
- package/Engines/abstractEngine.pure.js.map +1 -1
- package/Engines/constants.d.ts +4 -0
- package/Engines/constants.js +4 -0
- package/Engines/constants.js.map +1 -1
- package/Engines/engine.pure.d.ts +0 -1
- package/Engines/engine.pure.js +0 -7
- package/Engines/engine.pure.js.map +1 -1
- package/Engines/nativeEngine.pure.js +1 -1
- package/Engines/nativeEngine.pure.js.map +1 -1
- package/Engines/thinEngine.pure.d.ts +15 -0
- package/Engines/thinEngine.pure.js +61 -14
- package/Engines/thinEngine.pure.js.map +1 -1
- package/Engines/thinNativeEngine.pure.d.ts +218 -17
- package/Engines/thinNativeEngine.pure.js +1438 -165
- package/Engines/thinNativeEngine.pure.js.map +1 -1
- package/Engines/thinWebGPUEngine.d.ts +4 -0
- package/Engines/thinWebGPUEngine.js +16 -2
- package/Engines/thinWebGPUEngine.js.map +1 -1
- package/Engines/webgpuEngine.pure.d.ts +17 -3
- package/Engines/webgpuEngine.pure.js +56 -13
- package/Engines/webgpuEngine.pure.js.map +1 -1
- package/FlowGraph/Blocks/Data/Math/flowGraphMathBlocks.pure.js +2 -2
- package/FlowGraph/Blocks/Data/Math/flowGraphMathBlocks.pure.js.map +1 -1
- package/FlowGraph/Blocks/Data/Transformers/flowGraphJsonPointerParserBlock.pure.d.ts +10 -0
- package/FlowGraph/Blocks/Data/Transformers/flowGraphJsonPointerParserBlock.pure.js +24 -12
- package/FlowGraph/Blocks/Data/Transformers/flowGraphJsonPointerParserBlock.pure.js.map +1 -1
- package/FlowGraph/Blocks/Data/Utils/flowGraphArrayIndexBlock.pure.d.ts +11 -2
- package/FlowGraph/Blocks/Data/Utils/flowGraphArrayIndexBlock.pure.js +1 -1
- package/FlowGraph/Blocks/Data/Utils/flowGraphArrayIndexBlock.pure.js.map +1 -1
- package/FlowGraph/Blocks/Data/flowGraphGetPropertyBlock.pure.d.ts +7 -0
- package/FlowGraph/Blocks/Data/flowGraphGetPropertyBlock.pure.js +43 -0
- package/FlowGraph/Blocks/Data/flowGraphGetPropertyBlock.pure.js.map +1 -1
- package/FlowGraph/Blocks/Event/flowGraphMeshPickEventBlock.pure.d.ts +9 -1
- package/FlowGraph/Blocks/Event/flowGraphMeshPickEventBlock.pure.js +6 -8
- package/FlowGraph/Blocks/Event/flowGraphMeshPickEventBlock.pure.js.map +1 -1
- package/FlowGraph/Blocks/Event/flowGraphPointerOutEventBlock.pure.d.ts +2 -0
- package/FlowGraph/Blocks/Event/flowGraphPointerOutEventBlock.pure.js +5 -1
- package/FlowGraph/Blocks/Event/flowGraphPointerOutEventBlock.pure.js.map +1 -1
- package/FlowGraph/Blocks/Event/flowGraphPointerOverEventBlock.pure.d.ts +2 -0
- package/FlowGraph/Blocks/Event/flowGraphPointerOverEventBlock.pure.js +5 -1
- package/FlowGraph/Blocks/Event/flowGraphPointerOverEventBlock.pure.js.map +1 -1
- package/FlowGraph/Blocks/Event/flowGraphReceiveCustomEventBlock.pure.d.ts +9 -0
- package/FlowGraph/Blocks/Event/flowGraphReceiveCustomEventBlock.pure.js +34 -9
- package/FlowGraph/Blocks/Event/flowGraphReceiveCustomEventBlock.pure.js.map +1 -1
- package/FlowGraph/Blocks/Event/flowGraphSceneReadyEventBlock.pure.d.ts +2 -0
- package/FlowGraph/Blocks/Event/flowGraphSceneReadyEventBlock.pure.js +4 -0
- package/FlowGraph/Blocks/Event/flowGraphSceneReadyEventBlock.pure.js.map +1 -1
- package/FlowGraph/Blocks/Event/flowGraphSceneTickEventBlock.pure.d.ts +18 -4
- package/FlowGraph/Blocks/Event/flowGraphSceneTickEventBlock.pure.js +24 -6
- package/FlowGraph/Blocks/Event/flowGraphSceneTickEventBlock.pure.js.map +1 -1
- package/FlowGraph/Blocks/Event/flowGraphSendCustomEventBlock.pure.js +19 -7
- package/FlowGraph/Blocks/Event/flowGraphSendCustomEventBlock.pure.js.map +1 -1
- package/FlowGraph/Blocks/Execution/Animation/flowGraphInterpolationBlock.pure.js +3 -3
- package/FlowGraph/Blocks/Execution/Animation/flowGraphInterpolationBlock.pure.js.map +1 -1
- package/FlowGraph/Blocks/Execution/Animation/flowGraphPlayAnimationBlock.pure.d.ts +20 -2
- package/FlowGraph/Blocks/Execution/Animation/flowGraphPlayAnimationBlock.pure.js +85 -25
- package/FlowGraph/Blocks/Execution/Animation/flowGraphPlayAnimationBlock.pure.js.map +1 -1
- package/FlowGraph/Blocks/Execution/Animation/flowGraphStopAnimationBlock.pure.d.ts +16 -1
- package/FlowGraph/Blocks/Execution/Animation/flowGraphStopAnimationBlock.pure.js +64 -14
- package/FlowGraph/Blocks/Execution/Animation/flowGraphStopAnimationBlock.pure.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphCancelDelayBlock.pure.d.ts +12 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphCancelDelayBlock.pure.js +8 -0
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphCancelDelayBlock.pure.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphForLoopBlock.pure.js +4 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphForLoopBlock.pure.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphThrottleBlock.pure.d.ts +12 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphThrottleBlock.pure.js +5 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphThrottleBlock.pure.js.map +1 -1
- package/FlowGraph/Blocks/Execution/flowGraphConsoleLogBlock.pure.js +64 -16
- package/FlowGraph/Blocks/Execution/flowGraphConsoleLogBlock.pure.js.map +1 -1
- package/FlowGraph/Blocks/Execution/flowGraphSetPropertyBlock.pure.d.ts +2 -0
- package/FlowGraph/Blocks/Execution/flowGraphSetPropertyBlock.pure.js +14 -2
- package/FlowGraph/Blocks/Execution/flowGraphSetPropertyBlock.pure.js.map +1 -1
- package/FlowGraph/Blocks/Execution/flowGraphSetVariableBlock.pure.d.ts +5 -1
- package/FlowGraph/Blocks/Execution/flowGraphSetVariableBlock.pure.js +23 -8
- package/FlowGraph/Blocks/Execution/flowGraphSetVariableBlock.pure.js.map +1 -1
- package/FlowGraph/CustomTypes/flowGraphInteger.pure.d.ts +5 -0
- package/FlowGraph/CustomTypes/flowGraphInteger.pure.js +7 -0
- package/FlowGraph/CustomTypes/flowGraphInteger.pure.js.map +1 -1
- package/FlowGraph/CustomTypes/flowGraphMatrix.d.ts +10 -0
- package/FlowGraph/CustomTypes/flowGraphMatrix.js +14 -0
- package/FlowGraph/CustomTypes/flowGraphMatrix.js.map +1 -1
- package/FlowGraph/flowGraph.d.ts +6 -1
- package/FlowGraph/flowGraph.js +41 -9
- package/FlowGraph/flowGraph.js.map +1 -1
- package/FlowGraph/flowGraphAnimationHelpers.d.ts +24 -0
- package/FlowGraph/flowGraphAnimationHelpers.js +21 -0
- package/FlowGraph/flowGraphAnimationHelpers.js.map +1 -0
- package/FlowGraph/flowGraphBlock.js +3 -0
- package/FlowGraph/flowGraphBlock.js.map +1 -1
- package/FlowGraph/flowGraphConnection.d.ts +7 -0
- package/FlowGraph/flowGraphConnection.js +7 -0
- package/FlowGraph/flowGraphConnection.js.map +1 -1
- package/FlowGraph/flowGraphContext.d.ts +2 -1
- package/FlowGraph/flowGraphContext.js +5 -3
- package/FlowGraph/flowGraphContext.js.map +1 -1
- package/FlowGraph/flowGraphCoordinator.d.ts +15 -1
- package/FlowGraph/flowGraphCoordinator.js +47 -16
- package/FlowGraph/flowGraphCoordinator.js.map +1 -1
- package/FlowGraph/flowGraphEventBlock.d.ts +5 -0
- package/FlowGraph/flowGraphEventBlock.js +7 -0
- package/FlowGraph/flowGraphEventBlock.js.map +1 -1
- package/FlowGraph/flowGraphHostResolver.d.ts +2 -1
- package/FlowGraph/flowGraphHostResolver.js.map +1 -1
- package/FlowGraph/flowGraphParser.js +60 -2
- package/FlowGraph/flowGraphParser.js.map +1 -1
- package/FlowGraph/flowGraphValidator.js +0 -4
- package/FlowGraph/flowGraphValidator.js.map +1 -1
- package/FlowGraph/index.d.ts +2 -0
- package/FlowGraph/index.js +2 -0
- package/FlowGraph/index.js.map +1 -1
- package/FlowGraph/pure.d.ts +2 -0
- package/FlowGraph/pure.js +2 -0
- package/FlowGraph/pure.js.map +1 -1
- package/FlowGraph/serialization.d.ts +4 -2
- package/FlowGraph/serialization.js +12 -24
- package/FlowGraph/serialization.js.map +1 -1
- package/FlowGraph/typeDefinitions.d.ts +9 -1
- package/FlowGraph/typeDefinitions.js.map +1 -1
- package/FrameGraph/Node/Blocks/PostProcesses/meshBlendingPostProcessBlock.d.ts +5 -0
- package/FrameGraph/Node/Blocks/PostProcesses/meshBlendingPostProcessBlock.js +8 -0
- package/FrameGraph/Node/Blocks/PostProcesses/meshBlendingPostProcessBlock.js.map +1 -0
- package/FrameGraph/Node/Blocks/PostProcesses/meshBlendingPostProcessBlock.pure.d.ts +87 -0
- package/FrameGraph/Node/Blocks/PostProcesses/meshBlendingPostProcessBlock.pure.js +295 -0
- package/FrameGraph/Node/Blocks/PostProcesses/meshBlendingPostProcessBlock.pure.js.map +1 -0
- package/FrameGraph/Node/Blocks/PostProcesses/pure.d.ts +1 -0
- package/FrameGraph/Node/Blocks/PostProcesses/pure.js +1 -0
- package/FrameGraph/Node/Blocks/PostProcesses/pure.js.map +1 -1
- package/FrameGraph/Node/Blocks/Rendering/baseObjectRendererBlock.js +4 -4
- package/FrameGraph/Node/Blocks/Rendering/baseObjectRendererBlock.js.map +1 -1
- package/FrameGraph/Node/Blocks/Rendering/geometryRendererBlock.pure.d.ts +5 -1
- package/FrameGraph/Node/Blocks/Rendering/geometryRendererBlock.pure.js +13 -1
- package/FrameGraph/Node/Blocks/Rendering/geometryRendererBlock.pure.js.map +1 -1
- package/FrameGraph/Node/Blocks/Textures/minMaxReducerBlock.d.ts +1 -0
- package/FrameGraph/Node/Blocks/Textures/minMaxReducerBlock.js +4 -0
- package/FrameGraph/Node/Blocks/Textures/minMaxReducerBlock.js.map +1 -0
- package/FrameGraph/Node/Blocks/Textures/minMaxReducerBlock.pure.d.ts +54 -0
- package/FrameGraph/Node/Blocks/Textures/minMaxReducerBlock.pure.js +155 -0
- package/FrameGraph/Node/Blocks/Textures/minMaxReducerBlock.pure.js.map +1 -0
- package/FrameGraph/Node/Blocks/Textures/pure.d.ts +1 -0
- package/FrameGraph/Node/Blocks/Textures/pure.js +1 -0
- package/FrameGraph/Node/Blocks/Textures/pure.js.map +1 -1
- package/FrameGraph/Node/Blocks/allBlocks.pure.js +4 -0
- package/FrameGraph/Node/Blocks/allBlocks.pure.js.map +1 -1
- package/FrameGraph/Node/Blocks/index.d.ts +2 -0
- package/FrameGraph/Node/Blocks/index.js +2 -0
- package/FrameGraph/Node/Blocks/index.js.map +1 -1
- package/FrameGraph/Node/Blocks/inputBlock.pure.js +20 -1
- package/FrameGraph/Node/Blocks/inputBlock.pure.js.map +1 -1
- package/FrameGraph/Node/Blocks/pure.d.ts +2 -0
- package/FrameGraph/Node/Blocks/pure.js +2 -0
- package/FrameGraph/Node/Blocks/pure.js.map +1 -1
- package/FrameGraph/Node/Types/nodeRenderGraphTypes.d.ts +4 -2
- package/FrameGraph/Node/Types/nodeRenderGraphTypes.js +4 -2
- package/FrameGraph/Node/Types/nodeRenderGraphTypes.js.map +1 -1
- package/FrameGraph/Node/nodeRenderGraph.js +1 -1
- package/FrameGraph/Node/nodeRenderGraph.js.map +1 -1
- package/FrameGraph/Tasks/Layers/selectionOutlineTask.js +1 -0
- package/FrameGraph/Tasks/Layers/selectionOutlineTask.js.map +1 -1
- package/FrameGraph/Tasks/Misc/cullObjectsTask.js +5 -1
- package/FrameGraph/Tasks/Misc/cullObjectsTask.js.map +1 -1
- package/FrameGraph/Tasks/Misc/lightingVolumeTask.js +1 -0
- package/FrameGraph/Tasks/Misc/lightingVolumeTask.js.map +1 -1
- package/FrameGraph/Tasks/Misc/minMaxReducerTask.d.ts +62 -0
- package/FrameGraph/Tasks/Misc/minMaxReducerTask.js +159 -0
- package/FrameGraph/Tasks/Misc/minMaxReducerTask.js.map +1 -0
- package/FrameGraph/Tasks/PostProcesses/meshBlendingTask.d.ts +69 -0
- package/FrameGraph/Tasks/PostProcesses/meshBlendingTask.js +223 -0
- package/FrameGraph/Tasks/PostProcesses/meshBlendingTask.js.map +1 -0
- package/FrameGraph/Tasks/Rendering/geometryRendererTask.d.ts +25 -3
- package/FrameGraph/Tasks/Rendering/geometryRendererTask.js +72 -34
- package/FrameGraph/Tasks/Rendering/geometryRendererTask.js.map +1 -1
- package/FrameGraph/Tasks/Rendering/objectRendererTask.js +3 -1
- package/FrameGraph/Tasks/Rendering/objectRendererTask.js.map +1 -1
- package/FrameGraph/frameGraph.d.ts +4 -0
- package/FrameGraph/frameGraph.js +14 -0
- package/FrameGraph/frameGraph.js.map +1 -1
- package/FrameGraph/frameGraphObjectList.d.ts +6 -1
- package/FrameGraph/frameGraphObjectList.js.map +1 -1
- package/FrameGraph/frameGraphRenderContext.d.ts +3 -1
- package/FrameGraph/frameGraphRenderContext.js +5 -5
- package/FrameGraph/frameGraphRenderContext.js.map +1 -1
- package/FrameGraph/index.d.ts +2 -0
- package/FrameGraph/index.js +2 -0
- package/FrameGraph/index.js.map +1 -1
- package/FrameGraph/pure.d.ts +2 -0
- package/FrameGraph/pure.js +2 -0
- package/FrameGraph/pure.js.map +1 -1
- package/Inputs/scene.inputManager.d.ts +4 -0
- package/Inputs/scene.inputManager.js +50 -8
- package/Inputs/scene.inputManager.js.map +1 -1
- package/Lights/Clustered/clusteredLightingSceneComponent.pure.d.ts +5 -0
- package/Lights/Clustered/clusteredLightingSceneComponent.pure.js +22 -1
- package/Lights/Clustered/clusteredLightingSceneComponent.pure.js.map +1 -1
- package/Lights/Shadows/cascadedShadowGenerator.pure.js +7 -3
- package/Lights/Shadows/cascadedShadowGenerator.pure.js.map +1 -1
- package/Materials/GaussianSplatting/gaussianPointSplattingBlitMaterial.d.ts +7 -0
- package/Materials/GaussianSplatting/gaussianPointSplattingBlitMaterial.js +8 -0
- package/Materials/GaussianSplatting/gaussianPointSplattingBlitMaterial.js.map +1 -0
- package/Materials/GaussianSplatting/gaussianPointSplattingBlitMaterial.pure.d.ts +54 -0
- package/Materials/GaussianSplatting/gaussianPointSplattingBlitMaterial.pure.js +81 -0
- package/Materials/GaussianSplatting/gaussianPointSplattingBlitMaterial.pure.js.map +1 -0
- package/Materials/GaussianSplatting/gaussianPointSplattingDepthBlitMaterial.d.ts +7 -0
- package/Materials/GaussianSplatting/gaussianPointSplattingDepthBlitMaterial.js +8 -0
- package/Materials/GaussianSplatting/gaussianPointSplattingDepthBlitMaterial.js.map +1 -0
- package/Materials/GaussianSplatting/gaussianPointSplattingDepthBlitMaterial.pure.d.ts +60 -0
- package/Materials/GaussianSplatting/gaussianPointSplattingDepthBlitMaterial.pure.js +90 -0
- package/Materials/GaussianSplatting/gaussianPointSplattingDepthBlitMaterial.pure.js.map +1 -0
- package/Materials/GaussianSplatting/gaussianSplattingDebugMaterialPlugin.pure.d.ts +31 -0
- package/Materials/GaussianSplatting/gaussianSplattingDebugMaterialPlugin.pure.js +103 -5
- package/Materials/GaussianSplatting/gaussianSplattingDebugMaterialPlugin.pure.js.map +1 -1
- package/Materials/GaussianSplatting/gaussianSplattingGpuPickingMaterialPlugin.pure.js +6 -6
- package/Materials/GaussianSplatting/gaussianSplattingGpuPickingMaterialPlugin.pure.js.map +1 -1
- package/Materials/GaussianSplatting/gaussianSplattingMaterial.pure.d.ts +26 -1
- package/Materials/GaussianSplatting/gaussianSplattingMaterial.pure.js +153 -49
- package/Materials/GaussianSplatting/gaussianSplattingMaterial.pure.js.map +1 -1
- package/Materials/GaussianSplatting/gaussianSplattingOverdrawMaterialPlugin.d.ts +1 -0
- package/Materials/GaussianSplatting/gaussianSplattingOverdrawMaterialPlugin.js +4 -0
- package/Materials/GaussianSplatting/gaussianSplattingOverdrawMaterialPlugin.js.map +1 -0
- package/Materials/GaussianSplatting/gaussianSplattingOverdrawMaterialPlugin.pure.d.ts +83 -0
- package/Materials/GaussianSplatting/gaussianSplattingOverdrawMaterialPlugin.pure.js +191 -0
- package/Materials/GaussianSplatting/gaussianSplattingOverdrawMaterialPlugin.pure.js.map +1 -0
- package/Materials/GaussianSplatting/gaussianSplattingSizeMaterialPlugin.d.ts +1 -0
- package/Materials/GaussianSplatting/gaussianSplattingSizeMaterialPlugin.js +4 -0
- package/Materials/GaussianSplatting/gaussianSplattingSizeMaterialPlugin.js.map +1 -0
- package/Materials/GaussianSplatting/gaussianSplattingSizeMaterialPlugin.pure.d.ts +62 -0
- package/Materials/GaussianSplatting/gaussianSplattingSizeMaterialPlugin.pure.js +125 -0
- package/Materials/GaussianSplatting/gaussianSplattingSizeMaterialPlugin.pure.js.map +1 -0
- package/Materials/GaussianSplatting/gaussianSplattingSolidColorMaterialPlugin.pure.js +5 -5
- package/Materials/GaussianSplatting/gaussianSplattingSolidColorMaterialPlugin.pure.js.map +1 -1
- package/Materials/GaussianSplatting/pure.d.ts +4 -0
- package/Materials/GaussianSplatting/pure.js +4 -0
- package/Materials/GaussianSplatting/pure.js.map +1 -1
- package/Materials/Node/Blocks/Dual/imageSourceBlock.pure.d.ts +1 -0
- package/Materials/Node/Blocks/Dual/imageSourceBlock.pure.js +12 -0
- package/Materials/Node/Blocks/Dual/imageSourceBlock.pure.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/fragmentOutputBlock.pure.js +11 -1
- package/Materials/Node/Blocks/Fragment/fragmentOutputBlock.pure.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/prePassOutputBlock.pure.js +17 -2
- package/Materials/Node/Blocks/Fragment/prePassOutputBlock.pure.js.map +1 -1
- package/Materials/Node/Blocks/GaussianSplatting/gaussianSplattingBlock.pure.js +2 -2
- package/Materials/Node/Blocks/GaussianSplatting/gaussianSplattingBlock.pure.js.map +1 -1
- package/Materials/Node/nodeMaterial.pure.d.ts +4 -0
- package/Materials/Node/nodeMaterial.pure.js +4 -0
- package/Materials/Node/nodeMaterial.pure.js.map +1 -1
- package/Materials/Node/nodeMaterialBuildState.d.ts +1 -1
- package/Materials/Node/nodeMaterialBuildState.js +25 -3
- package/Materials/Node/nodeMaterialBuildState.js.map +1 -1
- package/Materials/PBR/openpbrMaterial.pure.d.ts +2 -0
- package/Materials/PBR/pbrBaseMaterial.pure.d.ts +2 -0
- package/Materials/Textures/Procedurals/proceduralTexture.pure.d.ts +14 -14
- package/Materials/Textures/Procedurals/proceduralTexture.pure.js +37 -13
- package/Materials/Textures/Procedurals/proceduralTexture.pure.js.map +1 -1
- package/Materials/Textures/baseTexture.pure.js +3 -0
- package/Materials/Textures/baseTexture.pure.js.map +1 -1
- package/Materials/Textures/cubeTexture.pure.js +1 -1
- package/Materials/Textures/cubeTexture.pure.js.map +1 -1
- package/Materials/Textures/internalTexture.d.ts +8 -1
- package/Materials/Textures/internalTexture.js +9 -2
- package/Materials/Textures/internalTexture.js.map +1 -1
- package/Materials/Textures/mirrorTexture.pure.js +3 -1
- package/Materials/Textures/mirrorTexture.pure.js.map +1 -1
- package/Materials/Textures/rawTexture2DArray.functions.d.ts +3 -3
- package/Materials/Textures/rawTexture2DArray.functions.js.map +1 -1
- package/Materials/Textures/rawTexture3D.d.ts +1 -1
- package/Materials/Textures/rawTexture3D.js +1 -1
- package/Materials/Textures/rawTexture3D.js.map +1 -1
- package/Materials/Textures/texture.pure.js +1 -1
- package/Materials/Textures/texture.pure.js.map +1 -1
- package/Materials/Textures/textureHelper.functions.d.ts +14 -0
- package/Materials/Textures/textureHelper.functions.js +24 -0
- package/Materials/Textures/textureHelper.functions.js.map +1 -1
- package/Materials/ditheredTileFadeMaterialPlugin.d.ts +210 -0
- package/Materials/ditheredTileFadeMaterialPlugin.js +509 -0
- package/Materials/ditheredTileFadeMaterialPlugin.js.map +1 -0
- package/Materials/effectRenderer.pure.d.ts +4 -0
- package/Materials/effectRenderer.pure.js +3 -2
- package/Materials/effectRenderer.pure.js.map +1 -1
- package/Materials/index.d.ts +5 -0
- package/Materials/index.js +5 -0
- package/Materials/index.js.map +1 -1
- package/Materials/material.pure.js +25 -12
- package/Materials/material.pure.js.map +1 -1
- package/Materials/materialHelper.geometryrendering.d.ts +46 -1
- package/Materials/materialHelper.geometryrendering.js +105 -8
- package/Materials/materialHelper.geometryrendering.js.map +1 -1
- package/Materials/prepass.defines.d.ts +2 -0
- package/Materials/prepass.defines.js +2 -0
- package/Materials/prepass.defines.js.map +1 -1
- package/Materials/pure.d.ts +5 -0
- package/Materials/pure.js +5 -0
- package/Materials/pure.js.map +1 -1
- package/Materials/standardMaterial.pure.d.ts +10 -0
- package/Materials/standardMaterial.pure.js +30 -5
- package/Materials/standardMaterial.pure.js.map +1 -1
- package/Meshes/Builders/polygonBuilder.pure.d.ts +4 -0
- package/Meshes/Builders/polygonBuilder.pure.js +3 -0
- package/Meshes/Builders/polygonBuilder.pure.js.map +1 -1
- package/Meshes/GaussianSplatting/gaussianPointSplattingController.d.ts +8 -0
- package/Meshes/GaussianSplatting/gaussianPointSplattingController.js +11 -0
- package/Meshes/GaussianSplatting/gaussianPointSplattingController.js.map +1 -0
- package/Meshes/GaussianSplatting/gaussianPointSplattingController.pure.d.ts +231 -0
- package/Meshes/GaussianSplatting/gaussianPointSplattingController.pure.js +1212 -0
- package/Meshes/GaussianSplatting/gaussianPointSplattingController.pure.js.map +1 -0
- package/Meshes/GaussianSplatting/gaussianPointSplattingRenderer.d.ts +14 -0
- package/Meshes/GaussianSplatting/gaussianPointSplattingRenderer.js +15 -0
- package/Meshes/GaussianSplatting/gaussianPointSplattingRenderer.js.map +1 -0
- package/Meshes/GaussianSplatting/gaussianPointSplattingRenderer.pure.d.ts +285 -0
- package/Meshes/GaussianSplatting/gaussianPointSplattingRenderer.pure.js +812 -0
- package/Meshes/GaussianSplatting/gaussianPointSplattingRenderer.pure.js.map +1 -0
- package/Meshes/GaussianSplatting/gaussianSplatting.functions.d.ts +19 -0
- package/Meshes/GaussianSplatting/gaussianSplatting.functions.js +23 -0
- package/Meshes/GaussianSplatting/gaussianSplatting.functions.js.map +1 -0
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.d.ts +1 -0
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.js +2 -0
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.js.map +1 -1
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.pure.d.ts +163 -14
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.pure.js +239 -24
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.pure.js.map +1 -1
- package/Meshes/GaussianSplatting/gaussianSplattingMeshBase.pure.d.ts +34 -4
- package/Meshes/GaussianSplatting/gaussianSplattingMeshBase.pure.js +125 -25
- package/Meshes/GaussianSplatting/gaussianSplattingMeshBase.pure.js.map +1 -1
- package/Meshes/GaussianSplatting/pure.d.ts +2 -0
- package/Meshes/GaussianSplatting/pure.js +2 -0
- package/Meshes/GaussianSplatting/pure.js.map +1 -1
- package/Meshes/Node/Blocks/booleanGeometryBlock.pure.js +25 -11
- package/Meshes/Node/Blocks/booleanGeometryBlock.pure.js.map +1 -1
- package/Meshes/abstractMesh.pure.d.ts +30 -0
- package/Meshes/abstractMesh.pure.js +54 -0
- package/Meshes/abstractMesh.pure.js.map +1 -1
- package/Meshes/index.d.ts +2 -0
- package/Meshes/index.js +2 -0
- package/Meshes/index.js.map +1 -1
- package/Meshes/instancedMesh.pure.d.ts +5 -0
- package/Meshes/instancedMesh.pure.js +12 -0
- package/Meshes/instancedMesh.pure.js.map +1 -1
- package/Meshes/mesh.pure.js +23 -8
- package/Meshes/mesh.pure.js.map +1 -1
- package/Meshes/meshBlendingTag.d.ts +47 -0
- package/Meshes/meshBlendingTag.js +64 -0
- package/Meshes/meshBlendingTag.js.map +1 -0
- package/Meshes/polygonMesh.js +2 -2
- package/Meshes/polygonMesh.js.map +1 -1
- package/Meshes/pure.d.ts +2 -0
- package/Meshes/pure.js +2 -0
- package/Meshes/pure.js.map +1 -1
- package/Meshes/subMesh.pure.d.ts +11 -2
- package/Meshes/subMesh.pure.js +20 -5
- package/Meshes/subMesh.pure.js.map +1 -1
- package/Meshes/thinInstanceMesh.pure.js +1 -0
- package/Meshes/thinInstanceMesh.pure.js.map +1 -1
- package/Misc/andOrNotEvaluator.js +4 -0
- package/Misc/andOrNotEvaluator.js.map +1 -1
- package/Misc/fileTools.pure.js +21 -0
- package/Misc/fileTools.pure.js.map +1 -1
- package/Misc/minMaxReducer.pure.d.ts +6 -0
- package/Misc/minMaxReducer.pure.js +10 -0
- package/Misc/minMaxReducer.pure.js.map +1 -1
- package/Misc/snapshotRenderingHelper.js +2 -2
- package/Misc/snapshotRenderingHelper.js.map +1 -1
- package/Misc/thinMinMaxReducer.d.ts +19 -2
- package/Misc/thinMinMaxReducer.js +74 -21
- package/Misc/thinMinMaxReducer.js.map +1 -1
- package/Misc/tools.pure.js +1 -1
- package/Misc/tools.pure.js.map +1 -1
- package/Particles/Node/Blocks/Update/updateNoiseBlock.pure.js +19 -7
- package/Particles/Node/Blocks/Update/updateNoiseBlock.pure.js.map +1 -1
- package/Particles/Node/Blocks/particleSourceTextureBlock.pure.js +3 -2
- package/Particles/Node/Blocks/particleSourceTextureBlock.pure.js.map +1 -1
- package/Particles/gpuParticleSystem.pure.d.ts +4 -0
- package/Particles/gpuParticleSystem.pure.js +101 -32
- package/Particles/gpuParticleSystem.pure.js.map +1 -1
- package/Particles/particle.js +3 -2
- package/Particles/particle.js.map +1 -1
- package/Particles/solidParticleSystem.js +7 -1
- package/Particles/solidParticleSystem.js.map +1 -1
- package/Particles/thinParticleSystem.function.d.ts +6 -0
- package/Particles/thinParticleSystem.function.js +144 -88
- package/Particles/thinParticleSystem.function.js.map +1 -1
- package/Particles/thinParticleSystem.pure.d.ts +8 -0
- package/Particles/thinParticleSystem.pure.js +154 -28
- package/Particles/thinParticleSystem.pure.js.map +1 -1
- package/Particles/webgl2ParticleSystem.pure.d.ts +1 -0
- package/Particles/webgl2ParticleSystem.pure.js +12 -4
- package/Particles/webgl2ParticleSystem.pure.js.map +1 -1
- package/Physics/v2/ragdoll.d.ts +2 -4
- package/Physics/v2/ragdoll.js +11 -4
- package/Physics/v2/ragdoll.js.map +1 -1
- package/PostProcesses/RenderPipeline/Pipelines/lensRenderingPipeline.pure.js +7 -0
- package/PostProcesses/RenderPipeline/Pipelines/lensRenderingPipeline.pure.js.map +1 -1
- package/PostProcesses/index.d.ts +2 -0
- package/PostProcesses/index.js +2 -0
- package/PostProcesses/index.js.map +1 -1
- package/PostProcesses/meshBlendingBlueNoise.d.ts +15 -0
- package/PostProcesses/meshBlendingBlueNoise.js +77 -0
- package/PostProcesses/meshBlendingBlueNoise.js.map +1 -0
- package/PostProcesses/meshBlendingPostProcess.d.ts +131 -0
- package/PostProcesses/meshBlendingPostProcess.js +315 -0
- package/PostProcesses/meshBlendingPostProcess.js.map +1 -0
- package/PostProcesses/pure.d.ts +2 -0
- package/PostProcesses/pure.js +2 -0
- package/PostProcesses/pure.js.map +1 -1
- package/PostProcesses/thinMeshBlendingPostProcess.d.ts +339 -0
- package/PostProcesses/thinMeshBlendingPostProcess.js +771 -0
- package/PostProcesses/thinMeshBlendingPostProcess.js.map +1 -0
- package/Rendering/IBLShadows/iblShadowsRenderPipeline.pure.js +6 -6
- package/Rendering/IBLShadows/iblShadowsRenderPipeline.pure.js.map +1 -1
- package/Rendering/IBLShadows/iblShadowsVoxelRenderer.pure.d.ts +12 -0
- package/Rendering/IBLShadows/iblShadowsVoxelRenderer.pure.js +50 -25
- package/Rendering/IBLShadows/iblShadowsVoxelRenderer.pure.js.map +1 -1
- package/Rendering/boundingBoxRenderer.pure.js +2 -1
- package/Rendering/boundingBoxRenderer.pure.js.map +1 -1
- package/Rendering/depthRenderer.pure.d.ts +9 -0
- package/Rendering/depthRenderer.pure.js +15 -4
- package/Rendering/depthRenderer.pure.js.map +1 -1
- package/Rendering/edgesRenderer.pure.d.ts +4 -2
- package/Rendering/edgesRenderer.pure.js +11 -2
- package/Rendering/edgesRenderer.pure.js.map +1 -1
- package/Rendering/fluidRenderer/fluidRenderingObject.d.ts +14 -0
- package/Rendering/fluidRenderer/fluidRenderingObject.js +26 -0
- package/Rendering/fluidRenderer/fluidRenderingObject.js.map +1 -1
- package/Rendering/fluidRenderer/fluidRenderingObjectParticleSystem.d.ts +13 -3
- package/Rendering/fluidRenderer/fluidRenderingObjectParticleSystem.js +22 -9
- package/Rendering/fluidRenderer/fluidRenderingObjectParticleSystem.js.map +1 -1
- package/Rendering/fluidRenderer/fluidRenderingTargetRenderer.js +3 -0
- package/Rendering/fluidRenderer/fluidRenderingTargetRenderer.js.map +1 -1
- package/Rendering/geometryBufferRenderer.pure.d.ts +38 -4
- package/Rendering/geometryBufferRenderer.pure.js +130 -18
- package/Rendering/geometryBufferRenderer.pure.js.map +1 -1
- package/Rendering/objectRenderer.d.ts +7 -1
- package/Rendering/objectRenderer.js +45 -7
- package/Rendering/objectRenderer.js.map +1 -1
- package/Rendering/outlineRenderer.pure.js +6 -2
- package/Rendering/outlineRenderer.pure.js.map +1 -1
- package/Rendering/prePassRenderer.pure.js +3 -3
- package/Rendering/prePassRenderer.pure.js.map +1 -1
- package/Rendering/renderingManager.d.ts +1 -1
- package/Rendering/renderingManager.js +5 -4
- package/Rendering/renderingManager.js.map +1 -1
- package/Shaders/ShadersInclude/defaultFragmentAlpha.d.ts +5 -0
- package/Shaders/ShadersInclude/defaultFragmentAlpha.js +34 -0
- package/Shaders/ShadersInclude/defaultFragmentAlpha.js.map +1 -0
- package/Shaders/ShadersInclude/gaussianSplatting.js +3 -1
- package/Shaders/ShadersInclude/gaussianSplatting.js.map +1 -1
- package/Shaders/ShadersInclude/gaussianSplattingVertexDeclaration.js +5 -1
- package/Shaders/ShadersInclude/gaussianSplattingVertexDeclaration.js.map +1 -1
- package/Shaders/ShadersInclude/geometryRenderingFragment.d.ts +5 -0
- package/Shaders/ShadersInclude/geometryRenderingFragment.js +74 -0
- package/Shaders/ShadersInclude/geometryRenderingFragment.js.map +1 -0
- package/Shaders/ShadersInclude/lightsFragmentFunctions.js +27 -3
- package/Shaders/ShadersInclude/lightsFragmentFunctions.js.map +1 -1
- package/Shaders/ShadersInclude/mrtFragmentDeclaration.js +89 -0
- package/Shaders/ShadersInclude/mrtFragmentDeclaration.js.map +1 -1
- package/Shaders/ShadersInclude/oitDeclaration.js +1 -1
- package/Shaders/ShadersInclude/oitDeclaration.js.map +1 -1
- package/Shaders/ShadersInclude/openpbrBlockPrePass.js +24 -17
- package/Shaders/ShadersInclude/openpbrBlockPrePass.js.map +1 -1
- package/Shaders/ShadersInclude/pbrBlockPrePass.js +27 -20
- package/Shaders/ShadersInclude/pbrBlockPrePass.js.map +1 -1
- package/Shaders/ShadersInclude/pbrDebug.js +6 -2
- package/Shaders/ShadersInclude/pbrDebug.js.map +1 -1
- package/Shaders/ShadersInclude/prePassDeclaration.js +95 -2
- package/Shaders/ShadersInclude/prePassDeclaration.js.map +1 -1
- package/Shaders/default.fragment.js +31 -40
- package/Shaders/default.fragment.js.map +1 -1
- package/Shaders/depthOfField.fragment.js +13 -9
- package/Shaders/depthOfField.fragment.js.map +1 -1
- package/Shaders/fluidRenderingParticleDepth.vertex.js +16 -1
- package/Shaders/fluidRenderingParticleDepth.vertex.js.map +1 -1
- package/Shaders/fluidRenderingParticleThickness.vertex.js +16 -1
- package/Shaders/fluidRenderingParticleThickness.vertex.js.map +1 -1
- package/Shaders/gaussianSplatting.fragment.js +63 -3
- package/Shaders/gaussianSplatting.fragment.js.map +1 -1
- package/Shaders/gaussianSplatting.vertex.js +80 -0
- package/Shaders/gaussianSplatting.vertex.js.map +1 -1
- package/Shaders/geometry.fragment.js +17 -11
- package/Shaders/geometry.fragment.js.map +1 -1
- package/Shaders/gpuRenderParticles.fragment.js +43 -1
- package/Shaders/gpuRenderParticles.fragment.js.map +1 -1
- package/Shaders/gpuRenderParticles.vertex.js +96 -16
- package/Shaders/gpuRenderParticles.vertex.js.map +1 -1
- package/Shaders/meshBlending.fragment.d.ts +5 -0
- package/Shaders/meshBlending.fragment.js +519 -0
- package/Shaders/meshBlending.fragment.js.map +1 -0
- package/Shaders/minmaxRedux.fragment.js +6 -1
- package/Shaders/minmaxRedux.fragment.js.map +1 -1
- package/Shaders/particles.fragment.js +43 -1
- package/Shaders/particles.fragment.js.map +1 -1
- package/Shaders/particles.vertex.js +84 -3
- package/Shaders/particles.vertex.js.map +1 -1
- package/Shaders/sprites.fragment.js +52 -2
- package/Shaders/sprites.fragment.js.map +1 -1
- package/Shaders/sprites.vertex.js +62 -1
- package/Shaders/sprites.vertex.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/defaultFragmentAlpha.d.ts +5 -0
- package/ShadersWGSL/ShadersInclude/defaultFragmentAlpha.js +33 -0
- package/ShadersWGSL/ShadersInclude/defaultFragmentAlpha.js.map +1 -0
- package/ShadersWGSL/ShadersInclude/gaussianPointSplatting.d.ts +5 -0
- package/ShadersWGSL/ShadersInclude/gaussianPointSplatting.js +65 -0
- package/ShadersWGSL/ShadersInclude/gaussianPointSplatting.js.map +1 -0
- package/ShadersWGSL/ShadersInclude/gaussianPointSplattingScan.d.ts +5 -0
- package/ShadersWGSL/ShadersInclude/gaussianPointSplattingScan.js +17 -0
- package/ShadersWGSL/ShadersInclude/gaussianPointSplattingScan.js.map +1 -0
- package/ShadersWGSL/ShadersInclude/gaussianSplatting.d.ts +1 -0
- package/ShadersWGSL/ShadersInclude/gaussianSplatting.js +6 -78
- package/ShadersWGSL/ShadersInclude/gaussianSplatting.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/gaussianSplattingFragmentDeclaration.js +2 -2
- package/ShadersWGSL/ShadersInclude/gaussianSplattingFragmentDeclaration.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/gaussianSplattingShared.d.ts +5 -0
- package/ShadersWGSL/ShadersInclude/gaussianSplattingShared.js +79 -0
- package/ShadersWGSL/ShadersInclude/gaussianSplattingShared.js.map +1 -0
- package/ShadersWGSL/ShadersInclude/geometryRenderingFragment.d.ts +6 -0
- package/ShadersWGSL/ShadersInclude/geometryRenderingFragment.js +76 -0
- package/ShadersWGSL/ShadersInclude/geometryRenderingFragment.js.map +1 -0
- package/ShadersWGSL/ShadersInclude/lightFragment.js +1 -1
- package/ShadersWGSL/ShadersInclude/lightFragment.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/lightsFragmentFunctions.js +27 -3
- package/ShadersWGSL/ShadersInclude/lightsFragmentFunctions.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/meshBlendTagFragmentOutput.d.ts +5 -0
- package/ShadersWGSL/ShadersInclude/meshBlendTagFragmentOutput.js +18 -0
- package/ShadersWGSL/ShadersInclude/meshBlendTagFragmentOutput.js.map +1 -0
- package/ShadersWGSL/ShadersInclude/openpbrBlockPrePass.d.ts +1 -0
- package/ShadersWGSL/ShadersInclude/openpbrBlockPrePass.js +11 -25
- package/ShadersWGSL/ShadersInclude/openpbrBlockPrePass.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/pbrBlockPrePass.d.ts +1 -0
- package/ShadersWGSL/ShadersInclude/pbrBlockPrePass.js +11 -25
- package/ShadersWGSL/ShadersInclude/pbrBlockPrePass.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/pbrDebug.js +5 -1
- package/ShadersWGSL/ShadersInclude/pbrDebug.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/prePassDeclaration.js +6 -1
- package/ShadersWGSL/ShadersInclude/prePassDeclaration.js.map +1 -1
- package/ShadersWGSL/default.fragment.js +17 -48
- package/ShadersWGSL/default.fragment.js.map +1 -1
- package/ShadersWGSL/fluidRenderingParticleDepth.vertex.js +15 -2
- package/ShadersWGSL/fluidRenderingParticleDepth.vertex.js.map +1 -1
- package/ShadersWGSL/fluidRenderingParticleThickness.vertex.js +15 -2
- package/ShadersWGSL/fluidRenderingParticleThickness.vertex.js.map +1 -1
- package/ShadersWGSL/gaussianPointSplattingBlit.fragment.d.ts +5 -0
- package/ShadersWGSL/gaussianPointSplattingBlit.fragment.js +22 -0
- package/ShadersWGSL/gaussianPointSplattingBlit.fragment.js.map +1 -0
- package/ShadersWGSL/gaussianPointSplattingBlit.vertex.d.ts +5 -0
- package/ShadersWGSL/gaussianPointSplattingBlit.vertex.js +19 -0
- package/ShadersWGSL/gaussianPointSplattingBlit.vertex.js.map +1 -0
- package/ShadersWGSL/gaussianPointSplattingDepthBlit.fragment.d.ts +5 -0
- package/ShadersWGSL/gaussianPointSplattingDepthBlit.fragment.js +21 -0
- package/ShadersWGSL/gaussianPointSplattingDepthBlit.fragment.js.map +1 -0
- package/ShadersWGSL/gaussianSplatting.fragment.js +63 -2
- package/ShadersWGSL/gaussianSplatting.fragment.js.map +1 -1
- package/ShadersWGSL/gaussianSplatting.vertex.js +82 -1
- package/ShadersWGSL/gaussianSplatting.vertex.js.map +1 -1
- package/ShadersWGSL/gaussianSplattingDepth.vertex.js +2 -1
- package/ShadersWGSL/gaussianSplattingDepth.vertex.js.map +1 -1
- package/ShadersWGSL/gaussianSplattingVoxel.vertex.js +2 -1
- package/ShadersWGSL/gaussianSplattingVoxel.vertex.js.map +1 -1
- package/ShadersWGSL/geometry.fragment.js +37 -2
- package/ShadersWGSL/geometry.fragment.js.map +1 -1
- package/ShadersWGSL/gpsHiZBuild.compute.d.ts +5 -0
- package/ShadersWGSL/gpsHiZBuild.compute.js +16 -0
- package/ShadersWGSL/gpsHiZBuild.compute.js.map +1 -0
- package/ShadersWGSL/gpsPartition.compute.d.ts +5 -0
- package/ShadersWGSL/gpsPartition.compute.js +27 -0
- package/ShadersWGSL/gpsPartition.compute.js.map +1 -0
- package/ShadersWGSL/gpsPreprocess.compute.d.ts +5 -0
- package/ShadersWGSL/gpsPreprocess.compute.js +86 -0
- package/ShadersWGSL/gpsPreprocess.compute.js.map +1 -0
- package/ShadersWGSL/gpsResolve.compute.d.ts +5 -0
- package/ShadersWGSL/gpsResolve.compute.js +41 -0
- package/ShadersWGSL/gpsResolve.compute.js.map +1 -0
- package/ShadersWGSL/gpsScanAdd.compute.d.ts +5 -0
- package/ShadersWGSL/gpsScanAdd.compute.js +22 -0
- package/ShadersWGSL/gpsScanAdd.compute.js.map +1 -0
- package/ShadersWGSL/gpsScanBlocks.compute.d.ts +5 -0
- package/ShadersWGSL/gpsScanBlocks.compute.js +23 -0
- package/ShadersWGSL/gpsScanBlocks.compute.js.map +1 -0
- package/ShadersWGSL/gpsScanSums.compute.d.ts +5 -0
- package/ShadersWGSL/gpsScanSums.compute.js +30 -0
- package/ShadersWGSL/gpsScanSums.compute.js.map +1 -0
- package/ShadersWGSL/gpsSplat.compute.d.ts +5 -0
- package/ShadersWGSL/gpsSplat.compute.js +37 -0
- package/ShadersWGSL/gpsSplat.compute.js.map +1 -0
- package/ShadersWGSL/gpuRenderParticles.fragment.js +47 -2
- package/ShadersWGSL/gpuRenderParticles.fragment.js.map +1 -1
- package/ShadersWGSL/gpuRenderParticles.vertex.js +110 -7
- package/ShadersWGSL/gpuRenderParticles.vertex.js.map +1 -1
- package/ShadersWGSL/meshBlending.fragment.d.ts +5 -0
- package/ShadersWGSL/meshBlending.fragment.js +576 -0
- package/ShadersWGSL/meshBlending.fragment.js.map +1 -0
- package/ShadersWGSL/minmaxRedux.fragment.js +20 -3
- package/ShadersWGSL/minmaxRedux.fragment.js.map +1 -1
- package/ShadersWGSL/openpbr.fragment.js +2 -1
- package/ShadersWGSL/openpbr.fragment.js.map +1 -1
- package/ShadersWGSL/particles.fragment.js +45 -1
- package/ShadersWGSL/particles.fragment.js.map +1 -1
- package/ShadersWGSL/particles.vertex.js +86 -4
- package/ShadersWGSL/particles.vertex.js.map +1 -1
- package/ShadersWGSL/pbr.fragment.js +2 -1
- package/ShadersWGSL/pbr.fragment.js.map +1 -1
- package/ShadersWGSL/sprites.fragment.js +56 -2
- package/ShadersWGSL/sprites.fragment.js.map +1 -1
- package/ShadersWGSL/sprites.vertex.js +62 -1
- package/ShadersWGSL/sprites.vertex.js.map +1 -1
- package/Sprites/spriteManager.d.ts +13 -0
- package/Sprites/spriteManager.js +15 -0
- package/Sprites/spriteManager.js.map +1 -1
- package/Sprites/spriteRenderer.d.ts +24 -1
- package/Sprites/spriteRenderer.js +368 -50
- package/Sprites/spriteRenderer.js.map +1 -1
- package/Sprites/thinSprite.d.ts +4 -0
- package/Sprites/thinSprite.js +4 -0
- package/Sprites/thinSprite.js.map +1 -1
- package/States/alphaCullingState.d.ts +3 -1
- package/States/alphaCullingState.js +18 -3
- package/States/alphaCullingState.js.map +1 -1
- package/XR/features/WebXRSpaceWarp.pure.js +2 -1
- package/XR/features/WebXRSpaceWarp.pure.js.map +1 -1
- package/XR/webXRDefaultExperience.d.ts +5 -1
- package/XR/webXRDefaultExperience.js.map +1 -1
- package/XR/webXREnterExitUI.d.ts +2 -1
- package/XR/webXREnterExitUI.js.map +1 -1
- package/assetContainer.d.ts +1 -0
- package/assetContainer.js +5 -1
- package/assetContainer.js.map +1 -1
- package/package.json +1 -1
- package/scene.pure.d.ts +36 -2
- package/scene.pure.js +63 -4
- package/scene.pure.js.map +1 -1
|
@@ -20,9 +20,16 @@ export interface IFlowGraphReceiveCustomEventBlockConfiguration extends IFlowGra
|
|
|
20
20
|
eventData: {
|
|
21
21
|
[key: string]: {
|
|
22
22
|
type: RichType<any>;
|
|
23
|
+
value?: any;
|
|
23
24
|
};
|
|
24
25
|
};
|
|
25
26
|
}
|
|
27
|
+
/**
|
|
28
|
+
* Returns the event-dispatch key for an authored custom event id.
|
|
29
|
+
* @param eventId authored custom event id
|
|
30
|
+
* @returns namespaced event key
|
|
31
|
+
*/
|
|
32
|
+
export declare function GetFlowGraphCustomEventKey(eventId: string): string;
|
|
26
33
|
/**
|
|
27
34
|
* A block that receives a custom event.
|
|
28
35
|
* It saves the event data in the data outputs, based on the provided eventData in the configuration. For example, if the event data is
|
|
@@ -40,6 +47,8 @@ export declare class FlowGraphReceiveCustomEventBlock extends FlowGraphEventBloc
|
|
|
40
47
|
* `event` outputs for equality succeeds. The reference format is owned by the host environment.
|
|
41
48
|
*/
|
|
42
49
|
readonly eventRef: FlowGraphDataConnection<string>;
|
|
50
|
+
/** @returns the configured custom event id */
|
|
51
|
+
get eventKey(): string;
|
|
43
52
|
constructor(
|
|
44
53
|
/**
|
|
45
54
|
* the configuration of the block
|
|
@@ -4,12 +4,25 @@ import { Logger } from "../../../Misc/logger.js";
|
|
|
4
4
|
import { getRichTypeByFlowGraphType, RichTypeString } from "../../flowGraphRichTypes.pure.js";
|
|
5
5
|
import { FlowGraphCoordinator } from "../../flowGraphCoordinator.js";
|
|
6
6
|
import { RegisterClass } from "../../../Misc/typeStore.js";
|
|
7
|
+
import { defaultValueSerializationFunction } from "../../serialization.js";
|
|
8
|
+
/**
|
|
9
|
+
* Returns the event-dispatch key for an authored custom event id.
|
|
10
|
+
* @param eventId authored custom event id
|
|
11
|
+
* @returns namespaced event key
|
|
12
|
+
*/
|
|
13
|
+
export function GetFlowGraphCustomEventKey(eventId) {
|
|
14
|
+
return `custom:${encodeURIComponent(eventId)}`;
|
|
15
|
+
}
|
|
7
16
|
/**
|
|
8
17
|
* A block that receives a custom event.
|
|
9
18
|
* It saves the event data in the data outputs, based on the provided eventData in the configuration. For example, if the event data is
|
|
10
19
|
* `{ x: { type: RichTypeNumber }, y: { type: RichTypeNumber } }`, the block will have two data outputs: x and y.
|
|
11
20
|
*/
|
|
12
21
|
export class FlowGraphReceiveCustomEventBlock extends FlowGraphEventBlock {
|
|
22
|
+
/** @returns the configured custom event id */
|
|
23
|
+
get eventKey() {
|
|
24
|
+
return GetFlowGraphCustomEventKey(this.config.eventId);
|
|
25
|
+
}
|
|
13
26
|
constructor(
|
|
14
27
|
/**
|
|
15
28
|
* the configuration of the block
|
|
@@ -19,7 +32,7 @@ export class FlowGraphReceiveCustomEventBlock extends FlowGraphEventBlock {
|
|
|
19
32
|
this.config = config;
|
|
20
33
|
this.initPriority = 1;
|
|
21
34
|
// use event data to register data outputs
|
|
22
|
-
for (const key
|
|
35
|
+
for (const key of Object.keys(this.config.eventData ?? {})) {
|
|
23
36
|
const entry = this.config.eventData[key];
|
|
24
37
|
// Handle deserialized config where type may be a string typeName, a plain object
|
|
25
38
|
// with a typeName property (from old JSON serialization), or a proper RichType instance.
|
|
@@ -37,7 +50,7 @@ export class FlowGraphReceiveCustomEventBlock extends FlowGraphEventBlock {
|
|
|
37
50
|
: this.registerDataOutput("event", RichTypeString);
|
|
38
51
|
}
|
|
39
52
|
_updateOutputs(context) {
|
|
40
|
-
this.eventRef.setValue(context.getEventReference(this.
|
|
53
|
+
this.eventRef.setValue(context.getEventReference(this.eventKey), context);
|
|
41
54
|
}
|
|
42
55
|
_preparePendingTasks(context) {
|
|
43
56
|
const observable = context.configuration.coordinator.getCustomEventObservable(this.config.eventId);
|
|
@@ -49,12 +62,12 @@ export class FlowGraphReceiveCustomEventBlock extends FlowGraphEventBlock {
|
|
|
49
62
|
const eventObserver = observable.add((eventData, eventState) => {
|
|
50
63
|
// Make this dispatch's EventState reachable by event/stopPropagation
|
|
51
64
|
// for the duration of the synchronous receiver flow.
|
|
52
|
-
context.configuration.coordinator._beginEventDispatch(this.
|
|
65
|
+
context.configuration.coordinator._beginEventDispatch(this.eventKey, eventState);
|
|
53
66
|
try {
|
|
54
67
|
// Drive the outputs from the configured payload schema rather than from the incoming
|
|
55
68
|
// keys, so a key the sender omitted (or sent as undefined) resets to its configured
|
|
56
69
|
// default instead of retaining the value from a previous dispatch.
|
|
57
|
-
for (const key
|
|
70
|
+
for (const key of Object.keys(this.config.eventData ?? {})) {
|
|
58
71
|
const output = this.getDataOutput(key);
|
|
59
72
|
if (!output) {
|
|
60
73
|
continue;
|
|
@@ -63,7 +76,7 @@ export class FlowGraphReceiveCustomEventBlock extends FlowGraphEventBlock {
|
|
|
63
76
|
output.setValue(incoming === undefined ? this._getEventDataDefault(key) : incoming, context);
|
|
64
77
|
}
|
|
65
78
|
// Expose the event reference before activating downstream flow.
|
|
66
|
-
this.eventRef.setValue(context.getEventReference(this.
|
|
79
|
+
this.eventRef.setValue(context.getEventReference(this.eventKey), context);
|
|
67
80
|
this._execute(context);
|
|
68
81
|
}
|
|
69
82
|
finally {
|
|
@@ -79,7 +92,9 @@ export class FlowGraphReceiveCustomEventBlock extends FlowGraphEventBlock {
|
|
|
79
92
|
* @returns the default value for that key
|
|
80
93
|
*/
|
|
81
94
|
_getEventDataDefault(key) {
|
|
82
|
-
const entry = this.config.eventData
|
|
95
|
+
const entry = this.config.eventData && Object.prototype.hasOwnProperty.call(this.config.eventData, key)
|
|
96
|
+
? this.config.eventData[key]
|
|
97
|
+
: undefined;
|
|
83
98
|
return entry?.value !== undefined ? entry.value : entry?.type?.defaultValue;
|
|
84
99
|
}
|
|
85
100
|
_cancelPendingTasks(context) {
|
|
@@ -98,9 +113,19 @@ export class FlowGraphReceiveCustomEventBlock extends FlowGraphEventBlock {
|
|
|
98
113
|
serialize(serializationObject = {}) {
|
|
99
114
|
super.serialize(serializationObject);
|
|
100
115
|
// Override the eventData in config to store typeName strings instead of RichType instances
|
|
101
|
-
const serializedEventData =
|
|
102
|
-
for (const key
|
|
103
|
-
|
|
116
|
+
const serializedEventData = Object.create(null);
|
|
117
|
+
for (const key of Object.keys(this.config.eventData ?? {})) {
|
|
118
|
+
const entry = this.config.eventData[key];
|
|
119
|
+
const serializedEntry = { type: entry.type.typeName };
|
|
120
|
+
if (entry.value !== undefined) {
|
|
121
|
+
defaultValueSerializationFunction("value", entry.value, serializedEntry);
|
|
122
|
+
}
|
|
123
|
+
Object.defineProperty(serializedEventData, key, {
|
|
124
|
+
configurable: true,
|
|
125
|
+
enumerable: true,
|
|
126
|
+
value: serializedEntry,
|
|
127
|
+
writable: true,
|
|
128
|
+
});
|
|
104
129
|
}
|
|
105
130
|
serializationObject.config.eventData = serializedEventData;
|
|
106
131
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flowGraphReceiveCustomEventBlock.pure.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FlowGraph/Blocks/Event/flowGraphReceiveCustomEventBlock.pure.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAI7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAEhE,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAiB,0BAA0B,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAI1G,OA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,CAAC,OAAO,EAAE,CAAC,CAAC;QACzG,CAAC;IACL,CAAC;IAEe,aAAa,CAAC,QAA0B,EAAE,QAAa;QACnE,OAAO,IAAI,CAAC;IAChB,CAAC;IAEe,SAAS,CAAC,sBAA2B,EAAE;QACnD,KAAK,CAAC,SAAS,CAAC,mBAAmB,CAAC,CAAC;QACrC,2FAA2F;QAC3F,MAAM,mBAAmB,GAAQ,EAAE,CAAC;QACpC,KAAK,MAAM,GAAG,IAAI,IAAI,CAAC,MAAM,CAAC,SAAS,EAAE,CAAC;YACtC,mBAAmB,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC;QAClF,CAAC;QACD,mBAAmB,CAAC,MAAM,CAAC,SAAS,GAAG,mBAAmB,CAAC;IAC/D,CAAC;IAED;;OAEG;IACa,YAAY;QACxB,uFAA8C;IAClD,CAAC;CACJ;AAED,IAAI,WAAW,GAAG,KAAK,CAAC;AACxB;;;GAGG;AACH,MAAM,UAAU,wCAAwC;IACpD,IAAI,WAAW,EAAE,CAAC;QACd,OAAO;IACX,CAAC;IACD,WAAW,GAAG,IAAI,CAAC;IAEnB,aAAa,kFAAyC,gCAAgC,CAAC,CAAC;AAC5F,CAAC","sourcesContent":["/** This file must only contain pure code and pure imports */\r\n\r\nimport { type Observer } from \"../../../Misc/observable.pure\";\r\nimport { type FlowGraphContext } from \"../../flowGraphContext\";\r\nimport { FlowGraphEventBlock } from \"../../flowGraphEventBlock\";\r\nimport { type Nullable } from \"../../../types\";\r\nimport { Logger } from \"../../../Misc/logger\";\r\nimport { type RichType, getRichTypeByFlowGraphType, RichTypeString } from \"../../flowGraphRichTypes.pure\";\r\nimport { type FlowGraphDataConnection } from \"../../flowGraphDataConnection.pure\";\r\nimport { type IFlowGraphBlockConfiguration } from \"../../flowGraphBlock\";\r\nimport { FlowGraphBlockNames } from \"../flowGraphBlockNames\";\r\nimport { FlowGraphCoordinator } from \"core/FlowGraph/flowGraphCoordinator\";\r\nimport { RegisterClass } from \"../../../Misc/typeStore\";\r\n/**\r\n * Parameters used to create a FlowGraphReceiveCustomEventBlock.\r\n */\r\nexport interface IFlowGraphReceiveCustomEventBlockConfiguration extends IFlowGraphBlockConfiguration {\r\n /**\r\n * The id of the event to receive.\r\n * This event id is unique to the environment (not the context).\r\n */\r\n eventId: string;\r\n /**\r\n * The names of the data outputs for that event. Should be in the same order as the event data in\r\n * SendCustomEvent\r\n */\r\n eventData: { [key: string]: { type: RichType<any> } };\r\n}\r\n\r\n/**\r\n * A block that receives a custom event.\r\n * It saves the event data in the data outputs, based on the provided eventData in the configuration. For example, if the event data is\r\n * `{ x: { type: RichTypeNumber }, y: { type: RichTypeNumber } }`, the block will have two data outputs: x and y.\r\n */\r\nexport class FlowGraphReceiveCustomEventBlock extends FlowGraphEventBlock {\r\n public override initPriority: number = 1;\r\n\r\n /**\r\n * Output: the opaque reference identifying the received event source.\r\n * Receivers configured with the same event id share the same reference, so comparing their\r\n * `event` outputs for equality succeeds. The reference format is owned by the host environment.\r\n */\r\n public readonly eventRef: FlowGraphDataConnection<string>;\r\n\r\n constructor(\r\n /**\r\n * the configuration of the block\r\n */\r\n public override config: IFlowGraphReceiveCustomEventBlockConfiguration\r\n ) {\r\n super(config);\r\n // use event data to register data outputs\r\n for (const key in this.config.eventData) {\r\n const entry = this.config.eventData[key];\r\n // Handle deserialized config where type may be a string typeName, a plain object\r\n // with a typeName property (from old JSON serialization), or a proper RichType instance.\r\n const typeKey = typeof entry.type === \"string\" ? entry.type : entry.type?.typeName;\r\n const richType = typeof entry.type?.serialize === \"function\" ? entry.type : getRichTypeByFlowGraphType(typeKey);\r\n entry.type = richType;\r\n // Pass default value from event data schema so outputs have the correct initial value\r\n this.registerDataOutput(key, richType, (entry as any).value);\r\n }\r\n // Reserved `event` output exposing the event reference. Guard against a\r\n // (pathological) custom event value socket literally named \"event\".\r\n this.eventRef =\r\n this.config.eventData && Object.prototype.hasOwnProperty.call(this.config.eventData, \"event\")\r\n ? this.getDataOutput(\"event\")!\r\n : this.registerDataOutput(\"event\", RichTypeString);\r\n }\r\n\r\n public override _updateOutputs(context: FlowGraphContext): void {\r\n this.eventRef.setValue(context.getEventReference(this.config.eventId), context);\r\n }\r\n\r\n public override _preparePendingTasks(context: FlowGraphContext): void {\r\n const observable = context.configuration.coordinator.getCustomEventObservable(this.config.eventId);\r\n // check if we are not exceeding the max number of events\r\n if (observable && observable.hasObservers() && observable.observers.length > FlowGraphCoordinator.MaxEventsPerType) {\r\n this._reportError(context, `FlowGraphReceiveCustomEventBlock: Too many observers for event ${this.config.eventId}. Max is ${FlowGraphCoordinator.MaxEventsPerType}.`);\r\n return;\r\n }\r\n\r\n const eventObserver = observable.add((eventData: { [key: string]: any }, eventState) => {\r\n // Make this dispatch's EventState reachable by event/stopPropagation\r\n // for the duration of the synchronous receiver flow.\r\n context.configuration.coordinator._beginEventDispatch(this.config.eventId, eventState);\r\n try {\r\n // Drive the outputs from the configured payload schema rather than from the incoming\r\n // keys, so a key the sender omitted (or sent as undefined) resets to its configured\r\n // default instead of retaining the value from a previous dispatch.\r\n for (const key in this.config.eventData) {\r\n const output = this.getDataOutput(key);\r\n if (!output) {\r\n continue;\r\n }\r\n const incoming = eventData?.[key];\r\n output.setValue(incoming === undefined ? this._getEventDataDefault(key) : incoming, context);\r\n }\r\n // Expose the event reference before activating downstream flow.\r\n this.eventRef.setValue(context.getEventReference(this.config.eventId), context);\r\n this._execute(context);\r\n } finally {\r\n context.configuration.coordinator._endEventDispatch();\r\n }\r\n });\r\n context._setExecutionVariable(this, \"_eventObserver\", eventObserver);\r\n }\r\n\r\n /**\r\n * The value an output falls back to when the sender provides no value for it: the default\r\n * declared by the payload schema, or the socket type's default when the schema declares none.\r\n * @param key the payload key\r\n * @returns the default value for that key\r\n */\r\n private _getEventDataDefault(key: string): any {\r\n const entry = this.config.eventData?.[key] as { type: RichType<any>; value?: any } | undefined;\r\n return entry?.value !== undefined ? entry.value : entry?.type?.defaultValue;\r\n }\r\n public override _cancelPendingTasks(context: FlowGraphContext): void {\r\n const observable = context.configuration.coordinator.getCustomEventObservable(this.config.eventId);\r\n if (observable) {\r\n const eventObserver = context._getExecutionVariable<Nullable<Observer<any[]>>>(this, \"_eventObserver\", null);\r\n observable.remove(eventObserver);\r\n } else {\r\n Logger.Warn(`FlowGraphReceiveCustomEventBlock: Missing observable for event ${this.config.eventId}`);\r\n }\r\n }\r\n\r\n public override _executeEvent(_context: FlowGraphContext, _payload: any): boolean {\r\n return true;\r\n }\r\n\r\n public override serialize(serializationObject: any = {}) {\r\n super.serialize(serializationObject);\r\n // Override the eventData in config to store typeName strings instead of RichType instances\r\n const serializedEventData: any = {};\r\n for (const key in this.config.eventData) {\r\n serializedEventData[key] = { type: this.config.eventData[key].type.typeName };\r\n }\r\n serializationObject.config.eventData = serializedEventData;\r\n }\r\n\r\n /**\r\n * @returns class name of the block.\r\n */\r\n public override getClassName(): string {\r\n return FlowGraphBlockNames.ReceiveCustomEvent;\r\n }\r\n}\r\n\r\nlet _Registered = false;\r\n/**\r\n * Register side effects for flowGraphReceiveCustomEventBlock.\r\n * Safe to call multiple times; only the first call has an effect.\r\n */\r\nexport function RegisterFlowGraphReceiveCustomEventBlock(): void {\r\n if (_Registered) {\r\n return;\r\n }\r\n _Registered = true;\r\n\r\n RegisterClass(FlowGraphBlockNames.ReceiveCustomEvent, FlowGraphReceiveCustomEventBlock);\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"flowGraphReceiveCustomEventBlock.pure.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FlowGraph/Blocks/Event/flowGraphReceiveCustomEventBlock.pure.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAI7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAEhE,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAiB,0BA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K,CAAC,KAAK,EAAE,eAAe,CAAC,CAAC;YAC7E,CAAC;YACD,MAAM,CAAC,cAAc,CAAC,mBAAmB,EAAE,GAAG,EAAE;gBAC5C,YAAY,EAAE,IAAI;gBAClB,UAAU,EAAE,IAAI;gBAChB,KAAK,EAAE,eAAe;gBACtB,QAAQ,EAAE,IAAI;aACjB,CAAC,CAAC;QACP,CAAC;QACD,mBAAmB,CAAC,MAAM,CAAC,SAAS,GAAG,mBAAmB,CAAC;IAC/D,CAAC;IAED;;OAEG;IACa,YAAY;QACxB,uFAA8C;IAClD,CAAC;CACJ;AAED,IAAI,WAAW,GAAG,KAAK,CAAC;AACxB;;;GAGG;AACH,MAAM,UAAU,wCAAwC;IACpD,IAAI,WAAW,EAAE,CAAC;QACd,OAAO;IACX,CAAC;IACD,WAAW,GAAG,IAAI,CAAC;IAEnB,aAAa,kFAAyC,gCAAgC,CAAC,CAAC;AAC5F,CAAC","sourcesContent":["/** This file must only contain pure code and pure imports */\r\n\r\nimport { type Observer } from \"../../../Misc/observable.pure\";\r\nimport { type FlowGraphContext } from \"../../flowGraphContext\";\r\nimport { FlowGraphEventBlock } from \"../../flowGraphEventBlock\";\r\nimport { type Nullable } from \"../../../types\";\r\nimport { Logger } from \"../../../Misc/logger\";\r\nimport { type RichType, getRichTypeByFlowGraphType, RichTypeString } from \"../../flowGraphRichTypes.pure\";\r\nimport { type FlowGraphDataConnection } from \"../../flowGraphDataConnection.pure\";\r\nimport { type IFlowGraphBlockConfiguration } from \"../../flowGraphBlock\";\r\nimport { FlowGraphBlockNames } from \"../flowGraphBlockNames\";\r\nimport { FlowGraphCoordinator } from \"core/FlowGraph/flowGraphCoordinator\";\r\nimport { RegisterClass } from \"../../../Misc/typeStore\";\r\nimport { defaultValueSerializationFunction } from \"../../serialization\";\r\n/**\r\n * Parameters used to create a FlowGraphReceiveCustomEventBlock.\r\n */\r\nexport interface IFlowGraphReceiveCustomEventBlockConfiguration extends IFlowGraphBlockConfiguration {\r\n /**\r\n * The id of the event to receive.\r\n * This event id is unique to the environment (not the context).\r\n */\r\n eventId: string;\r\n /**\r\n * The names of the data outputs for that event. Should be in the same order as the event data in\r\n * SendCustomEvent\r\n */\r\n eventData: { [key: string]: { type: RichType<any>; value?: any } };\r\n}\r\n\r\n/**\r\n * Returns the event-dispatch key for an authored custom event id.\r\n * @param eventId authored custom event id\r\n * @returns namespaced event key\r\n */\r\nexport function GetFlowGraphCustomEventKey(eventId: string): string {\r\n return `custom:${encodeURIComponent(eventId)}`;\r\n}\r\n\r\n/**\r\n * A block that receives a custom event.\r\n * It saves the event data in the data outputs, based on the provided eventData in the configuration. For example, if the event data is\r\n * `{ x: { type: RichTypeNumber }, y: { type: RichTypeNumber } }`, the block will have two data outputs: x and y.\r\n */\r\nexport class FlowGraphReceiveCustomEventBlock extends FlowGraphEventBlock {\r\n public override initPriority: number = 1;\r\n\r\n /**\r\n * Output: the opaque reference identifying the received event source.\r\n * Receivers configured with the same event id share the same reference, so comparing their\r\n * `event` outputs for equality succeeds. The reference format is owned by the host environment.\r\n */\r\n public readonly eventRef: FlowGraphDataConnection<string>;\r\n\r\n /** @returns the configured custom event id */\r\n public override get eventKey(): string {\r\n return GetFlowGraphCustomEventKey(this.config.eventId);\r\n }\r\n\r\n constructor(\r\n /**\r\n * the configuration of the block\r\n */\r\n public override config: IFlowGraphReceiveCustomEventBlockConfiguration\r\n ) {\r\n super(config);\r\n // use event data to register data outputs\r\n for (const key of Object.keys(this.config.eventData ?? {})) {\r\n const entry = this.config.eventData[key];\r\n // Handle deserialized config where type may be a string typeName, a plain object\r\n // with a typeName property (from old JSON serialization), or a proper RichType instance.\r\n const typeKey = typeof entry.type === \"string\" ? entry.type : entry.type?.typeName;\r\n const richType = typeof entry.type?.serialize === \"function\" ? entry.type : getRichTypeByFlowGraphType(typeKey);\r\n entry.type = richType;\r\n // Pass default value from event data schema so outputs have the correct initial value\r\n this.registerDataOutput(key, richType, (entry as any).value);\r\n }\r\n // Reserved `event` output exposing the event reference. Guard against a\r\n // (pathological) custom event value socket literally named \"event\".\r\n this.eventRef =\r\n this.config.eventData && Object.prototype.hasOwnProperty.call(this.config.eventData, \"event\")\r\n ? this.getDataOutput(\"event\")!\r\n : this.registerDataOutput(\"event\", RichTypeString);\r\n }\r\n\r\n public override _updateOutputs(context: FlowGraphContext): void {\r\n this.eventRef.setValue(context.getEventReference(this.eventKey), context);\r\n }\r\n\r\n public override _preparePendingTasks(context: FlowGraphContext): void {\r\n const observable = context.configuration.coordinator.getCustomEventObservable(this.config.eventId);\r\n // check if we are not exceeding the max number of events\r\n if (observable && observable.hasObservers() && observable.observers.length > FlowGraphCoordinator.MaxEventsPerType) {\r\n this._reportError(context, `FlowGraphReceiveCustomEventBlock: Too many observers for event ${this.config.eventId}. Max is ${FlowGraphCoordinator.MaxEventsPerType}.`);\r\n return;\r\n }\r\n\r\n const eventObserver = observable.add((eventData: { [key: string]: any }, eventState) => {\r\n // Make this dispatch's EventState reachable by event/stopPropagation\r\n // for the duration of the synchronous receiver flow.\r\n context.configuration.coordinator._beginEventDispatch(this.eventKey, eventState);\r\n try {\r\n // Drive the outputs from the configured payload schema rather than from the incoming\r\n // keys, so a key the sender omitted (or sent as undefined) resets to its configured\r\n // default instead of retaining the value from a previous dispatch.\r\n for (const key of Object.keys(this.config.eventData ?? {})) {\r\n const output = this.getDataOutput(key);\r\n if (!output) {\r\n continue;\r\n }\r\n const incoming = eventData?.[key];\r\n output.setValue(incoming === undefined ? this._getEventDataDefault(key) : incoming, context);\r\n }\r\n // Expose the event reference before activating downstream flow.\r\n this.eventRef.setValue(context.getEventReference(this.eventKey), context);\r\n this._execute(context);\r\n } finally {\r\n context.configuration.coordinator._endEventDispatch();\r\n }\r\n });\r\n context._setExecutionVariable(this, \"_eventObserver\", eventObserver);\r\n }\r\n\r\n /**\r\n * The value an output falls back to when the sender provides no value for it: the default\r\n * declared by the payload schema, or the socket type's default when the schema declares none.\r\n * @param key the payload key\r\n * @returns the default value for that key\r\n */\r\n private _getEventDataDefault(key: string): any {\r\n const entry =\r\n this.config.eventData && Object.prototype.hasOwnProperty.call(this.config.eventData, key)\r\n ? (this.config.eventData[key] as { type: RichType<any>; value?: any })\r\n : undefined;\r\n return entry?.value !== undefined ? entry.value : entry?.type?.defaultValue;\r\n }\r\n public override _cancelPendingTasks(context: FlowGraphContext): void {\r\n const observable = context.configuration.coordinator.getCustomEventObservable(this.config.eventId);\r\n if (observable) {\r\n const eventObserver = context._getExecutionVariable<Nullable<Observer<any[]>>>(this, \"_eventObserver\", null);\r\n observable.remove(eventObserver);\r\n } else {\r\n Logger.Warn(`FlowGraphReceiveCustomEventBlock: Missing observable for event ${this.config.eventId}`);\r\n }\r\n }\r\n\r\n public override _executeEvent(_context: FlowGraphContext, _payload: any): boolean {\r\n return true;\r\n }\r\n\r\n public override serialize(serializationObject: any = {}) {\r\n super.serialize(serializationObject);\r\n // Override the eventData in config to store typeName strings instead of RichType instances\r\n const serializedEventData: any = Object.create(null);\r\n for (const key of Object.keys(this.config.eventData ?? {})) {\r\n const entry = this.config.eventData[key];\r\n const serializedEntry: { type: string; value?: unknown } = { type: entry.type.typeName };\r\n if (entry.value !== undefined) {\r\n defaultValueSerializationFunction(\"value\", entry.value, serializedEntry);\r\n }\r\n Object.defineProperty(serializedEventData, key, {\r\n configurable: true,\r\n enumerable: true,\r\n value: serializedEntry,\r\n writable: true,\r\n });\r\n }\r\n serializationObject.config.eventData = serializedEventData;\r\n }\r\n\r\n /**\r\n * @returns class name of the block.\r\n */\r\n public override getClassName(): string {\r\n return FlowGraphBlockNames.ReceiveCustomEvent;\r\n }\r\n}\r\n\r\nlet _Registered = false;\r\n/**\r\n * Register side effects for flowGraphReceiveCustomEventBlock.\r\n * Safe to call multiple times; only the first call has an effect.\r\n */\r\nexport function RegisterFlowGraphReceiveCustomEventBlock(): void {\r\n if (_Registered) {\r\n return;\r\n }\r\n _Registered = true;\r\n\r\n RegisterClass(FlowGraphBlockNames.ReceiveCustomEvent, FlowGraphReceiveCustomEventBlock);\r\n}\r\n"]}
|
|
@@ -10,6 +10,8 @@ import { FlowGraphEventType } from "../../flowGraphEventType.js";
|
|
|
10
10
|
export declare class FlowGraphSceneReadyEventBlock extends FlowGraphEventBlock {
|
|
11
11
|
initPriority: number;
|
|
12
12
|
readonly type: FlowGraphEventType;
|
|
13
|
+
/** @returns the shared scene-ready event key */
|
|
14
|
+
get eventKey(): string;
|
|
13
15
|
/**
|
|
14
16
|
* Output: the opaque reference identifying this event source.
|
|
15
17
|
* All instances of this block share the same reference, so comparing the `event` output of two
|
|
@@ -8,6 +8,10 @@ const EventKey = "sceneReady";
|
|
|
8
8
|
* Block that triggers when a scene is ready.
|
|
9
9
|
*/
|
|
10
10
|
export class FlowGraphSceneReadyEventBlock extends FlowGraphEventBlock {
|
|
11
|
+
/** @returns the shared scene-ready event key */
|
|
12
|
+
get eventKey() {
|
|
13
|
+
return EventKey;
|
|
14
|
+
}
|
|
11
15
|
constructor() {
|
|
12
16
|
super();
|
|
13
17
|
this.initPriority = -1;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flowGraphSceneReadyEventBlock.pure.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FlowGraph/Blocks/Event/flowGraphSceneReadyEventBlock.pure.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAE7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAGhE,OAAO,EAAE,cAAc,EAAE,MAAM,wCAAwC,CAAC;AAGxE,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAExD,mEAAmE;AACnE,MAAM,QAAQ,GAAG,YAAY,CAAC;AAE9B;;GAEG;AACH,MAAM,OAAO,6BAA8B,SAAQ,mBAAmB;
|
|
1
|
+
{"version":3,"file":"flowGraphSceneReadyEventBlock.pure.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FlowGraph/Blocks/Event/flowGraphSceneReadyEventBlock.pure.ts"],"names":[],"mappings":"AAAA,6DAA6D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a,4EAAsC,6BAA6B,CAAC,CAAC;AACtF,CAAC","sourcesContent":["/** This file must only contain pure code and pure imports */\r\n\r\nimport { FlowGraphEventBlock } from \"../../flowGraphEventBlock\";\r\nimport { type FlowGraphContext } from \"core/FlowGraph/flowGraphContext\";\r\nimport { type FlowGraphDataConnection } from \"core/FlowGraph/flowGraphDataConnection.pure\";\r\nimport { RichTypeString } from \"core/FlowGraph/flowGraphRichTypes.pure\";\r\nimport { FlowGraphBlockNames } from \"../flowGraphBlockNames\";\r\nimport { FlowGraphEventType } from \"core/FlowGraph/flowGraphEventType\";\r\nimport { RegisterClass } from \"../../../Misc/typeStore\";\r\n\r\n/** Event source key used to build this block's event reference. */\r\nconst EventKey = \"sceneReady\";\r\n\r\n/**\r\n * Block that triggers when a scene is ready.\r\n */\r\nexport class FlowGraphSceneReadyEventBlock extends FlowGraphEventBlock {\r\n public override initPriority: number = -1;\r\n\r\n public override readonly type: FlowGraphEventType = FlowGraphEventType.SceneReady;\r\n /** @returns the shared scene-ready event key */\r\n public override get eventKey(): string {\r\n return EventKey;\r\n }\r\n\r\n /**\r\n * Output: the opaque reference identifying this event source.\r\n * All instances of this block share the same reference, so comparing the `event` output of two\r\n * of them for equality succeeds. The reference format is owned by the host environment.\r\n */\r\n public readonly eventRef: FlowGraphDataConnection<string>;\r\n\r\n constructor() {\r\n super();\r\n this.eventRef = this.registerDataOutput(\"event\", RichTypeString);\r\n }\r\n\r\n public override _updateOutputs(context: FlowGraphContext): void {\r\n this.eventRef.setValue(context.getEventReference(EventKey), context);\r\n }\r\n\r\n public override _executeEvent(context: FlowGraphContext, _payload: any): boolean {\r\n this.eventRef.setValue(context.getEventReference(EventKey), context);\r\n this._execute(context);\r\n return true;\r\n }\r\n public override _preparePendingTasks(context: FlowGraphContext): void {\r\n // no-op\r\n }\r\n public override _cancelPendingTasks(context: FlowGraphContext): void {\r\n // no-op\r\n }\r\n /**\r\n * @returns class name of the block.\r\n */\r\n public override getClassName() {\r\n return FlowGraphBlockNames.SceneReadyEvent;\r\n }\r\n}\r\n\r\nlet _Registered = false;\r\n/**\r\n * Register side effects for flowGraphSceneReadyEventBlock.\r\n * Safe to call multiple times; only the first call has an effect.\r\n */\r\nexport function RegisterFlowGraphSceneReadyEventBlock(): void {\r\n if (_Registered) {\r\n return;\r\n }\r\n _Registered = true;\r\n\r\n RegisterClass(FlowGraphBlockNames.SceneReadyEvent, FlowGraphSceneReadyEventBlock);\r\n}\r\n"]}
|
|
@@ -3,12 +3,20 @@ import { FlowGraphEventBlock } from "../../flowGraphEventBlock.js";
|
|
|
3
3
|
import { type FlowGraphContext } from "../../flowGraphContext.js";
|
|
4
4
|
import { type FlowGraphDataConnection } from "../../flowGraphDataConnection.pure.js";
|
|
5
5
|
import { FlowGraphEventType } from "../../flowGraphEventType.js";
|
|
6
|
+
import { type IFlowGraphBlockConfiguration } from "../../flowGraphBlock.js";
|
|
7
|
+
/**
|
|
8
|
+
* Configuration for the scene tick event.
|
|
9
|
+
*/
|
|
10
|
+
export interface IFlowGraphSceneTickEventBlockConfiguration extends IFlowGraphBlockConfiguration {
|
|
11
|
+
/** Whether elapsed time starts at the first tick, whose delta time remains NaN. Defaults to false. */
|
|
12
|
+
useFirstTickAsStart?: boolean;
|
|
13
|
+
}
|
|
6
14
|
/**
|
|
7
15
|
* Payload for the scene tick event.
|
|
8
16
|
*/
|
|
9
17
|
export interface IFlowGraphOnTickEventPayload {
|
|
10
18
|
/**
|
|
11
|
-
*
|
|
19
|
+
* The scene's accumulated time in seconds before the current frame interval.
|
|
12
20
|
*/
|
|
13
21
|
timeSinceStart: number;
|
|
14
22
|
/**
|
|
@@ -21,11 +29,11 @@ export interface IFlowGraphOnTickEventPayload {
|
|
|
21
29
|
*/
|
|
22
30
|
export declare class FlowGraphSceneTickEventBlock extends FlowGraphEventBlock {
|
|
23
31
|
/**
|
|
24
|
-
*
|
|
32
|
+
* Time in seconds since the scene started, or since the first tick when useFirstTickAsStart is enabled.
|
|
25
33
|
*/
|
|
26
34
|
readonly timeSinceStart: FlowGraphDataConnection<number>;
|
|
27
35
|
/**
|
|
28
|
-
*
|
|
36
|
+
* Time in seconds since the last frame. Remains NaN on the first opted-in tick.
|
|
29
37
|
*/
|
|
30
38
|
readonly deltaTime: FlowGraphDataConnection<number>;
|
|
31
39
|
/**
|
|
@@ -35,7 +43,13 @@ export declare class FlowGraphSceneTickEventBlock extends FlowGraphEventBlock {
|
|
|
35
43
|
*/
|
|
36
44
|
readonly eventRef: FlowGraphDataConnection<string>;
|
|
37
45
|
readonly type: FlowGraphEventType;
|
|
38
|
-
|
|
46
|
+
/** @returns the shared scene-tick event key */
|
|
47
|
+
get eventKey(): string;
|
|
48
|
+
/**
|
|
49
|
+
* Creates a scene tick event block.
|
|
50
|
+
* @param config optional clock behavior
|
|
51
|
+
*/
|
|
52
|
+
constructor(config?: IFlowGraphSceneTickEventBlockConfiguration);
|
|
39
53
|
_updateOutputs(context: FlowGraphContext): void;
|
|
40
54
|
/**
|
|
41
55
|
* @internal
|
|
@@ -8,11 +8,19 @@ const EventKey = "sceneTick";
|
|
|
8
8
|
* Block that triggers on scene tick (before each render).
|
|
9
9
|
*/
|
|
10
10
|
export class FlowGraphSceneTickEventBlock extends FlowGraphEventBlock {
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
/** @returns the shared scene-tick event key */
|
|
12
|
+
get eventKey() {
|
|
13
|
+
return EventKey;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Creates a scene tick event block.
|
|
17
|
+
* @param config optional clock behavior
|
|
18
|
+
*/
|
|
19
|
+
constructor(config) {
|
|
20
|
+
super(config);
|
|
13
21
|
this.type = "SceneBeforeRender" /* FlowGraphEventType.SceneBeforeRender */;
|
|
14
|
-
this.timeSinceStart = this.registerDataOutput("timeSinceStart", RichTypeNumber);
|
|
15
|
-
this.deltaTime = this.registerDataOutput("deltaTime", RichTypeNumber);
|
|
22
|
+
this.timeSinceStart = this.registerDataOutput("timeSinceStart", RichTypeNumber, config?.useFirstTickAsStart ? NaN : 0);
|
|
23
|
+
this.deltaTime = this.registerDataOutput("deltaTime", RichTypeNumber, config?.useFirstTickAsStart ? NaN : 0);
|
|
16
24
|
this.eventRef = this.registerDataOutput("event", RichTypeString);
|
|
17
25
|
}
|
|
18
26
|
_updateOutputs(context) {
|
|
@@ -28,8 +36,18 @@ export class FlowGraphSceneTickEventBlock extends FlowGraphEventBlock {
|
|
|
28
36
|
* @internal
|
|
29
37
|
*/
|
|
30
38
|
_executeEvent(context, payload) {
|
|
31
|
-
this.
|
|
32
|
-
|
|
39
|
+
if (this.config?.useFirstTickAsStart) {
|
|
40
|
+
const firstTick = context._getGlobalContextVariable("firstTickPayload", payload);
|
|
41
|
+
context._setGlobalContextVariable("firstTickPayload", firstTick);
|
|
42
|
+
// The scene counter advances after dispatch; elapsed time uses the current tick's interval instead of the first one.
|
|
43
|
+
const elapsedTime = payload.timeSinceStart - firstTick.timeSinceStart + payload.deltaTime - firstTick.deltaTime;
|
|
44
|
+
this.timeSinceStart.setValue(payload === firstTick ? 0 : elapsedTime, context);
|
|
45
|
+
this.deltaTime.setValue(payload === firstTick ? NaN : payload.deltaTime, context);
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
this.timeSinceStart.setValue(payload.timeSinceStart, context);
|
|
49
|
+
this.deltaTime.setValue(payload.deltaTime, context);
|
|
50
|
+
}
|
|
33
51
|
this.eventRef.setValue(context.getEventReference(EventKey), context);
|
|
34
52
|
this._execute(context);
|
|
35
53
|
return true;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flowGraphSceneTickEventBlock.pure.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FlowGraph/Blocks/Event/flowGraphSceneTickEventBlock.pure.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAE7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAEhE,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,wCAAwC,CAAC;AA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C,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 */\r\n\r\nimport { FlowGraphEventBlock } from \"../../flowGraphEventBlock\";\r\nimport { type FlowGraphContext } from \"core/FlowGraph/flowGraphContext\";\r\nimport { RichTypeNumber, RichTypeString } from \"core/FlowGraph/flowGraphRichTypes.pure\";\r\nimport { type FlowGraphDataConnection } from \"core/FlowGraph/flowGraphDataConnection.pure\";\r\nimport { FlowGraphBlockNames } from \"../flowGraphBlockNames\";\r\nimport { FlowGraphEventType } from \"core/FlowGraph/flowGraphEventType\";\r\nimport { RegisterClass } from \"../../../Misc/typeStore\";\r\nimport { type IFlowGraphBlockConfiguration } from \"../../flowGraphBlock\";\r\n\r\n/**\r\n * Configuration for the scene tick event.\r\n */\r\nexport interface IFlowGraphSceneTickEventBlockConfiguration extends IFlowGraphBlockConfiguration {\r\n /** Whether elapsed time starts at the first tick, whose delta time remains NaN. Defaults to false. */\r\n useFirstTickAsStart?: boolean;\r\n}\r\n\r\n/** Event source key used to build this block's event reference. */\r\nconst EventKey = \"sceneTick\";\r\n\r\n/**\r\n * Payload for the scene tick event.\r\n */\r\nexport interface IFlowGraphOnTickEventPayload {\r\n /**\r\n * The scene's accumulated time in seconds before the current frame interval.\r\n */\r\n timeSinceStart: number;\r\n /**\r\n * the time in seconds since the last frame.\r\n */\r\n deltaTime: number;\r\n}\r\n\r\n/**\r\n * Block that triggers on scene tick (before each render).\r\n */\r\nexport class FlowGraphSceneTickEventBlock extends FlowGraphEventBlock {\r\n /**\r\n * Time in seconds since the scene started, or since the first tick when useFirstTickAsStart is enabled.\r\n */\r\n public readonly timeSinceStart: FlowGraphDataConnection<number>;\r\n\r\n /**\r\n * Time in seconds since the last frame. Remains NaN on the first opted-in tick.\r\n */\r\n public readonly deltaTime: FlowGraphDataConnection<number>;\r\n\r\n /**\r\n * Output: the opaque reference identifying this event source.\r\n * All instances of this block share the same reference, so comparing the `event` output of two\r\n * of them for equality succeeds. The reference format is owned by the host environment.\r\n */\r\n public readonly eventRef: FlowGraphDataConnection<string>;\r\n\r\n public override readonly type: FlowGraphEventType = FlowGraphEventType.SceneBeforeRender;\r\n /** @returns the shared scene-tick event key */\r\n public override get eventKey(): string {\r\n return EventKey;\r\n }\r\n\r\n /**\r\n * Creates a scene tick event block.\r\n * @param config optional clock behavior\r\n */\r\n constructor(config?: IFlowGraphSceneTickEventBlockConfiguration) {\r\n super(config);\r\n this.timeSinceStart = this.registerDataOutput(\"timeSinceStart\", RichTypeNumber, config?.useFirstTickAsStart ? NaN : 0);\r\n this.deltaTime = this.registerDataOutput(\"deltaTime\", RichTypeNumber, config?.useFirstTickAsStart ? NaN : 0);\r\n this.eventRef = this.registerDataOutput(\"event\", RichTypeString);\r\n }\r\n\r\n public override _updateOutputs(context: FlowGraphContext): void {\r\n this.eventRef.setValue(context.getEventReference(EventKey), context);\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public override _preparePendingTasks(_context: FlowGraphContext): void {\r\n // no-op\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public override _executeEvent(context: FlowGraphContext, payload: IFlowGraphOnTickEventPayload): boolean {\r\n if (this.config?.useFirstTickAsStart) {\r\n const firstTick = context._getGlobalContextVariable(\"firstTickPayload\", payload);\r\n context._setGlobalContextVariable(\"firstTickPayload\", firstTick);\r\n // The scene counter advances after dispatch; elapsed time uses the current tick's interval instead of the first one.\r\n const elapsedTime = payload.timeSinceStart - firstTick.timeSinceStart + payload.deltaTime - firstTick.deltaTime;\r\n this.timeSinceStart.setValue(payload === firstTick ? 0 : elapsedTime, context);\r\n this.deltaTime.setValue(payload === firstTick ? NaN : payload.deltaTime, context);\r\n } else {\r\n this.timeSinceStart.setValue(payload.timeSinceStart, context);\r\n this.deltaTime.setValue(payload.deltaTime, context);\r\n }\r\n this.eventRef.setValue(context.getEventReference(EventKey), context);\r\n this._execute(context);\r\n return true;\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public override _cancelPendingTasks(_context: FlowGraphContext) {\r\n // no-op\r\n }\r\n\r\n /**\r\n * @returns class name of the block.\r\n */\r\n public override getClassName(): string {\r\n return FlowGraphBlockNames.SceneTickEvent;\r\n }\r\n}\r\n\r\nlet _Registered = false;\r\n/**\r\n * Register side effects for flowGraphSceneTickEventBlock.\r\n * Safe to call multiple times; only the first call has an effect.\r\n */\r\nexport function RegisterFlowGraphSceneTickEventBlock(): void {\r\n if (_Registered) {\r\n return;\r\n }\r\n _Registered = true;\r\n\r\n RegisterClass(FlowGraphBlockNames.SceneTickEvent, FlowGraphSceneTickEventBlock);\r\n}\r\n"]}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { getRichTypeByFlowGraphType } from "../../flowGraphRichTypes.pure.js";
|
|
3
3
|
import { FlowGraphExecutionBlockWithOutSignal } from "../../flowGraphExecutionBlockWithOutSignal.js";
|
|
4
4
|
import { RegisterClass } from "../../../Misc/typeStore.js";
|
|
5
|
+
import { defaultValueSerializationFunction } from "../../serialization.js";
|
|
5
6
|
/**
|
|
6
7
|
* A block that sends a custom event.
|
|
7
8
|
* To receive this event you need to use the ReceiveCustomEvent block.
|
|
@@ -16,7 +17,7 @@ export class FlowGraphSendCustomEventBlock extends FlowGraphExecutionBlockWithOu
|
|
|
16
17
|
config) {
|
|
17
18
|
super(config);
|
|
18
19
|
this.config = config;
|
|
19
|
-
for (const key
|
|
20
|
+
for (const key of Object.keys(this.config.eventData ?? {})) {
|
|
20
21
|
const entry = this.config.eventData[key];
|
|
21
22
|
// Handle deserialized config where type may be a string typeName, a plain object
|
|
22
23
|
// with a typeName property (from old JSON serialization), or a proper RichType instance.
|
|
@@ -29,9 +30,14 @@ export class FlowGraphSendCustomEventBlock extends FlowGraphExecutionBlockWithOu
|
|
|
29
30
|
_execute(context) {
|
|
30
31
|
const eventId = this.config.eventId;
|
|
31
32
|
// eventData is a map with the key being the data input's name, and value being the data input's value
|
|
32
|
-
const eventData =
|
|
33
|
+
const eventData = Object.create(null);
|
|
33
34
|
for (const port of this.dataInputs) {
|
|
34
|
-
eventData
|
|
35
|
+
Object.defineProperty(eventData, port.name, {
|
|
36
|
+
configurable: true,
|
|
37
|
+
enumerable: true,
|
|
38
|
+
value: port.getValue(context),
|
|
39
|
+
writable: true,
|
|
40
|
+
});
|
|
35
41
|
}
|
|
36
42
|
context.configuration.coordinator.notifyCustomEvent(eventId, eventData);
|
|
37
43
|
this.out._activateSignal(context);
|
|
@@ -39,13 +45,19 @@ export class FlowGraphSendCustomEventBlock extends FlowGraphExecutionBlockWithOu
|
|
|
39
45
|
serialize(serializationObject = {}) {
|
|
40
46
|
super.serialize(serializationObject);
|
|
41
47
|
// Override the eventData in config to store typeName strings instead of RichType instances
|
|
42
|
-
const serializedEventData =
|
|
43
|
-
for (const key
|
|
48
|
+
const serializedEventData = Object.create(null);
|
|
49
|
+
for (const key of Object.keys(this.config.eventData ?? {})) {
|
|
44
50
|
const entry = this.config.eventData[key];
|
|
45
|
-
|
|
51
|
+
const serializedEntry = { type: entry.type.typeName };
|
|
46
52
|
if (entry.value !== undefined) {
|
|
47
|
-
|
|
53
|
+
defaultValueSerializationFunction("value", entry.value, serializedEntry);
|
|
48
54
|
}
|
|
55
|
+
Object.defineProperty(serializedEventData, key, {
|
|
56
|
+
configurable: true,
|
|
57
|
+
enumerable: true,
|
|
58
|
+
value: serializedEntry,
|
|
59
|
+
writable: true,
|
|
60
|
+
});
|
|
49
61
|
}
|
|
50
62
|
serializationObject.config.eventData = serializedEventData;
|
|
51
63
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flowGraphSendCustomEventBlock.pure.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FlowGraph/Blocks/Event/flowGraphSendCustomEventBlock.pure.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAE7D,OAAO,EAAiB,0BAA0B,EAAE,MAAM,wCAAwC,CAAC;AACnG,OAAO,EAAE,oCAAoC,EAAE,MAAM,4CAA4C,CAAC;AAIlG,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"flowGraphSendCustomEventBlock.pure.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FlowGraph/Blocks/Event/flowGraphSendCustomEventBlock.pure.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAE7D,OAAO,EAAiB,0BAA0B,EAAE,MAAM,wCAAwC,CAAC;AACnG,OAAO,EAAE,oCAAoC,EAAE,MAAM,4CAA4C,CAAC;AAIlG,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,iCAAiC,EAAE,MAAM,qBAAqB,CAAC;AAgBxE;;;;;GAKG;AACH,MAAM,OAAO,6BAA8B,SAAQ,oCAAoC;IACnF;IACI;;OAEG;IACa,MAAmD;QAEnE,KAAK,CAAC,MAAM,CAAC,CAAC;QAFE,WAAM,GAAN,MAAM,CAA6C;QAGnE,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,IAAI,EAAE,CAAC,EAAE,CAAC;YACzD,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;YACzC,iFAAiF;YACjF,yFAAyF;YACzF,MAAM,OAAO,GAAG,OAAO,KAAK,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,EAAE,QAAQ,CAAC;YACnF,MAAM,QAAQ,GAAG,OAAO,KAAK,CAAC,IAAI,EAAE,SAAS,KAAK,UAAU,CAAC,CAAC,CAAC,KAAK,CA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AE,KAAK,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC;YACzF,IAAI,KAAK,CAAC,KAAK,KAAK,SAAS,EAAE,CAAC;gBAC5B,iCAAiC,CAAC,OAAO,EAAE,KAAK,CAAC,KAAK,EAAE,eAAe,CAAC,CAAC;YAC7E,CAAC;YACD,MAAM,CAAC,cAAc,CAAC,mBAAmB,EAAE,GAAG,EAAE;gBAC5C,YAAY,EAAE,IAAI;gBAClB,UAAU,EAAE,IAAI;gBAChB,KAAK,EAAE,eAAe;gBACtB,QAAQ,EAAE,IAAI;aACjB,CAAC,CAAC;QACP,CAAC;QACD,mBAAmB,CAAC,MAAM,CAAC,SAAS,GAAG,mBAAmB,CAAC;IAC/D,CAAC;IAED;;OAEG;IACa,YAAY;QACxB,iFAA2C;IAC/C,CAAC;CACJ;AAED,IAAI,WAAW,GAAG,KAAK,CAAC;AACxB;;;GAGG;AACH,MAAM,UAAU,qCAAqC;IACjD,IAAI,WAAW,EAAE,CAAC;QACd,OAAO;IACX,CAAC;IACD,WAAW,GAAG,IAAI,CAAC;IAEnB,aAAa,4EAAsC,6BAA6B,CAAC,CAAC;AACtF,CAAC","sourcesContent":["/** This file must only contain pure code and pure imports */\r\n\r\nimport { type RichType, getRichTypeByFlowGraphType } from \"core/FlowGraph/flowGraphRichTypes.pure\";\r\nimport { FlowGraphExecutionBlockWithOutSignal } from \"../../flowGraphExecutionBlockWithOutSignal\";\r\nimport { type FlowGraphContext } from \"../../flowGraphContext\";\r\nimport { type IFlowGraphBlockConfiguration } from \"../../flowGraphBlock\";\r\nimport { FlowGraphBlockNames } from \"../flowGraphBlockNames\";\r\nimport { RegisterClass } from \"../../../Misc/typeStore\";\r\nimport { defaultValueSerializationFunction } from \"../../serialization\";\r\n\r\n/**\r\n * Parameters used to create a FlowGraphSendCustomEventBlock.\r\n */\r\nexport interface IFlowGraphSendCustomEventBlockConfiguration extends IFlowGraphBlockConfiguration {\r\n /**\r\n * The id of the event to send.\r\n * Note - in the glTF specs this is an index to the event array (i.e. - a number)\r\n */\r\n eventId: string;\r\n /**\r\n * The names of the data inputs for that event.\r\n */\r\n eventData: { [key: string]: { type: RichType<any>; value?: any } };\r\n}\r\n/**\r\n * A block that sends a custom event.\r\n * To receive this event you need to use the ReceiveCustomEvent block.\r\n * This block has no output, but does have inputs based on the eventData from the configuration.\r\n * @see FlowGraphReceiveCustomEventBlock\r\n */\r\nexport class FlowGraphSendCustomEventBlock extends FlowGraphExecutionBlockWithOutSignal {\r\n public constructor(\r\n /**\r\n * the configuration of the block\r\n */\r\n public override config: IFlowGraphSendCustomEventBlockConfiguration\r\n ) {\r\n super(config);\r\n for (const key of Object.keys(this.config.eventData ?? {})) {\r\n const entry = this.config.eventData[key];\r\n // Handle deserialized config where type may be a string typeName, a plain object\r\n // with a typeName property (from old JSON serialization), or a proper RichType instance.\r\n const typeKey = typeof entry.type === \"string\" ? entry.type : entry.type?.typeName;\r\n const richType = typeof entry.type?.serialize === \"function\" ? entry.type : getRichTypeByFlowGraphType(typeKey);\r\n entry.type = richType;\r\n this.registerDataInput(key, richType, entry.value);\r\n }\r\n }\r\n\r\n public _execute(context: FlowGraphContext): void {\r\n const eventId = this.config.eventId;\r\n // eventData is a map with the key being the data input's name, and value being the data input's value\r\n const eventData: any = Object.create(null);\r\n for (const port of this.dataInputs) {\r\n Object.defineProperty(eventData, port.name, {\r\n configurable: true,\r\n enumerable: true,\r\n value: port.getValue(context),\r\n writable: true,\r\n });\r\n }\r\n\r\n context.configuration.coordinator.notifyCustomEvent(eventId, eventData);\r\n\r\n this.out._activateSignal(context);\r\n }\r\n\r\n public override serialize(serializationObject: any = {}) {\r\n super.serialize(serializationObject);\r\n // Override the eventData in config to store typeName strings instead of RichType instances\r\n const serializedEventData: any = Object.create(null);\r\n for (const key of Object.keys(this.config.eventData ?? {})) {\r\n const entry = this.config.eventData[key];\r\n const serializedEntry: { type: string; value?: unknown } = { type: entry.type.typeName };\r\n if (entry.value !== undefined) {\r\n defaultValueSerializationFunction(\"value\", entry.value, serializedEntry);\r\n }\r\n Object.defineProperty(serializedEventData, key, {\r\n configurable: true,\r\n enumerable: true,\r\n value: serializedEntry,\r\n writable: true,\r\n });\r\n }\r\n serializationObject.config.eventData = serializedEventData;\r\n }\r\n\r\n /**\r\n * @returns class name of the block.\r\n */\r\n public override getClassName(): string {\r\n return FlowGraphBlockNames.SendCustomEvent;\r\n }\r\n}\r\n\r\nlet _Registered = false;\r\n/**\r\n * Register side effects for flowGraphSendCustomEventBlock.\r\n * Safe to call multiple times; only the first call has an effect.\r\n */\r\nexport function RegisterFlowGraphSendCustomEventBlock(): void {\r\n if (_Registered) {\r\n return;\r\n }\r\n _Registered = true;\r\n\r\n RegisterClass(FlowGraphBlockNames.SendCustomEvent, FlowGraphSendCustomEventBlock);\r\n}\r\n"]}
|
|
@@ -65,16 +65,16 @@ export class FlowGraphInterpolationBlock extends FlowGraphBlock {
|
|
|
65
65
|
const type = this.initialValue.richType;
|
|
66
66
|
const keys = [];
|
|
67
67
|
// add initial value
|
|
68
|
-
const currentValue = this.initialValue.getValue(context)
|
|
68
|
+
const currentValue = this.initialValue.getValue(context) ?? type.defaultValue;
|
|
69
69
|
keys.push({ frame: 0, value: currentValue });
|
|
70
70
|
const numberOfKeyFrames = this.config?.numberOfKeyFrames ?? 1;
|
|
71
71
|
for (let i = 1; i < numberOfKeyFrames + 1; i++) {
|
|
72
72
|
const duration = this.keyFrames[i].duration?.getValue(context);
|
|
73
73
|
let value = this.keyFrames[i].value?.getValue(context);
|
|
74
74
|
if (i === numberOfKeyFrames - 1) {
|
|
75
|
-
value = value
|
|
75
|
+
value = value ?? type.defaultValue;
|
|
76
76
|
}
|
|
77
|
-
if (duration !== undefined && value) {
|
|
77
|
+
if (duration !== undefined && value !== undefined && value !== null) {
|
|
78
78
|
// convert duration to frames, based on 60 fps
|
|
79
79
|
keys.push({ frame: duration * 60, value });
|
|
80
80
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flowGraphInterpolationBlock.pure.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FlowGraph/Blocks/Execution/Animation/flowGraphInterpolationBlock.pure.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAG7D,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAqC,MAAM,+BAA+B,CAAC;AAGlG,OAAO,EAAuB,0BAA0B,EAAE,0BAA0B,EAAE,WAAW,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,wCAAwC,CAAC;AAClL,OAAO,EAAkB,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AAE1F,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AA8BpD;;;;;;;;;GASG;AACH,MAAM,OAAO,2BAA+B,SAAQ,cAAc;IA8C9D,YAAY,SAAoD,EAAE;QAC9D,KAAK,CAAC,MAAM,CAAC,CAAC;QAVlB;;;WAGG;QACa,cAAS,GAGnB,EAAE,CAAC;QAIL,MAAM,IAAI,GACN,OAAO,MAAM,EAAE,aAAa,KAAK,QAAQ;YACrC,CAAC,CAAC,0BAA0B,CAAC,MAAM,CAAC,aAAa,CAAC;YAClD,CAAC,CAAC,0BAA0B,CAAC,MAAM,EAAE,aAAa,IAAI,SAAS,CAAC,mBAAmB,CAAC,CAAC;QAE7F,MAAM,iBAAiB,GAAG,MAAM,EAAE,cAAc,IAAI,CAAC,CAAC;QACtD,MAAM,QAAQ,GAAG,IAAI,CAAC,iBAAiB,CAAC,YAAY,EAAE,cAAc,EAAE,CAAC,CAAC,CAAC;QACzE,MAAM,KAAK,GAAG,IAAI,CAAC,iBAAiB,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;QACtD,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC,CAAC;QACzC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,iBAAiB,GAAG,CAAC,EAAE,CAAC,E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ACrB,CAAC,CAAC,CAAC;YACH,OAAO,UAAU,CAAC;QACtB,CAAC;IACL,CAAC;IAEe,YAAY;QACxB,kFAA8C;IAClD,CAAC;CACJ;AAED,UAAU;AAEV,IAAI,WAAW,GAAG,KAAK,CAAC;AACxB;;;GAGG;AACH,MAAM,UAAU,mCAAmC;IAC/C,IAAI,WAAW,EAAE,CAAC;QACd,OAAO;IACX,CAAC;IACD,WAAW,GAAG,IAAI,CAAC;IAEnB,aAAa,6EAAyC,2BAA2B,CAAC,CAAC;AACvF,CAAC","sourcesContent":["/** This file must only contain pure code and pure imports */\n\nimport { type EasingFunction } from \"core/Animations/easing\";\nimport { Constants } from \"core/Engines/constants\";\nimport { FlowGraphBlock, type IFlowGraphBlockConfiguration } from \"core/FlowGraph/flowGraphBlock\";\nimport { type FlowGraphContext } from \"core/FlowGraph/flowGraphContext\";\nimport { type FlowGraphDataConnection } from \"core/FlowGraph/flowGraphDataConnection.pure\";\nimport { type FlowGraphTypes, getRichTypeByAnimationType, getRichTypeByFlowGraphType, RichTypeAny, RichTypeNumber, RichTypeString } from \"core/FlowGraph/flowGraphRichTypes.pure\";\nimport { type Animation, AnimationCreateAnimation } from \"core/Animations/animation.pure\";\nimport { FlowGraphBlockNames } from \"../../flowGraphBlockNames\";\nimport { RegisterClass } from \"core/Misc/typeStore\";\n\n/**\n * Configuration for the interpolation block.\n */\nexport interface IFlowGraphInterpolationBlockConfiguration extends IFlowGraphBlockConfiguration {\n /**\n * The number of keyframes to interpolate between.\n * Will default to 1 if not provided (i.e. from currentValue to a provided value in the time provided)\n */\n keyFramesCount?: number;\n\n /**\n * The duration of the interpolation.\n */\n duration?: number;\n\n /**\n * The name of the property that will be interpolated.\n */\n propertyName?: string | string[];\n\n /**\n * The type of the animation to create.\n * Default is ANIMATIONTYPE_FLOAT\n * This cannot be changed after construction, so make sure to pass the right value.\n */\n animationType?: number | FlowGraphTypes;\n}\n\n/**\n * This block is responsible for interpolating between two values.\n * The babylon concept used is Animation, and it is the output of this block.\n *\n * Note that values will be parsed when the in connection is triggered. until then changing the value will not trigger a new interpolation.\n *\n * Internally this block uses the Animation class.\n *\n * Note that if the interpolation is already running a signal will be sent to stop the animation group running it.\n */\nexport class FlowGraphInterpolationBlock<T> extends FlowGraphBlock {\n /**\n * Input connection: The value to interpolate from.\n * Optional. If not provided, the current value will be used.\n * Note that if provided, every time the animation is created this value will be used!\n */\n public readonly initialValue: FlowGraphDataConnection<T>;\n\n /**\n * Input connection: The value to interpolate to.\n * Optional. This can also be set using the KeyFrames input!\n * If provided it will be set to the last keyframe value.\n */\n public readonly endValue: FlowGraphDataConnection<T>;\n\n /**\n * output connection: The animation that will be created when in is triggered.\n */\n public readonly animation: FlowGraphDataConnection<Animation | Animation[]>;\n\n /**\n * Input connection: An optional easing function to use for the interpolation.\n */\n public readonly easingFunction: FlowGraphDataConnection<EasingFunction>;\n\n /**\n * Input connection: The name of the property that will be set\n */\n public readonly propertyName: FlowGraphDataConnection<string | string[]>;\n\n /**\n * If provided, this function will be used to create the animation object(s).\n */\n public readonly customBuildAnimation: FlowGraphDataConnection<\n (target: any, propertname: any, context: FlowGraphContext) => (keys: any[], fps: number, animationType: number, easingFunction?: EasingFunction) => Animation | Animation[]\n >;\n\n /**\n * The keyframes to interpolate between.\n * Each keyframe has a duration input and a value input.\n */\n public readonly keyFrames: {\n duration: FlowGraphDataConnection<number>;\n value: FlowGraphDataConnection<T>;\n }[] = [];\n\n constructor(config: IFlowGraphInterpolationBlockConfiguration = {}) {\n super(config);\n const type =\n typeof config?.animationType === \"string\"\n ? getRichTypeByFlowGraphType(config.animationType)\n : getRichTypeByAnimationType(config?.animationType ?? Constants.ANIMATIONTYPE_FLOAT);\n\n const numberOfKeyFrames = config?.keyFramesCount ?? 1;\n const duration = this.registerDataInput(`duration_0`, RichTypeNumber, 0);\n const value = this.registerDataInput(`value_0`, type);\n this.keyFrames.push({ duration, value });\n for (let i = 1; i < numberOfKeyFrames + 1; i++) {\n const duration = this.registerDataInput(`duration_${i}`, RichTypeNumber, i === numberOfKeyFrames ? config.duration : undefined);\n const value = this.registerDataInput(`value_${i}`, type);\n this.keyFrames.push({ duration, value });\n }\n this.initialValue = this.keyFrames[0].value;\n this.endValue = this.keyFrames[numberOfKeyFrames].value;\n this.easingFunction = this.registerDataInput(\"easingFunction\", RichTypeAny);\n this.animation = this.registerDataOutput(\"animation\", RichTypeAny);\n this.propertyName = this.registerDataInput(\"propertyName\", RichTypeString, config?.propertyName);\n this.customBuildAnimation = this.registerDataInput(\"customBuildAnimation\", RichTypeAny);\n }\n\n public override _updateOutputs(context: FlowGraphContext): void {\n const interpolationAnimations = context._getGlobalContextVariable(\"interpolationAnimations\", []) as number[];\n const propertyName = this.propertyName.getValue(context);\n const easingFunction = this.easingFunction.getValue(context);\n const animation = this._createAnimation(context, propertyName, easingFunction);\n // If an old animation exists, it will be ignored here.\n // This is because if the animation is running and they both have the same target, the old will be stopped.\n // This doesn't happen here, it happens in the play animation block.\n this.animation.setValue(animation, context);\n // to make sure no 2 interpolations are running on the same target, we will mark the animation in the context\n if (Array.isArray(animation)) {\n for (const anim of animation) {\n interpolationAnimations.push(anim.uniqueId);\n }\n } else {\n interpolationAnimations.push(animation.uniqueId);\n }\n context._setGlobalContextVariable(\"interpolationAnimations\", interpolationAnimations);\n }\n\n private _createAnimation(context: FlowGraphContext, propertyName: string | string[], easingFunction: EasingFunction): Animation | Animation[] {\n const type = this.initialValue.richType;\n const keys: { frame: number; value: T }[] = [];\n // add initial value\n const currentValue = this.initialValue.getValue(context) || type.defaultValue;\n keys.push({ frame: 0, value: currentValue });\n const numberOfKeyFrames = this.config?.numberOfKeyFrames ?? 1;\n for (let i = 1; i < numberOfKeyFrames + 1; i++) {\n const duration = this.keyFrames[i].duration?.getValue(context);\n let value = this.keyFrames[i].value?.getValue(context);\n if (i === numberOfKeyFrames - 1) {\n value = value || type.defaultValue;\n }\n if (duration !== undefined && value) {\n // convert duration to frames, based on 60 fps\n keys.push({ frame: duration * 60, value });\n }\n }\n const customBuildAnimation = this.customBuildAnimation.getValue(context);\n if (customBuildAnimation) {\n return customBuildAnimation(null, null, context)(keys, 60, type.animationType, easingFunction);\n }\n if (typeof propertyName === \"string\") {\n const animation = AnimationCreateAnimation(propertyName, type.animationType, 60, easingFunction);\n animation.setKeys(keys);\n return [animation];\n } else {\n const animations = propertyName.map((name) => {\n const animation = AnimationCreateAnimation(name, type.animationType, 60, easingFunction);\n animation.setKeys(keys);\n return animation;\n });\n return animations;\n }\n }\n\n public override getClassName(): string {\n return FlowGraphBlockNames.ValueInterpolation;\n }\n}\n\n// #L54P2C\n\nlet _Registered = false;\n/**\n * Register side effects for flowGraphInterpolationBlock.\n * Safe to call multiple times; only the first call has an effect.\n */\nexport function RegisterFlowGraphInterpolationBlock(): void {\n if (_Registered) {\n return;\n }\n _Registered = true;\n\n RegisterClass(FlowGraphBlockNames.ValueInterpolation, FlowGraphInterpolationBlock);\n}\n"]}
|
|
1
|
+
{"version":3,"file":"flowGraphInterpolationBlock.pure.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FlowGraph/Blocks/Execution/Animation/flowGraphInterpolationBlock.pure.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAG7D,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAqC,MAAM,+BAA+B,CAAC;AAGlG,OAAO,EAAuB,0BAA0B,EAAE,0BAA0B,EAAE,WAAW,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,wCAAwC,CAAC;AAClL,OAAO,EAAkB,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AAE1F,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AA8BpD;;;;;;;;;GASG;AACH,MAAM,OAAO,2BAA+B,SAAQ,cAAc;IA8C9D,YAAY,SAAoD,EAAE;QAC9D,KAAK,CAAC,MAAM,CAAC,CAAC;QAVlB;;;WAGG;QACa,cAAS,GAGnB,EAAE,CAAC;QAIL,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AAoB,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE,EAAE,IAAI,CAAC,aAAa,EAAE,cAAc,CAAC,CAAC;QACnG,CAAC;QACD,IAAI,OAAO,YAAY,KAAK,QAAQ,EAAE,CAAC;YACnC,MAAM,SAAS,GAAG,wBAAwB,CAAC,YAAY,EAAE,IAAI,CAAC,aAAa,EAAE,EAAE,EAAE,cAAc,CAAC,CAAC;YACjG,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;YACxB,OAAO,CAAC,SAAS,CAAC,CAAC;QACvB,CAAC;aAAM,CAAC;YACJ,MAAM,UAAU,GAAG,YAAY,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;gBACzC,MAAM,SAAS,GAAG,wBAAwB,CAAC,IAAI,EAAE,IAAI,CAAC,aAAa,EAAE,EAAE,EAAE,cAAc,CAAC,CAAC;gBACzF,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;gBACxB,OAAO,SAAS,CAAC;YACrB,CAAC,CAAC,CAAC;YACH,OAAO,UAAU,CAAC;QACtB,CAAC;IACL,CAAC;IAEe,YAAY;QACxB,kFAA8C;IAClD,CAAC;CACJ;AAED,UAAU;AAEV,IAAI,WAAW,GAAG,KAAK,CAAC;AACxB;;;GAGG;AACH,MAAM,UAAU,mCAAmC;IAC/C,IAAI,WAAW,EAAE,CAAC;QACd,OAAO;IACX,CAAC;IACD,WAAW,GAAG,IAAI,CAAC;IAEnB,aAAa,6EAAyC,2BAA2B,CAAC,CAAC;AACvF,CAAC","sourcesContent":["/** This file must only contain pure code and pure imports */\n\nimport { type EasingFunction } from \"core/Animations/easing\";\nimport { Constants } from \"core/Engines/constants\";\nimport { FlowGraphBlock, type IFlowGraphBlockConfiguration } from \"core/FlowGraph/flowGraphBlock\";\nimport { type FlowGraphContext } from \"core/FlowGraph/flowGraphContext\";\nimport { type FlowGraphDataConnection } from \"core/FlowGraph/flowGraphDataConnection.pure\";\nimport { type FlowGraphTypes, getRichTypeByAnimationType, getRichTypeByFlowGraphType, RichTypeAny, RichTypeNumber, RichTypeString } from \"core/FlowGraph/flowGraphRichTypes.pure\";\nimport { type Animation, AnimationCreateAnimation } from \"core/Animations/animation.pure\";\nimport { FlowGraphBlockNames } from \"../../flowGraphBlockNames\";\nimport { RegisterClass } from \"core/Misc/typeStore\";\n\n/**\n * Configuration for the interpolation block.\n */\nexport interface IFlowGraphInterpolationBlockConfiguration extends IFlowGraphBlockConfiguration {\n /**\n * The number of keyframes to interpolate between.\n * Will default to 1 if not provided (i.e. from currentValue to a provided value in the time provided)\n */\n keyFramesCount?: number;\n\n /**\n * The duration of the interpolation.\n */\n duration?: number;\n\n /**\n * The name of the property that will be interpolated.\n */\n propertyName?: string | string[];\n\n /**\n * The type of the animation to create.\n * Default is ANIMATIONTYPE_FLOAT\n * This cannot be changed after construction, so make sure to pass the right value.\n */\n animationType?: number | FlowGraphTypes;\n}\n\n/**\n * This block is responsible for interpolating between two values.\n * The babylon concept used is Animation, and it is the output of this block.\n *\n * Note that values will be parsed when the in connection is triggered. until then changing the value will not trigger a new interpolation.\n *\n * Internally this block uses the Animation class.\n *\n * Note that if the interpolation is already running a signal will be sent to stop the animation group running it.\n */\nexport class FlowGraphInterpolationBlock<T> extends FlowGraphBlock {\n /**\n * Input connection: The value to interpolate from.\n * Optional. If not provided, the current value will be used.\n * Note that if provided, every time the animation is created this value will be used!\n */\n public readonly initialValue: FlowGraphDataConnection<T>;\n\n /**\n * Input connection: The value to interpolate to.\n * Optional. This can also be set using the KeyFrames input!\n * If provided it will be set to the last keyframe value.\n */\n public readonly endValue: FlowGraphDataConnection<T>;\n\n /**\n * output connection: The animation that will be created when in is triggered.\n */\n public readonly animation: FlowGraphDataConnection<Animation | Animation[]>;\n\n /**\n * Input connection: An optional easing function to use for the interpolation.\n */\n public readonly easingFunction: FlowGraphDataConnection<EasingFunction>;\n\n /**\n * Input connection: The name of the property that will be set\n */\n public readonly propertyName: FlowGraphDataConnection<string | string[]>;\n\n /**\n * If provided, this function will be used to create the animation object(s).\n */\n public readonly customBuildAnimation: FlowGraphDataConnection<\n (target: any, propertname: any, context: FlowGraphContext) => (keys: any[], fps: number, animationType: number, easingFunction?: EasingFunction) => Animation | Animation[]\n >;\n\n /**\n * The keyframes to interpolate between.\n * Each keyframe has a duration input and a value input.\n */\n public readonly keyFrames: {\n duration: FlowGraphDataConnection<number>;\n value: FlowGraphDataConnection<T>;\n }[] = [];\n\n constructor(config: IFlowGraphInterpolationBlockConfiguration = {}) {\n super(config);\n const type =\n typeof config?.animationType === \"string\"\n ? getRichTypeByFlowGraphType(config.animationType)\n : getRichTypeByAnimationType(config?.animationType ?? Constants.ANIMATIONTYPE_FLOAT);\n\n const numberOfKeyFrames = config?.keyFramesCount ?? 1;\n const duration = this.registerDataInput(`duration_0`, RichTypeNumber, 0);\n const value = this.registerDataInput(`value_0`, type);\n this.keyFrames.push({ duration, value });\n for (let i = 1; i < numberOfKeyFrames + 1; i++) {\n const duration = this.registerDataInput(`duration_${i}`, RichTypeNumber, i === numberOfKeyFrames ? config.duration : undefined);\n const value = this.registerDataInput(`value_${i}`, type);\n this.keyFrames.push({ duration, value });\n }\n this.initialValue = this.keyFrames[0].value;\n this.endValue = this.keyFrames[numberOfKeyFrames].value;\n this.easingFunction = this.registerDataInput(\"easingFunction\", RichTypeAny);\n this.animation = this.registerDataOutput(\"animation\", RichTypeAny);\n this.propertyName = this.registerDataInput(\"propertyName\", RichTypeString, config?.propertyName);\n this.customBuildAnimation = this.registerDataInput(\"customBuildAnimation\", RichTypeAny);\n }\n\n public override _updateOutputs(context: FlowGraphContext): void {\n const interpolationAnimations = context._getGlobalContextVariable(\"interpolationAnimations\", []) as number[];\n const propertyName = this.propertyName.getValue(context);\n const easingFunction = this.easingFunction.getValue(context);\n const animation = this._createAnimation(context, propertyName, easingFunction);\n // If an old animation exists, it will be ignored here.\n // This is because if the animation is running and they both have the same target, the old will be stopped.\n // This doesn't happen here, it happens in the play animation block.\n this.animation.setValue(animation, context);\n // to make sure no 2 interpolations are running on the same target, we will mark the animation in the context\n if (Array.isArray(animation)) {\n for (const anim of animation) {\n interpolationAnimations.push(anim.uniqueId);\n }\n } else {\n interpolationAnimations.push(animation.uniqueId);\n }\n context._setGlobalContextVariable(\"interpolationAnimations\", interpolationAnimations);\n }\n\n private _createAnimation(context: FlowGraphContext, propertyName: string | string[], easingFunction: EasingFunction): Animation | Animation[] {\n const type = this.initialValue.richType;\n const keys: { frame: number; value: T }[] = [];\n // add initial value\n const currentValue = this.initialValue.getValue(context) ?? type.defaultValue;\n keys.push({ frame: 0, value: currentValue });\n const numberOfKeyFrames = this.config?.numberOfKeyFrames ?? 1;\n for (let i = 1; i < numberOfKeyFrames + 1; i++) {\n const duration = this.keyFrames[i].duration?.getValue(context);\n let value = this.keyFrames[i].value?.getValue(context);\n if (i === numberOfKeyFrames - 1) {\n value = value ?? type.defaultValue;\n }\n if (duration !== undefined && value !== undefined && value !== null) {\n // convert duration to frames, based on 60 fps\n keys.push({ frame: duration * 60, value });\n }\n }\n const customBuildAnimation = this.customBuildAnimation.getValue(context);\n if (customBuildAnimation) {\n return customBuildAnimation(null, null, context)(keys, 60, type.animationType, easingFunction);\n }\n if (typeof propertyName === \"string\") {\n const animation = AnimationCreateAnimation(propertyName, type.animationType, 60, easingFunction);\n animation.setKeys(keys);\n return [animation];\n } else {\n const animations = propertyName.map((name) => {\n const animation = AnimationCreateAnimation(name, type.animationType, 60, easingFunction);\n animation.setKeys(keys);\n return animation;\n });\n return animations;\n }\n }\n\n public override getClassName(): string {\n return FlowGraphBlockNames.ValueInterpolation;\n }\n}\n\n// #L54P2C\n\nlet _Registered = false;\n/**\n * Register side effects for flowGraphInterpolationBlock.\n * Safe to call multiple times; only the first call has an effect.\n */\nexport function RegisterFlowGraphInterpolationBlock(): void {\n if (_Registered) {\n return;\n }\n _Registered = true;\n\n RegisterClass(FlowGraphBlockNames.ValueInterpolation, FlowGraphInterpolationBlock);\n}\n"]}
|
|
@@ -5,6 +5,17 @@ import { FlowGraphAsyncExecutionBlock } from "../../../flowGraphAsyncExecutionBl
|
|
|
5
5
|
import { type IFlowGraphBlockConfiguration } from "../../../flowGraphBlock.js";
|
|
6
6
|
import { AnimationGroup } from "../../../../Animations/animationGroup.pure.js";
|
|
7
7
|
import { type Animation } from "../../../../Animations/animation.pure.js";
|
|
8
|
+
import { type IAnimatable } from "../../../../Animations/animatable.interface.js";
|
|
9
|
+
export { RemoveFlowGraphAnimationGroupObservers } from "../../../flowGraphAnimationHelpers.js";
|
|
10
|
+
/**
|
|
11
|
+
* Configuration for playing an animation.
|
|
12
|
+
*/
|
|
13
|
+
export interface IFlowGraphPlayAnimationBlockConfiguration extends IFlowGraphBlockConfiguration {
|
|
14
|
+
/**
|
|
15
|
+
* Whether animation-group playback uses the unbounded KHR_interactivity timeline.
|
|
16
|
+
*/
|
|
17
|
+
useVirtualTimeline?: boolean;
|
|
18
|
+
}
|
|
8
19
|
/**
|
|
9
20
|
* @experimental
|
|
10
21
|
* A block that plays an animation on an animatable object.
|
|
@@ -13,7 +24,7 @@ export declare class FlowGraphPlayAnimationBlock extends FlowGraphAsyncExecution
|
|
|
13
24
|
/**
|
|
14
25
|
* the configuration of the block
|
|
15
26
|
*/
|
|
16
|
-
config?:
|
|
27
|
+
config?: IFlowGraphPlayAnimationBlockConfiguration | undefined;
|
|
17
28
|
/**
|
|
18
29
|
* Input connection: The speed of the animation.
|
|
19
30
|
*/
|
|
@@ -51,6 +62,11 @@ export declare class FlowGraphPlayAnimationBlock extends FlowGraphAsyncExecution
|
|
|
51
62
|
* Input: If provided this animation will be used. Priority will be given to the animation group input.
|
|
52
63
|
*/
|
|
53
64
|
readonly animation: FlowGraphDataConnection<Animation | Animation[]>;
|
|
65
|
+
/**
|
|
66
|
+
* Input connection: Optional targets matching the animation array in order.
|
|
67
|
+
* When supplied, these replace the single object target. Ignored when animationGroup is supplied.
|
|
68
|
+
*/
|
|
69
|
+
readonly animationTargets: FlowGraphDataConnection<IAnimatable[] | undefined>;
|
|
54
70
|
/**
|
|
55
71
|
* Input connection: The target object that will be animated. If animation group is provided this input will be ignored.
|
|
56
72
|
*/
|
|
@@ -59,7 +75,7 @@ export declare class FlowGraphPlayAnimationBlock extends FlowGraphAsyncExecution
|
|
|
59
75
|
/**
|
|
60
76
|
* the configuration of the block
|
|
61
77
|
*/
|
|
62
|
-
config?:
|
|
78
|
+
config?: IFlowGraphPlayAnimationBlockConfiguration | undefined);
|
|
63
79
|
/**
|
|
64
80
|
* @internal
|
|
65
81
|
* @param context
|
|
@@ -93,6 +109,8 @@ export declare class FlowGraphPlayAnimationBlock extends FlowGraphAsyncExecution
|
|
|
93
109
|
*/
|
|
94
110
|
private _checkInterpolationDuplications;
|
|
95
111
|
private _stopAnimationGroup;
|
|
112
|
+
/** @internal */
|
|
113
|
+
_cleanupAfterExternalStop(context: FlowGraphContext, animationGroup: AnimationGroup): void;
|
|
96
114
|
private _removeFromCurrentlyRunning;
|
|
97
115
|
/**
|
|
98
116
|
* @internal
|