@babylonjs/core 6.24.0 → 6.25.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Buffers/buffer.align.d.ts +25 -0
- package/Buffers/buffer.align.js +120 -0
- package/Buffers/buffer.align.js.map +1 -0
- package/Buffers/buffer.d.ts +15 -3
- package/Buffers/buffer.js +27 -7
- package/Buffers/buffer.js.map +1 -1
- package/Buffers/index.d.ts +1 -0
- package/Buffers/index.js +1 -0
- package/Buffers/index.js.map +1 -1
- package/Cameras/Inputs/BaseCameraPointersInput.js +0 -3
- package/Cameras/Inputs/BaseCameraPointersInput.js.map +1 -1
- package/Cameras/Inputs/flyCameraMouseInput.js +1 -4
- package/Cameras/Inputs/flyCameraMouseInput.js.map +1 -1
- package/Cameras/Inputs/freeCameraMouseInput.js +0 -6
- package/Cameras/Inputs/freeCameraMouseInput.js.map +1 -1
- package/Cameras/RigModes/index.d.ts +0 -1
- package/Cameras/RigModes/index.js +0 -1
- package/Cameras/RigModes/index.js.map +1 -1
- package/Cameras/RigModes/vrRigMode.js +1 -1
- package/Cameras/RigModes/vrRigMode.js.map +1 -1
- package/Cameras/VR/index.d.ts +0 -1
- package/Cameras/VR/index.js +0 -1
- package/Cameras/VR/index.js.map +1 -1
- package/Cameras/VR/vrExperienceHelper.d.ts +7 -66
- package/Cameras/VR/vrExperienceHelper.js +17 -702
- package/Cameras/VR/vrExperienceHelper.js.map +1 -1
- package/Cameras/camera.d.ts +15 -20
- package/Cameras/camera.js +41 -36
- package/Cameras/camera.js.map +1 -1
- package/Cameras/targetCamera.js +1 -1
- package/Cameras/targetCamera.js.map +1 -1
- package/Engines/Extensions/index.d.ts +0 -1
- package/Engines/Extensions/index.js +0 -1
- package/Engines/Extensions/index.js.map +1 -1
- package/Engines/WebGL/webGLRenderTargetWrapper.d.ts +4 -0
- package/Engines/WebGL/webGLRenderTargetWrapper.js +4 -0
- package/Engines/WebGL/webGLRenderTargetWrapper.js.map +1 -1
- package/Engines/WebGPU/webgpuCacheRenderPipeline.js +8 -7
- package/Engines/WebGPU/webgpuCacheRenderPipeline.js.map +1 -1
- package/Engines/WebGPU/webgpuCacheSampler.js +1 -1
- package/Engines/WebGPU/webgpuCacheSampler.js.map +1 -1
- package/Engines/constants.d.ts +0 -4
- package/Engines/constants.js +0 -4
- package/Engines/constants.js.map +1 -1
- package/Engines/engine.d.ts +38 -258
- package/Engines/engine.js +0 -65
- package/Engines/engine.js.map +1 -1
- package/Engines/engineFactory.js +9 -14
- package/Engines/engineFactory.js.map +1 -1
- package/Engines/engineFeatures.d.ts +2 -0
- package/Engines/engineFeatures.js.map +1 -1
- package/Engines/nativeEngine.js +1 -0
- package/Engines/nativeEngine.js.map +1 -1
- package/Engines/nullEngine.js +1 -0
- package/Engines/nullEngine.js.map +1 -1
- package/Engines/thinEngine.d.ts +22 -5
- package/Engines/thinEngine.js +55 -22
- package/Engines/thinEngine.js.map +1 -1
- package/Engines/webgpuEngine.d.ts +1 -0
- package/Engines/webgpuEngine.js +4 -2
- package/Engines/webgpuEngine.js.map +1 -1
- package/FlowGraph/Blocks/Data/Logic/flowGraphBitwiseBlocks.d.ts +9 -8
- package/FlowGraph/Blocks/Data/Logic/flowGraphBitwiseBlocks.js +34 -16
- package/FlowGraph/Blocks/Data/Logic/flowGraphBitwiseBlocks.js.map +1 -1
- package/FlowGraph/Blocks/Data/Logic/flowGraphLogicBlocks.d.ts +4 -3
- package/FlowGraph/Blocks/Data/Logic/flowGraphLogicBlocks.js +14 -6
- package/FlowGraph/Blocks/Data/Logic/flowGraphLogicBlocks.js.map +1 -1
- package/FlowGraph/Blocks/Data/Math/flowGraphMatrixBlocks.d.ts +19 -14
- package/FlowGraph/Blocks/Data/Math/flowGraphMatrixBlocks.js +64 -27
- package/FlowGraph/Blocks/Data/Math/flowGraphMatrixBlocks.js.map +1 -1
- package/FlowGraph/Blocks/Data/Math/flowGraphNumberMathBlocks.d.ts +39 -41
- package/FlowGraph/Blocks/Data/Math/flowGraphNumberMathBlocks.js +152 -74
- package/FlowGraph/Blocks/Data/Math/flowGraphNumberMathBlocks.js.map +1 -1
- package/FlowGraph/Blocks/Data/Math/flowGraphVector2MathBlocks.d.ts +12 -12
- package/FlowGraph/Blocks/Data/Math/flowGraphVector2MathBlocks.js +42 -21
- package/FlowGraph/Blocks/Data/Math/flowGraphVector2MathBlocks.js.map +1 -1
- package/FlowGraph/Blocks/Data/Math/flowGraphVector3MathBlocks.d.ts +17 -14
- package/FlowGraph/Blocks/Data/Math/flowGraphVector3MathBlocks.js +62 -26
- package/FlowGraph/Blocks/Data/Math/flowGraphVector3MathBlocks.js.map +1 -1
- package/FlowGraph/Blocks/Data/Math/flowGraphVector4MathBlocks.d.ts +13 -10
- package/FlowGraph/Blocks/Data/Math/flowGraphVector4MathBlocks.js +46 -18
- package/FlowGraph/Blocks/Data/Math/flowGraphVector4MathBlocks.js.map +1 -1
- package/FlowGraph/Blocks/Data/flowGraphBinaryOperationBlock.d.ts +4 -1
- package/FlowGraph/Blocks/Data/flowGraphBinaryOperationBlock.js +6 -2
- package/FlowGraph/Blocks/Data/flowGraphBinaryOperationBlock.js.map +1 -1
- package/FlowGraph/Blocks/Data/flowGraphConditionalDataBlock.d.ts +3 -1
- package/FlowGraph/Blocks/Data/flowGraphConditionalDataBlock.js +7 -2
- package/FlowGraph/Blocks/Data/flowGraphConditionalDataBlock.js.map +1 -1
- package/FlowGraph/Blocks/Data/flowGraphConstantBlock.d.ts +5 -3
- package/FlowGraph/Blocks/Data/flowGraphConstantBlock.js +10 -5
- package/FlowGraph/Blocks/Data/flowGraphConstantBlock.js.map +1 -1
- package/FlowGraph/Blocks/Data/flowGraphConstantOperationBlock.d.ts +4 -1
- package/FlowGraph/Blocks/Data/flowGraphConstantOperationBlock.js +6 -2
- package/FlowGraph/Blocks/Data/flowGraphConstantOperationBlock.js.map +1 -1
- package/FlowGraph/Blocks/Data/flowGraphCoordinateTransformBlock.d.ts +3 -1
- package/FlowGraph/Blocks/Data/flowGraphCoordinateTransformBlock.js +7 -2
- package/FlowGraph/Blocks/Data/flowGraphCoordinateTransformBlock.js.map +1 -1
- package/FlowGraph/Blocks/Data/flowGraphGetVariableBlock.d.ts +3 -1
- package/FlowGraph/Blocks/Data/flowGraphGetVariableBlock.js +7 -2
- package/FlowGraph/Blocks/Data/flowGraphGetVariableBlock.js.map +1 -1
- package/FlowGraph/Blocks/Data/flowGraphUnaryOperationBlock.d.ts +4 -1
- package/FlowGraph/Blocks/Data/flowGraphUnaryOperationBlock.js +6 -2
- package/FlowGraph/Blocks/Data/flowGraphUnaryOperationBlock.js.map +1 -1
- package/FlowGraph/Blocks/Event/flowGraphMeshPickEventBlock.d.ts +6 -2
- package/FlowGraph/Blocks/Event/flowGraphMeshPickEventBlock.js +12 -3
- package/FlowGraph/Blocks/Event/flowGraphMeshPickEventBlock.js.map +1 -1
- package/FlowGraph/Blocks/Event/flowGraphReceiveCustomEventBlock.d.ts +5 -3
- package/FlowGraph/Blocks/Event/flowGraphReceiveCustomEventBlock.js +11 -6
- package/FlowGraph/Blocks/Event/flowGraphReceiveCustomEventBlock.js.map +1 -1
- package/FlowGraph/Blocks/Event/flowGraphSceneReadyEventBlock.d.ts +1 -0
- package/FlowGraph/Blocks/Event/flowGraphSceneReadyEventBlock.js +7 -2
- package/FlowGraph/Blocks/Event/flowGraphSceneReadyEventBlock.js.map +1 -1
- package/FlowGraph/Blocks/Event/flowGraphSceneTickEventBlock.d.ts +1 -0
- package/FlowGraph/Blocks/Event/flowGraphSceneTickEventBlock.js +7 -2
- package/FlowGraph/Blocks/Event/flowGraphSceneTickEventBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/Animation/flowGraphPauseAnimationBlock.d.ts +3 -1
- package/FlowGraph/Blocks/Execution/Animation/flowGraphPauseAnimationBlock.js +7 -2
- package/FlowGraph/Blocks/Execution/Animation/flowGraphPauseAnimationBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/Animation/flowGraphPlayAnimationBlock.d.ts +3 -1
- package/FlowGraph/Blocks/Execution/Animation/flowGraphPlayAnimationBlock.js +8 -3
- package/FlowGraph/Blocks/Execution/Animation/flowGraphPlayAnimationBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/Animation/flowGraphStopAnimationBlock.d.ts +3 -1
- package/FlowGraph/Blocks/Execution/Animation/flowGraphStopAnimationBlock.js +7 -2
- package/FlowGraph/Blocks/Execution/Animation/flowGraphStopAnimationBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/Audio/flowGraphPlayAudioBlock.d.ts +3 -1
- package/FlowGraph/Blocks/Execution/Audio/flowGraphPlayAudioBlock.js +7 -2
- package/FlowGraph/Blocks/Execution/Audio/flowGraphPlayAudioBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/Audio/flowGraphStopAudioBlock.d.ts +3 -1
- package/FlowGraph/Blocks/Execution/Audio/flowGraphStopAudioBlock.js +7 -2
- package/FlowGraph/Blocks/Execution/Audio/flowGraphStopAudioBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphBranchBlock.d.ts +3 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphBranchBlock.js +7 -2
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphBranchBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphCounterBlock.d.ts +3 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphCounterBlock.js +7 -2
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphCounterBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDebounceBlock.d.ts +3 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDebounceBlock.js +7 -2
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDebounceBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDoNBlock.d.ts +3 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDoNBlock.js +7 -2
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDoNBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphFlipFlopBlock.d.ts +3 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphFlipFlopBlock.js +7 -2
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphFlipFlopBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphForLoopBlock.d.ts +3 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphForLoopBlock.js +7 -2
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphForLoopBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphMultiGateBlock.d.ts +6 -3
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphMultiGateBlock.js +22 -16
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphMultiGateBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphSwitchBlock.d.ts +7 -4
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphSwitchBlock.js +15 -10
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphSwitchBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphThrottleBlock.d.ts +3 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphThrottleBlock.js +7 -2
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphThrottleBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphTimerBlock.d.ts +3 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphTimerBlock.js +8 -3
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphTimerBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWaitAllBlock.d.ts +7 -4
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWaitAllBlock.js +14 -7
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWaitAllBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWhileLoopBlock.d.ts +5 -3
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWhileLoopBlock.js +9 -4
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWhileLoopBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/flowGraphLogBlock.d.ts +3 -1
- package/FlowGraph/Blocks/Execution/flowGraphLogBlock.js +7 -2
- package/FlowGraph/Blocks/Execution/flowGraphLogBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/flowGraphSendCustomEventBlock.d.ts +3 -1
- package/FlowGraph/Blocks/Execution/flowGraphSendCustomEventBlock.js +8 -3
- package/FlowGraph/Blocks/Execution/flowGraphSendCustomEventBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/flowGraphSetPropertyBlock.d.ts +3 -1
- package/FlowGraph/Blocks/Execution/flowGraphSetPropertyBlock.js +7 -2
- package/FlowGraph/Blocks/Execution/flowGraphSetPropertyBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/flowGraphSetVariableBlock.d.ts +3 -1
- package/FlowGraph/Blocks/Execution/flowGraphSetVariableBlock.js +7 -2
- package/FlowGraph/Blocks/Execution/flowGraphSetVariableBlock.js.map +1 -1
- package/FlowGraph/flowGraph.d.ts +41 -3
- package/FlowGraph/flowGraph.js +135 -0
- package/FlowGraph/flowGraph.js.map +1 -1
- package/FlowGraph/flowGraphAsyncExecutionBlock.d.ts +2 -1
- package/FlowGraph/flowGraphAsyncExecutionBlock.js +2 -2
- package/FlowGraph/flowGraphAsyncExecutionBlock.js.map +1 -1
- package/FlowGraph/flowGraphBlock.d.ts +15 -3
- package/FlowGraph/flowGraphBlock.js +50 -7
- package/FlowGraph/flowGraphBlock.js.map +1 -1
- package/FlowGraph/flowGraphConnection.d.ts +34 -4
- package/FlowGraph/flowGraphConnection.js +49 -3
- package/FlowGraph/flowGraphConnection.js.map +1 -1
- package/FlowGraph/flowGraphContext.d.ts +25 -5
- package/FlowGraph/flowGraphContext.js +86 -4
- package/FlowGraph/flowGraphContext.js.map +1 -1
- package/FlowGraph/flowGraphCoordinator.d.ts +7 -1
- package/FlowGraph/flowGraphCoordinator.js +18 -2
- package/FlowGraph/flowGraphCoordinator.js.map +1 -1
- package/FlowGraph/flowGraphDataConnection.d.ts +4 -11
- package/FlowGraph/flowGraphDataConnection.js +16 -14
- package/FlowGraph/flowGraphDataConnection.js.map +1 -1
- package/FlowGraph/flowGraphExecutionBlock.d.ts +8 -3
- package/FlowGraph/flowGraphExecutionBlock.js +37 -6
- package/FlowGraph/flowGraphExecutionBlock.js.map +1 -1
- package/FlowGraph/flowGraphRichTypes.d.ts +5 -9
- package/FlowGraph/flowGraphRichTypes.js +29 -44
- package/FlowGraph/flowGraphRichTypes.js.map +1 -1
- package/FlowGraph/flowGraphSignalConnection.js +2 -0
- package/FlowGraph/flowGraphSignalConnection.js.map +1 -1
- package/FlowGraph/flowGraphVariableDefinitions.d.ts +22 -2
- package/FlowGraph/flowGraphVariableDefinitions.js +29 -0
- package/FlowGraph/flowGraphVariableDefinitions.js.map +1 -1
- package/FlowGraph/flowGraphWithOnDoneExecutionBlock.d.ts +2 -1
- package/FlowGraph/flowGraphWithOnDoneExecutionBlock.js +2 -2
- package/FlowGraph/flowGraphWithOnDoneExecutionBlock.js.map +1 -1
- package/Gamepads/gamepadManager.js +0 -5
- package/Gamepads/gamepadManager.js.map +1 -1
- package/Gamepads/index.d.ts +0 -1
- package/Gamepads/index.js +0 -2
- package/Gamepads/index.js.map +1 -1
- package/Gizmos/gizmo.js +1 -4
- package/Gizmos/gizmo.js.map +1 -1
- package/Materials/GreasedLine/greasedLineMaterialDefaults.d.ts +24 -0
- package/Materials/GreasedLine/greasedLineMaterialDefaults.js +19 -0
- package/Materials/GreasedLine/greasedLineMaterialDefaults.js.map +1 -0
- package/Materials/GreasedLine/greasedLineMaterialInterfaces.d.ts +243 -0
- package/Materials/GreasedLine/greasedLineMaterialInterfaces.js +55 -0
- package/Materials/GreasedLine/greasedLineMaterialInterfaces.js.map +1 -0
- package/Materials/GreasedLine/greasedLinePluginMaterial.d.ts +253 -0
- package/Materials/{greasedLinePluginMaterial.js → GreasedLine/greasedLinePluginMaterial.js} +148 -205
- package/Materials/GreasedLine/greasedLinePluginMaterial.js.map +1 -0
- package/Materials/{greasedLineSimpleMaterial.d.ts → GreasedLine/greasedLineSimpleMaterial.d.ts} +20 -48
- package/Materials/{greasedLineSimpleMaterial.js → GreasedLine/greasedLineSimpleMaterial.js} +74 -91
- package/Materials/GreasedLine/greasedLineSimpleMaterial.js.map +1 -0
- package/Materials/Node/Blocks/Input/prePassTextureBlock.d.ts +1 -1
- package/Materials/Node/Blocks/Input/prePassTextureBlock.js.map +1 -1
- package/Materials/Textures/texture.js +1 -0
- package/Materials/Textures/texture.js.map +1 -1
- package/Materials/index.d.ts +4 -1
- package/Materials/index.js +4 -1
- package/Materials/index.js.map +1 -1
- package/Maths/math.vector.d.ts +32 -22
- package/Maths/math.vector.js +54 -43
- package/Maths/math.vector.js.map +1 -1
- package/Meshes/Builders/greasedLineBuilder.d.ts +7 -6
- package/Meshes/Builders/greasedLineBuilder.js +65 -31
- package/Meshes/Builders/greasedLineBuilder.js.map +1 -1
- package/Meshes/GreasedLine/greasedLineBaseMesh.d.ts +216 -0
- package/Meshes/GreasedLine/greasedLineBaseMesh.js +247 -0
- package/Meshes/GreasedLine/greasedLineBaseMesh.js.map +1 -0
- package/Meshes/GreasedLine/greasedLineMesh.d.ts +92 -0
- package/Meshes/{greasedLineMesh.js → GreasedLine/greasedLineMesh.js} +29 -223
- package/Meshes/GreasedLine/greasedLineMesh.js.map +1 -0
- package/Meshes/GreasedLine/greasedLineRibbonMesh.d.ts +107 -0
- package/Meshes/GreasedLine/greasedLineRibbonMesh.js +462 -0
- package/Meshes/GreasedLine/greasedLineRibbonMesh.js.map +1 -0
- package/Meshes/Node/Blocks/Sources/meshBlock.d.ts +9 -2
- package/Meshes/Node/Blocks/Sources/meshBlock.js +17 -5
- package/Meshes/Node/Blocks/Sources/meshBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Textures/geometryTextureBlock.d.ts +15 -0
- package/Meshes/Node/Blocks/Textures/geometryTextureBlock.js +50 -1
- package/Meshes/Node/Blocks/Textures/geometryTextureBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Textures/geometryTextureFetchBlock.js +5 -5
- package/Meshes/Node/Blocks/Textures/geometryTextureFetchBlock.js.map +1 -1
- package/Meshes/Node/nodeGeometry.d.ts +1 -2
- package/Meshes/Node/nodeGeometry.js +3 -4
- package/Meshes/Node/nodeGeometry.js.map +1 -1
- package/Meshes/Node/nodeGeometryBlock.d.ts +1 -2
- package/Meshes/Node/nodeGeometryBlock.js +1 -2
- package/Meshes/Node/nodeGeometryBlock.js.map +1 -1
- package/Meshes/geometry.js +6 -12
- package/Meshes/geometry.js.map +1 -1
- package/Meshes/index.d.ts +3 -1
- package/Meshes/index.js +3 -1
- package/Meshes/index.js.map +1 -1
- package/Meshes/mesh.d.ts +4 -0
- package/Meshes/mesh.js +7 -0
- package/Meshes/mesh.js.map +1 -1
- package/Misc/deepCopier.js +3 -0
- package/Misc/deepCopier.js.map +1 -1
- package/Misc/greasedLineTools.d.ts +52 -5
- package/Misc/greasedLineTools.js +180 -10
- package/Misc/greasedLineTools.js.map +1 -1
- package/PostProcesses/RenderPipeline/Pipelines/defaultRenderingPipeline.js +9 -2
- package/PostProcesses/RenderPipeline/Pipelines/defaultRenderingPipeline.js.map +1 -1
- package/PostProcesses/motionBlurPostProcess.js +4 -1
- package/PostProcesses/motionBlurPostProcess.js.map +1 -1
- package/PostProcesses/postProcess.js +1 -6
- package/PostProcesses/postProcess.js.map +1 -1
- package/Rendering/geometryBufferRenderer.js +4 -0
- package/Rendering/geometryBufferRenderer.js.map +1 -1
- package/Shaders/greasedLine.fragment.js +2 -5
- package/Shaders/greasedLine.fragment.js.map +1 -1
- package/Shaders/greasedLine.vertex.js +15 -4
- package/Shaders/greasedLine.vertex.js.map +1 -1
- package/XR/webXRDefaultExperience.d.ts +1 -1
- package/XR/webXRDefaultExperience.js +1 -1
- package/XR/webXRDefaultExperience.js.map +1 -1
- package/package.json +1 -1
- package/scene.d.ts +17 -10
- package/scene.js +25 -30
- package/scene.js.map +1 -1
- package/Cameras/RigModes/webVRRigMode.d.ts +0 -5
- package/Cameras/RigModes/webVRRigMode.js +0 -34
- package/Cameras/RigModes/webVRRigMode.js.map +0 -1
- package/Cameras/VR/webVRCamera.d.ts +0 -316
- package/Cameras/VR/webVRCamera.js +0 -618
- package/Cameras/VR/webVRCamera.js.map +0 -1
- package/Engines/Extensions/engine.webVR.d.ts +0 -91
- package/Engines/Extensions/engine.webVR.js +0 -195
- package/Engines/Extensions/engine.webVR.js.map +0 -1
- package/FlowGraph/Blocks/Execution/flowGraphCustomFunctionBlock.d.ts +0 -23
- package/FlowGraph/Blocks/Execution/flowGraphCustomFunctionBlock.js +0 -18
- package/FlowGraph/Blocks/Execution/flowGraphCustomFunctionBlock.js.map +0 -1
- package/Gamepads/Controllers/daydreamController.d.ts +0 -38
- package/Gamepads/Controllers/daydreamController.js +0 -70
- package/Gamepads/Controllers/daydreamController.js.map +0 -1
- package/Gamepads/Controllers/gearVRController.d.ts +0 -39
- package/Gamepads/Controllers/gearVRController.js +0 -79
- package/Gamepads/Controllers/gearVRController.js.map +0 -1
- package/Gamepads/Controllers/genericController.d.ts +0 -34
- package/Gamepads/Controllers/genericController.js +0 -48
- package/Gamepads/Controllers/genericController.js.map +0 -1
- package/Gamepads/Controllers/index.d.ts +0 -8
- package/Gamepads/Controllers/index.js +0 -9
- package/Gamepads/Controllers/index.js.map +0 -1
- package/Gamepads/Controllers/oculusTouchController.d.ts +0 -78
- package/Gamepads/Controllers/oculusTouchController.js +0 -196
- package/Gamepads/Controllers/oculusTouchController.js.map +0 -1
- package/Gamepads/Controllers/poseEnabledController.d.ts +0 -219
- package/Gamepads/Controllers/poseEnabledController.js +0 -293
- package/Gamepads/Controllers/poseEnabledController.js.map +0 -1
- package/Gamepads/Controllers/viveController.d.ts +0 -52
- package/Gamepads/Controllers/viveController.js +0 -115
- package/Gamepads/Controllers/viveController.js.map +0 -1
- package/Gamepads/Controllers/webVRController.d.ts +0 -85
- package/Gamepads/Controllers/webVRController.js +0 -122
- package/Gamepads/Controllers/webVRController.js.map +0 -1
- package/Gamepads/Controllers/windowsMotionController.d.ts +0 -212
- package/Gamepads/Controllers/windowsMotionController.js +0 -519
- package/Gamepads/Controllers/windowsMotionController.js.map +0 -1
- package/Materials/greasedLinePluginMaterial.d.ts +0 -496
- package/Materials/greasedLinePluginMaterial.js.map +0 -1
- package/Materials/greasedLineSimpleMaterial.js.map +0 -1
- package/Meshes/greasedLineMesh.d.ts +0 -204
- package/Meshes/greasedLineMesh.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flowGraphForLoopBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FlowGraph/Blocks/Execution/ControlFlow/flowGraphForLoopBlock.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iCAAiC,EAAE,sDAAyD;AAErG,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"flowGraphForLoopBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FlowGraph/Blocks/Execution/ControlFlow/flowGraphForLoopBlock.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iCAAiC,EAAE,sDAAyD;AAErG,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAE3D;;;GAGG;AACH,MAAM,OAAO,qBAAsB,SAAQ,iCAAiC;IA0BxE,YAAmB,MAAqC;QACpD,KAAK,CAAC,MAAM,CAAC,CAAC;QAEd,IAAI,CAAC,UAAU,GAAG,I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GAAG,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QAChD,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QACjD,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QACzC,OAAO,CAAC,qBAAqB,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;QACpD,OAAO,CAAC,qBAAqB,CAAC,IAAI,EAAE,UAAU,EAAE,QAAQ,CAAC,CAAC;QAC1D,OAAO,CAAC,qBAAqB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;QAClD,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;IAC/B,CAAC;IAEM,YAAY;QACf,OAAO,gBAAgB,CAAC;IAC5B,CAAC;CACJ;AACD,aAAa,CAAC,gBAAgB,EAAE,qBAAqB,CAAC,CAAC","sourcesContent":["import type { FlowGraphSignalConnection } from \"../../../flowGraphSignalConnection\";\r\nimport type { FlowGraphDataConnection } from \"../../../flowGraphDataConnection\";\r\nimport { FlowGraphWithOnDoneExecutionBlock } from \"core/FlowGraph/flowGraphWithOnDoneExecutionBlock\";\r\nimport type { FlowGraphContext } from \"../../../flowGraphContext\";\r\nimport { RichTypeNumber } from \"../../../flowGraphRichTypes\";\r\nimport { RegisterClass } from \"../../../../Misc/typeStore\";\r\nimport type { IFlowGraphBlockConfiguration } from \"../../../flowGraphBlock\";\r\n/**\r\n * @experimental\r\n * Block that executes an action in a loop.\r\n */\r\nexport class FlowGraphForLoopBlock extends FlowGraphWithOnDoneExecutionBlock {\r\n /**\r\n * Input connection: The start index of the loop.\r\n */\r\n public readonly startIndex: FlowGraphDataConnection<number>;\r\n /**\r\n * Input connection: The end index of the loop.\r\n */\r\n public readonly endIndex: FlowGraphDataConnection<number>;\r\n /**\r\n * Input connection: The step of the loop.\r\n */\r\n public readonly step: FlowGraphDataConnection<number>;\r\n /**\r\n * Output connection: The current index of the loop.\r\n */\r\n public readonly index: FlowGraphDataConnection<number>;\r\n /**\r\n * Output connection: The signal that is activated when the loop body is executed.\r\n */\r\n public readonly onLoop: FlowGraphSignalConnection;\r\n /**\r\n * Output connection: The signal that is activated when the loop is done.\r\n */\r\n public readonly onDone: FlowGraphSignalConnection;\r\n\r\n public constructor(config?: IFlowGraphBlockConfiguration) {\r\n super(config);\r\n\r\n this.startIndex = this._registerDataInput(\"startIndex\", RichTypeNumber);\r\n this.endIndex = this._registerDataInput(\"endIndex\", RichTypeNumber);\r\n this.step = this._registerDataInput(\"step\", RichTypeNumber);\r\n\r\n this.index = this._registerDataOutput(\"index\", RichTypeNumber);\r\n this.onLoop = this._registerSignalOutput(\"onLoop\");\r\n this.onDone = this._registerSignalOutput(\"onDone\");\r\n }\r\n\r\n private _executeLoop(context: FlowGraphContext) {\r\n let index = context._getExecutionVariable(this, \"index\");\r\n const endIndex = context._getExecutionVariable(this, \"endIndex\");\r\n if (index < endIndex) {\r\n this.index.setValue(index, context);\r\n this.onLoop._activateSignal(context);\r\n const step = context._getExecutionVariable(this, \"step\", 1);\r\n index += step;\r\n context._setExecutionVariable(this, \"index\", index);\r\n this._executeLoop(context);\r\n } else {\r\n this.onDone._activateSignal(context);\r\n }\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _execute(context: FlowGraphContext): void {\r\n const index = this.startIndex.getValue(context);\r\n const endIndex = this.endIndex.getValue(context);\r\n const step = this.step.getValue(context);\r\n context._setExecutionVariable(this, \"index\", index);\r\n context._setExecutionVariable(this, \"endIndex\", endIndex);\r\n context._setExecutionVariable(this, \"step\", step);\r\n this._executeLoop(context);\r\n }\r\n\r\n public getClassName(): string {\r\n return \"FGForLoopBlock\";\r\n }\r\n}\r\nRegisterClass(\"FGForLoopBlock\", FlowGraphForLoopBlock);\r\n"]}
|
|
@@ -2,11 +2,12 @@ import type { FlowGraphContext } from "../../../flowGraphContext";
|
|
|
2
2
|
import type { FlowGraphDataConnection } from "../../../flowGraphDataConnection";
|
|
3
3
|
import { FlowGraphExecutionBlock } from "../../../flowGraphExecutionBlock";
|
|
4
4
|
import type { FlowGraphSignalConnection } from "../../../flowGraphSignalConnection";
|
|
5
|
+
import type { IFlowGraphBlockConfiguration } from "../../../flowGraphBlock";
|
|
5
6
|
/**
|
|
6
7
|
* @experimental
|
|
7
8
|
* Configuration for the multi gate block.
|
|
8
9
|
*/
|
|
9
|
-
export interface IFlowGraphMultiGateBlockConfiguration {
|
|
10
|
+
export interface IFlowGraphMultiGateBlockConfiguration extends IFlowGraphBlockConfiguration {
|
|
10
11
|
/**
|
|
11
12
|
* The number of output flows.
|
|
12
13
|
*/
|
|
@@ -30,7 +31,7 @@ export interface IFlowGraphMultiGateBlockConfiguration {
|
|
|
30
31
|
* @see https://docs.google.com/document/d/1MT7gL-IEn_PUw-4XGBazMxsyqsxqgAVGYcNeC4Cj_9Q/edit#heading=h.i2sn85fbjo60
|
|
31
32
|
*/
|
|
32
33
|
export declare class FlowGraphMultiGateBlock extends FlowGraphExecutionBlock {
|
|
33
|
-
|
|
34
|
+
config: IFlowGraphMultiGateBlockConfiguration;
|
|
34
35
|
/**
|
|
35
36
|
* Input connection: Resets the gate.
|
|
36
37
|
*/
|
|
@@ -38,14 +39,16 @@ export declare class FlowGraphMultiGateBlock extends FlowGraphExecutionBlock {
|
|
|
38
39
|
/**
|
|
39
40
|
* Output connections: The output flows.
|
|
40
41
|
*/
|
|
41
|
-
|
|
42
|
+
outFlows: FlowGraphSignalConnection[];
|
|
42
43
|
/**
|
|
43
44
|
* Output connection: The index of the current output flow.
|
|
44
45
|
*/
|
|
45
46
|
readonly currentIndex: FlowGraphDataConnection<number>;
|
|
46
47
|
private _cachedUnusedIndexes;
|
|
47
48
|
constructor(config: IFlowGraphMultiGateBlockConfiguration);
|
|
49
|
+
configure(): void;
|
|
48
50
|
private _getUnusedIndexes;
|
|
49
51
|
private _getNextOutput;
|
|
50
52
|
_execute(context: FlowGraphContext, callingSignal: FlowGraphSignalConnection): void;
|
|
53
|
+
getClassName(): string;
|
|
51
54
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { RegisterClass } from "../../../../Misc/typeStore.js";
|
|
1
2
|
import { FlowGraphExecutionBlock } from "../../../flowGraphExecutionBlock.js";
|
|
2
3
|
import { RichTypeNumber } from "../../../flowGraphRichTypes.js";
|
|
3
4
|
/**
|
|
@@ -7,25 +8,26 @@ import { RichTypeNumber } from "../../../flowGraphRichTypes.js";
|
|
|
7
8
|
*/
|
|
8
9
|
export class FlowGraphMultiGateBlock extends FlowGraphExecutionBlock {
|
|
9
10
|
constructor(config) {
|
|
10
|
-
super();
|
|
11
|
-
|
|
12
|
-
* Output connections: The output flows.
|
|
13
|
-
*/
|
|
14
|
-
this.outFlows = [];
|
|
11
|
+
super(config);
|
|
12
|
+
this.config = config;
|
|
15
13
|
this._cachedUnusedIndexes = [];
|
|
16
|
-
this._config = Object.assign({ isRandom: false, loop: false, startIndex: 0 }, config);
|
|
17
|
-
this._config.startIndex = Math.max(0, Math.min(this._config.startIndex, this._config.numberOutputFlows - 1));
|
|
18
|
-
for (let i = 0; i < this._config.numberOutputFlows; i++) {
|
|
19
|
-
this.outFlows.push(this._registerSignalOutput(`out${i}`));
|
|
20
|
-
}
|
|
21
14
|
this.reset = this._registerSignalInput("reset");
|
|
22
15
|
this.currentIndex = this._registerDataOutput("currentIndex", RichTypeNumber);
|
|
23
16
|
}
|
|
17
|
+
configure() {
|
|
18
|
+
super.configure();
|
|
19
|
+
this.config.startIndex = this.config.startIndex !== undefined ? this.config.startIndex : 0;
|
|
20
|
+
this.config.startIndex = Math.max(0, Math.min(this.config.startIndex, this.config.numberOutputFlows - 1));
|
|
21
|
+
this.outFlows = [];
|
|
22
|
+
for (let i = 0; i < this.config.numberOutputFlows; i++) {
|
|
23
|
+
this.outFlows.push(this._registerSignalOutput(`out${i}`));
|
|
24
|
+
}
|
|
25
|
+
}
|
|
24
26
|
_getUnusedIndexes(context) {
|
|
25
27
|
const result = this._cachedUnusedIndexes;
|
|
26
28
|
result.length = 0;
|
|
27
29
|
if (!context._hasExecutionVariable(this, "unusedIndexes")) {
|
|
28
|
-
for (let i = 0; i < this.
|
|
30
|
+
for (let i = 0; i < this.config.numberOutputFlows; i++) {
|
|
29
31
|
result.push(i);
|
|
30
32
|
}
|
|
31
33
|
}
|
|
@@ -38,7 +40,7 @@ export class FlowGraphMultiGateBlock extends FlowGraphExecutionBlock {
|
|
|
38
40
|
return result;
|
|
39
41
|
}
|
|
40
42
|
_getNextOutput(currentIndex, unusedIndexes) {
|
|
41
|
-
if (this.
|
|
43
|
+
if (this.config.isRandom) {
|
|
42
44
|
const nextIndex = Math.floor(Math.random() * unusedIndexes.length);
|
|
43
45
|
return unusedIndexes[nextIndex];
|
|
44
46
|
}
|
|
@@ -48,7 +50,7 @@ export class FlowGraphMultiGateBlock extends FlowGraphExecutionBlock {
|
|
|
48
50
|
}
|
|
49
51
|
_execute(context, callingSignal) {
|
|
50
52
|
var _a;
|
|
51
|
-
const currentIndex = (_a = context._getExecutionVariable(this, "currentIndex")) !== null && _a !== void 0 ? _a : this.
|
|
53
|
+
const currentIndex = (_a = context._getExecutionVariable(this, "currentIndex")) !== null && _a !== void 0 ? _a : this.config.startIndex - 1;
|
|
52
54
|
let unusedIndexes = this._getUnusedIndexes(context);
|
|
53
55
|
if (callingSignal === this.reset) {
|
|
54
56
|
context._deleteExecutionVariable(this, "currentIndex");
|
|
@@ -56,15 +58,15 @@ export class FlowGraphMultiGateBlock extends FlowGraphExecutionBlock {
|
|
|
56
58
|
return;
|
|
57
59
|
}
|
|
58
60
|
let nextIndex = this._getNextOutput(currentIndex, unusedIndexes);
|
|
59
|
-
if (nextIndex >= this.
|
|
61
|
+
if (nextIndex >= this.config.numberOutputFlows && this.config.loop) {
|
|
60
62
|
nextIndex = 0;
|
|
61
63
|
}
|
|
62
|
-
else if (nextIndex >= this.
|
|
64
|
+
else if (nextIndex >= this.config.numberOutputFlows && !this.config.loop) {
|
|
63
65
|
return;
|
|
64
66
|
}
|
|
65
67
|
unusedIndexes = unusedIndexes.filter((i) => i !== nextIndex);
|
|
66
68
|
if (unusedIndexes.length === 0) {
|
|
67
|
-
for (let i = 0; i < this.
|
|
69
|
+
for (let i = 0; i < this.config.numberOutputFlows; i++) {
|
|
68
70
|
unusedIndexes.push(i);
|
|
69
71
|
}
|
|
70
72
|
}
|
|
@@ -73,5 +75,9 @@ export class FlowGraphMultiGateBlock extends FlowGraphExecutionBlock {
|
|
|
73
75
|
this.currentIndex.setValue(nextIndex, context);
|
|
74
76
|
this.outFlows[nextIndex]._activateSignal(context);
|
|
75
77
|
}
|
|
78
|
+
getClassName() {
|
|
79
|
+
return "FGMultiGateBlock";
|
|
80
|
+
}
|
|
76
81
|
}
|
|
82
|
+
RegisterClass("FGMultiGateBlock", FlowGraphMultiGateBlock);
|
|
77
83
|
//# sourceMappingURL=flowGraphMultiGateBlock.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flowGraphMultiGateBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FlowGraph/Blocks/Execution/ControlFlow/flowGraphMultiGateBlock.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"flowGraphMultiGateBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FlowGraph/Blocks/Execution/ControlFlow/flowGraphMultiGateBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAG3D,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAC3E,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAyB7D;;;;GAIG;AACH,MAAM,OAAO,uBAAwB,SAAQ,uBAAuB;IAehE,YAAmB,MAA6C;QAC5D,KAAK,CAAC,MAAM,CAAC,CAAC;QADC,WAAM,GAAN,MAAM,CAAuC;QAFxD,y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AAC,IAAI,EAAE;YAChE,SAAS,GAAG,CAAC,CAAC;SACjB;aAAM,IAAI,SAAS,IAAI,IAAI,CAAC,MAAM,CAAC,iBAAiB,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE;YACxE,OAAO;SACV;QAED,aAAa,GAAG,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,SAAS,CAAC,CAAC;QAC7D,IAAI,aAAa,CAAC,MAAM,KAAK,CAAC,EAAE;YAC5B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,iBAAiB,EAAE,CAAC,EAAE,EAAE;gBACpD,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;aACzB;SACJ;QACD,OAAO,CAAC,qBAAqB,CAAC,IAAI,EAAE,eAAe,EAAE,aAAa,CAAC,CAAC;QACpE,OAAO,CAAC,qBAAqB,CAAC,IAAI,EAAE,cAAc,EAAE,SAAS,CAAC,CAAC;QAC/D,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;QAC/C,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;IACtD,CAAC;IAEM,YAAY;QACf,OAAO,kBAAkB,CAAC;IAC9B,CAAC;CACJ;AACD,aAAa,CAAC,kBAAkB,EAAE,uBAAuB,CAAC,CAAC","sourcesContent":["import { RegisterClass } from \"../../../../Misc/typeStore\";\r\nimport type { FlowGraphContext } from \"../../../flowGraphContext\";\r\nimport type { FlowGraphDataConnection } from \"../../../flowGraphDataConnection\";\r\nimport { FlowGraphExecutionBlock } from \"../../../flowGraphExecutionBlock\";\r\nimport { RichTypeNumber } from \"../../../flowGraphRichTypes\";\r\nimport type { FlowGraphSignalConnection } from \"../../../flowGraphSignalConnection\";\r\nimport type { IFlowGraphBlockConfiguration } from \"../../../flowGraphBlock\";\r\n/**\r\n * @experimental\r\n * Configuration for the multi gate block.\r\n */\r\nexport interface IFlowGraphMultiGateBlockConfiguration extends IFlowGraphBlockConfiguration {\r\n /**\r\n * The number of output flows.\r\n */\r\n numberOutputFlows: number;\r\n /**\r\n * If the block should pick a random output flow from the ones that haven't been executed. Default to false.\r\n */\r\n isRandom?: boolean;\r\n /**\r\n * If the block should loop back to the first output flow after executing the last one. Default to false.\r\n */\r\n loop?: boolean;\r\n /**\r\n * The index of the output flow to start with. Default to 0.\r\n */\r\n startIndex?: number;\r\n}\r\n/**\r\n * @experimental\r\n * A block that has an input flow and routes it to any potential output flows, randomly or sequentially\r\n * @see https://docs.google.com/document/d/1MT7gL-IEn_PUw-4XGBazMxsyqsxqgAVGYcNeC4Cj_9Q/edit#heading=h.i2sn85fbjo60\r\n */\r\nexport class FlowGraphMultiGateBlock extends FlowGraphExecutionBlock {\r\n /**\r\n * Input connection: Resets the gate.\r\n */\r\n public readonly reset: FlowGraphSignalConnection;\r\n /**\r\n * Output connections: The output flows.\r\n */\r\n public outFlows: FlowGraphSignalConnection[];\r\n /**\r\n * Output connection: The index of the current output flow.\r\n */\r\n public readonly currentIndex: FlowGraphDataConnection<number>;\r\n private _cachedUnusedIndexes: number[] = [];\r\n\r\n constructor(public config: IFlowGraphMultiGateBlockConfiguration) {\r\n super(config);\r\n this.reset = this._registerSignalInput(\"reset\");\r\n this.currentIndex = this._registerDataOutput(\"currentIndex\", RichTypeNumber);\r\n }\r\n\r\n public configure() {\r\n super.configure();\r\n this.config.startIndex = this.config.startIndex !== undefined ? this.config.startIndex : 0;\r\n this.config.startIndex = Math.max(0, Math.min(this.config.startIndex!, this.config.numberOutputFlows - 1));\r\n this.outFlows = [];\r\n for (let i = 0; i < this.config.numberOutputFlows; i++) {\r\n this.outFlows.push(this._registerSignalOutput(`out${i}`));\r\n }\r\n }\r\n\r\n private _getUnusedIndexes(context: FlowGraphContext): number[] {\r\n const result = this._cachedUnusedIndexes;\r\n result.length = 0;\r\n if (!context._hasExecutionVariable(this, \"unusedIndexes\")) {\r\n for (let i = 0; i < this.config.numberOutputFlows; i++) {\r\n result.push(i);\r\n }\r\n } else {\r\n const contextUnusedIndexes = context._getExecutionVariable(this, \"unusedIndexes\");\r\n for (let i = 0; i < contextUnusedIndexes.length; i++) {\r\n result.push(contextUnusedIndexes[i]);\r\n }\r\n }\r\n return result;\r\n }\r\n\r\n private _getNextOutput(currentIndex: number, unusedIndexes: number[]): number {\r\n if (this.config.isRandom) {\r\n const nextIndex = Math.floor(Math.random() * unusedIndexes.length);\r\n return unusedIndexes[nextIndex];\r\n } else {\r\n return currentIndex + 1;\r\n }\r\n }\r\n\r\n public _execute(context: FlowGraphContext, callingSignal: FlowGraphSignalConnection): void {\r\n const currentIndex = context._getExecutionVariable(this, \"currentIndex\") ?? this.config.startIndex! - 1;\r\n let unusedIndexes = this._getUnusedIndexes(context);\r\n\r\n if (callingSignal === this.reset) {\r\n context._deleteExecutionVariable(this, \"currentIndex\");\r\n context._deleteExecutionVariable(this, \"unusedIndexes\");\r\n return;\r\n }\r\n\r\n let nextIndex = this._getNextOutput(currentIndex, unusedIndexes);\r\n if (nextIndex >= this.config.numberOutputFlows && this.config.loop) {\r\n nextIndex = 0;\r\n } else if (nextIndex >= this.config.numberOutputFlows && !this.config.loop) {\r\n return;\r\n }\r\n\r\n unusedIndexes = unusedIndexes.filter((i) => i !== nextIndex);\r\n if (unusedIndexes.length === 0) {\r\n for (let i = 0; i < this.config.numberOutputFlows; i++) {\r\n unusedIndexes.push(i);\r\n }\r\n }\r\n context._setExecutionVariable(this, \"unusedIndexes\", unusedIndexes);\r\n context._setExecutionVariable(this, \"currentIndex\", nextIndex);\r\n this.currentIndex.setValue(nextIndex, context);\r\n this.outFlows[nextIndex]._activateSignal(context);\r\n }\r\n\r\n public getClassName(): string {\r\n return \"FGMultiGateBlock\";\r\n }\r\n}\r\nRegisterClass(\"FGMultiGateBlock\", FlowGraphMultiGateBlock);\r\n"]}
|
|
@@ -2,11 +2,12 @@ import type { FlowGraphContext } from "../../../flowGraphContext";
|
|
|
2
2
|
import type { FlowGraphDataConnection } from "../../../flowGraphDataConnection";
|
|
3
3
|
import { FlowGraphExecutionBlock } from "../../../flowGraphExecutionBlock";
|
|
4
4
|
import type { FlowGraphSignalConnection } from "../../../flowGraphSignalConnection";
|
|
5
|
+
import type { IFlowGraphBlockConfiguration } from "../../../flowGraphBlock";
|
|
5
6
|
/**
|
|
6
7
|
* @experimental
|
|
7
8
|
* Configuration for a switch block.
|
|
8
9
|
*/
|
|
9
|
-
export interface IFlowGraphSwitchBlockConfiguration<T> {
|
|
10
|
+
export interface IFlowGraphSwitchBlockConfiguration<T> extends IFlowGraphBlockConfiguration {
|
|
10
11
|
/**
|
|
11
12
|
* The possible values for the selection.
|
|
12
13
|
*/
|
|
@@ -17,7 +18,7 @@ export interface IFlowGraphSwitchBlockConfiguration<T> {
|
|
|
17
18
|
* A block that executes a branch based on a selection.
|
|
18
19
|
*/
|
|
19
20
|
export declare class FlowGraphSwitchBlock<T> extends FlowGraphExecutionBlock {
|
|
20
|
-
|
|
21
|
+
config: IFlowGraphSwitchBlockConfiguration<T>;
|
|
21
22
|
/**
|
|
22
23
|
* Input connection: The value of the selection.
|
|
23
24
|
*/
|
|
@@ -25,7 +26,9 @@ export declare class FlowGraphSwitchBlock<T> extends FlowGraphExecutionBlock {
|
|
|
25
26
|
/**
|
|
26
27
|
* Output connection: The output flows.
|
|
27
28
|
*/
|
|
28
|
-
|
|
29
|
-
constructor(
|
|
29
|
+
outputFlows: FlowGraphSignalConnection[];
|
|
30
|
+
constructor(config: IFlowGraphSwitchBlockConfiguration<T>);
|
|
31
|
+
configure(): void;
|
|
30
32
|
_execute(context: FlowGraphContext, _callingSignal: FlowGraphSignalConnection): void;
|
|
33
|
+
getClassName(): string;
|
|
31
34
|
}
|
|
@@ -1,26 +1,27 @@
|
|
|
1
1
|
import { FlowGraphExecutionBlock } from "../../../flowGraphExecutionBlock.js";
|
|
2
2
|
import { RichTypeAny } from "../../../flowGraphRichTypes.js";
|
|
3
|
+
import { RegisterClass } from "../../../../Misc/typeStore.js";
|
|
3
4
|
/**
|
|
4
5
|
* @experimental
|
|
5
6
|
* A block that executes a branch based on a selection.
|
|
6
7
|
*/
|
|
7
8
|
export class FlowGraphSwitchBlock extends FlowGraphExecutionBlock {
|
|
8
|
-
constructor(
|
|
9
|
-
super();
|
|
10
|
-
this.
|
|
11
|
-
/**
|
|
12
|
-
* Output connection: The output flows.
|
|
13
|
-
*/
|
|
14
|
-
this.outputFlows = [];
|
|
9
|
+
constructor(config) {
|
|
10
|
+
super(config);
|
|
11
|
+
this.config = config;
|
|
15
12
|
this.selection = this._registerDataInput("selection", RichTypeAny);
|
|
16
|
-
|
|
13
|
+
}
|
|
14
|
+
configure() {
|
|
15
|
+
super.configure();
|
|
16
|
+
this.outputFlows = [];
|
|
17
|
+
for (let i = 0; i <= this.config.cases.length; i++) {
|
|
17
18
|
this.outputFlows.push(this._registerSignalOutput(`out${i}`));
|
|
18
19
|
}
|
|
19
20
|
}
|
|
20
21
|
_execute(context, _callingSignal) {
|
|
21
22
|
const selectionValue = this.selection.getValue(context);
|
|
22
|
-
for (let i = 0; i < this.
|
|
23
|
-
if (selectionValue === this.
|
|
23
|
+
for (let i = 0; i < this.config.cases.length; i++) {
|
|
24
|
+
if (selectionValue === this.config.cases[i]) {
|
|
24
25
|
this.outputFlows[i]._activateSignal(context);
|
|
25
26
|
return;
|
|
26
27
|
}
|
|
@@ -28,5 +29,9 @@ export class FlowGraphSwitchBlock extends FlowGraphExecutionBlock {
|
|
|
28
29
|
// default case
|
|
29
30
|
this.outputFlows[this.outputFlows.length - 1]._activateSignal(context);
|
|
30
31
|
}
|
|
32
|
+
getClassName() {
|
|
33
|
+
return "FGSwitchBlock";
|
|
34
|
+
}
|
|
31
35
|
}
|
|
36
|
+
RegisterClass("FGSwitchBlock", FlowGraphSwitchBlock);
|
|
32
37
|
//# sourceMappingURL=flowGraphSwitchBlock.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flowGraphSwitchBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FlowGraph/Blocks/Execution/ControlFlow/flowGraphSwitchBlock.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAC3E,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"flowGraphSwitchBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FlowGraph/Blocks/Execution/ControlFlow/flowGraphSwitchBlock.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAC3E,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAG1D,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAY3D;;;GAGG;AACH,MAAM,OAAO,oBAAwB,SAAQ,uBAAuB;IAUhE,YAAmB,MAA6C;QAC5D,KAAK,CAAC,MAAM,CAAC,CAAC;QADC,WAAM,GAAN,MAAM,CAAuC;QAG5D,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,kBAAkB,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;IACvE,CAAC;IAEM,SAAS;QACZ,KAAK,CAAC,SAAS,EAAE,CAAC;QAClB,IAAI,CAAC,WAAW,GAAG,EAAE,CAAC;QACtB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YAChD,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,qBAAqB,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC;SAChE;IACL,CAAC;IAEM,QAAQ,CAAC,OAAyB,EAAE,cAAyC;QAChF,MAAM,cAAc,GAAG,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QAExD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YAC/C,IAAI,cAAc,KAAK,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE;gBACzC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;gBAC7C,OAAO;aACV;SACJ;QAED,eAAe;QACf,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;IAC3E,CAAC;IAEM,YAAY;QACf,OAAO,eAAe,CAAC;IAC3B,CAAC;CACJ;AACD,aAAa,CAAC,eAAe,EAAE,oBAAoB,CAAC,CAAC","sourcesContent":["import type { FlowGraphContext } from \"../../../flowGraphContext\";\r\nimport type { FlowGraphDataConnection } from \"../../../flowGraphDataConnection\";\r\nimport { FlowGraphExecutionBlock } from \"../../../flowGraphExecutionBlock\";\r\nimport { RichTypeAny } from \"../../../flowGraphRichTypes\";\r\nimport type { FlowGraphSignalConnection } from \"../../../flowGraphSignalConnection\";\r\nimport type { IFlowGraphBlockConfiguration } from \"../../../flowGraphBlock\";\r\nimport { RegisterClass } from \"../../../../Misc/typeStore\";\r\n/**\r\n * @experimental\r\n * Configuration for a switch block.\r\n */\r\nexport interface IFlowGraphSwitchBlockConfiguration<T> extends IFlowGraphBlockConfiguration {\r\n /**\r\n * The possible values for the selection.\r\n */\r\n cases: T[];\r\n}\r\n\r\n/**\r\n * @experimental\r\n * A block that executes a branch based on a selection.\r\n */\r\nexport class FlowGraphSwitchBlock<T> extends FlowGraphExecutionBlock {\r\n /**\r\n * Input connection: The value of the selection.\r\n */\r\n public readonly selection: FlowGraphDataConnection<T>;\r\n /**\r\n * Output connection: The output flows.\r\n */\r\n public outputFlows: FlowGraphSignalConnection[];\r\n\r\n constructor(public config: IFlowGraphSwitchBlockConfiguration<T>) {\r\n super(config);\r\n\r\n this.selection = this._registerDataInput(\"selection\", RichTypeAny);\r\n }\r\n\r\n public configure(): void {\r\n super.configure();\r\n this.outputFlows = [];\r\n for (let i = 0; i <= this.config.cases.length; i++) {\r\n this.outputFlows.push(this._registerSignalOutput(`out${i}`));\r\n }\r\n }\r\n\r\n public _execute(context: FlowGraphContext, _callingSignal: FlowGraphSignalConnection): void {\r\n const selectionValue = this.selection.getValue(context);\r\n\r\n for (let i = 0; i < this.config.cases.length; i++) {\r\n if (selectionValue === this.config.cases[i]) {\r\n this.outputFlows[i]._activateSignal(context);\r\n return;\r\n }\r\n }\r\n\r\n // default case\r\n this.outputFlows[this.outputFlows.length - 1]._activateSignal(context);\r\n }\r\n\r\n public getClassName(): string {\r\n return \"FGSwitchBlock\";\r\n }\r\n}\r\nRegisterClass(\"FGSwitchBlock\", FlowGraphSwitchBlock);\r\n"]}
|
|
@@ -2,6 +2,7 @@ import type { FlowGraphContext } from "../../../flowGraphContext";
|
|
|
2
2
|
import type { FlowGraphDataConnection } from "../../../flowGraphDataConnection";
|
|
3
3
|
import type { FlowGraphSignalConnection } from "../../../flowGraphSignalConnection";
|
|
4
4
|
import { FlowGraphWithOnDoneExecutionBlock } from "../../../flowGraphWithOnDoneExecutionBlock";
|
|
5
|
+
import type { IFlowGraphBlockConfiguration } from "../../../flowGraphBlock";
|
|
5
6
|
/**
|
|
6
7
|
* @experimental
|
|
7
8
|
* A block that throttles the execution of its output flow.
|
|
@@ -19,6 +20,7 @@ export declare class FlowGraphThrottleBlock extends FlowGraphWithOnDoneExecution
|
|
|
19
20
|
* Output connection: The time remaining before the throttle is done, in ms.
|
|
20
21
|
*/
|
|
21
22
|
readonly timeRemaining: FlowGraphDataConnection<number>;
|
|
22
|
-
constructor();
|
|
23
|
+
constructor(config?: IFlowGraphBlockConfiguration);
|
|
23
24
|
_execute(context: FlowGraphContext, callingSignal: FlowGraphSignalConnection): void;
|
|
25
|
+
getClassName(): string;
|
|
24
26
|
}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { RichTypeNumber } from "../../../flowGraphRichTypes.js";
|
|
2
2
|
import { FlowGraphWithOnDoneExecutionBlock } from "../../../flowGraphWithOnDoneExecutionBlock.js";
|
|
3
|
+
import { RegisterClass } from "../../../../Misc/typeStore.js";
|
|
3
4
|
/**
|
|
4
5
|
* @experimental
|
|
5
6
|
* A block that throttles the execution of its output flow.
|
|
6
7
|
*/
|
|
7
8
|
export class FlowGraphThrottleBlock extends FlowGraphWithOnDoneExecutionBlock {
|
|
8
|
-
constructor() {
|
|
9
|
-
super();
|
|
9
|
+
constructor(config) {
|
|
10
|
+
super(config);
|
|
10
11
|
this.reset = this._registerSignalInput("reset");
|
|
11
12
|
this.duration = this._registerDataInput("duration", RichTypeNumber);
|
|
12
13
|
this.timeRemaining = this._registerDataOutput("timeRemaining", RichTypeNumber);
|
|
@@ -27,5 +28,9 @@ export class FlowGraphThrottleBlock extends FlowGraphWithOnDoneExecutionBlock {
|
|
|
27
28
|
this.timeRemaining.setValue(remaining, context);
|
|
28
29
|
}
|
|
29
30
|
}
|
|
31
|
+
getClassName() {
|
|
32
|
+
return "FGThrottleBlock";
|
|
33
|
+
}
|
|
30
34
|
}
|
|
35
|
+
RegisterClass("FGThrottleBlock", FlowGraphThrottleBlock);
|
|
31
36
|
//# sourceMappingURL=flowGraphThrottleBlock.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flowGraphThrottleBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FlowGraph/Blocks/Execution/ControlFlow/flowGraphThrottleBlock.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAE7D,OAAO,EAAE,iCAAiC,EAAE,MAAM,4CAA4C,CAAC;AAE/F;;;GAGG;AACH,MAAM,OAAO,sBAAuB,SAAQ,iCAAiC;IAczE;
|
|
1
|
+
{"version":3,"file":"flowGraphThrottleBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FlowGraph/Blocks/Execution/ControlFlow/flowGraphThrottleBlock.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAE7D,OAAO,EAAE,iCAAiC,EAAE,MAAM,4CAA4C,CAAC;AAE/F,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D;;;GAGG;AACH,MAAM,OAAO,sBAAuB,SAAQ,iCAAiC;IAczE,YAAY,MAAqC;QAC7C,KAAK,CAAC,MAAM,CAAC,CAAC;QACd,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAC;QAChD,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,kBAAkB,CAAC,UAAU,EAAE,cAAc,CAAC,CAAC;QACpE,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,mBAAmB,CAAC,eAAe,EAAE,cAAc,CAAC,CAAC;IACnF,CAAC;IACM,QAAQ,CAAC,OAAyB,EAAE,aAAwC;QAC/E,MAAM,gBAAgB,GAAG,OAAO,CAAC,qBAAqB,CAAC,IAAI,EAAE,kBAAkB,CAAC,CAAC;QACjF,MAAM,aAAa,GAAG,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QACtD,MAAM,WAAW,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;QAC/B,IAAI,aAAa,KAAK,IAAI,CAAC,KAAK,IAAI,gBAAgB,KAAK,SAAS,IAAI,WAAW,GAAG,gBAAgB,GAAG,aAAa,EAAE;YAClH,0BAA0B;YAC1B,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;YACxC,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;YACrC,OAAO,CAAC,qBAAqB,CAAC,IAAI,EAAE,kBAAkB,EAAE,WAAW,CAAC,CAAC;SACxE;aAAM;YACH,mDAAmD;YACnD,MAAM,SAAS,GAAG,aAAa,GAAG,CAAC,WAAW,GAAG,gBAAgB,CAAC,CAAC;YACnE,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;SACnD;IACL,CAAC;IACM,YAAY;QACf,OAAO,iBAAiB,CAAC;IAC7B,CAAC;CACJ;AACD,aAAa,CAAC,iBAAiB,EAAE,sBAAsB,CAAC,CAAC","sourcesContent":["import type { FlowGraphContext } from \"../../../flowGraphContext\";\r\nimport type { FlowGraphDataConnection } from \"../../../flowGraphDataConnection\";\r\nimport { RichTypeNumber } from \"../../../flowGraphRichTypes\";\r\nimport type { FlowGraphSignalConnection } from \"../../../flowGraphSignalConnection\";\r\nimport { FlowGraphWithOnDoneExecutionBlock } from \"../../../flowGraphWithOnDoneExecutionBlock\";\r\nimport type { IFlowGraphBlockConfiguration } from \"../../../flowGraphBlock\";\r\nimport { RegisterClass } from \"../../../../Misc/typeStore\";\r\n/**\r\n * @experimental\r\n * A block that throttles the execution of its output flow.\r\n */\r\nexport class FlowGraphThrottleBlock extends FlowGraphWithOnDoneExecutionBlock {\r\n /**\r\n * Input connection: The duration of the throttle, in ms.\r\n */\r\n public readonly duration: FlowGraphDataConnection<number>;\r\n /**\r\n * Input connection: Resets the throttle.\r\n */\r\n public readonly reset: FlowGraphSignalConnection;\r\n /**\r\n * Output connection: The time remaining before the throttle is done, in ms.\r\n */\r\n public readonly timeRemaining: FlowGraphDataConnection<number>;\r\n\r\n constructor(config?: IFlowGraphBlockConfiguration) {\r\n super(config);\r\n this.reset = this._registerSignalInput(\"reset\");\r\n this.duration = this._registerDataInput(\"duration\", RichTypeNumber);\r\n this.timeRemaining = this._registerDataOutput(\"timeRemaining\", RichTypeNumber);\r\n }\r\n public _execute(context: FlowGraphContext, callingSignal: FlowGraphSignalConnection): void {\r\n const lastExecutedTime = context._getExecutionVariable(this, \"lastExecutedTime\");\r\n const durationValue = this.duration.getValue(context);\r\n const currentTime = Date.now();\r\n if (callingSignal === this.reset || lastExecutedTime === undefined || currentTime - lastExecutedTime > durationValue) {\r\n //activate the output flow\r\n this.timeRemaining.setValue(0, context);\r\n this.onDone._activateSignal(context);\r\n context._setExecutionVariable(this, \"lastExecutedTime\", currentTime);\r\n } else {\r\n //activate the output flow after the remaining time\r\n const remaining = durationValue - (currentTime - lastExecutedTime);\r\n this.timeRemaining.setValue(remaining, context);\r\n }\r\n }\r\n public getClassName(): string {\r\n return \"FGThrottleBlock\";\r\n }\r\n}\r\nRegisterClass(\"FGThrottleBlock\", FlowGraphThrottleBlock);\r\n"]}
|
|
@@ -2,6 +2,7 @@ import type { FlowGraphDataConnection } from "../../../flowGraphDataConnection";
|
|
|
2
2
|
import type { FlowGraphSignalConnection } from "../../../flowGraphSignalConnection";
|
|
3
3
|
import type { FlowGraphContext } from "../../../flowGraphContext";
|
|
4
4
|
import { FlowGraphAsyncExecutionBlock } from "../../../flowGraphAsyncExecutionBlock";
|
|
5
|
+
import type { IFlowGraphBlockConfiguration } from "../../../flowGraphBlock";
|
|
5
6
|
/**
|
|
6
7
|
* @experimental
|
|
7
8
|
* Block that provides two different output flows. One is started immediately once the block is executed,
|
|
@@ -17,7 +18,7 @@ export declare class FlowGraphTimerBlock extends FlowGraphAsyncExecutionBlock {
|
|
|
17
18
|
* This signal is activated asynchronically.
|
|
18
19
|
*/
|
|
19
20
|
readonly onTimerDone: FlowGraphSignalConnection;
|
|
20
|
-
constructor();
|
|
21
|
+
constructor(config?: IFlowGraphBlockConfiguration);
|
|
21
22
|
_preparePendingTasks(context: FlowGraphContext): void;
|
|
22
23
|
/**
|
|
23
24
|
* @internal
|
|
@@ -25,4 +26,5 @@ export declare class FlowGraphTimerBlock extends FlowGraphAsyncExecutionBlock {
|
|
|
25
26
|
_execute(context: FlowGraphContext): void;
|
|
26
27
|
private _onEnded;
|
|
27
28
|
_cancelPendingTasks(context: FlowGraphContext): void;
|
|
29
|
+
getClassName(): string;
|
|
28
30
|
}
|
|
@@ -2,14 +2,15 @@ import { AdvancedTimer } from "../../../../Misc/timer.js";
|
|
|
2
2
|
import { FlowGraphAsyncExecutionBlock } from "../../../flowGraphAsyncExecutionBlock.js";
|
|
3
3
|
import { RichTypeNumber } from "../../../flowGraphRichTypes.js";
|
|
4
4
|
import { Tools } from "../../../../Misc/tools.js";
|
|
5
|
+
import { RegisterClass } from "../../../../Misc/typeStore.js";
|
|
5
6
|
/**
|
|
6
7
|
* @experimental
|
|
7
8
|
* Block that provides two different output flows. One is started immediately once the block is executed,
|
|
8
9
|
* and the other is executed after a set time. The timer for this block runs based on the scene's render loop.
|
|
9
10
|
*/
|
|
10
11
|
export class FlowGraphTimerBlock extends FlowGraphAsyncExecutionBlock {
|
|
11
|
-
constructor() {
|
|
12
|
-
super();
|
|
12
|
+
constructor(config) {
|
|
13
|
+
super(config);
|
|
13
14
|
this.timeout = this._registerDataInput("timeout", RichTypeNumber);
|
|
14
15
|
this.onTimerDone = this._registerSignalOutput("onTimerDone");
|
|
15
16
|
}
|
|
@@ -17,7 +18,7 @@ export class FlowGraphTimerBlock extends FlowGraphAsyncExecutionBlock {
|
|
|
17
18
|
const currentTimeout = this.timeout.getValue(context);
|
|
18
19
|
if (currentTimeout !== undefined && currentTimeout >= 0) {
|
|
19
20
|
const timers = context._getExecutionVariable(this, "runningTimers") || [];
|
|
20
|
-
const scene = context.
|
|
21
|
+
const scene = context.configuration.scene;
|
|
21
22
|
const timer = new AdvancedTimer({
|
|
22
23
|
timeout: currentTimeout,
|
|
23
24
|
contextObservable: scene.onBeforeRenderObservable,
|
|
@@ -54,5 +55,9 @@ export class FlowGraphTimerBlock extends FlowGraphAsyncExecutionBlock {
|
|
|
54
55
|
}
|
|
55
56
|
context._deleteExecutionVariable(this, "runningTimers");
|
|
56
57
|
}
|
|
58
|
+
getClassName() {
|
|
59
|
+
return "FGTimerBlock";
|
|
60
|
+
}
|
|
57
61
|
}
|
|
62
|
+
RegisterClass("FGTimerBlock", FlowGraphTimerBlock);
|
|
58
63
|
//# sourceMappingURL=flowGraphTimerBlock.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flowGraphTimerBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FlowGraph/Blocks/Execution/ControlFlow/flowGraphTimerBlock.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAEvD,OAAO,EAAE,4BAA4B,EAAE,MAAM,uCAAuC,CAAC;AACrF,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAE/C;;;;GAIG;AACH,MAAM,OAAO,mBAAoB,SAAQ,4BAA4B;IAWjE;
|
|
1
|
+
{"version":3,"file":"flowGraphTimerBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FlowGraph/Blocks/Execution/ControlFlow/flowGraphTimerBlock.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAEvD,OAAO,EAAE,4BAA4B,EAAE,MAAM,uCAAuC,CAAC;AACrF,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAE/C,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D;;;;GAIG;AACH,MAAM,OAAO,mBAAoB,SAAQ,4BAA4B;IAWjE,YAAY,MAAqC;QAC7C,KAAK,CAAC,MAAM,CAAC,CAAC;QAEd,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,kBAAkB,CAAC,SAAS,EAAE,cAAc,CAAC,CAAC;QAClE,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,qBAAqB,CAAC,aAAa,CAAC,CAAC;IACjE,CAAC;IAEM,oBAAo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/F;QACD,OAAO,CAAC,mBAAmB,CAAC,IAAI,CAAC,CAAC;QAClC,IAAI,CAAC,WAAW,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;IAC9C,CAAC;IAEM,mBAAmB,CAAC,OAAyB;QAChD,MAAM,MAAM,GAAG,OAAO,CAAC,qBAAqB,CAAC,IAAI,EAAE,eAAe,CAAC,IAAI,EAAE,CAAC;QAC1E,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE;YACxB,KAAK,CAAC,OAAO,EAAE,CAAC;SACnB;QACD,OAAO,CAAC,wBAAwB,CAAC,IAAI,EAAE,eAAe,CAAC,CAAC;IAC5D,CAAC;IAEM,YAAY;QACf,OAAO,cAAc,CAAC;IAC1B,CAAC;CACJ;AACD,aAAa,CAAC,cAAc,EAAE,mBAAmB,CAAC,CAAC","sourcesContent":["import type { FlowGraphDataConnection } from \"../../../flowGraphDataConnection\";\r\nimport type { FlowGraphSignalConnection } from \"../../../flowGraphSignalConnection\";\r\nimport { AdvancedTimer } from \"../../../../Misc/timer\";\r\nimport type { FlowGraphContext } from \"../../../flowGraphContext\";\r\nimport { FlowGraphAsyncExecutionBlock } from \"../../../flowGraphAsyncExecutionBlock\";\r\nimport { RichTypeNumber } from \"../../../flowGraphRichTypes\";\r\nimport { Tools } from \"../../../../Misc/tools\";\r\nimport type { IFlowGraphBlockConfiguration } from \"../../../flowGraphBlock\";\r\nimport { RegisterClass } from \"../../../../Misc/typeStore\";\r\n/**\r\n * @experimental\r\n * Block that provides two different output flows. One is started immediately once the block is executed,\r\n * and the other is executed after a set time. The timer for this block runs based on the scene's render loop.\r\n */\r\nexport class FlowGraphTimerBlock extends FlowGraphAsyncExecutionBlock {\r\n /**\r\n * Input connection: The timeout of the timer.\r\n */\r\n public readonly timeout: FlowGraphDataConnection<number>;\r\n /**\r\n * Output connection: The signal that is activated when the timer is done.\r\n * This signal is activated asynchronically.\r\n */\r\n public readonly onTimerDone: FlowGraphSignalConnection;\r\n\r\n constructor(config?: IFlowGraphBlockConfiguration) {\r\n super(config);\r\n\r\n this.timeout = this._registerDataInput(\"timeout\", RichTypeNumber);\r\n this.onTimerDone = this._registerSignalOutput(\"onTimerDone\");\r\n }\r\n\r\n public _preparePendingTasks(context: FlowGraphContext): void {\r\n const currentTimeout = this.timeout.getValue(context);\r\n\r\n if (currentTimeout !== undefined && currentTimeout >= 0) {\r\n const timers = context._getExecutionVariable(this, \"runningTimers\") || [];\r\n const scene = context.configuration.scene;\r\n const timer: AdvancedTimer = new AdvancedTimer({\r\n timeout: currentTimeout,\r\n contextObservable: scene.onBeforeRenderObservable,\r\n onEnded: () => this._onEnded(timer, context),\r\n });\r\n timer.start();\r\n\r\n timers.push(timer);\r\n context._setExecutionVariable(this, \"runningTimers\", timers);\r\n }\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _execute(context: FlowGraphContext) {\r\n this._startPendingTasks(context);\r\n this.onDone._activateSignal(context);\r\n }\r\n\r\n private _onEnded(timer: AdvancedTimer, context: FlowGraphContext) {\r\n const timers = context._getExecutionVariable(this, \"runningTimers\") || [];\r\n const index = timers.indexOf(timer);\r\n if (index !== -1) {\r\n timers.splice(index, 1);\r\n } else {\r\n Tools.Warn(\"FlowGraphTimerBlock: Timer ended but was not found in the running timers list\");\r\n }\r\n context._removePendingBlock(this);\r\n this.onTimerDone._activateSignal(context);\r\n }\r\n\r\n public _cancelPendingTasks(context: FlowGraphContext): void {\r\n const timers = context._getExecutionVariable(this, \"runningTimers\") || [];\r\n for (const timer of timers) {\r\n timer.dispose();\r\n }\r\n context._deleteExecutionVariable(this, \"runningTimers\");\r\n }\r\n\r\n public getClassName(): string {\r\n return \"FGTimerBlock\";\r\n }\r\n}\r\nRegisterClass(\"FGTimerBlock\", FlowGraphTimerBlock);\r\n"]}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import type { FlowGraphContext } from "../../../flowGraphContext";
|
|
2
2
|
import type { FlowGraphSignalConnection } from "../../../flowGraphSignalConnection";
|
|
3
3
|
import { FlowGraphWithOnDoneExecutionBlock } from "../../../flowGraphWithOnDoneExecutionBlock";
|
|
4
|
+
import type { IFlowGraphBlockConfiguration } from "../../../flowGraphBlock";
|
|
4
5
|
/**
|
|
5
6
|
* @experimental
|
|
6
7
|
* Configuration for the wait all block.
|
|
7
8
|
*/
|
|
8
|
-
export interface IFlowGraphWaitAllBlockConfiguration {
|
|
9
|
+
export interface IFlowGraphWaitAllBlockConfiguration extends IFlowGraphBlockConfiguration {
|
|
9
10
|
/**
|
|
10
|
-
* The number of input flows.
|
|
11
|
+
* The number of input flows. There will always be at least one input flow.
|
|
11
12
|
*/
|
|
12
13
|
numberInputFlows: number;
|
|
13
14
|
}
|
|
@@ -16,7 +17,7 @@ export interface IFlowGraphWaitAllBlockConfiguration {
|
|
|
16
17
|
* A block that waits for all input flows to be activated before activating its output flow.
|
|
17
18
|
*/
|
|
18
19
|
export declare class FlowGraphWaitAllBlock extends FlowGraphWithOnDoneExecutionBlock {
|
|
19
|
-
|
|
20
|
+
config: IFlowGraphWaitAllBlockConfiguration;
|
|
20
21
|
/**
|
|
21
22
|
* Input connection: Resets the block.
|
|
22
23
|
*/
|
|
@@ -26,7 +27,9 @@ export declare class FlowGraphWaitAllBlock extends FlowGraphWithOnDoneExecutionB
|
|
|
26
27
|
*/
|
|
27
28
|
readonly inFlows: FlowGraphSignalConnection[];
|
|
28
29
|
private _cachedActivationState;
|
|
29
|
-
constructor(
|
|
30
|
+
constructor(config: IFlowGraphWaitAllBlockConfiguration);
|
|
31
|
+
configure(): void;
|
|
30
32
|
private _getCurrentActivationState;
|
|
31
33
|
_execute(context: FlowGraphContext, callingSignal: FlowGraphSignalConnection): void;
|
|
34
|
+
getClassName(): string;
|
|
32
35
|
}
|
|
@@ -1,20 +1,23 @@
|
|
|
1
1
|
import { FlowGraphWithOnDoneExecutionBlock } from "../../../flowGraphWithOnDoneExecutionBlock.js";
|
|
2
|
+
import { RegisterClass } from "../../../../Misc/typeStore.js";
|
|
2
3
|
/**
|
|
3
4
|
* @experimental
|
|
4
5
|
* A block that waits for all input flows to be activated before activating its output flow.
|
|
5
6
|
*/
|
|
6
7
|
export class FlowGraphWaitAllBlock extends FlowGraphWithOnDoneExecutionBlock {
|
|
7
|
-
constructor(
|
|
8
|
-
super();
|
|
9
|
-
this.
|
|
8
|
+
constructor(config) {
|
|
9
|
+
super(config);
|
|
10
|
+
this.config = config;
|
|
10
11
|
/**
|
|
11
12
|
* Input connection: The 2nd to nth input flows (the first is named onStart)
|
|
12
13
|
*/
|
|
13
14
|
this.inFlows = [];
|
|
14
15
|
this._cachedActivationState = [];
|
|
15
16
|
this.reset = this._registerSignalInput("reset");
|
|
17
|
+
}
|
|
18
|
+
configure() {
|
|
16
19
|
// The first inFlow is the default input signal all execution blocks have
|
|
17
|
-
for (let i = 1; i < this.
|
|
20
|
+
for (let i = 1; i < this.config.numberInputFlows; i++) {
|
|
18
21
|
this.inFlows.push(this._registerSignalInput(`in${i}`));
|
|
19
22
|
}
|
|
20
23
|
}
|
|
@@ -22,7 +25,7 @@ export class FlowGraphWaitAllBlock extends FlowGraphWithOnDoneExecutionBlock {
|
|
|
22
25
|
const activationState = this._cachedActivationState;
|
|
23
26
|
activationState.length = 0;
|
|
24
27
|
if (!context._hasExecutionVariable(this, "activationState")) {
|
|
25
|
-
for (let i = 0; i < this.
|
|
28
|
+
for (let i = 0; i < this.config.numberInputFlows; i++) {
|
|
26
29
|
activationState.push(false);
|
|
27
30
|
}
|
|
28
31
|
}
|
|
@@ -37,7 +40,7 @@ export class FlowGraphWaitAllBlock extends FlowGraphWithOnDoneExecutionBlock {
|
|
|
37
40
|
_execute(context, callingSignal) {
|
|
38
41
|
const activationState = this._getCurrentActivationState(context);
|
|
39
42
|
if (callingSignal === this.reset) {
|
|
40
|
-
for (let i = 0; i < this.
|
|
43
|
+
for (let i = 0; i < this.config.numberInputFlows; i++) {
|
|
41
44
|
activationState[i] = false;
|
|
42
45
|
}
|
|
43
46
|
}
|
|
@@ -53,10 +56,14 @@ export class FlowGraphWaitAllBlock extends FlowGraphWithOnDoneExecutionBlock {
|
|
|
53
56
|
context._setExecutionVariable(this, "activationState", activationState.slice());
|
|
54
57
|
if (activationState.every((value) => value)) {
|
|
55
58
|
this.onDone._activateSignal(context);
|
|
56
|
-
for (let i = 0; i < this.
|
|
59
|
+
for (let i = 0; i < this.config.numberInputFlows; i++) {
|
|
57
60
|
activationState[i] = false;
|
|
58
61
|
}
|
|
59
62
|
}
|
|
60
63
|
}
|
|
64
|
+
getClassName() {
|
|
65
|
+
return "FGWaitAllBlock";
|
|
66
|
+
}
|
|
61
67
|
}
|
|
68
|
+
RegisterClass("FGWaitAllBlock", FlowGraphWaitAllBlock);
|
|
62
69
|
//# sourceMappingURL=flowGraphWaitAllBlock.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flowGraphWaitAllBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWaitAllBlock.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iCAAiC,EAAE,MAAM,4CAA4C,CAAC;
|
|
1
|
+
{"version":3,"file":"flowGraphWaitAllBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWaitAllBlock.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iCAAiC,EAAE,MAAM,4CAA4C,CAAC;AAE/F,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAY3D;;;GAGG;AACH,MAAM,OAAO,qBAAsB,SAAQ,iCAAiC;IAWxE,YAAmB,MAA2C;QAC1D,KAAK,CAAC,MAAM,CAAC,CAAC;QADC,WAAM,GAAN,MAAM,CAAqC;QAN9D;;WAEG;QACa,YAAO,GAAgC,EAAE,CAAC;QAClD,2BAAsB,GAAc,EAAE,CAAC;QAK3C,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,oBAAoB,CAAC,OAAO,CAAC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eAAe,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC;aAC9B;SACJ;aAAM,IAAI,aAAa,KAAK,IAAI,CAAC,OAAO,EAAE;YACvC,eAAe,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;SAC7B;aAAM;YACH,MAAM,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;YAClD,IAAI,KAAK,IAAI,CAAC,EAAE;gBACZ,eAAe,CAAC,KAAK,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC;aACrC;SACJ;QAED,OAAO,CAAC,qBAAqB,CAAC,IAAI,EAAE,iBAAiB,EAAE,eAAe,CAAC,KAAK,EAAE,CAAC,CAAC;QAEhF,IAAI,eAAe,CAAC,KAAK,CAAC,CAAC,KAAc,EAAE,EAAE,CAAC,KAAK,CAAC,EAAE;YAClD,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;YACrC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,gBAAgB,EAAE,CAAC,EAAE,EAAE;gBACnD,eAAe,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC;aAC9B;SACJ;IACL,CAAC;IAEM,YAAY;QACf,OAAO,gBAAgB,CAAC;IAC5B,CAAC;CACJ;AACD,aAAa,CAAC,gBAAgB,EAAE,qBAAqB,CAAC,CAAC","sourcesContent":["import type { FlowGraphContext } from \"../../../flowGraphContext\";\r\nimport type { FlowGraphSignalConnection } from \"../../../flowGraphSignalConnection\";\r\nimport { FlowGraphWithOnDoneExecutionBlock } from \"../../../flowGraphWithOnDoneExecutionBlock\";\r\nimport type { IFlowGraphBlockConfiguration } from \"../../../flowGraphBlock\";\r\nimport { RegisterClass } from \"../../../../Misc/typeStore\";\r\n/**\r\n * @experimental\r\n * Configuration for the wait all block.\r\n */\r\nexport interface IFlowGraphWaitAllBlockConfiguration extends IFlowGraphBlockConfiguration {\r\n /**\r\n * The number of input flows. There will always be at least one input flow.\r\n */\r\n numberInputFlows: number;\r\n}\r\n\r\n/**\r\n * @experimental\r\n * A block that waits for all input flows to be activated before activating its output flow.\r\n */\r\nexport class FlowGraphWaitAllBlock extends FlowGraphWithOnDoneExecutionBlock {\r\n /**\r\n * Input connection: Resets the block.\r\n */\r\n public reset: FlowGraphSignalConnection;\r\n /**\r\n * Input connection: The 2nd to nth input flows (the first is named onStart)\r\n */\r\n public readonly inFlows: FlowGraphSignalConnection[] = [];\r\n private _cachedActivationState: boolean[] = [];\r\n\r\n constructor(public config: IFlowGraphWaitAllBlockConfiguration) {\r\n super(config);\r\n\r\n this.reset = this._registerSignalInput(\"reset\");\r\n }\r\n\r\n configure(): void {\r\n // The first inFlow is the default input signal all execution blocks have\r\n for (let i = 1; i < this.config.numberInputFlows; i++) {\r\n this.inFlows.push(this._registerSignalInput(`in${i}`));\r\n }\r\n }\r\n\r\n private _getCurrentActivationState(context: FlowGraphContext) {\r\n const activationState = this._cachedActivationState;\r\n activationState.length = 0;\r\n if (!context._hasExecutionVariable(this, \"activationState\")) {\r\n for (let i = 0; i < this.config.numberInputFlows; i++) {\r\n activationState.push(false);\r\n }\r\n } else {\r\n const contextActivationState = context._getExecutionVariable(this, \"activationState\");\r\n for (let i = 0; i < contextActivationState.length; i++) {\r\n activationState.push(contextActivationState[i]);\r\n }\r\n }\r\n return activationState;\r\n }\r\n\r\n public _execute(context: FlowGraphContext, callingSignal: FlowGraphSignalConnection): void {\r\n const activationState = this._getCurrentActivationState(context);\r\n if (callingSignal === this.reset) {\r\n for (let i = 0; i < this.config.numberInputFlows; i++) {\r\n activationState[i] = false;\r\n }\r\n } else if (callingSignal === this.onStart) {\r\n activationState[0] = true;\r\n } else {\r\n const index = this.inFlows.indexOf(callingSignal);\r\n if (index >= 0) {\r\n activationState[index + 1] = true;\r\n }\r\n }\r\n\r\n context._setExecutionVariable(this, \"activationState\", activationState.slice());\r\n\r\n if (activationState.every((value: boolean) => value)) {\r\n this.onDone._activateSignal(context);\r\n for (let i = 0; i < this.config.numberInputFlows; i++) {\r\n activationState[i] = false;\r\n }\r\n }\r\n }\r\n\r\n public getClassName(): string {\r\n return \"FGWaitAllBlock\";\r\n }\r\n}\r\nRegisterClass(\"FGWaitAllBlock\", FlowGraphWaitAllBlock);\r\n"]}
|