@babylonjs/core 6.30.0 → 6.32.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/Actions/action.js.map +1 -1
- package/Animations/animation.d.ts +8 -2
- package/Animations/animation.js +21 -13
- package/Animations/animation.js.map +1 -1
- package/Animations/runtimeAnimation.js +6 -15
- package/Animations/runtimeAnimation.js.map +1 -1
- package/Cameras/Inputs/freeCameraDeviceOrientationInput.js.map +1 -1
- package/Cameras/camera.js +1 -1
- package/Cameras/camera.js.map +1 -1
- package/Culling/ray.js +24 -24
- package/Culling/ray.js.map +1 -1
- package/Debug/skeletonViewer.d.ts +2 -2
- package/Debug/skeletonViewer.js +38 -12
- package/Debug/skeletonViewer.js.map +1 -1
- package/DeviceInput/InputDevices/deviceSource.js.map +1 -1
- package/DeviceInput/InputDevices/deviceTypes.js.map +1 -1
- package/DeviceInput/webDeviceInputSystem.js.map +1 -1
- package/Engines/Extensions/engine.views.d.ts +8 -5
- package/Engines/Extensions/engine.views.js +14 -8
- package/Engines/Extensions/engine.views.js.map +1 -1
- package/Engines/Processors/shaderCodeNode.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.multiRender.js +6 -3
- package/Engines/WebGPU/Extensions/engine.multiRender.js.map +1 -1
- package/Engines/WebGPU/webgpuShaderProcessorsGLSL.js.map +1 -1
- package/Engines/WebGPU/webgpuShaderProcessorsWGSL.js.map +1 -1
- package/Engines/WebGPU/webgpuTextureHelper.js.map +1 -1
- package/Engines/engine.d.ts +16 -1
- package/Engines/engine.js +1 -1
- package/Engines/engine.js.map +1 -1
- package/Engines/thinEngine.js +2 -2
- package/Engines/thinEngine.js.map +1 -1
- package/Engines/webgpuEngine.js.map +1 -1
- package/FlowGraph/Blocks/Data/Math/flowGraphMatrixBlocks.js +12 -12
- package/FlowGraph/Blocks/Data/Math/flowGraphMatrixBlocks.js.map +1 -1
- package/FlowGraph/Blocks/Data/Math/flowGraphNumberMathBlocks.js +4 -4
- package/FlowGraph/Blocks/Data/Math/flowGraphNumberMathBlocks.js.map +1 -1
- package/FlowGraph/Blocks/Data/Math/flowGraphVector2MathBlocks.js +9 -9
- package/FlowGraph/Blocks/Data/Math/flowGraphVector2MathBlocks.js.map +1 -1
- package/FlowGraph/Blocks/Data/Math/flowGraphVector3MathBlocks.js +11 -11
- package/FlowGraph/Blocks/Data/Math/flowGraphVector3MathBlocks.js.map +1 -1
- package/FlowGraph/Blocks/Data/Math/flowGraphVector4MathBlocks.js +10 -10
- package/FlowGraph/Blocks/Data/Math/flowGraphVector4MathBlocks.js.map +1 -1
- package/FlowGraph/Blocks/Data/flowGraphBinaryOperationBlock.js +2 -2
- package/FlowGraph/Blocks/Data/flowGraphBinaryOperationBlock.js.map +1 -1
- package/FlowGraph/Blocks/Data/flowGraphCachedOperationBlock.js +1 -1
- package/FlowGraph/Blocks/Data/flowGraphCachedOperationBlock.js.map +1 -1
- package/FlowGraph/Blocks/Data/flowGraphConditionalDataBlock.js +4 -4
- package/FlowGraph/Blocks/Data/flowGraphConditionalDataBlock.js.map +1 -1
- package/FlowGraph/Blocks/Data/flowGraphConstantBlock.js +1 -1
- package/FlowGraph/Blocks/Data/flowGraphConstantBlock.js.map +1 -1
- package/FlowGraph/Blocks/Data/flowGraphCoordinateTransformBlock.js +4 -4
- package/FlowGraph/Blocks/Data/flowGraphCoordinateTransformBlock.js.map +1 -1
- package/FlowGraph/Blocks/Data/flowGraphGetVariableBlock.js +2 -2
- package/FlowGraph/Blocks/Data/flowGraphGetVariableBlock.js.map +1 -1
- package/FlowGraph/Blocks/Data/flowGraphUnaryOperationBlock.js +1 -1
- package/FlowGraph/Blocks/Data/flowGraphUnaryOperationBlock.js.map +1 -1
- package/FlowGraph/Blocks/Event/flowGraphMeshPickEventBlock.d.ts +4 -4
- package/FlowGraph/Blocks/Event/flowGraphMeshPickEventBlock.js +16 -6
- package/FlowGraph/Blocks/Event/flowGraphMeshPickEventBlock.js.map +1 -1
- package/FlowGraph/Blocks/Event/flowGraphReceiveCustomEventBlock.d.ts +1 -0
- package/FlowGraph/Blocks/Event/flowGraphReceiveCustomEventBlock.js +5 -1
- package/FlowGraph/Blocks/Event/flowGraphReceiveCustomEventBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/Animation/flowGraphPauseAnimationBlock.js +1 -1
- package/FlowGraph/Blocks/Execution/Animation/flowGraphPauseAnimationBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/Animation/flowGraphPlayAnimationBlock.d.ts +17 -6
- package/FlowGraph/Blocks/Execution/Animation/flowGraphPlayAnimationBlock.js +16 -9
- package/FlowGraph/Blocks/Execution/Animation/flowGraphPlayAnimationBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/Animation/flowGraphStopAnimationBlock.js +1 -1
- package/FlowGraph/Blocks/Execution/Animation/flowGraphStopAnimationBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/Audio/flowGraphPlayAudioBlock.js +1 -1
- package/FlowGraph/Blocks/Execution/Audio/flowGraphPlayAudioBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/Audio/flowGraphStopAudioBlock.js +1 -1
- package/FlowGraph/Blocks/Execution/Audio/flowGraphStopAudioBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphBranchBlock.js +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphBranchBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphCounterBlock.js +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphCounterBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDebounceBlock.js +2 -2
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDebounceBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDoNBlock.js +2 -2
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDoNBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphFlipFlopBlock.js +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphFlipFlopBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphForLoopBlock.js +4 -4
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphForLoopBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphMultiGateBlock.d.ts +1 -0
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphMultiGateBlock.js +8 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphMultiGateBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphSwitchBlock.d.ts +1 -0
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphSwitchBlock.js +5 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphSwitchBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphThrottleBlock.js +2 -2
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphThrottleBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphTimerBlock.js +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphTimerBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWaitAllBlock.d.ts +1 -0
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWaitAllBlock.js +4 -0
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWaitAllBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWhileLoopBlock.d.ts +1 -0
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWhileLoopBlock.js +6 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWhileLoopBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/flowGraphLogBlock.js +1 -1
- package/FlowGraph/Blocks/Execution/flowGraphLogBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/flowGraphSendCustomEventBlock.js +2 -2
- package/FlowGraph/Blocks/Execution/flowGraphSendCustomEventBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/flowGraphSetPropertyBlock.d.ts +8 -12
- package/FlowGraph/Blocks/Execution/flowGraphSetPropertyBlock.js +9 -19
- package/FlowGraph/Blocks/Execution/flowGraphSetPropertyBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/flowGraphSetVariableBlock.js +2 -2
- package/FlowGraph/Blocks/Execution/flowGraphSetVariableBlock.js.map +1 -1
- package/FlowGraph/flowGraphBlock.d.ts +2 -2
- package/FlowGraph/flowGraphBlock.js +20 -4
- package/FlowGraph/flowGraphBlock.js.map +1 -1
- package/FlowGraph/flowGraphContext.d.ts +4 -4
- package/FlowGraph/flowGraphContext.js +22 -40
- package/FlowGraph/flowGraphContext.js.map +1 -1
- package/FlowGraph/flowGraphPath.d.ts +27 -0
- package/FlowGraph/flowGraphPath.js +136 -0
- package/FlowGraph/flowGraphPath.js.map +1 -0
- package/FlowGraph/flowGraphPathComponent.d.ts +42 -0
- package/FlowGraph/flowGraphPathComponent.js +51 -0
- package/FlowGraph/flowGraphPathComponent.js.map +1 -0
- package/FlowGraph/index.d.ts +1 -0
- package/FlowGraph/index.js +1 -0
- package/FlowGraph/index.js.map +1 -1
- package/Gizmos/axisDragGizmo.d.ts +4 -2
- package/Gizmos/axisDragGizmo.js +18 -6
- package/Gizmos/axisDragGizmo.js.map +1 -1
- package/Gizmos/axisScaleGizmo.d.ts +2 -2
- package/Gizmos/axisScaleGizmo.js +1 -1
- package/Gizmos/axisScaleGizmo.js.map +1 -1
- package/Gizmos/planeDragGizmo.d.ts +4 -4
- package/Gizmos/planeDragGizmo.js +1 -1
- package/Gizmos/planeDragGizmo.js.map +1 -1
- package/Gizmos/planeRotationGizmo.d.ts +13 -7
- package/Gizmos/planeRotationGizmo.js +26 -10
- package/Gizmos/planeRotationGizmo.js.map +1 -1
- package/Lights/Shadows/shadowGenerator.d.ts +8 -0
- package/Lights/Shadows/shadowGenerator.js +12 -0
- package/Lights/Shadows/shadowGenerator.js.map +1 -1
- package/Loading/sceneLoader.js.map +1 -1
- package/Materials/GreasedLine/greasedLineSimpleMaterial.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/perturbNormalBlock.js.map +1 -1
- package/Materials/Node/Blocks/Teleport/teleportInBlock.d.ts +6 -0
- package/Materials/Node/Blocks/Teleport/teleportInBlock.js +22 -0
- package/Materials/Node/Blocks/Teleport/teleportInBlock.js.map +1 -1
- package/Materials/Node/Blocks/modBlock.js +1 -0
- package/Materials/Node/Blocks/modBlock.js.map +1 -1
- package/Materials/Textures/Procedurals/proceduralTexture.d.ts +1 -1
- package/Materials/Textures/Procedurals/proceduralTexture.js +1 -1
- package/Materials/Textures/Procedurals/proceduralTexture.js.map +1 -1
- package/Materials/Textures/multiRenderTarget.d.ts +14 -10
- package/Materials/Textures/multiRenderTarget.js +7 -5
- package/Materials/Textures/multiRenderTarget.js.map +1 -1
- package/Materials/imageProcessingConfiguration.d.ts +2 -2
- package/Materials/imageProcessingConfiguration.js +2 -2
- package/Materials/imageProcessingConfiguration.js.map +1 -1
- package/Maths/math.size.d.ts +6 -0
- package/Maths/math.size.js +8 -0
- package/Maths/math.size.js.map +1 -1
- package/Maths/math.vector.d.ts +5 -5
- package/Maths/math.vector.js +6 -5
- package/Maths/math.vector.js.map +1 -1
- package/Meshes/Builders/linesBuilder.js +4 -2
- package/Meshes/Builders/linesBuilder.js.map +1 -1
- package/Meshes/GreasedLine/greasedLineBaseMesh.d.ts +1 -1
- package/Meshes/GreasedLine/greasedLineBaseMesh.js +1 -1
- package/Meshes/GreasedLine/greasedLineBaseMesh.js.map +1 -1
- package/Meshes/geometry.d.ts +8 -0
- package/Meshes/geometry.js +20 -1
- package/Meshes/geometry.js.map +1 -1
- package/Meshes/groundMesh.js +1 -1
- package/Meshes/groundMesh.js.map +1 -1
- package/Meshes/mesh.d.ts +8 -0
- package/Meshes/mesh.js +14 -2
- package/Meshes/mesh.js.map +1 -1
- package/Meshes/mesh.vertexData.js.map +1 -1
- package/Misc/dds.js.map +1 -1
- package/Misc/greasedLineTools.js.map +1 -1
- package/Misc/tools.js.map +1 -1
- package/Physics/physicsHelper.d.ts +1 -1
- package/Physics/physicsHelper.js +1 -1
- package/Physics/physicsHelper.js.map +1 -1
- package/PostProcesses/RenderPipeline/Pipelines/ssrRenderingPipeline.d.ts +1 -1
- package/PostProcesses/RenderPipeline/Pipelines/ssrRenderingPipeline.js +1 -1
- package/PostProcesses/RenderPipeline/Pipelines/ssrRenderingPipeline.js.map +1 -1
- package/PostProcesses/bloomEffect.d.ts +1 -1
- package/PostProcesses/bloomEffect.js +1 -1
- package/PostProcesses/bloomEffect.js.map +1 -1
- package/PostProcesses/postProcess.d.ts +10 -2
- package/PostProcesses/postProcess.js +17 -7
- package/PostProcesses/postProcess.js.map +1 -1
- package/Rendering/depthPeelingRenderer.d.ts +5 -0
- package/Rendering/depthPeelingRenderer.js +33 -9
- package/Rendering/depthPeelingRenderer.js.map +1 -1
- package/Rendering/depthRenderer.js +9 -0
- package/Rendering/depthRenderer.js.map +1 -1
- package/Rendering/geometryBufferRenderer.d.ts +6 -3
- package/Rendering/geometryBufferRenderer.js +28 -10
- package/Rendering/geometryBufferRenderer.js.map +1 -1
- package/Rendering/geometryBufferRendererSceneComponent.d.ts +5 -2
- package/Rendering/geometryBufferRendererSceneComponent.js.map +1 -1
- package/Shaders/ShadersInclude/bonesDeclaration.js +1 -1
- package/Shaders/ShadersInclude/bonesDeclaration.js.map +1 -1
- package/Shaders/depth.vertex.d.ts +2 -0
- package/Shaders/depth.vertex.js +4 -0
- package/Shaders/depth.vertex.js.map +1 -1
- package/XR/features/WebXRAbstractFeature.d.ts +10 -1
- package/XR/features/WebXRAbstractFeature.js +13 -0
- package/XR/features/WebXRAbstractFeature.js.map +1 -1
- package/XR/features/WebXRLightEstimation.d.ts +5 -0
- package/XR/features/WebXRLightEstimation.js +14 -2
- package/XR/features/WebXRLightEstimation.js.map +1 -1
- package/XR/features/WebXRRawCameraAccess.d.ts +81 -0
- package/XR/features/WebXRRawCameraAccess.js +169 -0
- package/XR/features/WebXRRawCameraAccess.js.map +1 -0
- package/XR/features/index.d.ts +1 -0
- package/XR/features/index.js +1 -0
- package/XR/features/index.js.map +1 -1
- package/XR/webXRFeaturesManager.d.ts +13 -0
- package/XR/webXRFeaturesManager.js +4 -0
- package/XR/webXRFeaturesManager.js.map +1 -1
- package/package.json +1 -1
- package/scene.d.ts +1 -1
- package/scene.js +11 -6
- package/scene.js.map +1 -1
- package/types.js.map +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flowGraphPlayAnimationBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FlowGraph/Blocks/Execution/Animation/flowGraphPlayAnimationBlock.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,4BAA4B,EAAE,MAAM,uCAAuC,CAAC;AACrF,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC3F,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"flowGraphPlayAnimationBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FlowGraph/Blocks/Execution/Animation/flowGraphPlayAnimationBlock.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,4BAA4B,EAAE,MAAM,uCAAuC,CAAC;AACrF,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC3F,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAG3D,OAAO,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AASzE;;;GAGG;AACH,MAAM,OAAO,2BAA4B,SAAQ,4BAA4B;IAoCzE,YAA0B,MAAiD;QACvE,KAAK,CAAC,MAAM,CAAC,CAAC;QADQ,WAAM,GAA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EAAE,CAAC,CAAC,CAAC;SACjC;QACD,OAAO,CAAC,mBAAmB,CAAC,IAAI,CAAC,CAAC;QAClC,IAAI,CAAC,cAAc,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;IACjD,CAAC;IAED;;;OAGG;IACI,mBAAmB,CAAC,OAAyB;;QAChD,MAAM,YAAY,GAAG,MAAC,OAAO,CAAC,qBAAqB,CAAC,IAAI,EAAE,oBAAoB,CAAkB,mCAAI,EAAE,CAAC;QACvG,KAAK,MAAM,IAAI,IAAI,YAAY,EAAE;YAC7B,IAAI,CAAC,IAAI,EAAE,CAAC;SACf;QACD,OAAO,CAAC,wBAAwB,CAAC,IAAI,EAAE,oBAAoB,CAAC,CAAC;IACjE,CAAC;IAEM,YAAY;QACf,OAAO,sBAAsB,CAAC;IAClC,CAAC;IAEM,SAAS,CAAC,sBAA2B,EAAE;QAC1C,KAAK,CAAC,SAAS,CAAC,mBAAmB,CAAC,CAAC;QACrC,mBAAmB,CAAC,MAAM,CAAC,UAAU,GAAG,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,SAAS,EAAE,CAAC;QAC3E,mBAAmB,CAAC,MAAM,CAAC,aAAa,GAAG,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,SAAS,EAAE,CAAC;IACrF,CAAC;CACJ;AAED,aAAa,CAAC,sBAAsB,EAAE,2BAA2B,CAAC,CAAC","sourcesContent":["import type { FlowGraphContext } from \"../../../flowGraphContext\";\r\nimport type { Animatable } from \"../../../../Animations\";\r\nimport type { FlowGraphDataConnection } from \"../../../flowGraphDataConnection\";\r\nimport type { FlowGraphSignalConnection } from \"../../../flowGraphSignalConnection\";\r\nimport { FlowGraphAsyncExecutionBlock } from \"../../../flowGraphAsyncExecutionBlock\";\r\nimport { RichTypeAny, RichTypeNumber, RichTypeBoolean } from \"../../../flowGraphRichTypes\";\r\nimport { RegisterClass } from \"../../../../Misc/typeStore\";\r\nimport type { IFlowGraphBlockConfiguration } from \"../../../flowGraphBlock\";\r\nimport type { FlowGraphPath } from \"../../../flowGraphPath\";\r\nimport { FlowGraphPathComponent } from \"../../../flowGraphPathComponent\";\r\n\r\n/**\r\n * @experimental\r\n */\r\nexport interface IFlowGraphPlayAnimationBlockConfiguration extends IFlowGraphBlockConfiguration {\r\n targetPath: FlowGraphPath;\r\n animationPath: FlowGraphPath;\r\n}\r\n/**\r\n * @experimental\r\n * A block that plays an animation on an animatable object.\r\n */\r\nexport class FlowGraphPlayAnimationBlock extends FlowGraphAsyncExecutionBlock {\r\n /**\r\n * The substitution inputs for template strings in the target\r\n */\r\n public readonly templateTargetComponent: FlowGraphPathComponent;\r\n /**\r\n * The substitution inputs for template strings in the animation\r\n */\r\n public readonly templateAnimationComponent: FlowGraphPathComponent;\r\n /**\r\n * Input connection: The speed of the animation.\r\n */\r\n public readonly speed: FlowGraphDataConnection<number>;\r\n /**\r\n * Input connection: Should the animation loop?\r\n */\r\n public readonly loop: FlowGraphDataConnection<boolean>;\r\n /**\r\n * Input connection: The starting frame of the animation.\r\n */\r\n public readonly from: FlowGraphDataConnection<number>;\r\n /**\r\n * Input connection: The ending frame of the animation.\r\n */\r\n public readonly to: FlowGraphDataConnection<number>;\r\n\r\n /**\r\n * Output connection: The signal that is triggered when the animation ends.\r\n */\r\n public readonly onAnimationEnd: FlowGraphSignalConnection;\r\n\r\n /**\r\n * Output connection: The animatable that is currently running.\r\n */\r\n public readonly runningAnimatable: FlowGraphDataConnection<Animatable>;\r\n\r\n public constructor(public config: IFlowGraphPlayAnimationBlockConfiguration) {\r\n super(config);\r\n\r\n this.templateTargetComponent = new FlowGraphPathComponent(config.targetPath, this);\r\n this.templateAnimationComponent = new FlowGraphPathComponent(config.animationPath, this);\r\n\r\n this.speed = this.registerDataInput(\"speed\", RichTypeNumber);\r\n this.loop = this.registerDataInput(\"loop\", RichTypeBoolean);\r\n this.from = this.registerDataInput(\"from\", RichTypeNumber);\r\n this.to = this.registerDataInput(\"to\", RichTypeNumber);\r\n\r\n this.onAnimationEnd = this._registerSignalOutput(\"onAnimationEnd\");\r\n this.runningAnimatable = this.registerDataOutput(\"runningAnimatable\", RichTypeAny);\r\n }\r\n\r\n /**\r\n * @internal\r\n * @param context\r\n */\r\n public _preparePendingTasks(context: FlowGraphContext): void {\r\n const targetValue = this.templateTargetComponent.getProperty(context);\r\n const animationValue = this.templateAnimationComponent.getProperty(context);\r\n\r\n if (!targetValue || !animationValue) {\r\n throw new Error(\"Cannot play animation without target or animation\");\r\n }\r\n\r\n const contextAnimatables = (context._getExecutionVariable(this, \"runningAnimatables\") as Animatable[]) ?? [];\r\n\r\n // was an animation started on this target already and was just paused? if so, we can unpause it.\r\n const existingAnimatable = this.runningAnimatable.getValue(context);\r\n if (existingAnimatable && existingAnimatable.paused) {\r\n existingAnimatable.restart();\r\n } else {\r\n const scene = context.configuration.scene;\r\n const animatable = scene.beginDirectAnimation(\r\n targetValue,\r\n [animationValue],\r\n this.from.getValue(context),\r\n this.to.getValue(context),\r\n this.loop.getValue(context),\r\n this.speed.getValue(context),\r\n () => this._onAnimationEnd(animatable, context)\r\n );\r\n this.runningAnimatable.setValue(animatable, context);\r\n contextAnimatables.push(animatable);\r\n }\r\n\r\n context._setExecutionVariable(this, \"runningAnimatables\", contextAnimatables);\r\n }\r\n\r\n public _execute(context: FlowGraphContext): void {\r\n this._startPendingTasks(context);\r\n\r\n this.onDone._activateSignal(context);\r\n }\r\n\r\n private _onAnimationEnd(animatable: Animatable, context: FlowGraphContext) {\r\n const contextAnims = (context._getExecutionVariable(this, \"runningAnimatables\") as Animatable[]) ?? [];\r\n const index = contextAnims.indexOf(animatable);\r\n if (index !== -1) {\r\n contextAnims.splice(index, 1);\r\n }\r\n context._removePendingBlock(this);\r\n this.onAnimationEnd._activateSignal(context);\r\n }\r\n\r\n /**\r\n * @internal\r\n * Stop any currently running animations.\r\n */\r\n public _cancelPendingTasks(context: FlowGraphContext): void {\r\n const contextAnims = (context._getExecutionVariable(this, \"runningAnimatables\") as Animatable[]) ?? [];\r\n for (const anim of contextAnims) {\r\n anim.stop();\r\n }\r\n context._deleteExecutionVariable(this, \"runningAnimatables\");\r\n }\r\n\r\n public getClassName(): string {\r\n return \"FGPlayAnimationBlock\";\r\n }\r\n\r\n public serialize(serializationObject: any = {}) {\r\n super.serialize(serializationObject);\r\n serializationObject.config.targetPath = this.config.targetPath.serialize();\r\n serializationObject.config.animationPath = this.config.animationPath.serialize();\r\n }\r\n}\r\n\r\nRegisterClass(\"FGPlayAnimationBlock\", FlowGraphPlayAnimationBlock);\r\n"]}
|
|
@@ -8,7 +8,7 @@ import { RegisterClass } from "../../../../Misc/typeStore.js";
|
|
|
8
8
|
export class FlowGraphStopAnimationBlock extends FlowGraphWithOnDoneExecutionBlock {
|
|
9
9
|
constructor(config) {
|
|
10
10
|
super(config);
|
|
11
|
-
this.animationToStop = this.
|
|
11
|
+
this.animationToStop = this.registerDataInput("animationToStop", RichTypeAny);
|
|
12
12
|
}
|
|
13
13
|
_execute(context) {
|
|
14
14
|
const animationToStopValue = this.animationToStop.getValue(context);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flowGraphStopAnimationBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FlowGraph/Blocks/Execution/Animation/flowGraphStopAnimationBlock.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iCAAiC,EAAE,MAAM,4CAA4C,CAAC;AAE/F,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAE1D,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D;;;GAGG;AACH,MAAM,OAAO,2BAA4B,SAAQ,iCAAiC;IAM9E,YAAY,MAAqC;QAC7C,KAAK,CAAC,MAAM,CAAC,CAAC;QACd,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"flowGraphStopAnimationBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FlowGraph/Blocks/Execution/Animation/flowGraphStopAnimationBlock.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iCAAiC,EAAE,MAAM,4CAA4C,CAAC;AAE/F,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAE1D,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D;;;GAGG;AACH,MAAM,OAAO,2BAA4B,SAAQ,iCAAiC;IAM9E,YAAY,MAAqC;QAC7C,KAAK,CAAC,MAAM,CAAC,CAAC;QACd,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC,iBAAiB,CAAC,iBAAiB,EAAE,WAAW,CAAC,CAAC;IAClF,CAAC;IAEM,QAAQ,CAAC,OAAyB;QACrC,MAAM,oBAAoB,GAAG,IAAI,CAAC,eAAe,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QACpE,oBAAoB,CAAC,IAAI,EAAE,CAAC;QAC5B,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;IACzC,CAAC;IAEM,YAAY;QACf,OAAO,sBAAsB,CAAC;IAClC,CAAC;CACJ;AACD,aAAa,CAAC,sBAAsB,EAAE,2BAA2B,CAAC,CAAC","sourcesContent":["import type { FlowGraphContext } from \"../../../flowGraphContext\";\r\nimport type { FlowGraphDataConnection } from \"../../../flowGraphDataConnection\";\r\nimport { FlowGraphWithOnDoneExecutionBlock } from \"../../../flowGraphWithOnDoneExecutionBlock\";\r\nimport type { Animatable } from \"../../../../Animations\";\r\nimport { RichTypeAny } from \"../../../flowGraphRichTypes\";\r\nimport type { IFlowGraphBlockConfiguration } from \"../../../flowGraphBlock\";\r\nimport { RegisterClass } from \"../../../../Misc/typeStore\";\r\n/**\r\n * @experimental\r\n * Block that stops a running animation\r\n */\r\nexport class FlowGraphStopAnimationBlock extends FlowGraphWithOnDoneExecutionBlock {\r\n /**\r\n *\r\n */\r\n public readonly animationToStop: FlowGraphDataConnection<Animatable>;\r\n\r\n constructor(config?: IFlowGraphBlockConfiguration) {\r\n super(config);\r\n this.animationToStop = this.registerDataInput(\"animationToStop\", RichTypeAny);\r\n }\r\n\r\n public _execute(context: FlowGraphContext): void {\r\n const animationToStopValue = this.animationToStop.getValue(context);\r\n animationToStopValue.stop();\r\n this.onDone._activateSignal(context);\r\n }\r\n\r\n public getClassName(): string {\r\n return \"FGStopAnimationBlock\";\r\n }\r\n}\r\nRegisterClass(\"FGStopAnimationBlock\", FlowGraphStopAnimationBlock);\r\n"]}
|
|
@@ -9,7 +9,7 @@ import { RegisterClass } from "../../../../Misc/typeStore.js";
|
|
|
9
9
|
export class FlowGraphPlayAudioBlock extends FlowGraphWithOnDoneExecutionBlock {
|
|
10
10
|
constructor(config) {
|
|
11
11
|
super(config);
|
|
12
|
-
this.audio = this.
|
|
12
|
+
this.audio = this.registerDataInput("audio", RichTypeAny);
|
|
13
13
|
}
|
|
14
14
|
_execute(context, _callingSignal) {
|
|
15
15
|
const audioValue = this.audio.getValue(context);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flowGraphPlayAudioBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FlowGraph/Blocks/Execution/Audio/flowGraphPlayAudioBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAGhD,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAE1D,OAAO,EAAE,iCAAiC,EAAE,MAAM,4CAA4C,CAAC;AAE/F,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D;;;GAGG;AACH,MAAM,OAAO,uBAAwB,SAAQ,iCAAiC;IAM1E,YAAY,MAAqC;QAC7C,KAAK,CAAC,MAAM,CAAC,CAAC;QAEd,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"flowGraphPlayAudioBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FlowGraph/Blocks/Execution/Audio/flowGraphPlayAudioBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAGhD,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAE1D,OAAO,EAAE,iCAAiC,EAAE,MAAM,4CAA4C,CAAC;AAE/F,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D;;;GAGG;AACH,MAAM,OAAO,uBAAwB,SAAQ,iCAAiC;IAM1E,YAAY,MAAqC;QAC7C,KAAK,CAAC,MAAM,CAAC,CAAC;QAEd,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,iBAAiB,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;IAC9D,CAAC;IAEM,QAAQ,CAAC,OAAyB,EAAE,cAAyC;QAChF,MAAM,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QAChD,IAAI,UAAU,YAAY,KAAK,EAAE;YAC7B,UAAU,CAAC,IAAI,EAAE,CAAC;SACrB;QACD,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;IACzC,CAAC;IAEM,YAAY;QACf,OAAO,kBAAkB,CAAC;IAC9B,CAAC;CACJ;AACD,aAAa,CAAC,kBAAkB,EAAE,uBAAuB,CAAC,CAAC","sourcesContent":["import { Sound } from \"../../../../Audio/sound\";\r\nimport type { FlowGraphContext } from \"../../../flowGraphContext\";\r\nimport type { FlowGraphDataConnection } from \"../../../flowGraphDataConnection\";\r\nimport { RichTypeAny } 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 plays an audio.\r\n */\r\nexport class FlowGraphPlayAudioBlock extends FlowGraphWithOnDoneExecutionBlock {\r\n /**\r\n * Input connection: The audio to play.\r\n */\r\n public readonly audio: FlowGraphDataConnection<Sound>;\r\n\r\n constructor(config?: IFlowGraphBlockConfiguration) {\r\n super(config);\r\n\r\n this.audio = this.registerDataInput(\"audio\", RichTypeAny);\r\n }\r\n\r\n public _execute(context: FlowGraphContext, _callingSignal: FlowGraphSignalConnection): void {\r\n const audioValue = this.audio.getValue(context);\r\n if (audioValue instanceof Sound) {\r\n audioValue.play();\r\n }\r\n this.onDone._activateSignal(context);\r\n }\r\n\r\n public getClassName(): string {\r\n return \"FGPlayAudioBlock\";\r\n }\r\n}\r\nRegisterClass(\"FGPlayAudioBlock\", FlowGraphPlayAudioBlock);\r\n"]}
|
|
@@ -9,7 +9,7 @@ import { RegisterClass } from "../../../../Misc/typeStore.js";
|
|
|
9
9
|
export class FlowGraphStopAudioBlock extends FlowGraphWithOnDoneExecutionBlock {
|
|
10
10
|
constructor(config) {
|
|
11
11
|
super(config);
|
|
12
|
-
this.audio = this.
|
|
12
|
+
this.audio = this.registerDataInput("audio", RichTypeAny);
|
|
13
13
|
}
|
|
14
14
|
_execute(context, _callingSignal) {
|
|
15
15
|
const audioValue = this.audio.getValue(context);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flowGraphStopAudioBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FlowGraph/Blocks/Execution/Audio/flowGraphStopAudioBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAGhD,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAE1D,OAAO,EAAE,iCAAiC,EAAE,MAAM,4CAA4C,CAAC;AAE/F,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D;;;GAGG;AACH,MAAM,OAAO,uBAAwB,SAAQ,iCAAiC;IAM1E,YAAY,MAAqC;QAC7C,KAAK,CAAC,MAAM,CAAC,CAAC;QAEd,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"flowGraphStopAudioBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FlowGraph/Blocks/Execution/Audio/flowGraphStopAudioBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAGhD,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAE1D,OAAO,EAAE,iCAAiC,EAAE,MAAM,4CAA4C,CAAC;AAE/F,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D;;;GAGG;AACH,MAAM,OAAO,uBAAwB,SAAQ,iCAAiC;IAM1E,YAAY,MAAqC;QAC7C,KAAK,CAAC,MAAM,CAAC,CAAC;QAEd,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,iBAAiB,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;IAC9D,CAAC;IAEM,QAAQ,CAAC,OAAyB,EAAE,cAAyC;QAChF,MAAM,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QAChD,IAAI,UAAU,YAAY,KAAK,EAAE;YAC7B,UAAU,CAAC,IAAI,EAAE,CAAC;SACrB;IACL,CAAC;IAEM,YAAY;QACf,OAAO,kBAAkB,CAAC;IAC9B,CAAC;CACJ;AACD,aAAa,CAAC,kBAAkB,EAAE,uBAAuB,CAAC,CAAC","sourcesContent":["import { Sound } from \"../../../../Audio/sound\";\r\nimport type { FlowGraphContext } from \"../../../flowGraphContext\";\r\nimport type { FlowGraphDataConnection } from \"../../../flowGraphDataConnection\";\r\nimport { RichTypeAny } 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 * Stops an audio.\r\n * @experimental\r\n */\r\nexport class FlowGraphStopAudioBlock extends FlowGraphWithOnDoneExecutionBlock {\r\n /**\r\n * Input connection: The audio to stop.\r\n */\r\n public readonly audio: FlowGraphDataConnection<Sound>;\r\n\r\n constructor(config?: IFlowGraphBlockConfiguration) {\r\n super(config);\r\n\r\n this.audio = this.registerDataInput(\"audio\", RichTypeAny);\r\n }\r\n\r\n public _execute(context: FlowGraphContext, _callingSignal: FlowGraphSignalConnection): void {\r\n const audioValue = this.audio.getValue(context);\r\n if (audioValue instanceof Sound) {\r\n audioValue.stop();\r\n }\r\n }\r\n\r\n public getClassName(): string {\r\n return \"FGStopAudioBlock\";\r\n }\r\n}\r\nRegisterClass(\"FGStopAudioBlock\", FlowGraphStopAudioBlock);\r\n"]}
|
|
@@ -8,7 +8,7 @@ import { RegisterClass } from "../../../../Misc/typeStore.js";
|
|
|
8
8
|
export class FlowGraphBranchBlock extends FlowGraphExecutionBlock {
|
|
9
9
|
constructor(config) {
|
|
10
10
|
super(config);
|
|
11
|
-
this.condition = this.
|
|
11
|
+
this.condition = this.registerDataInput("condition", RichTypeBoolean);
|
|
12
12
|
this.onTrue = this._registerSignalOutput("onTrue");
|
|
13
13
|
this.onFalse = this._registerSignalOutput("onFalse");
|
|
14
14
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flowGraphBranchBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FlowGraph/Blocks/Execution/ControlFlow/flowGraphBranchBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAG9D,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAE3E,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAG3D;;;GAGG;AACH,MAAM,OAAO,oBAAqB,SAAQ,uBAAuB;IAc7D,YAAY,MAAqC;QAC7C,KAAK,CAAC,MAAM,CAAC,CAAC;QAEd,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"flowGraphBranchBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FlowGraph/Blocks/Execution/ControlFlow/flowGraphBranchBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAG9D,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAE3E,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAG3D;;;GAGG;AACH,MAAM,OAAO,oBAAqB,SAAQ,uBAAuB;IAc7D,YAAY,MAAqC;QAC7C,KAAK,CAAC,MAAM,CAAC,CAAC;QAEd,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,iBAAiB,CAAC,WAAW,EAAE,eAAe,CAAC,CAAC;QAEtE,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,qBAAqB,CAAC,QAAQ,CAAC,CAAC;QACnD,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,qBAAqB,CAAC,SAAS,CAAC,CAAC;IACzD,CAAC;IAEM,QAAQ,CAAC,OAAyB;QACrC,IAAI,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE;YAClC,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;SACxC;aAAM;YACH,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;SACzC;IACL,CAAC;IAEM,YAAY;QACf,OAAO,eAAe,CAAC;IAC3B,CAAC;CACJ;AACD,aAAa,CAAC,eAAe,EAAE,oBAAoB,CAAC,CAAC","sourcesContent":["import { RichTypeBoolean } from \"../../../flowGraphRichTypes\";\r\nimport type { FlowGraphContext } from \"../../../flowGraphContext\";\r\nimport type { FlowGraphDataConnection } from \"../../../flowGraphDataConnection\";\r\nimport { FlowGraphExecutionBlock } from \"../../../flowGraphExecutionBlock\";\r\nimport type { FlowGraphSignalConnection } from \"../../../flowGraphSignalConnection\";\r\nimport { RegisterClass } from \"../../../../Misc/typeStore\";\r\nimport type { IFlowGraphBlockConfiguration } from \"../../../flowGraphBlock\";\r\n\r\n/**\r\n * @experimental\r\n * A block that evaluates a condition and executes one of two branches.\r\n */\r\nexport class FlowGraphBranchBlock extends FlowGraphExecutionBlock {\r\n /**\r\n * Input connection: The condition to evaluate.\r\n */\r\n public readonly condition: FlowGraphDataConnection<boolean>;\r\n /**\r\n * Output connection: The branch to execute if the condition is true.\r\n */\r\n public readonly onTrue: FlowGraphSignalConnection;\r\n /**\r\n * Output connection: The branch to execute if the condition is false.\r\n */\r\n public readonly onFalse: FlowGraphSignalConnection;\r\n\r\n constructor(config?: IFlowGraphBlockConfiguration) {\r\n super(config);\r\n\r\n this.condition = this.registerDataInput(\"condition\", RichTypeBoolean);\r\n\r\n this.onTrue = this._registerSignalOutput(\"onTrue\");\r\n this.onFalse = this._registerSignalOutput(\"onFalse\");\r\n }\r\n\r\n public _execute(context: FlowGraphContext): void {\r\n if (this.condition.getValue(context)) {\r\n this.onTrue._activateSignal(context);\r\n } else {\r\n this.onFalse._activateSignal(context);\r\n }\r\n }\r\n\r\n public getClassName(): string {\r\n return \"FGBranchBlock\";\r\n }\r\n}\r\nRegisterClass(\"FGBranchBlock\", FlowGraphBranchBlock);\r\n"]}
|
|
@@ -8,7 +8,7 @@ import { RegisterClass } from "../../../../Misc/typeStore.js";
|
|
|
8
8
|
export class FlowGraphCounterBlock extends FlowGraphWithOnDoneExecutionBlock {
|
|
9
9
|
constructor(config) {
|
|
10
10
|
super(config);
|
|
11
|
-
this.count = this.
|
|
11
|
+
this.count = this.registerDataOutput("count", RichTypeNumber);
|
|
12
12
|
this.reset = this._registerSignalInput("reset");
|
|
13
13
|
}
|
|
14
14
|
_execute(context, callingSignal) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flowGraphCounterBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FlowGraph/Blocks/Execution/ControlFlow/flowGraphCounterBlock.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAE7D,OAAO,EAAE,iCAAiC,EAAE,MAAM,4CAA4C,CAAC;AAC/F,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAE3D;;;GAGG;AACH,MAAM,OAAO,qBAAsB,SAAQ,iCAAiC;IAUxE,YAAY,MAAqC;QAC7C,KAAK,CAAC,MAAM,CAAC,CAAC;QAEd,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"flowGraphCounterBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FlowGraph/Blocks/Execution/ControlFlow/flowGraphCounterBlock.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAE7D,OAAO,EAAE,iCAAiC,EAAE,MAAM,4CAA4C,CAAC;AAC/F,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAE3D;;;GAGG;AACH,MAAM,OAAO,qBAAsB,SAAQ,iCAAiC;IAUxE,YAAY,MAAqC;QAC7C,KAAK,CAAC,MAAM,CAAC,CAAC;QAEd,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,kBAAkB,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC;QAC9D,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAC;IACpD,CAAC;IAEM,QAAQ,CAAC,OAAyB,EAAE,aAAwC;;QAC/E,IAAI,aAAa,KAAK,IAAI,CAAC,KAAK,EAAE;YAC9B,OAAO,CAAC,qBAAqB,CAAC,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC;YAChD,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;YAChC,OAAO;SACV;QACD,MAAM,UAAU,GAAG,CAAC,MAAA,OAAO,CAAC,qBAAqB,CAAC,IAAI,EAAE,OAAO,CAAC,mCAAI,CAAC,CAAC,GAAG,CAAC,CAAC;QAE3E,OAAO,CAAC,qBAAqB,CAAC,IAAI,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;QACzD,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;QACzC,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;IACzC,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 { FlowGraphDataConnection } from \"../../../flowGraphDataConnection\";\r\nimport { RichTypeNumber } from \"../../../flowGraphRichTypes\";\r\nimport type { FlowGraphSignalConnection } from \"../../../flowGraphSignalConnection\";\r\nimport { FlowGraphWithOnDoneExecutionBlock } from \"../../../flowGraphWithOnDoneExecutionBlock\";\r\nimport { RegisterClass } from \"../../../../Misc/typeStore\";\r\nimport type { IFlowGraphBlockConfiguration } from \"../../../flowGraphBlock\";\r\n/**\r\n * @experimental\r\n * A block that counts the number of times it has been called.\r\n */\r\nexport class FlowGraphCounterBlock extends FlowGraphWithOnDoneExecutionBlock {\r\n /**\r\n * Output connection: The number of times the block has been called.\r\n */\r\n public readonly count: FlowGraphDataConnection<number>;\r\n /**\r\n * Input connection: Resets the counter.\r\n */\r\n public readonly reset: FlowGraphSignalConnection;\r\n\r\n constructor(config?: IFlowGraphBlockConfiguration) {\r\n super(config);\r\n\r\n this.count = this.registerDataOutput(\"count\", RichTypeNumber);\r\n this.reset = this._registerSignalInput(\"reset\");\r\n }\r\n\r\n public _execute(context: FlowGraphContext, callingSignal: FlowGraphSignalConnection): void {\r\n if (callingSignal === this.reset) {\r\n context._setExecutionVariable(this, \"count\", 0);\r\n this.count.setValue(0, context);\r\n return;\r\n }\r\n const countValue = (context._getExecutionVariable(this, \"count\") ?? 0) + 1;\r\n\r\n context._setExecutionVariable(this, \"count\", countValue);\r\n this.count.setValue(countValue, context);\r\n this.onDone._activateSignal(context);\r\n }\r\n\r\n public getClassName(): string {\r\n return \"FGCounterBlock\";\r\n }\r\n}\r\nRegisterClass(\"FGCounterBlock\", FlowGraphCounterBlock);\r\n"]}
|
|
@@ -8,9 +8,9 @@ import { RegisterClass } from "../../../../Misc/typeStore.js";
|
|
|
8
8
|
export class FlowGraphDebounceBlock extends FlowGraphWithOnDoneExecutionBlock {
|
|
9
9
|
constructor(config) {
|
|
10
10
|
super(config);
|
|
11
|
-
this.count = this.
|
|
11
|
+
this.count = this.registerDataInput("count", RichTypeNumber);
|
|
12
12
|
this.reset = this._registerSignalInput("reset");
|
|
13
|
-
this.currentCount = this.
|
|
13
|
+
this.currentCount = this.registerDataOutput("currentCount", RichTypeNumber);
|
|
14
14
|
}
|
|
15
15
|
_execute(context, callingSignal) {
|
|
16
16
|
if (callingSignal === this.reset) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flowGraphDebounceBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDebounceBlock.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,uCAA0C;AAEnE,OAAO,EAAE,iCAAiC,EAAE,sDAAyD;AACrG,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAG3D;;;GAGG;AACH,MAAM,OAAO,sBAAuB,SAAQ,iCAAiC;IAczE,YAAY,MAAqC;QAC7C,KAAK,CAAC,MAAM,CAAC,CAAC;QACd,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"flowGraphDebounceBlock.js","sourceRoot":"","sources":["../../../../../../../dev/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AAO,CAAC,qBAAqB,CAAC,IAAI,EAAE,eAAe,EAAE,CAAC,CAAC,CAAC;SAC3D;IACL,CAAC;IAEM,YAAY;QACf,OAAO,iBAAiB,CAAC;IAC7B,CAAC;CACJ;AACD,aAAa,CAAC,iBAAiB,EAAE,sBAAsB,CAAC,CAAC","sourcesContent":["import type { FlowGraphContext } from \"core/FlowGraph/flowGraphContext\";\r\nimport type { FlowGraphDataConnection } from \"core/FlowGraph/flowGraphDataConnection\";\r\nimport { RichTypeNumber } from \"core/FlowGraph/flowGraphRichTypes\";\r\nimport type { FlowGraphSignalConnection } from \"core/FlowGraph/flowGraphSignalConnection\";\r\nimport { FlowGraphWithOnDoneExecutionBlock } from \"core/FlowGraph/flowGraphWithOnDoneExecutionBlock\";\r\nimport { RegisterClass } from \"../../../../Misc/typeStore\";\r\nimport type { IFlowGraphBlockConfiguration } from \"../../../flowGraphBlock\";\r\n\r\n/**\r\n * @experimental\r\n * This block debounces the execution of a input, i.e. ensures that the input is only executed once every X times\r\n */\r\nexport class FlowGraphDebounceBlock extends FlowGraphWithOnDoneExecutionBlock {\r\n /**\r\n * Input: The number of times the input must be executed before the onDone signal is activated\r\n */\r\n public readonly count: FlowGraphDataConnection<number>;\r\n /**\r\n * Input: Resets the debounce counter\r\n */\r\n public readonly reset: FlowGraphSignalConnection;\r\n /**\r\n * Output: The current count of the debounce counter\r\n */\r\n public readonly currentCount: FlowGraphDataConnection<number>;\r\n\r\n constructor(config?: IFlowGraphBlockConfiguration) {\r\n super(config);\r\n this.count = this.registerDataInput(\"count\", RichTypeNumber);\r\n this.reset = this._registerSignalInput(\"reset\");\r\n this.currentCount = this.registerDataOutput(\"currentCount\", RichTypeNumber);\r\n }\r\n\r\n public _execute(context: FlowGraphContext, callingSignal: FlowGraphSignalConnection): void {\r\n if (callingSignal === this.reset) {\r\n context._setExecutionVariable(this, \"debounceCount\", 0);\r\n return;\r\n }\r\n const count = this.count.getValue(context);\r\n const currentCount = context._getExecutionVariable(this, \"debounceCount\", 0);\r\n const newCount = currentCount + 1;\r\n\r\n this.currentCount.setValue(newCount, context);\r\n context._setExecutionVariable(this, \"debounceCount\", newCount);\r\n if (newCount >= count) {\r\n this.onDone._activateSignal(context);\r\n context._setExecutionVariable(this, \"debounceCount\", 0);\r\n }\r\n }\r\n\r\n public getClassName(): string {\r\n return \"FGDebounceBlock\";\r\n }\r\n}\r\nRegisterClass(\"FGDebounceBlock\", FlowGraphDebounceBlock);\r\n"]}
|
|
@@ -9,8 +9,8 @@ export class FlowGraphDoNBlock extends FlowGraphWithOnDoneExecutionBlock {
|
|
|
9
9
|
constructor(config) {
|
|
10
10
|
super(config);
|
|
11
11
|
this.reset = this._registerSignalInput("reset");
|
|
12
|
-
this.maxNumberOfExecutions = this.
|
|
13
|
-
this.currentCount = this.
|
|
12
|
+
this.maxNumberOfExecutions = this.registerDataInput("numberOfExecutions", RichTypeNumber);
|
|
13
|
+
this.currentCount = this.registerDataOutput("currentCount", RichTypeNumber);
|
|
14
14
|
}
|
|
15
15
|
_execute(context, callingSignal) {
|
|
16
16
|
if (callingSignal === this.reset) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flowGraphDoNBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDoNBlock.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAE7D,OAAO,EAAE,iCAAiC,EAAE,MAAM,4CAA4C,CAAC;AAC/F,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAG3D;;;GAGG;AACH,MAAM,OAAO,iBAAkB,SAAQ,iCAAiC;IAcpE,YAAY,MAAqC;QAC7C,KAAK,CAAC,MAAM,CAAC,CAAC;QACd,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAC;QAChD,IAAI,CAAC,qBAAqB,GAAG,IAAI,CAAC,
|
|
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;AACD,aAAa,CAAC,YAAY,EAAE,iBAAiB,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 { RegisterClass } from \"../../../../Misc/typeStore\";\r\nimport type { IFlowGraphBlockConfiguration } from \"../../../flowGraphBlock\";\r\n\r\n/**\r\n * A block that executes a branch a set number of times.\r\n * @experimental\r\n */\r\nexport class FlowGraphDoNBlock extends FlowGraphWithOnDoneExecutionBlock {\r\n /**\r\n * Input connection: Resets the counter\r\n */\r\n public readonly reset: FlowGraphSignalConnection;\r\n /**\r\n * Input connection: The maximum number of times the block can be executed.\r\n */\r\n public readonly maxNumberOfExecutions: FlowGraphDataConnection<number>;\r\n /**\r\n * Output connection: The number of times the block has been executed.\r\n */\r\n public readonly currentCount: FlowGraphDataConnection<number>;\r\n\r\n constructor(config?: IFlowGraphBlockConfiguration) {\r\n super(config);\r\n this.reset = this._registerSignalInput(\"reset\");\r\n this.maxNumberOfExecutions = this.registerDataInput(\"numberOfExecutions\", RichTypeNumber);\r\n this.currentCount = this.registerDataOutput(\"currentCount\", RichTypeNumber);\r\n }\r\n\r\n public _execute(context: FlowGraphContext, callingSignal: FlowGraphSignalConnection): void {\r\n if (callingSignal === this.reset) {\r\n this.currentCount.setValue(0, context);\r\n } else {\r\n const currentCountValue = this.currentCount.getValue(context);\r\n if (currentCountValue < this.maxNumberOfExecutions.getValue(context)) {\r\n this.currentCount.setValue(currentCountValue + 1, context);\r\n this.onDone._activateSignal(context);\r\n }\r\n }\r\n }\r\n\r\n public getClassName(): string {\r\n return \"FGDoNBlock\";\r\n }\r\n}\r\nRegisterClass(\"FGDoNBlock\", FlowGraphDoNBlock);\r\n"]}
|
|
@@ -10,7 +10,7 @@ export class FlowGraphFlipFlopBlock extends FlowGraphExecutionBlock {
|
|
|
10
10
|
super(config);
|
|
11
11
|
this.onOn = this._registerSignalOutput("onOn");
|
|
12
12
|
this.onOff = this._registerSignalOutput("onOff");
|
|
13
|
-
this.isOn = this.
|
|
13
|
+
this.isOn = this.registerDataOutput("isOn", RichTypeBoolean);
|
|
14
14
|
}
|
|
15
15
|
_execute(context, _callingSignal) {
|
|
16
16
|
let value = context._getExecutionVariable(this, "value", false);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flowGraphFlipFlopBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FlowGraph/Blocks/Execution/ControlFlow/flowGraphFlipFlopBlock.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,uBAAuB,EAAE,4CAA+C;AACjF,OAAO,EAAE,eAAe,EAAE,uCAA0C;AAEpE,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAG3D;;;GAGG;AACH,MAAM,OAAO,sBAAuB,SAAQ,uBAAuB;IAc/D,YAAY,MAAqC;QAC7C,KAAK,CAAC,MAAM,CAAC,CAAC;QAEd,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,qBAAqB,CAAC,MAAM,CAAC,CAAC;QAC/C,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,qBAAqB,CAAC,OAAO,CAAC,CAAC;QACjD,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"flowGraphFlipFlopBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FlowGraph/Blocks/Execution/ControlFlow/flowGraphFlipFlopBlock.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,uBAAuB,EAAE,4CAA+C;AACjF,OAAO,EAAE,eAAe,EAAE,uCAA0C;AAEpE,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAG3D;;;GAGG;AACH,MAAM,OAAO,sBAAuB,SAAQ,uBAAuB;IAc/D,YAAY,MAAqC;QAC7C,KAAK,CAAC,MAAM,CAAC,CAAC;QAEd,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,qBAAqB,CAAC,MAAM,CAAC,CAAC;QAC/C,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,qBAAqB,CAAC,OAAO,CAAC,CAAC;QACjD,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,kBAAkB,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;IACjE,CAAC;IAEM,QAAQ,CAAC,OAAyB,EAAE,cAAyC;QAChF,IAAI,KAAK,GAAG,OAAO,CAAC,qBAAqB,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;QAEhE,KAAK,GAAG,CAAC,KAAK,CAAC;QACf,OAAO,CAAC,qBAAqB,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;QACpD,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;QACnC,IAAI,KAAK,EAAE;YACP,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;SACtC;aAAM;YACH,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;SACvC;IACL,CAAC;IAEM,YAAY;QACf,OAAO,iBAAiB,CAAC;IAC7B,CAAC;CACJ;AACD,aAAa,CAAC,iBAAiB,EAAE,sBAAsB,CAAC,CAAC","sourcesContent":["import type { FlowGraphContext } from \"core/FlowGraph/flowGraphContext\";\r\nimport type { FlowGraphDataConnection } from \"core/FlowGraph/flowGraphDataConnection\";\r\nimport { FlowGraphExecutionBlock } from \"core/FlowGraph/flowGraphExecutionBlock\";\r\nimport { RichTypeBoolean } from \"core/FlowGraph/flowGraphRichTypes\";\r\nimport type { FlowGraphSignalConnection } from \"core/FlowGraph/flowGraphSignalConnection\";\r\nimport { RegisterClass } from \"../../../../Misc/typeStore\";\r\nimport type { IFlowGraphBlockConfiguration } from \"../../../flowGraphBlock\";\r\n\r\n/**\r\n * @experimental\r\n * This block flip flops between two outputs.\r\n */\r\nexport class FlowGraphFlipFlopBlock extends FlowGraphExecutionBlock {\r\n /**\r\n * Output connection: The signal to execute when the variable is on.\r\n */\r\n public readonly onOn: FlowGraphSignalConnection;\r\n /**\r\n * Output connection: The signal to execute when the variable is off.\r\n */\r\n public readonly onOff: FlowGraphSignalConnection;\r\n /**\r\n * Output connection: If the variable is on.\r\n */\r\n public readonly isOn: FlowGraphDataConnection<boolean>;\r\n\r\n constructor(config?: IFlowGraphBlockConfiguration) {\r\n super(config);\r\n\r\n this.onOn = this._registerSignalOutput(\"onOn\");\r\n this.onOff = this._registerSignalOutput(\"onOff\");\r\n this.isOn = this.registerDataOutput(\"isOn\", RichTypeBoolean);\r\n }\r\n\r\n public _execute(context: FlowGraphContext, _callingSignal: FlowGraphSignalConnection): void {\r\n let value = context._getExecutionVariable(this, \"value\", false);\r\n\r\n value = !value;\r\n context._setExecutionVariable(this, \"value\", value);\r\n this.isOn.setValue(value, context);\r\n if (value) {\r\n this.onOn._activateSignal(context);\r\n } else {\r\n this.onOff._activateSignal(context);\r\n }\r\n }\r\n\r\n public getClassName(): string {\r\n return \"FGFlipFlopBlock\";\r\n }\r\n}\r\nRegisterClass(\"FGFlipFlopBlock\", FlowGraphFlipFlopBlock);\r\n"]}
|
|
@@ -8,10 +8,10 @@ import { RegisterClass } from "../../../../Misc/typeStore.js";
|
|
|
8
8
|
export class FlowGraphForLoopBlock extends FlowGraphWithOnDoneExecutionBlock {
|
|
9
9
|
constructor(config) {
|
|
10
10
|
super(config);
|
|
11
|
-
this.startIndex = this.
|
|
12
|
-
this.endIndex = this.
|
|
13
|
-
this.step = this.
|
|
14
|
-
this.index = this.
|
|
11
|
+
this.startIndex = this.registerDataInput("startIndex", RichTypeNumber);
|
|
12
|
+
this.endIndex = this.registerDataInput("endIndex", RichTypeNumber);
|
|
13
|
+
this.step = this.registerDataInput("step", RichTypeNumber);
|
|
14
|
+
this.index = this.registerDataOutput("index", RichTypeNumber);
|
|
15
15
|
this.onLoop = this._registerSignalOutput("onLoop");
|
|
16
16
|
this.onDone = this._registerSignalOutput("onDone");
|
|
17
17
|
}
|
|
@@ -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;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,IAAI,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,IAAI,CAAC,iBAAiB,CAAC,YAAY,EAAE,cAAc,CAAC,CAAC;QACvE,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,iBAAiB,CAAC,UAAU,EAAE,cAAc,CAAC,CAAC;QACnE,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC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,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"]}
|
|
@@ -51,4 +51,5 @@ export declare class FlowGraphMultiGateBlock extends FlowGraphExecutionBlock {
|
|
|
51
51
|
private _getNextOutput;
|
|
52
52
|
_execute(context: FlowGraphContext, callingSignal: FlowGraphSignalConnection): void;
|
|
53
53
|
getClassName(): string;
|
|
54
|
+
serialize(serializationObject?: any): void;
|
|
54
55
|
}
|
|
@@ -12,7 +12,7 @@ export class FlowGraphMultiGateBlock extends FlowGraphExecutionBlock {
|
|
|
12
12
|
this.config = config;
|
|
13
13
|
this._cachedUnusedIndexes = [];
|
|
14
14
|
this.reset = this._registerSignalInput("reset");
|
|
15
|
-
this.currentIndex = this.
|
|
15
|
+
this.currentIndex = this.registerDataOutput("currentIndex", RichTypeNumber);
|
|
16
16
|
}
|
|
17
17
|
configure() {
|
|
18
18
|
super.configure();
|
|
@@ -78,6 +78,13 @@ export class FlowGraphMultiGateBlock extends FlowGraphExecutionBlock {
|
|
|
78
78
|
getClassName() {
|
|
79
79
|
return "FGMultiGateBlock";
|
|
80
80
|
}
|
|
81
|
+
serialize(serializationObject) {
|
|
82
|
+
super.serialize(serializationObject);
|
|
83
|
+
serializationObject.config.numberOutputFlows = this.config.numberOutputFlows;
|
|
84
|
+
serializationObject.config.isRandom = this.config.isRandom;
|
|
85
|
+
serializationObject.config.loop = this.config.loop;
|
|
86
|
+
serializationObject.config.startIndex = this.config.startIndex;
|
|
87
|
+
}
|
|
81
88
|
}
|
|
82
89
|
RegisterClass("FGMultiGateBlock", FlowGraphMultiGateBlock);
|
|
83
90
|
//# 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,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,yBAAoB,GAAa,EAAE,CAAC;QAIxC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAC;QAChD,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,
|
|
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,yBAAoB,GAAa,EAAE,CAAC;QAIxC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAC;QAChD,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,kBAAkB,CAAC,cAAc,EAAE,cAAc,CAAC,CAAC;IAChF,CAAC;IAEM,SAAS;QACZ,KAAK,CAAC,SAAS,EAAE,CAAC;QAClB,IAAI,CAAC,MAAM,CAAC,UAAU,GAAG,IAAI,CAAC,MAAM,CAAC,UAAU,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;QAC3F,IAAI,CAAC,MAAM,CAAC,UAAU,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,UAAW,EAAE,IAAI,CAAC,MAAM,CAAC,iBAAiB,GAAG,CAAC,CAAC,CAAC,CAAC;QAC3G,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAC;QACn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AAC,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;IAEM,SAAS,CAAC,mBAAyB;QACtC,KAAK,CAAC,SAAS,CAAC,mBAAmB,CAAC,CAAC;QACrC,mBAAmB,CAAC,MAAM,CAAC,iBAAiB,GAAG,IAAI,CAAC,MAAM,CAAC,iBAAiB,CAAC;QAC7E,mBAAmB,CAAC,MAAM,CAAC,QAAQ,GAAG,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC;QAC3D,mBAAmB,CAAC,MAAM,CAAC,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;QACnD,mBAAmB,CAAC,MAAM,CAAC,UAAU,GAAG,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC;IACnE,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\n public serialize(serializationObject?: any): void {\r\n super.serialize(serializationObject);\r\n serializationObject.config.numberOutputFlows = this.config.numberOutputFlows;\r\n serializationObject.config.isRandom = this.config.isRandom;\r\n serializationObject.config.loop = this.config.loop;\r\n serializationObject.config.startIndex = this.config.startIndex;\r\n }\r\n}\r\nRegisterClass(\"FGMultiGateBlock\", FlowGraphMultiGateBlock);\r\n"]}
|
|
@@ -31,4 +31,5 @@ export declare class FlowGraphSwitchBlock<T> extends FlowGraphExecutionBlock {
|
|
|
31
31
|
configure(): void;
|
|
32
32
|
_execute(context: FlowGraphContext, _callingSignal: FlowGraphSignalConnection): void;
|
|
33
33
|
getClassName(): string;
|
|
34
|
+
serialize(serializationObject?: any): void;
|
|
34
35
|
}
|
|
@@ -9,7 +9,7 @@ export class FlowGraphSwitchBlock extends FlowGraphExecutionBlock {
|
|
|
9
9
|
constructor(config) {
|
|
10
10
|
super(config);
|
|
11
11
|
this.config = config;
|
|
12
|
-
this.selection = this.
|
|
12
|
+
this.selection = this.registerDataInput("selection", RichTypeAny);
|
|
13
13
|
}
|
|
14
14
|
configure() {
|
|
15
15
|
super.configure();
|
|
@@ -32,6 +32,10 @@ export class FlowGraphSwitchBlock extends FlowGraphExecutionBlock {
|
|
|
32
32
|
getClassName() {
|
|
33
33
|
return "FGSwitchBlock";
|
|
34
34
|
}
|
|
35
|
+
serialize(serializationObject) {
|
|
36
|
+
super.serialize(serializationObject);
|
|
37
|
+
serializationObject.cases = this.config.cases;
|
|
38
|
+
}
|
|
35
39
|
}
|
|
36
40
|
RegisterClass("FGSwitchBlock", FlowGraphSwitchBlock);
|
|
37
41
|
//# 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;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,C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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;IAEM,SAAS,CAAC,mBAAyB;QACtC,KAAK,CAAC,SAAS,CAAC,mBAAmB,CAAC,CAAC;QACrC,mBAAmB,CAAC,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC;IAClD,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\n public serialize(serializationObject?: any): void {\r\n super.serialize(serializationObject);\r\n serializationObject.cases = this.config.cases;\r\n }\r\n}\r\nRegisterClass(\"FGSwitchBlock\", FlowGraphSwitchBlock);\r\n"]}
|
|
@@ -9,8 +9,8 @@ export class FlowGraphThrottleBlock extends FlowGraphWithOnDoneExecutionBlock {
|
|
|
9
9
|
constructor(config) {
|
|
10
10
|
super(config);
|
|
11
11
|
this.reset = this._registerSignalInput("reset");
|
|
12
|
-
this.duration = this.
|
|
13
|
-
this.timeRemaining = this.
|
|
12
|
+
this.duration = this.registerDataInput("duration", RichTypeNumber);
|
|
13
|
+
this.timeRemaining = this.registerDataOutput("timeRemaining", RichTypeNumber);
|
|
14
14
|
}
|
|
15
15
|
_execute(context, callingSignal) {
|
|
16
16
|
const lastExecutedTime = context._getExecutionVariable(this, "lastExecutedTime");
|
|
@@ -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,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,
|
|
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,iBAAiB,CAAC,UAAU,EAAE,cAAc,CAAC,CAAC;QACnE,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,kBAAkB,CAAC,eAAe,EAAE,cAAc,CAAC,CAAC;IAClF,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"]}
|
|
@@ -11,7 +11,7 @@ import { RegisterClass } from "../../../../Misc/typeStore.js";
|
|
|
11
11
|
export class FlowGraphTimerBlock extends FlowGraphAsyncExecutionBlock {
|
|
12
12
|
constructor(config) {
|
|
13
13
|
super(config);
|
|
14
|
-
this.timeout = this.
|
|
14
|
+
this.timeout = this.registerDataInput("timeout", RichTypeNumber);
|
|
15
15
|
this.onTimerDone = this._registerSignalOutput("onTimerDone");
|
|
16
16
|
}
|
|
17
17
|
_preparePendingTasks(context) {
|
|
@@ -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,w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,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"]}
|
|
@@ -32,4 +32,5 @@ export declare class FlowGraphWaitAllBlock extends FlowGraphWithOnDoneExecutionB
|
|
|
32
32
|
private _getCurrentActivationState;
|
|
33
33
|
_execute(context: FlowGraphContext, callingSignal: FlowGraphSignalConnection): void;
|
|
34
34
|
getClassName(): string;
|
|
35
|
+
serialize(serializationObject?: any): void;
|
|
35
36
|
}
|
|
@@ -64,6 +64,10 @@ export class FlowGraphWaitAllBlock extends FlowGraphWithOnDoneExecutionBlock {
|
|
|
64
64
|
getClassName() {
|
|
65
65
|
return "FGWaitAllBlock";
|
|
66
66
|
}
|
|
67
|
+
serialize(serializationObject) {
|
|
68
|
+
super.serialize(serializationObject);
|
|
69
|
+
serializationObject.config.numberInputFlows = this.config.numberInputFlows;
|
|
70
|
+
}
|
|
67
71
|
}
|
|
68
72
|
RegisterClass("FGWaitAllBlock", FlowGraphWaitAllBlock);
|
|
69
73
|
//# sourceMappingURL=flowGraphWaitAllBlock.js.map
|