@babylonjs/core 7.51.0 → 7.51.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Animations/animation.js +2 -1
- package/Animations/animation.js.map +1 -1
- package/Buffers/bufferUtils.d.ts +7 -5
- package/Buffers/bufferUtils.js +13 -9
- package/Buffers/bufferUtils.js.map +1 -1
- package/Engines/abstractEngine.js +2 -2
- package/Engines/abstractEngine.js.map +1 -1
- package/Engines/constants.d.ts +32 -0
- package/Engines/constants.js +33 -0
- package/Engines/constants.js.map +1 -1
- package/Engines/webgpuEngine.js +6 -3
- package/Engines/webgpuEngine.js.map +1 -1
- package/FlowGraph/Blocks/Data/Math/flowGraphMathBlocks.d.ts +148 -465
- package/FlowGraph/Blocks/Data/Math/flowGraphMathBlocks.js +394 -691
- package/FlowGraph/Blocks/Data/Math/flowGraphMathBlocks.js.map +1 -1
- package/FlowGraph/Blocks/Data/Math/flowGraphMathCombineExtractBlocks.d.ts +142 -0
- package/FlowGraph/Blocks/Data/Math/flowGraphMathCombineExtractBlocks.js +342 -0
- package/FlowGraph/Blocks/Data/Math/flowGraphMathCombineExtractBlocks.js.map +1 -0
- package/FlowGraph/Blocks/Data/Math/flowGraphMatrixMathBlocks.d.ts +107 -0
- package/FlowGraph/Blocks/Data/Math/flowGraphMatrixMathBlocks.js +130 -0
- package/FlowGraph/Blocks/Data/Math/flowGraphMatrixMathBlocks.js.map +1 -0
- package/FlowGraph/Blocks/Data/Math/flowGraphVectorMathBlocks.d.ts +77 -0
- package/FlowGraph/Blocks/Data/Math/flowGraphVectorMathBlocks.js +139 -0
- package/FlowGraph/Blocks/Data/Math/flowGraphVectorMathBlocks.js.map +1 -0
- package/FlowGraph/Blocks/Data/Math/index.d.ts +3 -0
- package/FlowGraph/Blocks/Data/Math/index.js +3 -0
- package/FlowGraph/Blocks/Data/Math/index.js.map +1 -1
- package/FlowGraph/Blocks/Data/Transformers/flowGraphJsonPointerParserBlock.d.ts +85 -0
- package/FlowGraph/Blocks/Data/Transformers/flowGraphJsonPointerParserBlock.js +133 -0
- package/FlowGraph/Blocks/Data/Transformers/flowGraphJsonPointerParserBlock.js.map +1 -0
- package/FlowGraph/Blocks/Data/Transformers/flowGraphTypeToTypeBlocks.d.ts +49 -0
- package/FlowGraph/Blocks/Data/Transformers/flowGraphTypeToTypeBlocks.js +71 -0
- package/FlowGraph/Blocks/Data/Transformers/flowGraphTypeToTypeBlocks.js.map +1 -0
- package/FlowGraph/Blocks/Data/Transformers/index.d.ts +2 -0
- package/FlowGraph/Blocks/Data/Transformers/index.js +3 -0
- package/FlowGraph/Blocks/Data/Transformers/index.js.map +1 -0
- package/FlowGraph/Blocks/Data/Utils/flowGraphArrayIndexBlock.d.ts +39 -0
- package/FlowGraph/Blocks/Data/Utils/flowGraphArrayIndexBlock.js +46 -0
- package/FlowGraph/Blocks/Data/Utils/flowGraphArrayIndexBlock.js.map +1 -0
- package/FlowGraph/Blocks/Data/Utils/flowGraphCodeExecutionBlock.d.ts +35 -0
- package/FlowGraph/Blocks/Data/Utils/flowGraphCodeExecutionBlock.js +34 -0
- package/FlowGraph/Blocks/Data/Utils/flowGraphCodeExecutionBlock.js.map +1 -0
- package/FlowGraph/Blocks/Data/Utils/flowGraphContextBlock.d.ts +20 -0
- package/FlowGraph/Blocks/Data/Utils/flowGraphContextBlock.js +25 -0
- package/FlowGraph/Blocks/Data/Utils/flowGraphContextBlock.js.map +1 -0
- package/FlowGraph/Blocks/Data/Utils/flowGraphFunctionReferenceBlock.d.ts +34 -0
- package/FlowGraph/Blocks/Data/Utils/flowGraphFunctionReferenceBlock.js +35 -0
- package/FlowGraph/Blocks/Data/Utils/flowGraphFunctionReferenceBlock.js.map +1 -0
- package/FlowGraph/Blocks/Data/Utils/flowGraphIndexOfBlock.d.ts +39 -0
- package/FlowGraph/Blocks/Data/Utils/flowGraphIndexOfBlock.js +42 -0
- package/FlowGraph/Blocks/Data/Utils/flowGraphIndexOfBlock.js.map +1 -0
- package/FlowGraph/Blocks/Data/Utils/index.d.ts +5 -0
- package/FlowGraph/Blocks/Data/Utils/index.js +6 -0
- package/FlowGraph/Blocks/Data/Utils/index.js.map +1 -0
- package/FlowGraph/Blocks/Data/flowGraphBinaryOperationBlock.d.ts +0 -1
- package/FlowGraph/Blocks/Data/flowGraphBinaryOperationBlock.js +3 -2
- package/FlowGraph/Blocks/Data/flowGraphBinaryOperationBlock.js.map +1 -1
- package/FlowGraph/Blocks/Data/flowGraphCachedOperationBlock.d.ts +1 -1
- package/FlowGraph/Blocks/Data/flowGraphCachedOperationBlock.js +4 -4
- package/FlowGraph/Blocks/Data/flowGraphCachedOperationBlock.js.map +1 -1
- package/FlowGraph/Blocks/Data/flowGraphConditionalDataBlock.d.ts +6 -3
- package/FlowGraph/Blocks/Data/flowGraphConditionalDataBlock.js +12 -6
- package/FlowGraph/Blocks/Data/flowGraphConditionalDataBlock.js.map +1 -1
- package/FlowGraph/Blocks/Data/flowGraphConstantBlock.d.ts +0 -2
- package/FlowGraph/Blocks/Data/flowGraphConstantBlock.js +2 -3
- package/FlowGraph/Blocks/Data/flowGraphConstantBlock.js.map +1 -1
- package/FlowGraph/Blocks/Data/flowGraphConstantOperationBlock.d.ts +5 -4
- package/FlowGraph/Blocks/Data/flowGraphConstantOperationBlock.js +5 -4
- package/FlowGraph/Blocks/Data/flowGraphConstantOperationBlock.js.map +1 -1
- package/FlowGraph/Blocks/Data/flowGraphGetAssetBlock.d.ts +62 -0
- package/FlowGraph/Blocks/Data/flowGraphGetAssetBlock.js +41 -0
- package/FlowGraph/Blocks/Data/flowGraphGetAssetBlock.js.map +1 -0
- package/FlowGraph/Blocks/Data/flowGraphGetPropertyBlock.d.ts +38 -33
- package/FlowGraph/Blocks/Data/flowGraphGetPropertyBlock.js +42 -25
- package/FlowGraph/Blocks/Data/flowGraphGetPropertyBlock.js.map +1 -1
- package/FlowGraph/Blocks/Data/flowGraphGetVariableBlock.d.ts +11 -16
- package/FlowGraph/Blocks/Data/flowGraphGetVariableBlock.js +9 -17
- package/FlowGraph/Blocks/Data/flowGraphGetVariableBlock.js.map +1 -1
- package/FlowGraph/Blocks/Data/flowGraphTernaryOperationBlock.d.ts +1 -1
- package/FlowGraph/Blocks/Data/flowGraphTernaryOperationBlock.js +1 -1
- package/FlowGraph/Blocks/Data/flowGraphTernaryOperationBlock.js.map +1 -1
- package/FlowGraph/Blocks/Data/{flowGraphCoordinateTransformBlock.d.ts → flowGraphTransformCoordinatesSystemBlock.d.ts} +1 -2
- package/FlowGraph/Blocks/Data/{flowGraphCoordinateTransformBlock.js → flowGraphTransformCoordinatesSystemBlock.js} +4 -5
- package/FlowGraph/Blocks/Data/flowGraphTransformCoordinatesSystemBlock.js.map +1 -0
- package/FlowGraph/Blocks/Data/flowGraphUnaryOperationBlock.d.ts +1 -1
- package/FlowGraph/Blocks/Data/flowGraphUnaryOperationBlock.js +1 -1
- package/FlowGraph/Blocks/Data/flowGraphUnaryOperationBlock.js.map +1 -1
- package/FlowGraph/Blocks/Data/index.d.ts +7 -3
- package/FlowGraph/Blocks/Data/index.js +9 -4
- package/FlowGraph/Blocks/Data/index.js.map +1 -1
- package/FlowGraph/Blocks/Event/flowGraphMeshPickEventBlock.d.ts +45 -24
- package/FlowGraph/Blocks/Event/flowGraphMeshPickEventBlock.js +45 -51
- package/FlowGraph/Blocks/Event/flowGraphMeshPickEventBlock.js.map +1 -1
- package/FlowGraph/Blocks/Event/flowGraphPointerOutEventBlock.d.ts +61 -0
- package/FlowGraph/Blocks/Event/flowGraphPointerOutEventBlock.js +39 -0
- package/FlowGraph/Blocks/Event/flowGraphPointerOutEventBlock.js.map +1 -0
- package/FlowGraph/Blocks/Event/flowGraphPointerOverEventBlock.d.ts +61 -0
- package/FlowGraph/Blocks/Event/flowGraphPointerOverEventBlock.js +40 -0
- package/FlowGraph/Blocks/Event/flowGraphPointerOverEventBlock.js.map +1 -0
- package/FlowGraph/Blocks/Event/flowGraphReceiveCustomEventBlock.d.ts +12 -14
- package/FlowGraph/Blocks/Event/flowGraphReceiveCustomEventBlock.js +19 -26
- package/FlowGraph/Blocks/Event/flowGraphReceiveCustomEventBlock.js.map +1 -1
- package/FlowGraph/Blocks/Event/flowGraphSceneReadyEventBlock.d.ts +6 -12
- package/FlowGraph/Blocks/Event/flowGraphSceneReadyEventBlock.js +13 -24
- package/FlowGraph/Blocks/Event/flowGraphSceneReadyEventBlock.js.map +1 -1
- package/FlowGraph/Blocks/Event/flowGraphSceneTickEventBlock.d.ts +31 -7
- package/FlowGraph/Blocks/Event/flowGraphSceneTickEventBlock.js +22 -20
- package/FlowGraph/Blocks/Event/flowGraphSceneTickEventBlock.js.map +1 -1
- package/FlowGraph/Blocks/{Execution → Event}/flowGraphSendCustomEventBlock.d.ts +12 -7
- package/FlowGraph/Blocks/Event/flowGraphSendCustomEventBlock.js +39 -0
- package/FlowGraph/Blocks/Event/flowGraphSendCustomEventBlock.js.map +1 -0
- package/FlowGraph/Blocks/Event/index.d.ts +3 -0
- package/FlowGraph/Blocks/Event/index.js +3 -0
- package/FlowGraph/Blocks/Event/index.js.map +1 -1
- package/FlowGraph/Blocks/Execution/Animation/flowGraphBezierCurveEasingBlock.d.ts +44 -0
- package/FlowGraph/Blocks/Execution/Animation/flowGraphBezierCurveEasingBlock.js +46 -0
- package/FlowGraph/Blocks/Execution/Animation/flowGraphBezierCurveEasingBlock.js.map +1 -0
- package/FlowGraph/Blocks/Execution/Animation/flowGraphEasingBlock.d.ts +60 -0
- package/FlowGraph/Blocks/Execution/Animation/flowGraphEasingBlock.js +93 -0
- package/FlowGraph/Blocks/Execution/Animation/flowGraphEasingBlock.js.map +1 -0
- package/FlowGraph/Blocks/Execution/Animation/flowGraphInterpolationBlock.d.ts +82 -0
- package/FlowGraph/Blocks/Execution/Animation/flowGraphInterpolationBlock.js +105 -0
- package/FlowGraph/Blocks/Execution/Animation/flowGraphInterpolationBlock.js.map +1 -0
- package/FlowGraph/Blocks/Execution/Animation/flowGraphPauseAnimationBlock.d.ts +2 -2
- package/FlowGraph/Blocks/Execution/Animation/flowGraphPauseAnimationBlock.js +2 -2
- package/FlowGraph/Blocks/Execution/Animation/flowGraphPauseAnimationBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/Animation/flowGraphPlayAnimationBlock.d.ts +40 -42
- package/FlowGraph/Blocks/Execution/Animation/flowGraphPlayAnimationBlock.js +116 -50
- package/FlowGraph/Blocks/Execution/Animation/flowGraphPlayAnimationBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/Animation/flowGraphStopAnimationBlock.d.ts +12 -4
- package/FlowGraph/Blocks/Execution/Animation/flowGraphStopAnimationBlock.js +86 -8
- package/FlowGraph/Blocks/Execution/Animation/flowGraphStopAnimationBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/Animation/index.d.ts +3 -0
- package/FlowGraph/Blocks/Execution/Animation/index.js +3 -0
- package/FlowGraph/Blocks/Execution/Animation/index.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphBranchBlock.d.ts +1 -2
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphBranchBlock.js +3 -4
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphBranchBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/{Audio/flowGraphStopAudioBlock.d.ts → ControlFlow/flowGraphCancelDelayBlock.d.ts} +6 -8
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphCancelDelayBlock.js +31 -0
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphCancelDelayBlock.js.map +1 -0
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphCounterBlock.d.ts +2 -2
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphCounterBlock.js +5 -5
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphCounterBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDebounceBlock.d.ts +0 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDebounceBlock.js +2 -3
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDebounceBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDoNBlock.d.ts +5 -10
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDoNBlock.js +11 -15
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDoNBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphFlipFlopBlock.d.ts +11 -3
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphFlipFlopBlock.js +5 -6
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphFlipFlopBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphForLoopBlock.d.ts +27 -7
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphForLoopBlock.js +28 -30
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphForLoopBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphMultiGateBlock.d.ts +13 -16
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphMultiGateBlock.js +50 -52
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphMultiGateBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphSequenceBlock.d.ts +8 -9
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphSequenceBlock.js +26 -13
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphSequenceBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphSetDelayBlock.d.ts +32 -0
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphSetDelayBlock.js +84 -0
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphSetDelayBlock.js.map +1 -0
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphSwitchBlock.d.ts +20 -6
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphSwitchBlock.js +55 -16
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphSwitchBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphThrottleBlock.d.ts +3 -4
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphThrottleBlock.js +36 -13
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphThrottleBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWaitAllBlock.d.ts +13 -5
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWaitAllBlock.js +22 -17
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWaitAllBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWhileLoopBlock.d.ts +12 -16
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWhileLoopBlock.js +21 -21
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWhileLoopBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/index.d.ts +2 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/index.js +2 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/index.js.map +1 -1
- package/FlowGraph/Blocks/Execution/flowGraphConsoleLogBlock.d.ts +4 -5
- package/FlowGraph/Blocks/Execution/flowGraphConsoleLogBlock.js +13 -8
- package/FlowGraph/Blocks/Execution/flowGraphConsoleLogBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/flowGraphSetPropertyBlock.d.ts +33 -36
- package/FlowGraph/Blocks/Execution/flowGraphSetPropertyBlock.js +42 -26
- package/FlowGraph/Blocks/Execution/flowGraphSetPropertyBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/flowGraphSetVariableBlock.d.ts +10 -25
- package/FlowGraph/Blocks/Execution/flowGraphSetVariableBlock.js +38 -24
- package/FlowGraph/Blocks/Execution/flowGraphSetVariableBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/index.d.ts +0 -3
- package/FlowGraph/Blocks/Execution/index.js +0 -3
- package/FlowGraph/Blocks/Execution/index.js.map +1 -1
- package/FlowGraph/Blocks/flowGraphBlockFactory.d.ts +16 -0
- package/FlowGraph/Blocks/flowGraphBlockFactory.js +292 -0
- package/FlowGraph/Blocks/flowGraphBlockFactory.js.map +1 -0
- package/FlowGraph/Blocks/flowGraphBlockNames.d.ts +145 -0
- package/FlowGraph/Blocks/flowGraphBlockNames.js +147 -0
- package/FlowGraph/Blocks/flowGraphBlockNames.js.map +1 -0
- package/FlowGraph/Blocks/index.d.ts +2 -0
- package/FlowGraph/Blocks/index.js +2 -0
- package/FlowGraph/Blocks/index.js.map +1 -1
- package/FlowGraph/{flowGraphInteger.d.ts → CustomTypes/flowGraphInteger.d.ts} +2 -3
- package/FlowGraph/{flowGraphInteger.js → CustomTypes/flowGraphInteger.js} +4 -5
- package/FlowGraph/CustomTypes/flowGraphInteger.js.map +1 -0
- package/FlowGraph/CustomTypes/flowGraphMatrix.d.ts +196 -0
- package/FlowGraph/CustomTypes/flowGraphMatrix.js +272 -0
- package/FlowGraph/CustomTypes/flowGraphMatrix.js.map +1 -0
- package/FlowGraph/CustomTypes/index.d.ts +2 -0
- package/FlowGraph/CustomTypes/index.js +3 -0
- package/FlowGraph/CustomTypes/index.js.map +1 -0
- package/FlowGraph/flowGraph.d.ts +29 -34
- package/FlowGraph/flowGraph.js +120 -104
- package/FlowGraph/flowGraph.js.map +1 -1
- package/FlowGraph/flowGraphAssetsContext.d.ts +29 -0
- package/FlowGraph/flowGraphAssetsContext.js +52 -0
- package/FlowGraph/flowGraphAssetsContext.js.map +1 -0
- package/FlowGraph/flowGraphAsyncExecutionBlock.d.ts +15 -8
- package/FlowGraph/flowGraphAsyncExecutionBlock.js +25 -5
- package/FlowGraph/flowGraphAsyncExecutionBlock.js.map +1 -1
- package/FlowGraph/flowGraphBlock.d.ts +22 -15
- package/FlowGraph/flowGraphBlock.js +31 -52
- package/FlowGraph/flowGraphBlock.js.map +1 -1
- package/FlowGraph/flowGraphConnection.d.ts +13 -12
- package/FlowGraph/flowGraphConnection.js +31 -16
- package/FlowGraph/flowGraphConnection.js.map +1 -1
- package/FlowGraph/flowGraphContext.d.ts +89 -13
- package/FlowGraph/flowGraphContext.js +210 -23
- package/FlowGraph/flowGraphContext.js.map +1 -1
- package/FlowGraph/flowGraphCoordinator.d.ts +4 -10
- package/FlowGraph/flowGraphCoordinator.js +4 -16
- package/FlowGraph/flowGraphCoordinator.js.map +1 -1
- package/FlowGraph/flowGraphDataConnection.d.ts +52 -14
- package/FlowGraph/flowGraphDataConnection.js +73 -26
- package/FlowGraph/flowGraphDataConnection.js.map +1 -1
- package/FlowGraph/flowGraphEventBlock.d.ts +17 -1
- package/FlowGraph/flowGraphEventBlock.js +13 -2
- package/FlowGraph/flowGraphEventBlock.js.map +1 -1
- package/FlowGraph/flowGraphEventType.d.ts +16 -0
- package/FlowGraph/flowGraphEventType.js +18 -0
- package/FlowGraph/flowGraphEventType.js.map +1 -0
- package/FlowGraph/flowGraphExecutionBlock.d.ts +11 -1
- package/FlowGraph/flowGraphExecutionBlock.js +21 -2
- package/FlowGraph/flowGraphExecutionBlock.js.map +1 -1
- package/FlowGraph/flowGraphExecutionBlockWithOutSignal.d.ts +2 -2
- package/FlowGraph/flowGraphExecutionBlockWithOutSignal.js +0 -1
- package/FlowGraph/flowGraphExecutionBlockWithOutSignal.js.map +1 -1
- package/FlowGraph/flowGraphLogger.d.ts +60 -0
- package/FlowGraph/flowGraphLogger.js +53 -0
- package/FlowGraph/flowGraphLogger.js.map +1 -0
- package/FlowGraph/flowGraphParser.d.ts +85 -0
- package/FlowGraph/flowGraphParser.js +271 -0
- package/FlowGraph/flowGraphParser.js.map +1 -0
- package/FlowGraph/flowGraphPathConverter.d.ts +1 -1
- package/FlowGraph/flowGraphPathConverter.js +3 -2
- package/FlowGraph/flowGraphPathConverter.js.map +1 -1
- package/FlowGraph/flowGraphPathConverterComponent.d.ts +8 -1
- package/FlowGraph/flowGraphPathConverterComponent.js +18 -2
- package/FlowGraph/flowGraphPathConverterComponent.js.map +1 -1
- package/FlowGraph/flowGraphRichTypes.d.ts +51 -9
- package/FlowGraph/flowGraphRichTypes.js +160 -50
- package/FlowGraph/flowGraphRichTypes.js.map +1 -1
- package/FlowGraph/flowGraphSceneEventCoordinator.d.ts +45 -0
- package/FlowGraph/flowGraphSceneEventCoordinator.js +77 -0
- package/FlowGraph/flowGraphSceneEventCoordinator.js.map +1 -0
- package/FlowGraph/flowGraphSignalConnection.d.ts +8 -5
- package/FlowGraph/flowGraphSignalConnection.js +26 -9
- package/FlowGraph/flowGraphSignalConnection.js.map +1 -1
- package/FlowGraph/index.d.ts +6 -1
- package/FlowGraph/index.js +7 -1
- package/FlowGraph/index.js.map +1 -1
- package/FlowGraph/serialization.d.ts +5 -2
- package/FlowGraph/serialization.js +94 -22
- package/FlowGraph/serialization.js.map +1 -1
- package/FlowGraph/typeDefinitions.d.ts +74 -12
- package/FlowGraph/typeDefinitions.js.map +1 -1
- package/FlowGraph/utils.d.ts +47 -0
- package/FlowGraph/utils.js +55 -0
- package/FlowGraph/utils.js.map +1 -1
- package/Maths/math.path.js +3 -0
- package/Maths/math.path.js.map +1 -1
- package/Meshes/geometry.d.ts +2 -1
- package/Meshes/geometry.js +8 -3
- package/Meshes/geometry.js.map +1 -1
- package/Meshes/mesh.d.ts +2 -1
- package/Meshes/mesh.js +3 -2
- package/Meshes/mesh.js.map +1 -1
- package/Misc/sceneOptimizer.js +1 -0
- package/Misc/sceneOptimizer.js.map +1 -1
- package/Misc/screenshotTools.d.ts +4 -2
- package/Misc/screenshotTools.js +8 -5
- package/Misc/screenshotTools.js.map +1 -1
- package/ObjectModel/objectModelInterfaces.d.ts +2 -2
- package/ObjectModel/objectModelInterfaces.js.map +1 -1
- package/Physics/v2/characterController.d.ts +8 -0
- package/Physics/v2/characterController.js +12 -5
- package/Physics/v2/characterController.js.map +1 -1
- package/Shaders/ShadersInclude/pbrBlockSubSurface.js +1 -1
- package/Shaders/ShadersInclude/pbrBlockSubSurface.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/pbrBlockSubSurface.js +1 -1
- package/ShadersWGSL/ShadersInclude/pbrBlockSubSurface.js.map +1 -1
- package/package.json +1 -1
- package/FlowGraph/Blocks/Data/Logic/flowGraphLogicBlocks.d.ts +0 -24
- package/FlowGraph/Blocks/Data/Logic/flowGraphLogicBlocks.js +0 -39
- package/FlowGraph/Blocks/Data/Logic/flowGraphLogicBlocks.js.map +0 -1
- package/FlowGraph/Blocks/Data/Logic/index.d.ts +0 -1
- package/FlowGraph/Blocks/Data/Logic/index.js +0 -2
- package/FlowGraph/Blocks/Data/Logic/index.js.map +0 -1
- package/FlowGraph/Blocks/Data/flowGraphCoordinateTransformBlock.js.map +0 -1
- package/FlowGraph/Blocks/Execution/Audio/flowGraphPlayAudioBlock.d.ts +0 -19
- package/FlowGraph/Blocks/Execution/Audio/flowGraphPlayAudioBlock.js +0 -26
- package/FlowGraph/Blocks/Execution/Audio/flowGraphPlayAudioBlock.js.map +0 -1
- package/FlowGraph/Blocks/Execution/Audio/flowGraphStopAudioBlock.js +0 -25
- package/FlowGraph/Blocks/Execution/Audio/flowGraphStopAudioBlock.js.map +0 -1
- package/FlowGraph/Blocks/Execution/Audio/index.d.ts +0 -2
- package/FlowGraph/Blocks/Execution/Audio/index.js +0 -3
- package/FlowGraph/Blocks/Execution/Audio/index.js.map +0 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphTimerBlock.d.ts +0 -31
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphTimerBlock.js +0 -69
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphTimerBlock.js.map +0 -1
- package/FlowGraph/Blocks/Execution/flowGraphSendCustomEventBlock.js +0 -38
- package/FlowGraph/Blocks/Execution/flowGraphSendCustomEventBlock.js.map +0 -1
- package/FlowGraph/flowGraphContextLogger.d.ts +0 -9
- package/FlowGraph/flowGraphContextLogger.js +0 -14
- package/FlowGraph/flowGraphContextLogger.js.map +0 -1
- package/FlowGraph/flowGraphInteger.js.map +0 -1
|
@@ -1,52 +1,50 @@
|
|
|
1
1
|
import { FlowGraphExecutionBlockWithOutSignal } from "../../../flowGraphExecutionBlockWithOutSignal.js";
|
|
2
|
-
import { RichTypeNumber } from "../../../flowGraphRichTypes.js";
|
|
2
|
+
import { RichTypeAny, RichTypeFlowGraphInteger, RichTypeNumber } from "../../../flowGraphRichTypes.js";
|
|
3
3
|
import { RegisterClass } from "../../../../Misc/typeStore.js";
|
|
4
|
+
import { getNumericValue } from "../../../utils.js";
|
|
5
|
+
import { FlowGraphInteger } from "../../../CustomTypes/flowGraphInteger.js";
|
|
4
6
|
/**
|
|
5
|
-
* @experimental
|
|
6
7
|
* Block that executes an action in a loop.
|
|
7
8
|
*/
|
|
8
9
|
export class FlowGraphForLoopBlock extends FlowGraphExecutionBlockWithOutSignal {
|
|
9
10
|
constructor(config) {
|
|
10
11
|
super(config);
|
|
11
|
-
this.startIndex = this.registerDataInput("startIndex",
|
|
12
|
-
this.endIndex = this.registerDataInput("endIndex",
|
|
13
|
-
this.step = this.registerDataInput("step", RichTypeNumber);
|
|
14
|
-
this.index = this.registerDataOutput("index",
|
|
15
|
-
this.
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
let index = context._getExecutionVariable(this, "index");
|
|
19
|
-
const endIndex = context._getExecutionVariable(this, "endIndex");
|
|
20
|
-
if (index < endIndex) {
|
|
21
|
-
this.index.setValue(index, context);
|
|
22
|
-
this.onLoop._activateSignal(context);
|
|
23
|
-
const step = context._getExecutionVariable(this, "step", 1);
|
|
24
|
-
index += step;
|
|
25
|
-
context._setExecutionVariable(this, "index", index);
|
|
26
|
-
this._executeLoop(context);
|
|
27
|
-
}
|
|
28
|
-
else {
|
|
29
|
-
this.out._activateSignal(context);
|
|
30
|
-
}
|
|
12
|
+
this.startIndex = this.registerDataInput("startIndex", RichTypeAny, 0);
|
|
13
|
+
this.endIndex = this.registerDataInput("endIndex", RichTypeAny);
|
|
14
|
+
this.step = this.registerDataInput("step", RichTypeNumber, 1);
|
|
15
|
+
this.index = this.registerDataOutput("index", RichTypeFlowGraphInteger, new FlowGraphInteger(getNumericValue(config?.initialIndex ?? 0)));
|
|
16
|
+
this.executionFlow = this._registerSignalOutput("executionFlow");
|
|
17
|
+
this.completed = this._registerSignalOutput("completed");
|
|
18
|
+
this._unregisterSignalOutput("out");
|
|
31
19
|
}
|
|
32
20
|
/**
|
|
33
21
|
* @internal
|
|
34
22
|
*/
|
|
35
23
|
_execute(context) {
|
|
36
|
-
const index = this.startIndex.getValue(context);
|
|
37
|
-
const endIndex = this.endIndex.getValue(context);
|
|
24
|
+
const index = getNumericValue(this.startIndex.getValue(context));
|
|
38
25
|
const step = this.step.getValue(context);
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
26
|
+
let endIndex = getNumericValue(this.endIndex.getValue(context));
|
|
27
|
+
for (let i = index; i < endIndex; i += step) {
|
|
28
|
+
this.index.setValue(new FlowGraphInteger(i), context);
|
|
29
|
+
this.executionFlow._activateSignal(context);
|
|
30
|
+
endIndex = getNumericValue(this.endIndex.getValue(context));
|
|
31
|
+
if (i > FlowGraphForLoopBlock.MaxLoopIterations) {
|
|
32
|
+
break;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
this.completed._activateSignal(context);
|
|
43
36
|
}
|
|
44
37
|
/**
|
|
45
38
|
* @returns class name of the block.
|
|
46
39
|
*/
|
|
47
40
|
getClassName() {
|
|
48
|
-
return "
|
|
41
|
+
return "FlowGraphForLoopBlock" /* FlowGraphBlockNames.ForLoop */;
|
|
49
42
|
}
|
|
50
43
|
}
|
|
51
|
-
|
|
44
|
+
/**
|
|
45
|
+
* The maximum number of iterations allowed for the loop.
|
|
46
|
+
* If the loop exceeds this number, it will stop. This number is configurable to avoid infinite loops.
|
|
47
|
+
*/
|
|
48
|
+
FlowGraphForLoopBlock.MaxLoopIterations = 1000;
|
|
49
|
+
RegisterClass("FlowGraphForLoopBlock" /* FlowGraphBlockNames.ForLoop */, FlowGraphForLoopBlock);
|
|
52
50
|
//# sourceMappingURL=flowGraphForLoopBlock.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flowGraphForLoopBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FlowGraph/Blocks/Execution/ControlFlow/flowGraphForLoopBlock.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,oCAAoC,EAAE,yDAA4D;AAE3G,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,oCAAoC,EAAE,yDAA4D;AAE3G,OAAO,EAAE,WAAW,EAAE,wBAAwB,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AACpG,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAI3D,OAAO,EAAE,eAAe,EAAE,0BAA6B;AACvD,OAAO,EAAE,gBAAgB,EAAE,iDAAoD;AAY/E;;GAEG;AACH,MAAM,OAAO,qBAAsB,SAAQ,oCAAoC;IAiC3E,YAAmB,MAA4C;QAC3D,KAAK,CAAC,MAAM,CAAC,CAAC;QAEd,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,iBAAiB,CAAC,YAAY,EAAE,WAAW,EAAE,CAAC,CAAC,CAAC;QACvE,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,iBAAiB,CAAC,UAAU,EAAE,WAAW,CAAC,CAAC;QAChE,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,iBAAiB,CAAC,MAAM,EAAE,cAAc,EAAE,CAAC,CAAC,CAAC;QAE9D,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,kBAAkB,CAAC,OAAO,EAAE,wBAAwB,EAAE,IAAI,gBAAgB,CAAC,eAAe,CAAC,MAAM,EAAE,YAAY,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;QAC1I,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,qBAAqB,CAAC,eAAe,CAAC,CAAC;QACjE,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,qBAAqB,CAAC,WAAW,CAAC,CAAC;QAEzD,IAAI,CAAC,uBAAuB,CAAC,KAAK,CAAC,CAAC;IACxC,CAAC;IAED;;OAEG;IACI,QAAQ,CAAC,OAAyB;QACrC,MAAM,KAAK,GAAG,eAAe,CAAC,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC;QACjE,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QACzC,IAAI,QAAQ,GAAG,eAAe,CAAC,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC;QAChE,KAAK,IAAI,CAAC,GAAG,KAAK,EAAE,CAAC,GAAG,QAAQ,EAAE,CAAC,IAAI,IAAI,EAAE,CAAC;YAC1C,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,gBAAgB,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;YACtD,IAAI,CAAC,aAAa,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;YAC5C,QAAQ,GAAG,eAAe,CAAC,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC;YAC5D,IAAI,CAAC,GAAG,qBAAqB,CAAC,iBAAiB,EAAE,CAAC;gBAC9C,MAAM;YACV,CAAC;QACL,CAAC;QAED,IAAI,CAAC,SAAS,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;IAC5C,CAAC;IAED;;OAEG;IACa,YAAY;QACxB,iEAAmC;IACvC,CAAC;;AAtED;;;GAGG;AACW,uCAAiB,GAAG,IAAI,CAAC;AAoE3C,aAAa,4DAA8B,qBAAqB,CAAC,CAAC","sourcesContent":["import type { FlowGraphSignalConnection } from \"../../../flowGraphSignalConnection\";\r\nimport type { FlowGraphDataConnection } from \"../../../flowGraphDataConnection\";\r\nimport { FlowGraphExecutionBlockWithOutSignal } from \"core/FlowGraph/flowGraphExecutionBlockWithOutSignal\";\r\nimport type { FlowGraphContext } from \"../../../flowGraphContext\";\r\nimport { RichTypeAny, RichTypeFlowGraphInteger, RichTypeNumber } from \"../../../flowGraphRichTypes\";\r\nimport { RegisterClass } from \"../../../../Misc/typeStore\";\r\nimport type { IFlowGraphBlockConfiguration } from \"../../../flowGraphBlock\";\r\nimport { FlowGraphBlockNames } from \"../../flowGraphBlockNames\";\r\nimport type { FlowGraphNumber } from \"core/FlowGraph/utils\";\r\nimport { getNumericValue } from \"core/FlowGraph/utils\";\r\nimport { FlowGraphInteger } from \"core/FlowGraph/CustomTypes/flowGraphInteger\";\r\n\r\n/**\r\n * Configuration for the For Loop block.\r\n */\r\nexport interface IFlowGraphForLoopBlockConfiguration extends IFlowGraphBlockConfiguration {\r\n /**\r\n * The initial index of the loop.\r\n * if not set will default to 0\r\n */\r\n initialIndex?: FlowGraphNumber;\r\n}\r\n/**\r\n * Block that executes an action in a loop.\r\n */\r\nexport class FlowGraphForLoopBlock extends FlowGraphExecutionBlockWithOutSignal {\r\n /**\r\n * The maximum number of iterations allowed for the loop.\r\n * If the loop exceeds this number, it will stop. This number is configurable to avoid infinite loops.\r\n */\r\n public static MaxLoopIterations = 1000;\r\n /**\r\n * Input connection: The start index of the loop.\r\n */\r\n public readonly startIndex: FlowGraphDataConnection<FlowGraphNumber>;\r\n /**\r\n * Input connection: The end index of the loop.\r\n */\r\n public readonly endIndex: FlowGraphDataConnection<FlowGraphNumber>;\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<FlowGraphInteger>;\r\n /**\r\n * Output connection: The signal that is activated when the loop body is executed.\r\n */\r\n public readonly executionFlow: FlowGraphSignalConnection;\r\n\r\n /**\r\n * Output connection: The completed signal. Triggered when condition is false.\r\n * No out signal is available.\r\n */\r\n public readonly completed: FlowGraphSignalConnection;\r\n\r\n public constructor(config?: IFlowGraphForLoopBlockConfiguration) {\r\n super(config);\r\n\r\n this.startIndex = this.registerDataInput(\"startIndex\", RichTypeAny, 0);\r\n this.endIndex = this.registerDataInput(\"endIndex\", RichTypeAny);\r\n this.step = this.registerDataInput(\"step\", RichTypeNumber, 1);\r\n\r\n this.index = this.registerDataOutput(\"index\", RichTypeFlowGraphInteger, new FlowGraphInteger(getNumericValue(config?.initialIndex ?? 0)));\r\n this.executionFlow = this._registerSignalOutput(\"executionFlow\");\r\n this.completed = this._registerSignalOutput(\"completed\");\r\n\r\n this._unregisterSignalOutput(\"out\");\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _execute(context: FlowGraphContext): void {\r\n const index = getNumericValue(this.startIndex.getValue(context));\r\n const step = this.step.getValue(context);\r\n let endIndex = getNumericValue(this.endIndex.getValue(context));\r\n for (let i = index; i < endIndex; i += step) {\r\n this.index.setValue(new FlowGraphInteger(i), context);\r\n this.executionFlow._activateSignal(context);\r\n endIndex = getNumericValue(this.endIndex.getValue(context));\r\n if (i > FlowGraphForLoopBlock.MaxLoopIterations) {\r\n break;\r\n }\r\n }\r\n\r\n this.completed._activateSignal(context);\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.ForLoop;\r\n }\r\n}\r\nRegisterClass(FlowGraphBlockNames.ForLoop, FlowGraphForLoopBlock);\r\n"]}
|
|
@@ -3,15 +3,15 @@ import type { FlowGraphDataConnection } from "../../../flowGraphDataConnection";
|
|
|
3
3
|
import { FlowGraphExecutionBlock } from "../../../flowGraphExecutionBlock";
|
|
4
4
|
import type { FlowGraphSignalConnection } from "../../../flowGraphSignalConnection";
|
|
5
5
|
import type { IFlowGraphBlockConfiguration } from "../../../flowGraphBlock";
|
|
6
|
+
import { FlowGraphInteger } from "../../../CustomTypes/flowGraphInteger.js";
|
|
6
7
|
/**
|
|
7
|
-
* @experimental
|
|
8
8
|
* Configuration for the multi gate block.
|
|
9
9
|
*/
|
|
10
10
|
export interface IFlowGraphMultiGateBlockConfiguration extends IFlowGraphBlockConfiguration {
|
|
11
11
|
/**
|
|
12
|
-
* The number of output
|
|
12
|
+
* The number of output signals. Required.
|
|
13
13
|
*/
|
|
14
|
-
|
|
14
|
+
outputSignalCount: number;
|
|
15
15
|
/**
|
|
16
16
|
* If the block should pick a random output flow from the ones that haven't been executed. Default to false.
|
|
17
17
|
*/
|
|
@@ -19,16 +19,10 @@ export interface IFlowGraphMultiGateBlockConfiguration extends IFlowGraphBlockCo
|
|
|
19
19
|
/**
|
|
20
20
|
* If the block should loop back to the first output flow after executing the last one. Default to false.
|
|
21
21
|
*/
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* The index of the output flow to start with. Default to 0.
|
|
25
|
-
*/
|
|
26
|
-
startIndex?: number;
|
|
22
|
+
isLoop?: boolean;
|
|
27
23
|
}
|
|
28
24
|
/**
|
|
29
|
-
* @experimental
|
|
30
25
|
* A block that has an input flow and routes it to any potential output flows, randomly or sequentially
|
|
31
|
-
* @see https://docs.google.com/document/d/1MT7gL-IEn_PUw-4XGBazMxsyqsxqgAVGYcNeC4Cj_9Q/edit#heading=h.i2sn85fbjo60
|
|
32
26
|
*/
|
|
33
27
|
export declare class FlowGraphMultiGateBlock extends FlowGraphExecutionBlock {
|
|
34
28
|
/**
|
|
@@ -40,21 +34,24 @@ export declare class FlowGraphMultiGateBlock extends FlowGraphExecutionBlock {
|
|
|
40
34
|
*/
|
|
41
35
|
readonly reset: FlowGraphSignalConnection;
|
|
42
36
|
/**
|
|
43
|
-
* Output connections: The output
|
|
37
|
+
* Output connections: The output signals.
|
|
44
38
|
*/
|
|
45
|
-
|
|
39
|
+
readonly outputSignals: FlowGraphSignalConnection[];
|
|
46
40
|
/**
|
|
47
41
|
* Output connection: The index of the current output flow.
|
|
48
42
|
*/
|
|
49
|
-
readonly
|
|
50
|
-
private _cachedUnusedIndexes;
|
|
43
|
+
readonly lastIndex: FlowGraphDataConnection<FlowGraphInteger>;
|
|
51
44
|
constructor(
|
|
52
45
|
/**
|
|
53
46
|
* the configuration of the block
|
|
54
47
|
*/
|
|
55
48
|
config: IFlowGraphMultiGateBlockConfiguration);
|
|
56
|
-
private
|
|
57
|
-
|
|
49
|
+
private _getNextIndex;
|
|
50
|
+
/**
|
|
51
|
+
* Sets the block's output signals. Would usually be passed from the constructor but can be changed afterwards.
|
|
52
|
+
* @param numberOutputSignals the number of output flows
|
|
53
|
+
*/
|
|
54
|
+
setNumberOfOutputSignals(numberOutputSignals?: number): void;
|
|
58
55
|
_execute(context: FlowGraphContext, callingSignal: FlowGraphSignalConnection): void;
|
|
59
56
|
/**
|
|
60
57
|
* @returns class name of the block.
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { RegisterClass } from "../../../../Misc/typeStore.js";
|
|
2
2
|
import { FlowGraphExecutionBlock } from "../../../flowGraphExecutionBlock.js";
|
|
3
|
-
import {
|
|
3
|
+
import { RichTypeFlowGraphInteger } from "../../../flowGraphRichTypes.js";
|
|
4
|
+
import { FlowGraphInteger } from "../../../CustomTypes/flowGraphInteger.js";
|
|
4
5
|
/**
|
|
5
|
-
* @experimental
|
|
6
6
|
* A block that has an input flow and routes it to any potential output flows, randomly or sequentially
|
|
7
|
-
* @see https://docs.google.com/document/d/1MT7gL-IEn_PUw-4XGBazMxsyqsxqgAVGYcNeC4Cj_9Q/edit#heading=h.i2sn85fbjo60
|
|
8
7
|
*/
|
|
9
8
|
export class FlowGraphMultiGateBlock extends FlowGraphExecutionBlock {
|
|
10
9
|
constructor(
|
|
@@ -14,72 +13,71 @@ export class FlowGraphMultiGateBlock extends FlowGraphExecutionBlock {
|
|
|
14
13
|
config) {
|
|
15
14
|
super(config);
|
|
16
15
|
this.config = config;
|
|
17
|
-
|
|
16
|
+
/**
|
|
17
|
+
* Output connections: The output signals.
|
|
18
|
+
*/
|
|
19
|
+
this.outputSignals = [];
|
|
18
20
|
this.reset = this._registerSignalInput("reset");
|
|
19
|
-
this.
|
|
20
|
-
this.config
|
|
21
|
-
this.config.startIndex = Math.max(0, Math.min(this.config.startIndex, this.config.numberOutputFlows - 1));
|
|
22
|
-
this.outFlows = [];
|
|
23
|
-
for (let i = 0; i < this.config.numberOutputFlows; i++) {
|
|
24
|
-
this.outFlows.push(this._registerSignalOutput(`out${i}`));
|
|
25
|
-
}
|
|
21
|
+
this.lastIndex = this.registerDataOutput("lastIndex", RichTypeFlowGraphInteger, new FlowGraphInteger(-1));
|
|
22
|
+
this.setNumberOfOutputSignals(config?.outputSignalCount);
|
|
26
23
|
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
if (!
|
|
31
|
-
|
|
32
|
-
|
|
24
|
+
_getNextIndex(indexesUsed) {
|
|
25
|
+
// find the next index available from the indexes used array
|
|
26
|
+
// if all outputs were used, reset the indexes used array if we are in a loop multi gate
|
|
27
|
+
if (!indexesUsed.includes(false)) {
|
|
28
|
+
if (this.config.isLoop) {
|
|
29
|
+
indexesUsed.fill(false);
|
|
33
30
|
}
|
|
34
31
|
}
|
|
32
|
+
if (!this.config.isRandom) {
|
|
33
|
+
return indexesUsed.indexOf(false);
|
|
34
|
+
}
|
|
35
35
|
else {
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
result.push(contextUnusedIndexes[i]);
|
|
39
|
-
}
|
|
36
|
+
const unusedIndexes = indexesUsed.map((used, index) => (used ? -1 : index)).filter((index) => index !== -1);
|
|
37
|
+
return unusedIndexes.length ? unusedIndexes[Math.floor(Math.random() * unusedIndexes.length)] : -1;
|
|
40
38
|
}
|
|
41
|
-
return result;
|
|
42
39
|
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
40
|
+
/**
|
|
41
|
+
* Sets the block's output signals. Would usually be passed from the constructor but can be changed afterwards.
|
|
42
|
+
* @param numberOutputSignals the number of output flows
|
|
43
|
+
*/
|
|
44
|
+
setNumberOfOutputSignals(numberOutputSignals = 1) {
|
|
45
|
+
// check the size of the outFlow Array, see if it is not larger than needed
|
|
46
|
+
while (this.outputSignals.length > numberOutputSignals) {
|
|
47
|
+
const flow = this.outputSignals.pop();
|
|
48
|
+
if (flow) {
|
|
49
|
+
flow.disconnectFromAll();
|
|
50
|
+
this._unregisterSignalOutput(flow.name);
|
|
51
|
+
}
|
|
47
52
|
}
|
|
48
|
-
|
|
49
|
-
|
|
53
|
+
while (this.outputSignals.length < numberOutputSignals) {
|
|
54
|
+
this.outputSignals.push(this._registerSignalOutput(`out_${this.outputSignals.length}`));
|
|
50
55
|
}
|
|
51
56
|
}
|
|
52
57
|
_execute(context, callingSignal) {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
context._deleteExecutionVariable(this, "currentIndex");
|
|
57
|
-
context._deleteExecutionVariable(this, "unusedIndexes");
|
|
58
|
-
return;
|
|
58
|
+
// set the state(s) of the block
|
|
59
|
+
if (!context._hasExecutionVariable(this, "indexesUsed")) {
|
|
60
|
+
context._setExecutionVariable(this, "indexesUsed", this.outputSignals.map(() => false));
|
|
59
61
|
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
}
|
|
64
|
-
else if (nextIndex >= this.config.numberOutputFlows && !this.config.loop) {
|
|
62
|
+
if (callingSignal === this.reset) {
|
|
63
|
+
context._deleteExecutionVariable(this, "indexesUsed");
|
|
64
|
+
this.lastIndex.setValue(new FlowGraphInteger(-1), context);
|
|
65
65
|
return;
|
|
66
66
|
}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
67
|
+
const indexesUsed = context._getExecutionVariable(this, "indexesUsed", []);
|
|
68
|
+
const nextIndex = this._getNextIndex(indexesUsed);
|
|
69
|
+
if (nextIndex > -1) {
|
|
70
|
+
this.lastIndex.setValue(new FlowGraphInteger(nextIndex), context);
|
|
71
|
+
indexesUsed[nextIndex] = true;
|
|
72
|
+
context._setExecutionVariable(this, "indexesUsed", indexesUsed);
|
|
73
|
+
this.outputSignals[nextIndex]._activateSignal(context);
|
|
72
74
|
}
|
|
73
|
-
context._setExecutionVariable(this, "unusedIndexes", unusedIndexes);
|
|
74
|
-
context._setExecutionVariable(this, "currentIndex", nextIndex);
|
|
75
|
-
this.currentIndex.setValue(nextIndex, context);
|
|
76
|
-
this.outFlows[nextIndex]._activateSignal(context);
|
|
77
75
|
}
|
|
78
76
|
/**
|
|
79
77
|
* @returns class name of the block.
|
|
80
78
|
*/
|
|
81
79
|
getClassName() {
|
|
82
|
-
return "
|
|
80
|
+
return "FlowGraphMultiGateBlock" /* FlowGraphBlockNames.MultiGate */;
|
|
83
81
|
}
|
|
84
82
|
/**
|
|
85
83
|
* Serializes the block.
|
|
@@ -87,11 +85,11 @@ export class FlowGraphMultiGateBlock extends FlowGraphExecutionBlock {
|
|
|
87
85
|
*/
|
|
88
86
|
serialize(serializationObject) {
|
|
89
87
|
super.serialize(serializationObject);
|
|
90
|
-
serializationObject.config.
|
|
88
|
+
serializationObject.config.outputSignalCount = this.config.outputSignalCount;
|
|
91
89
|
serializationObject.config.isRandom = this.config.isRandom;
|
|
92
|
-
serializationObject.config.loop = this.config.
|
|
90
|
+
serializationObject.config.loop = this.config.isLoop;
|
|
93
91
|
serializationObject.config.startIndex = this.config.startIndex;
|
|
94
92
|
}
|
|
95
93
|
}
|
|
96
|
-
RegisterClass("
|
|
94
|
+
RegisterClass("FlowGraphMultiGateBlock" /* FlowGraphBlockNames.MultiGate */, FlowGraphMultiGateBlock);
|
|
97
95
|
//# 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":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAG3D,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAC3E,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"flowGraphMultiGateBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FlowGraph/Blocks/Execution/ControlFlow/flowGraphMultiGateBlock.ts"],"names":[],"mappings":"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","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 { RichTypeFlowGraphInteger } from \"../../../flowGraphRichTypes\";\r\nimport type { FlowGraphSignalConnection } from \"../../../flowGraphSignalConnection\";\r\nimport type { IFlowGraphBlockConfiguration } from \"../../../flowGraphBlock\";\r\nimport { FlowGraphBlockNames } from \"../../flowGraphBlockNames\";\r\nimport { FlowGraphInteger } from \"core/FlowGraph/CustomTypes/flowGraphInteger\";\r\n/**\r\n * Configuration for the multi gate block.\r\n */\r\nexport interface IFlowGraphMultiGateBlockConfiguration extends IFlowGraphBlockConfiguration {\r\n /**\r\n * The number of output signals. Required.\r\n */\r\n outputSignalCount: 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 isLoop?: boolean;\r\n}\r\n\r\n/**\r\n * A block that has an input flow and routes it to any potential output flows, randomly or sequentially\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 signals.\r\n */\r\n public readonly outputSignals: FlowGraphSignalConnection[] = [];\r\n /**\r\n * Output connection: The index of the current output flow.\r\n */\r\n public readonly lastIndex: FlowGraphDataConnection<FlowGraphInteger>;\r\n\r\n constructor(\r\n /**\r\n * the configuration of the block\r\n */\r\n public override config: IFlowGraphMultiGateBlockConfiguration\r\n ) {\r\n super(config);\r\n this.reset = this._registerSignalInput(\"reset\");\r\n this.lastIndex = this.registerDataOutput(\"lastIndex\", RichTypeFlowGraphInteger, new FlowGraphInteger(-1));\r\n this.setNumberOfOutputSignals(config?.outputSignalCount);\r\n }\r\n\r\n private _getNextIndex(indexesUsed: boolean[]): number {\r\n // find the next index available from the indexes used array\r\n\r\n // if all outputs were used, reset the indexes used array if we are in a loop multi gate\r\n if (!indexesUsed.includes(false)) {\r\n if (this.config.isLoop) {\r\n indexesUsed.fill(false);\r\n }\r\n }\r\n if (!this.config.isRandom) {\r\n return indexesUsed.indexOf(false);\r\n } else {\r\n const unusedIndexes = indexesUsed.map((used, index) => (used ? -1 : index)).filter((index) => index !== -1);\r\n return unusedIndexes.length ? unusedIndexes[Math.floor(Math.random() * unusedIndexes.length)] : -1;\r\n }\r\n }\r\n\r\n /**\r\n * Sets the block's output signals. Would usually be passed from the constructor but can be changed afterwards.\r\n * @param numberOutputSignals the number of output flows\r\n */\r\n public setNumberOfOutputSignals(numberOutputSignals: number = 1) {\r\n // check the size of the outFlow Array, see if it is not larger than needed\r\n while (this.outputSignals.length > numberOutputSignals) {\r\n const flow = this.outputSignals.pop();\r\n if (flow) {\r\n flow.disconnectFromAll();\r\n this._unregisterSignalOutput(flow.name);\r\n }\r\n }\r\n\r\n while (this.outputSignals.length < numberOutputSignals) {\r\n this.outputSignals.push(this._registerSignalOutput(`out_${this.outputSignals.length}`));\r\n }\r\n }\r\n\r\n public _execute(context: FlowGraphContext, callingSignal: FlowGraphSignalConnection): void {\r\n // set the state(s) of the block\r\n if (!context._hasExecutionVariable(this, \"indexesUsed\")) {\r\n context._setExecutionVariable(\r\n this,\r\n \"indexesUsed\",\r\n this.outputSignals.map(() => false)\r\n );\r\n }\r\n\r\n if (callingSignal === this.reset) {\r\n context._deleteExecutionVariable(this, \"indexesUsed\");\r\n this.lastIndex.setValue(new FlowGraphInteger(-1), context);\r\n return;\r\n }\r\n const indexesUsed = context._getExecutionVariable(this, \"indexesUsed\", [] as boolean[]);\r\n const nextIndex = this._getNextIndex(indexesUsed);\r\n if (nextIndex > -1) {\r\n this.lastIndex.setValue(new FlowGraphInteger(nextIndex), context);\r\n indexesUsed[nextIndex] = true;\r\n context._setExecutionVariable(this, \"indexesUsed\", indexesUsed);\r\n this.outputSignals[nextIndex]._activateSignal(context);\r\n }\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.MultiGate;\r\n }\r\n\r\n /**\r\n * Serializes the block.\r\n * @param serializationObject the object to serialize to.\r\n */\r\n public override serialize(serializationObject?: any): void {\r\n super.serialize(serializationObject);\r\n serializationObject.config.outputSignalCount = this.config.outputSignalCount;\r\n serializationObject.config.isRandom = this.config.isRandom;\r\n serializationObject.config.loop = this.config.isLoop;\r\n serializationObject.config.startIndex = this.config.startIndex;\r\n }\r\n}\r\nRegisterClass(FlowGraphBlockNames.MultiGate, FlowGraphMultiGateBlock);\r\n"]}
|
|
@@ -3,17 +3,15 @@ import type { FlowGraphContext } from "../../../flowGraphContext";
|
|
|
3
3
|
import { FlowGraphExecutionBlock } from "../../../flowGraphExecutionBlock";
|
|
4
4
|
import type { FlowGraphSignalConnection } from "../../../flowGraphSignalConnection";
|
|
5
5
|
/**
|
|
6
|
-
* @experimental
|
|
7
6
|
* Configuration for the sequence block.
|
|
8
7
|
*/
|
|
9
8
|
export interface IFlowGraphSequenceBlockConfiguration extends IFlowGraphBlockConfiguration {
|
|
10
9
|
/**
|
|
11
|
-
* The number of output
|
|
10
|
+
* The number of output signals. Defaults to 1.
|
|
12
11
|
*/
|
|
13
|
-
|
|
12
|
+
outputSignalCount?: number;
|
|
14
13
|
}
|
|
15
14
|
/**
|
|
16
|
-
* @experimental
|
|
17
15
|
* A block that executes its output flows in sequence.
|
|
18
16
|
*/
|
|
19
17
|
export declare class FlowGraphSequenceBlock extends FlowGraphExecutionBlock {
|
|
@@ -24,7 +22,7 @@ export declare class FlowGraphSequenceBlock extends FlowGraphExecutionBlock {
|
|
|
24
22
|
/**
|
|
25
23
|
* The output flows.
|
|
26
24
|
*/
|
|
27
|
-
|
|
25
|
+
executionSignals: FlowGraphSignalConnection[];
|
|
28
26
|
constructor(
|
|
29
27
|
/**
|
|
30
28
|
* the configuration of the block
|
|
@@ -32,11 +30,12 @@ export declare class FlowGraphSequenceBlock extends FlowGraphExecutionBlock {
|
|
|
32
30
|
config: IFlowGraphSequenceBlockConfiguration);
|
|
33
31
|
_execute(context: FlowGraphContext): void;
|
|
34
32
|
/**
|
|
35
|
-
*
|
|
33
|
+
* Sets the block's output flows. Would usually be passed from the constructor but can be changed afterwards.
|
|
34
|
+
* @param outputSignalCount the number of output flows
|
|
36
35
|
*/
|
|
37
|
-
|
|
36
|
+
setNumberOfOutputSignals(outputSignalCount?: number): void;
|
|
38
37
|
/**
|
|
39
|
-
*
|
|
38
|
+
* @returns class name of the block.
|
|
40
39
|
*/
|
|
41
|
-
|
|
40
|
+
getClassName(): string;
|
|
42
41
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { RegisterClass } from "../../../../Misc/typeStore.js";
|
|
2
2
|
import { FlowGraphExecutionBlock } from "../../../flowGraphExecutionBlock.js";
|
|
3
3
|
/**
|
|
4
|
-
* @experimental
|
|
5
4
|
* A block that executes its output flows in sequence.
|
|
6
5
|
*/
|
|
7
6
|
export class FlowGraphSequenceBlock extends FlowGraphExecutionBlock {
|
|
@@ -12,26 +11,40 @@ export class FlowGraphSequenceBlock extends FlowGraphExecutionBlock {
|
|
|
12
11
|
config) {
|
|
13
12
|
super(config);
|
|
14
13
|
this.config = config;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
14
|
+
/**
|
|
15
|
+
* The output flows.
|
|
16
|
+
*/
|
|
17
|
+
this.executionSignals = [];
|
|
18
|
+
this.setNumberOfOutputSignals(this.config.outputSignalCount);
|
|
19
19
|
}
|
|
20
20
|
_execute(context) {
|
|
21
|
-
for (let i = 0; i < this.
|
|
22
|
-
this.
|
|
21
|
+
for (let i = 0; i < this.executionSignals.length; i++) {
|
|
22
|
+
this.executionSignals[i]._activateSignal(context);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Sets the block's output flows. Would usually be passed from the constructor but can be changed afterwards.
|
|
27
|
+
* @param outputSignalCount the number of output flows
|
|
28
|
+
*/
|
|
29
|
+
setNumberOfOutputSignals(outputSignalCount = 1) {
|
|
30
|
+
// check the size of the outFlow Array, see if it is not larger than needed
|
|
31
|
+
while (this.executionSignals.length > outputSignalCount) {
|
|
32
|
+
const flow = this.executionSignals.pop();
|
|
33
|
+
if (flow) {
|
|
34
|
+
flow.disconnectFromAll();
|
|
35
|
+
this._unregisterSignalOutput(flow.name);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
while (this.executionSignals.length < outputSignalCount) {
|
|
39
|
+
this.executionSignals.push(this._registerSignalOutput(`out_${this.executionSignals.length}`));
|
|
23
40
|
}
|
|
24
41
|
}
|
|
25
42
|
/**
|
|
26
43
|
* @returns class name of the block.
|
|
27
44
|
*/
|
|
28
45
|
getClassName() {
|
|
29
|
-
return FlowGraphSequenceBlock.
|
|
46
|
+
return "FlowGraphSequenceBlock" /* FlowGraphBlockNames.Sequence */;
|
|
30
47
|
}
|
|
31
48
|
}
|
|
32
|
-
|
|
33
|
-
* the class name of the block.
|
|
34
|
-
*/
|
|
35
|
-
FlowGraphSequenceBlock.ClassName = "FGSequenceBlock";
|
|
36
|
-
RegisterClass(FlowGraphSequenceBlock.ClassName, FlowGraphSequenceBlock);
|
|
49
|
+
RegisterClass("FlowGraphSequenceBlock" /* FlowGraphBlockNames.Sequence */, FlowGraphSequenceBlock);
|
|
37
50
|
//# sourceMappingURL=flowGraphSequenceBlock.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flowGraphSequenceBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FlowGraph/Blocks/Execution/ControlFlow/flowGraphSequenceBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"flowGraphSequenceBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FlowGraph/Blocks/Execution/ControlFlow/flowGraphSequenceBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAI3D,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAa3E;;GAEG;AACH,MAAM,OAAO,sBAAuB,SAAQ,uBAAuB;IAM/D;IACI;;OAEG;IACa,MAA4C;QAE5D,KAAK,CAAC,MAAM,CAAC,CAAC;QAFE,WAAM,GAAN,MAAM,CAAsC;QAThE;;WAEG;QACI,qBAAgB,GAAgC,EAAE,CAAC;QAStD,IAAI,CAAC,wBAAwB,CAAC,IAAI,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC;IACjE,CAAC;IAEM,QAAQ,CAAC,OAAyB;QACrC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,gBAAgB,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YACpD,IAAI,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;QACtD,CAAC;IACL,CAAC;IAED;;;OAGG;IACI,wBAAwB,CAAC,oBAA4B,CAAC;QACzD,2EAA2E;QAC3E,OAAO,IAAI,CAAC,gBAAgB,CAAC,MAAM,GAAG,iBAAiB,EAAE,CAAC;YACtD,MAAM,IAAI,GAAG,IAAI,CAAC,gBAAgB,CAAC,GAAG,EAAE,CAAC;YACzC,IAAI,IAAI,EAAE,CAAC;gBACP,IAAI,CAAC,iBAAiB,EAAE,CAAC;gBACzB,IAAI,CAAC,uBAAuB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAC5C,CAAC;QACL,CAAC;QAED,OAAO,IAAI,CAAC,gBAAgB,CAAC,MAAM,GAAG,iBAAiB,EAAE,CAAC;YACtD,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,qBAAqB,CAAC,OAAO,IAAI,CAAC,gBAAgB,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;QAClG,CAAC;IACL,CAAC;IAED;;OAEG;IACa,YAAY;QACxB,mEAAoC;IACxC,CAAC;CACJ;AAED,aAAa,8DAA+B,sBAAsB,CAAC,CAAC","sourcesContent":["import { RegisterClass } from \"../../../../Misc/typeStore\";\r\nimport { FlowGraphBlockNames } from \"../../flowGraphBlockNames\";\r\nimport type { IFlowGraphBlockConfiguration } from \"../../../flowGraphBlock\";\r\nimport type { FlowGraphContext } from \"../../../flowGraphContext\";\r\nimport { FlowGraphExecutionBlock } from \"../../../flowGraphExecutionBlock\";\r\nimport type { FlowGraphSignalConnection } from \"../../../flowGraphSignalConnection\";\r\n\r\n/**\r\n * Configuration for the sequence block.\r\n */\r\nexport interface IFlowGraphSequenceBlockConfiguration extends IFlowGraphBlockConfiguration {\r\n /**\r\n * The number of output signals. Defaults to 1.\r\n */\r\n outputSignalCount?: number;\r\n}\r\n\r\n/**\r\n * A block that executes its output flows in sequence.\r\n */\r\nexport class FlowGraphSequenceBlock extends FlowGraphExecutionBlock {\r\n /**\r\n * The output flows.\r\n */\r\n public executionSignals: FlowGraphSignalConnection[] = [];\r\n\r\n constructor(\r\n /**\r\n * the configuration of the block\r\n */\r\n public override config: IFlowGraphSequenceBlockConfiguration\r\n ) {\r\n super(config);\r\n this.setNumberOfOutputSignals(this.config.outputSignalCount);\r\n }\r\n\r\n public _execute(context: FlowGraphContext) {\r\n for (let i = 0; i < this.executionSignals.length; i++) {\r\n this.executionSignals[i]._activateSignal(context);\r\n }\r\n }\r\n\r\n /**\r\n * Sets the block's output flows. Would usually be passed from the constructor but can be changed afterwards.\r\n * @param outputSignalCount the number of output flows\r\n */\r\n public setNumberOfOutputSignals(outputSignalCount: number = 1) {\r\n // check the size of the outFlow Array, see if it is not larger than needed\r\n while (this.executionSignals.length > outputSignalCount) {\r\n const flow = this.executionSignals.pop();\r\n if (flow) {\r\n flow.disconnectFromAll();\r\n this._unregisterSignalOutput(flow.name);\r\n }\r\n }\r\n\r\n while (this.executionSignals.length < outputSignalCount) {\r\n this.executionSignals.push(this._registerSignalOutput(`out_${this.executionSignals.length}`));\r\n }\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.Sequence;\r\n }\r\n}\r\n\r\nRegisterClass(FlowGraphBlockNames.Sequence, FlowGraphSequenceBlock);\r\n"]}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { FlowGraphAsyncExecutionBlock } from "../../../flowGraphAsyncExecutionBlock";
|
|
2
|
+
import type { IFlowGraphBlockConfiguration } from "../../../flowGraphBlock";
|
|
3
|
+
import type { FlowGraphContext } from "../../../flowGraphContext";
|
|
4
|
+
import type { FlowGraphDataConnection } from "../../../flowGraphDataConnection";
|
|
5
|
+
import type { FlowGraphSignalConnection } from "../../../flowGraphSignalConnection";
|
|
6
|
+
/**
|
|
7
|
+
* Block that sets a delay in seconds before activating the output signal.
|
|
8
|
+
*/
|
|
9
|
+
export declare class FlowGraphSetDelayBlock extends FlowGraphAsyncExecutionBlock {
|
|
10
|
+
/**
|
|
11
|
+
* The maximum number of parallel delays that can be set per node.
|
|
12
|
+
*/
|
|
13
|
+
static MaxParallelDelayCount: number;
|
|
14
|
+
/**
|
|
15
|
+
* Input signal: If activated the delayed activations set by this block will be canceled.
|
|
16
|
+
*/
|
|
17
|
+
readonly cancel: FlowGraphSignalConnection;
|
|
18
|
+
/**
|
|
19
|
+
* Input connection: The duration of the delay in seconds.
|
|
20
|
+
*/
|
|
21
|
+
readonly duration: FlowGraphDataConnection<number>;
|
|
22
|
+
/**
|
|
23
|
+
* Output connection: The last delay index that was set.
|
|
24
|
+
*/
|
|
25
|
+
readonly lastDelayIndex: FlowGraphDataConnection<number>;
|
|
26
|
+
constructor(config?: IFlowGraphBlockConfiguration);
|
|
27
|
+
_preparePendingTasks(context: FlowGraphContext): void;
|
|
28
|
+
_cancelPendingTasks(context: FlowGraphContext): void;
|
|
29
|
+
_execute(context: FlowGraphContext, callingSignal: FlowGraphSignalConnection): void;
|
|
30
|
+
getClassName(): string;
|
|
31
|
+
private _onEnded;
|
|
32
|
+
}
|