@babylonjs/core 6.19.0 → 6.20.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.
Files changed (253) hide show
  1. package/Actions/actionManager.js +2 -2
  2. package/Actions/actionManager.js.map +1 -1
  3. package/Animations/runtimeAnimation.js +2 -2
  4. package/Animations/runtimeAnimation.js.map +1 -1
  5. package/Cameras/Inputs/BaseCameraPointersInput.d.ts +4 -4
  6. package/Cameras/Inputs/BaseCameraPointersInput.js +4 -6
  7. package/Cameras/Inputs/BaseCameraPointersInput.js.map +1 -1
  8. package/Cameras/Inputs/arcRotateCameraPointersInput.d.ts +3 -2
  9. package/Cameras/Inputs/arcRotateCameraPointersInput.js +3 -2
  10. package/Cameras/Inputs/arcRotateCameraPointersInput.js.map +1 -1
  11. package/Cameras/Inputs/flyCameraMouseInput.js +2 -7
  12. package/Cameras/Inputs/flyCameraMouseInput.js.map +1 -1
  13. package/Cameras/Inputs/freeCameraKeyboardMoveInput.js +2 -7
  14. package/Cameras/Inputs/freeCameraKeyboardMoveInput.js.map +1 -1
  15. package/Cameras/Inputs/freeCameraMouseInput.js +4 -14
  16. package/Cameras/Inputs/freeCameraMouseInput.js.map +1 -1
  17. package/Cameras/Inputs/freeCameraTouchInput.js +2 -1
  18. package/Cameras/Inputs/freeCameraTouchInput.js.map +1 -1
  19. package/Cameras/arcRotateCamera.js +2 -7
  20. package/Cameras/arcRotateCamera.js.map +1 -1
  21. package/Cameras/camera.d.ts +2 -0
  22. package/Cameras/camera.js +8 -0
  23. package/Cameras/camera.js.map +1 -1
  24. package/Compute/computeShader.d.ts +15 -0
  25. package/Compute/computeShader.js +39 -0
  26. package/Compute/computeShader.js.map +1 -1
  27. package/Debug/physicsViewer.d.ts +33 -0
  28. package/Debug/physicsViewer.js +205 -0
  29. package/Debug/physicsViewer.js.map +1 -1
  30. package/Engines/Extensions/engine.computeShader.d.ts +2 -1
  31. package/Engines/Extensions/engine.computeShader.js +1 -0
  32. package/Engines/Extensions/engine.computeShader.js.map +1 -1
  33. package/Engines/WebGPU/webgpuComputeContext.js +15 -0
  34. package/Engines/WebGPU/webgpuComputeContext.js.map +1 -1
  35. package/Engines/thinEngine.js +2 -2
  36. package/Engines/thinEngine.js.map +1 -1
  37. package/FlowGraph/Blocks/Data/flowGraphAddBlock.d.ts +23 -0
  38. package/FlowGraph/Blocks/Data/flowGraphAddBlock.js +18 -0
  39. package/FlowGraph/Blocks/Data/flowGraphAddBlock.js.map +1 -0
  40. package/FlowGraph/Blocks/Data/flowGraphConditionalDataBlock.d.ts +30 -0
  41. package/FlowGraph/Blocks/Data/flowGraphConditionalDataBlock.js +22 -0
  42. package/FlowGraph/Blocks/Data/flowGraphConditionalDataBlock.js.map +1 -0
  43. package/FlowGraph/Blocks/Data/flowGraphGetVariableBlock.d.ts +33 -0
  44. package/FlowGraph/Blocks/Data/flowGraphGetVariableBlock.js +30 -0
  45. package/FlowGraph/Blocks/Data/flowGraphGetVariableBlock.js.map +1 -0
  46. package/FlowGraph/Blocks/Data/index.d.ts +3 -1
  47. package/FlowGraph/Blocks/Data/index.js +3 -1
  48. package/FlowGraph/Blocks/Data/index.js.map +1 -1
  49. package/FlowGraph/Blocks/Event/flowGraphMeshPickEventBlock.d.ts +12 -10
  50. package/FlowGraph/Blocks/Event/flowGraphMeshPickEventBlock.js +25 -29
  51. package/FlowGraph/Blocks/Event/flowGraphMeshPickEventBlock.js.map +1 -1
  52. package/FlowGraph/Blocks/Event/flowGraphReceiveCustomEventBlock.d.ts +25 -0
  53. package/FlowGraph/Blocks/Event/flowGraphReceiveCustomEventBlock.js +31 -0
  54. package/FlowGraph/Blocks/Event/flowGraphReceiveCustomEventBlock.js.map +1 -0
  55. package/FlowGraph/Blocks/Event/flowGraphSceneReadyEventBlock.d.ts +3 -7
  56. package/FlowGraph/Blocks/Event/flowGraphSceneReadyEventBlock.js +11 -11
  57. package/FlowGraph/Blocks/Event/flowGraphSceneReadyEventBlock.js.map +1 -1
  58. package/FlowGraph/Blocks/Event/index.d.ts +1 -0
  59. package/FlowGraph/Blocks/Event/index.js +1 -0
  60. package/FlowGraph/Blocks/Event/index.js.map +1 -1
  61. package/FlowGraph/Blocks/Execution/flowGraphConditionalBlock.d.ts +24 -0
  62. package/FlowGraph/Blocks/Execution/flowGraphConditionalBlock.js +23 -0
  63. package/FlowGraph/Blocks/Execution/flowGraphConditionalBlock.js.map +1 -0
  64. package/FlowGraph/Blocks/Execution/flowGraphForLoopBlock.d.ts +10 -13
  65. package/FlowGraph/Blocks/Execution/flowGraphForLoopBlock.js +28 -22
  66. package/FlowGraph/Blocks/Execution/flowGraphForLoopBlock.js.map +1 -1
  67. package/FlowGraph/Blocks/Execution/flowGraphLogBlock.d.ts +5 -5
  68. package/FlowGraph/Blocks/Execution/flowGraphLogBlock.js +8 -6
  69. package/FlowGraph/Blocks/Execution/flowGraphLogBlock.js.map +1 -1
  70. package/FlowGraph/Blocks/Execution/flowGraphPlayAnimationBlock.d.ts +56 -0
  71. package/FlowGraph/Blocks/Execution/flowGraphPlayAnimationBlock.js +66 -0
  72. package/FlowGraph/Blocks/Execution/flowGraphPlayAnimationBlock.js.map +1 -0
  73. package/FlowGraph/Blocks/Execution/flowGraphSendCustomEventBlock.d.ts +18 -0
  74. package/FlowGraph/Blocks/Execution/flowGraphSendCustomEventBlock.js +19 -0
  75. package/FlowGraph/Blocks/Execution/flowGraphSendCustomEventBlock.js.map +1 -0
  76. package/FlowGraph/Blocks/Execution/flowGraphSetPropertyBlock.d.ts +26 -0
  77. package/FlowGraph/Blocks/Execution/flowGraphSetPropertyBlock.js +36 -0
  78. package/FlowGraph/Blocks/Execution/flowGraphSetPropertyBlock.js.map +1 -0
  79. package/FlowGraph/Blocks/Execution/flowGraphSetVariableBlock.d.ts +23 -0
  80. package/FlowGraph/Blocks/Execution/flowGraphSetVariableBlock.js +25 -0
  81. package/FlowGraph/Blocks/Execution/flowGraphSetVariableBlock.js.map +1 -0
  82. package/FlowGraph/Blocks/Execution/flowGraphStopAnimationBlock.d.ts +16 -0
  83. package/FlowGraph/Blocks/Execution/flowGraphStopAnimationBlock.js +18 -0
  84. package/FlowGraph/Blocks/Execution/flowGraphStopAnimationBlock.js.map +1 -0
  85. package/FlowGraph/Blocks/Execution/flowGraphTimerBlock.d.ts +32 -0
  86. package/FlowGraph/Blocks/Execution/flowGraphTimerBlock.js +62 -0
  87. package/FlowGraph/Blocks/Execution/flowGraphTimerBlock.js.map +1 -0
  88. package/FlowGraph/Blocks/Execution/index.d.ts +7 -0
  89. package/FlowGraph/Blocks/Execution/index.js +7 -0
  90. package/FlowGraph/Blocks/Execution/index.js.map +1 -1
  91. package/FlowGraph/flowGraph.d.ts +42 -12
  92. package/FlowGraph/flowGraph.js +37 -23
  93. package/FlowGraph/flowGraph.js.map +1 -1
  94. package/FlowGraph/flowGraphAsyncExecutionBlock.d.ts +29 -0
  95. package/FlowGraph/flowGraphAsyncExecutionBlock.js +21 -0
  96. package/FlowGraph/flowGraphAsyncExecutionBlock.js.map +1 -0
  97. package/FlowGraph/flowGraphBlock.d.ts +9 -11
  98. package/FlowGraph/flowGraphBlock.js +12 -8
  99. package/FlowGraph/flowGraphBlock.js.map +1 -1
  100. package/FlowGraph/flowGraphConnection.d.ts +17 -7
  101. package/FlowGraph/flowGraphConnection.js +26 -9
  102. package/FlowGraph/flowGraphConnection.js.map +1 -1
  103. package/FlowGraph/flowGraphContext.d.ts +102 -0
  104. package/FlowGraph/flowGraphContext.js +111 -0
  105. package/FlowGraph/flowGraphContext.js.map +1 -0
  106. package/FlowGraph/flowGraphCustomEvent.d.ts +5 -0
  107. package/FlowGraph/flowGraphCustomEvent.js +2 -0
  108. package/FlowGraph/flowGraphCustomEvent.js.map +1 -0
  109. package/FlowGraph/flowGraphDataConnection.d.ts +10 -2
  110. package/FlowGraph/flowGraphDataConnection.js +16 -8
  111. package/FlowGraph/flowGraphDataConnection.js.map +1 -1
  112. package/FlowGraph/flowGraphEventBlock.d.ts +5 -12
  113. package/FlowGraph/flowGraphEventBlock.js +5 -5
  114. package/FlowGraph/flowGraphEventBlock.js.map +1 -1
  115. package/FlowGraph/flowGraphEventCoordinator.d.ts +23 -0
  116. package/FlowGraph/flowGraphEventCoordinator.js +37 -0
  117. package/FlowGraph/flowGraphEventCoordinator.js.map +1 -0
  118. package/FlowGraph/flowGraphExecutionBlock.d.ts +5 -5
  119. package/FlowGraph/flowGraphExecutionBlock.js +3 -3
  120. package/FlowGraph/flowGraphExecutionBlock.js.map +1 -1
  121. package/FlowGraph/flowGraphRichTypes.d.ts +28 -0
  122. package/FlowGraph/flowGraphRichTypes.js +43 -0
  123. package/FlowGraph/flowGraphRichTypes.js.map +1 -0
  124. package/FlowGraph/flowGraphSignalConnection.d.ts +7 -1
  125. package/FlowGraph/flowGraphSignalConnection.js +11 -4
  126. package/FlowGraph/flowGraphSignalConnection.js.map +1 -1
  127. package/FlowGraph/flowGraphVariableDefinitions.d.ts +12 -0
  128. package/FlowGraph/flowGraphVariableDefinitions.js +22 -0
  129. package/FlowGraph/flowGraphVariableDefinitions.js.map +1 -0
  130. package/FlowGraph/flowGraphWithOnDoneExecutionBlock.d.ts +10 -2
  131. package/FlowGraph/flowGraphWithOnDoneExecutionBlock.js +8 -2
  132. package/FlowGraph/flowGraphWithOnDoneExecutionBlock.js.map +1 -1
  133. package/FlowGraph/index.d.ts +3 -0
  134. package/FlowGraph/index.js +3 -0
  135. package/FlowGraph/index.js.map +1 -1
  136. package/Materials/Node/nodeMaterial.d.ts +2 -1
  137. package/Materials/Node/nodeMaterial.js +26 -2
  138. package/Materials/Node/nodeMaterial.js.map +1 -1
  139. package/Materials/PBR/pbrBaseMaterial.d.ts +1 -0
  140. package/Materials/PBR/pbrBaseMaterial.js +1 -0
  141. package/Materials/PBR/pbrBaseMaterial.js.map +1 -1
  142. package/Materials/Textures/videoTexture.d.ts +5 -0
  143. package/Materials/Textures/videoTexture.js +6 -0
  144. package/Materials/Textures/videoTexture.js.map +1 -1
  145. package/Materials/materialHelper.js +1 -0
  146. package/Materials/materialHelper.js.map +1 -1
  147. package/Materials/standardMaterial.d.ts +1 -0
  148. package/Materials/standardMaterial.js +1 -0
  149. package/Materials/standardMaterial.js.map +1 -1
  150. package/Materials/uniformBuffer.d.ts +7 -0
  151. package/Materials/uniformBuffer.js +8 -0
  152. package/Materials/uniformBuffer.js.map +1 -1
  153. package/Maths/math.vector.d.ts +5 -0
  154. package/Maths/math.vector.js +7 -0
  155. package/Maths/math.vector.js.map +1 -1
  156. package/Meshes/Node/Blocks/Instances/instantiateBlock.d.ts +11 -5
  157. package/Meshes/Node/Blocks/Instances/instantiateBlock.js +20 -10
  158. package/Meshes/Node/Blocks/Instances/instantiateBlock.js.map +1 -1
  159. package/Meshes/Node/Blocks/Instances/instantiateOnFacesBlock.d.ts +15 -9
  160. package/Meshes/Node/Blocks/Instances/instantiateOnFacesBlock.js +20 -11
  161. package/Meshes/Node/Blocks/Instances/instantiateOnFacesBlock.js.map +1 -1
  162. package/Meshes/Node/Blocks/Instances/instantiateOnVerticesBlock.d.ts +15 -9
  163. package/Meshes/Node/Blocks/Instances/instantiateOnVerticesBlock.js +20 -11
  164. package/Meshes/Node/Blocks/Instances/instantiateOnVerticesBlock.js.map +1 -1
  165. package/Meshes/Node/Blocks/Instances/instantiateOnVolumeBlock.d.ts +15 -9
  166. package/Meshes/Node/Blocks/Instances/instantiateOnVolumeBlock.js +20 -11
  167. package/Meshes/Node/Blocks/Instances/instantiateOnVolumeBlock.js.map +1 -1
  168. package/Meshes/Node/Blocks/Set/setColorsBlock.d.ts +12 -0
  169. package/Meshes/Node/Blocks/Set/setColorsBlock.js +62 -27
  170. package/Meshes/Node/Blocks/Set/setColorsBlock.js.map +1 -1
  171. package/Meshes/Node/Blocks/Set/setMaterialIDBlock.d.ts +7 -0
  172. package/Meshes/Node/Blocks/Set/setMaterialIDBlock.js +19 -0
  173. package/Meshes/Node/Blocks/Set/setMaterialIDBlock.js.map +1 -1
  174. package/Meshes/Node/Blocks/Set/setNormalsBlock.d.ts +12 -0
  175. package/Meshes/Node/Blocks/Set/setNormalsBlock.js +62 -27
  176. package/Meshes/Node/Blocks/Set/setNormalsBlock.js.map +1 -1
  177. package/Meshes/Node/Blocks/Set/setPositionsBlock.d.ts +12 -0
  178. package/Meshes/Node/Blocks/Set/setPositionsBlock.js +54 -19
  179. package/Meshes/Node/Blocks/Set/setPositionsBlock.js.map +1 -1
  180. package/Meshes/Node/Blocks/Set/setTangentsBlock.d.ts +12 -0
  181. package/Meshes/Node/Blocks/Set/setTangentsBlock.js +62 -27
  182. package/Meshes/Node/Blocks/Set/setTangentsBlock.js.map +1 -1
  183. package/Meshes/Node/Blocks/Set/setUVsBlock.d.ts +5 -0
  184. package/Meshes/Node/Blocks/Set/setUVsBlock.js +65 -46
  185. package/Meshes/Node/Blocks/Set/setUVsBlock.js.map +1 -1
  186. package/Meshes/Node/Blocks/debugBlock.js +5 -1
  187. package/Meshes/Node/Blocks/debugBlock.js.map +1 -1
  188. package/Meshes/Node/Blocks/geometryInputBlock.js +1 -0
  189. package/Meshes/Node/Blocks/geometryInputBlock.js.map +1 -1
  190. package/Meshes/Node/Blocks/intFloatConverterBlock.js +2 -2
  191. package/Meshes/Node/Blocks/intFloatConverterBlock.js.map +1 -1
  192. package/Meshes/Node/Blocks/mapRangeBlock.js +8 -1
  193. package/Meshes/Node/Blocks/mapRangeBlock.js.map +1 -1
  194. package/Meshes/Node/Blocks/mathBlock.js +1 -0
  195. package/Meshes/Node/Blocks/mathBlock.js.map +1 -1
  196. package/Meshes/Node/Blocks/matrixComposeBlock.d.ts +30 -0
  197. package/Meshes/Node/Blocks/matrixComposeBlock.js +55 -0
  198. package/Meshes/Node/Blocks/matrixComposeBlock.js.map +1 -0
  199. package/Meshes/Node/Enums/nodeGeometryContextualSources.d.ts +3 -1
  200. package/Meshes/Node/Enums/nodeGeometryContextualSources.js +2 -0
  201. package/Meshes/Node/Enums/nodeGeometryContextualSources.js.map +1 -1
  202. package/Meshes/Node/Interfaces/nodeGeometryInstancingContext.d.ts +10 -0
  203. package/Meshes/Node/Interfaces/nodeGeometryInstancingContext.js +2 -0
  204. package/Meshes/Node/Interfaces/nodeGeometryInstancingContext.js.map +1 -0
  205. package/Meshes/Node/index.d.ts +1 -0
  206. package/Meshes/Node/index.js +1 -0
  207. package/Meshes/Node/index.js.map +1 -1
  208. package/Meshes/Node/nodeGeometry.js +2 -2
  209. package/Meshes/Node/nodeGeometry.js.map +1 -1
  210. package/Meshes/Node/nodeGeometryBuildState.d.ts +5 -0
  211. package/Meshes/Node/nodeGeometryBuildState.js +20 -0
  212. package/Meshes/Node/nodeGeometryBuildState.js.map +1 -1
  213. package/Meshes/abstractMesh.js +4 -1
  214. package/Meshes/abstractMesh.js.map +1 -1
  215. package/Meshes/geometry.js +10 -10
  216. package/Meshes/geometry.js.map +1 -1
  217. package/Meshes/mesh.js +7 -5
  218. package/Meshes/mesh.js.map +1 -1
  219. package/Misc/PerformanceViewer/performanceViewerCollectionStrategies.js +2 -1
  220. package/Misc/PerformanceViewer/performanceViewerCollectionStrategies.js.map +1 -1
  221. package/Misc/dumpTools.js +3 -2
  222. package/Misc/dumpTools.js.map +1 -1
  223. package/Misc/equirectangularCapture.d.ts +39 -0
  224. package/Misc/equirectangularCapture.js +56 -0
  225. package/Misc/equirectangularCapture.js.map +1 -0
  226. package/Misc/index.d.ts +1 -0
  227. package/Misc/index.js +1 -0
  228. package/Misc/index.js.map +1 -1
  229. package/Particles/solidParticleSystem.d.ts +4 -0
  230. package/Particles/solidParticleSystem.js +16 -1
  231. package/Particles/solidParticleSystem.js.map +1 -1
  232. package/Physics/v2/IPhysicsEnginePlugin.d.ts +10 -0
  233. package/Physics/v2/IPhysicsEnginePlugin.js.map +1 -1
  234. package/Physics/v2/Plugins/havokPlugin.d.ts +8 -1
  235. package/Physics/v2/Plugins/havokPlugin.js +34 -0
  236. package/Physics/v2/Plugins/havokPlugin.js.map +1 -1
  237. package/Physics/v2/physicsConstraint.d.ts +11 -1
  238. package/Physics/v2/physicsConstraint.js +7 -0
  239. package/Physics/v2/physicsConstraint.js.map +1 -1
  240. package/Rendering/prePassRenderer.d.ts +6 -0
  241. package/Rendering/prePassRenderer.js +14 -0
  242. package/Rendering/prePassRenderer.js.map +1 -1
  243. package/Shaders/default.fragment.js +4 -0
  244. package/Shaders/default.fragment.js.map +1 -1
  245. package/Shaders/equirectangularPanorama.fragment.d.ts +5 -0
  246. package/Shaders/equirectangularPanorama.fragment.js +17 -0
  247. package/Shaders/equirectangularPanorama.fragment.js.map +1 -0
  248. package/Shaders/pbr.fragment.js +4 -0
  249. package/Shaders/pbr.fragment.js.map +1 -1
  250. package/package.json +1 -1
  251. package/FlowGraph/Blocks/Data/flowGraphBinaryOpBlocks.d.ts +0 -34
  252. package/FlowGraph/Blocks/Data/flowGraphBinaryOpBlocks.js +0 -29
  253. package/FlowGraph/Blocks/Data/flowGraphBinaryOpBlocks.js.map +0 -1
@@ -0,0 +1,23 @@
1
+ import type { FlowGraphContext } from "../../flowGraphContext";
2
+ import { FlowGraphBlock } from "../../flowGraphBlock";
3
+ import type { FlowGraphDataConnection } from "../../flowGraphDataConnection";
4
+ /**
5
+ * A block that adds two numbers.
6
+ * @experimental
7
+ */
8
+ export declare class FlowGraphAddNumbersBlock extends FlowGraphBlock {
9
+ /**
10
+ * Input connection: The first number to add.
11
+ */
12
+ readonly numberLeft: FlowGraphDataConnection<number>;
13
+ /**
14
+ * Input connection: The second number to add.
15
+ */
16
+ readonly numberRight: FlowGraphDataConnection<number>;
17
+ /**
18
+ * Output connection: The sum of the two numbers.
19
+ */
20
+ readonly output: FlowGraphDataConnection<number>;
21
+ constructor();
22
+ _updateOutputs(_context: FlowGraphContext): void;
23
+ }
@@ -0,0 +1,18 @@
1
+ import { FlowGraphBlock } from "../../flowGraphBlock.js";
2
+ import { RichTypeNumber } from "../../flowGraphRichTypes.js";
3
+ /**
4
+ * A block that adds two numbers.
5
+ * @experimental
6
+ */
7
+ export class FlowGraphAddNumbersBlock extends FlowGraphBlock {
8
+ constructor() {
9
+ super();
10
+ this.numberLeft = this._registerDataInput("numberLeft", RichTypeNumber);
11
+ this.numberRight = this._registerDataInput("numberRight", RichTypeNumber);
12
+ this.output = this._registerDataOutput("output", RichTypeNumber);
13
+ }
14
+ _updateOutputs(_context) {
15
+ this.output.value = this.numberLeft.getValue(_context) + this.numberRight.getValue(_context);
16
+ }
17
+ }
18
+ //# sourceMappingURL=flowGraphAddBlock.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"flowGraphAddBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FlowGraph/Blocks/Data/flowGraphAddBlock.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAE1D;;;GAGG;AACH,MAAM,OAAO,wBAAyB,SAAQ,cAAc;IAcxD;QACI,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,kBAAkB,CAAC,YAAY,EAAE,cAAc,CAAC,CAAC;QACxE,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,kBAAkB,CAAC,aAAa,EAAE,cAAc,CAAC,CAAC;QAC1E,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,mBAAmB,CAAC,QAAQ,EAAE,cAAc,CAAC,CAAC;IACrE,CAAC;IAEM,cAAc,CAAC,QAA0B;QAC5C,IAAI,CAAC,MAAM,CAAC,KAAK,GAAG,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;IACjG,CAAC;CACJ","sourcesContent":["import type { FlowGraphContext } from \"../../flowGraphContext\";\r\nimport { FlowGraphBlock } from \"../../flowGraphBlock\";\r\nimport type { FlowGraphDataConnection } from \"../../flowGraphDataConnection\";\r\nimport { RichTypeNumber } from \"../../flowGraphRichTypes\";\r\n\r\n/**\r\n * A block that adds two numbers.\r\n * @experimental\r\n */\r\nexport class FlowGraphAddNumbersBlock extends FlowGraphBlock {\r\n /**\r\n * Input connection: The first number to add.\r\n */\r\n public readonly numberLeft: FlowGraphDataConnection<number>;\r\n /**\r\n * Input connection: The second number to add.\r\n */\r\n public readonly numberRight: FlowGraphDataConnection<number>;\r\n /**\r\n * Output connection: The sum of the two numbers.\r\n */\r\n public readonly output: FlowGraphDataConnection<number>;\r\n\r\n constructor() {\r\n super();\r\n this.numberLeft = this._registerDataInput(\"numberLeft\", RichTypeNumber);\r\n this.numberRight = this._registerDataInput(\"numberRight\", RichTypeNumber);\r\n this.output = this._registerDataOutput(\"output\", RichTypeNumber);\r\n }\r\n\r\n public _updateOutputs(_context: FlowGraphContext): void {\r\n this.output.value = this.numberLeft.getValue(_context) + this.numberRight.getValue(_context);\r\n }\r\n}\r\n"]}
@@ -0,0 +1,30 @@
1
+ import type { FlowGraphContext } from "../../flowGraphContext";
2
+ import { FlowGraphBlock } from "../../flowGraphBlock";
3
+ import type { FlowGraphDataConnection } from "../../flowGraphDataConnection";
4
+ /**
5
+ * @experimental
6
+ * Block that returns a value based on a condition.
7
+ */
8
+ export declare class FlowGraphConditionalDataBlock<T> extends FlowGraphBlock {
9
+ /**
10
+ * Input connection: The condition to check.
11
+ */
12
+ readonly condition: FlowGraphDataConnection<boolean>;
13
+ /**
14
+ * Input connection: The value to return if the condition is true.
15
+ */
16
+ readonly trueValue: FlowGraphDataConnection<T>;
17
+ /**
18
+ * Input connection: The value to return if the condition is false.
19
+ */
20
+ readonly falseValue: FlowGraphDataConnection<T>;
21
+ /**
22
+ * Output connection: The value that was returned.
23
+ */
24
+ readonly output: FlowGraphDataConnection<T>;
25
+ constructor();
26
+ /**
27
+ * @internal
28
+ */
29
+ _updateOutputs(context: FlowGraphContext): void;
30
+ }
@@ -0,0 +1,22 @@
1
+ import { FlowGraphBlock } from "../../flowGraphBlock.js";
2
+ import { RichTypeBoolean, RichTypeAny } from "../../flowGraphRichTypes.js";
3
+ /**
4
+ * @experimental
5
+ * Block that returns a value based on a condition.
6
+ */
7
+ export class FlowGraphConditionalDataBlock extends FlowGraphBlock {
8
+ constructor() {
9
+ super();
10
+ this.condition = this._registerDataInput("condition", RichTypeBoolean);
11
+ this.trueValue = this._registerDataInput("trueValue", RichTypeAny);
12
+ this.falseValue = this._registerDataInput("falseValue", RichTypeAny);
13
+ this.output = this._registerDataOutput("output", RichTypeAny);
14
+ }
15
+ /**
16
+ * @internal
17
+ */
18
+ _updateOutputs(context) {
19
+ this.output.value = this.condition.getValue(context) ? this.trueValue.getValue(context) : this.falseValue.getValue(context);
20
+ }
21
+ }
22
+ //# sourceMappingURL=flowGraphConditionalDataBlock.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"flowGraphConditionalDataBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FlowGraph/Blocks/Data/flowGraphConditionalDataBlock.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAExE;;;GAGG;AACH,MAAM,OAAO,6BAAiC,SAAQ,cAAc;IAmBhE;QACI,KAAK,EAAE,CAAC;QAER,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,kBAAkB,CAAC,WAAW,EAAE,eAAe,CAAC,CAAC;QACvE,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,kBAAkB,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;QACnE,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,kBAAkB,CAAC,YAAY,EAAE,WAAW,CAAC,CAAC;QAErE,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,mBAAmB,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;IAClE,CAAC;IAED;;OAEG;IACI,cAAc,CAAC,OAAyB;QAC3C,IAAI,CAAC,MAAM,CAAC,KAAK,GAAG,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;IAChI,CAAC;CACJ","sourcesContent":["import type { FlowGraphContext } from \"../../flowGraphContext\";\r\nimport { FlowGraphBlock } from \"../../flowGraphBlock\";\r\nimport type { FlowGraphDataConnection } from \"../../flowGraphDataConnection\";\r\nimport { RichTypeBoolean, RichTypeAny } from \"../../flowGraphRichTypes\";\r\n\r\n/**\r\n * @experimental\r\n * Block that returns a value based on a condition.\r\n */\r\nexport class FlowGraphConditionalDataBlock<T> extends FlowGraphBlock {\r\n /**\r\n * Input connection: The condition to check.\r\n */\r\n public readonly condition: FlowGraphDataConnection<boolean>;\r\n /**\r\n * Input connection: The value to return if the condition is true.\r\n */\r\n public readonly trueValue: FlowGraphDataConnection<T>;\r\n /**\r\n * Input connection: The value to return if the condition is false.\r\n */\r\n public readonly falseValue: FlowGraphDataConnection<T>;\r\n\r\n /**\r\n * Output connection: The value that was returned.\r\n */\r\n public readonly output: FlowGraphDataConnection<T>;\r\n\r\n constructor() {\r\n super();\r\n\r\n this.condition = this._registerDataInput(\"condition\", RichTypeBoolean);\r\n this.trueValue = this._registerDataInput(\"trueValue\", RichTypeAny);\r\n this.falseValue = this._registerDataInput(\"falseValue\", RichTypeAny);\r\n\r\n this.output = this._registerDataOutput(\"output\", RichTypeAny);\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _updateOutputs(context: FlowGraphContext): void {\r\n this.output.value = this.condition.getValue(context) ? this.trueValue.getValue(context) : this.falseValue.getValue(context);\r\n }\r\n}\r\n"]}
@@ -0,0 +1,33 @@
1
+ import type { FlowGraphContext } from "../../flowGraphContext";
2
+ import { FlowGraphBlock } from "../../flowGraphBlock";
3
+ import type { FlowGraphDataConnection } from "../../flowGraphDataConnection";
4
+ /**
5
+ * @experimental
6
+ * Parameters used to create a FlowGraphGetVariableBlock.
7
+ */
8
+ export interface IFlowGraphGetVariableBlockParameter {
9
+ variableName: string;
10
+ }
11
+ /**
12
+ * A block that gets the value of a variable.
13
+ * @experimental
14
+ */
15
+ export declare class FlowGraphGetVariableBlock<T> extends FlowGraphBlock {
16
+ /**
17
+ * Input connection: The name of the variable to get.
18
+ */
19
+ readonly variableName: FlowGraphDataConnection<string>;
20
+ /**
21
+ * Output connection: The value of the variable.
22
+ */
23
+ readonly output: FlowGraphDataConnection<T>;
24
+ /**
25
+ * Construct a FlowGraphGetVariableBlock.
26
+ * @param params optional construction parameters
27
+ */
28
+ constructor(params?: IFlowGraphGetVariableBlockParameter);
29
+ /**
30
+ * @internal
31
+ */
32
+ _updateOutputs(context: FlowGraphContext): void;
33
+ }
@@ -0,0 +1,30 @@
1
+ import { FlowGraphBlock } from "../../flowGraphBlock.js";
2
+ import { RichTypeString, RichTypeAny } from "../../flowGraphRichTypes.js";
3
+ /**
4
+ * A block that gets the value of a variable.
5
+ * @experimental
6
+ */
7
+ export class FlowGraphGetVariableBlock extends FlowGraphBlock {
8
+ /**
9
+ * Construct a FlowGraphGetVariableBlock.
10
+ * @param params optional construction parameters
11
+ */
12
+ constructor(params) {
13
+ super();
14
+ this.variableName = this._registerDataInput("variableName", RichTypeString);
15
+ if (params === null || params === void 0 ? void 0 : params.variableName) {
16
+ this.variableName.value = params.variableName;
17
+ }
18
+ this.output = this._registerDataOutput("output", RichTypeAny);
19
+ }
20
+ /**
21
+ * @internal
22
+ */
23
+ _updateOutputs(context) {
24
+ const variableNameValue = this.variableName.getValue(context);
25
+ if (context.hasVariable(variableNameValue)) {
26
+ this.output.value = context.getVariable(variableNameValue);
27
+ }
28
+ }
29
+ }
30
+ //# sourceMappingURL=flowGraphGetVariableBlock.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"flowGraphGetVariableBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FlowGraph/Blocks/Data/flowGraphGetVariableBlock.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAQvE;;;GAGG;AACH,MAAM,OAAO,yBAA6B,SAAQ,cAAc;IAU5D;;;OAGG;IACH,YAAY,MAA4C;QACpD,KAAK,EAAE,CAAC;QAER,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,kBAAkB,CAAC,cAAc,EAAE,cAAc,CAAC,CAAC;QAC5E,IAAI,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,YAAY,EAAE;YACtB,IAAI,CAAC,YAAY,CAAC,KAAK,GAAG,MAAM,CAAC,YAAY,CAAC;SACjD;QACD,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,mBAAmB,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;IAClE,CAAC;IAED;;OAEG;IACI,cAAc,CAAC,OAAyB;QAC3C,MAAM,iBAAiB,GAAG,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QAC9D,IAAI,OAAO,CAAC,WAAW,CAAC,iBAAiB,CAAC,EAAE;YACxC,IAAI,CAAC,MAAM,CAAC,KAAK,GAAG,OAAO,CAAC,WAAW,CAAC,iBAAiB,CAAC,CAAC;SAC9D;IACL,CAAC;CACJ","sourcesContent":["import type { FlowGraphContext } from \"../../flowGraphContext\";\r\nimport { FlowGraphBlock } from \"../../flowGraphBlock\";\r\nimport type { FlowGraphDataConnection } from \"../../flowGraphDataConnection\";\r\nimport { RichTypeString, RichTypeAny } from \"../../flowGraphRichTypes\";\r\n/**\r\n * @experimental\r\n * Parameters used to create a FlowGraphGetVariableBlock.\r\n */\r\nexport interface IFlowGraphGetVariableBlockParameter {\r\n variableName: string;\r\n}\r\n/**\r\n * A block that gets the value of a variable.\r\n * @experimental\r\n */\r\nexport class FlowGraphGetVariableBlock<T> extends FlowGraphBlock {\r\n /**\r\n * Input connection: The name of the variable to get.\r\n */\r\n public readonly variableName: FlowGraphDataConnection<string>;\r\n /**\r\n * Output connection: The value of the variable.\r\n */\r\n public readonly output: FlowGraphDataConnection<T>;\r\n\r\n /**\r\n * Construct a FlowGraphGetVariableBlock.\r\n * @param params optional construction parameters\r\n */\r\n constructor(params?: IFlowGraphGetVariableBlockParameter) {\r\n super();\r\n\r\n this.variableName = this._registerDataInput(\"variableName\", RichTypeString);\r\n if (params?.variableName) {\r\n this.variableName.value = params.variableName;\r\n }\r\n this.output = this._registerDataOutput(\"output\", RichTypeAny);\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _updateOutputs(context: FlowGraphContext): void {\r\n const variableNameValue = this.variableName.getValue(context);\r\n if (context.hasVariable(variableNameValue)) {\r\n this.output.value = context.getVariable(variableNameValue);\r\n }\r\n }\r\n}\r\n"]}
@@ -1 +1,3 @@
1
- export * from "./flowGraphBinaryOpBlocks";
1
+ export * from "./flowGraphConditionalDataBlock";
2
+ export * from "./flowGraphGetVariableBlock";
3
+ export * from "./flowGraphAddBlock";
@@ -1,2 +1,4 @@
1
- export * from "./flowGraphBinaryOpBlocks.js";
1
+ export * from "./flowGraphConditionalDataBlock.js";
2
+ export * from "./flowGraphGetVariableBlock.js";
3
+ export * from "./flowGraphAddBlock.js";
2
4
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FlowGraph/Blocks/Data/index.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAC","sourcesContent":["export * from \"./flowGraphBinaryOpBlocks\";\r\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FlowGraph/Blocks/Data/index.ts"],"names":[],"mappings":"AAAA,cAAc,iCAAiC,CAAC;AAChD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,qBAAqB,CAAC","sourcesContent":["export * from \"./flowGraphConditionalDataBlock\";\r\nexport * from \"./flowGraphGetVariableBlock\";\r\nexport * from \"./flowGraphAddBlock\";\r\n"]}
@@ -1,23 +1,25 @@
1
- import type { AbstractMesh } from "../../../Meshes/abstractMesh";
2
- import type { FlowGraph } from "../../flowGraph";
3
1
  import { FlowGraphEventBlock } from "../../flowGraphEventBlock";
2
+ import type { FlowGraphContext } from "../../flowGraphContext.js";
3
+ /**
4
+ * @experimental
5
+ */
6
+ export interface IFlowGraphMeshPickParams {
7
+ meshVariableName: string;
8
+ }
4
9
  /**
5
10
  * @experimental
6
11
  * A block that activates when a mesh is picked.
7
12
  */
8
13
  export declare class FlowGraphMeshPickEventBlock extends FlowGraphEventBlock {
9
- private _meshToPick;
10
- private _meshPickObserver;
11
- private _meshDisposeObserver;
12
- constructor(graph: FlowGraph, meshToPick: AbstractMesh);
13
- set meshToPick(mesh: AbstractMesh);
14
- get meshToPick(): AbstractMesh;
14
+ private _meshVariableName;
15
+ constructor(params: IFlowGraphMeshPickParams);
15
16
  /**
16
17
  * @internal
17
18
  */
18
- _startListening(): void;
19
+ _preparePendingTasks(context: FlowGraphContext): void;
20
+ _onDispose(context: FlowGraphContext): void;
19
21
  /**
20
22
  * @internal
21
23
  */
22
- _stopListening(): void;
24
+ _cancelPendingTasks(context: FlowGraphContext): void;
23
25
  }
@@ -5,47 +5,43 @@ import { PointerEventTypes } from "../../../Events/pointerEvents.js";
5
5
  * A block that activates when a mesh is picked.
6
6
  */
7
7
  export class FlowGraphMeshPickEventBlock extends FlowGraphEventBlock {
8
- constructor(graph, meshToPick) {
9
- super(graph);
10
- this._meshToPick = meshToPick;
11
- }
12
- set meshToPick(mesh) {
13
- if (this._meshToPick !== mesh) {
14
- const wasListening = !!this._meshPickObserver;
15
- if (wasListening) {
16
- this._stopListening();
17
- }
18
- this._meshToPick = mesh;
19
- if (wasListening) {
20
- this._startListening();
21
- }
22
- }
23
- }
24
- get meshToPick() {
25
- return this._meshToPick;
8
+ constructor(params) {
9
+ super();
10
+ this._meshVariableName = params.meshVariableName;
26
11
  }
27
12
  /**
28
13
  * @internal
29
14
  */
30
- _startListening() {
31
- if (!this._meshPickObserver) {
32
- this._meshPickObserver = this._meshToPick.getScene().onPointerObservable.add((pointerInfo) => {
15
+ _preparePendingTasks(context) {
16
+ let pickObserver = context._getExecutionVariable(this, "meshPickObserver");
17
+ if (!pickObserver) {
18
+ const mesh = context.getVariable(this._meshVariableName);
19
+ pickObserver = mesh.getScene().onPointerObservable.add((pointerInfo) => {
33
20
  var _a;
34
- if (pointerInfo.type === PointerEventTypes.POINTERPICK && ((_a = pointerInfo.pickInfo) === null || _a === void 0 ? void 0 : _a.pickedMesh) === this._meshToPick) {
35
- this._execute();
21
+ if (pointerInfo.type === PointerEventTypes.POINTERPICK && ((_a = pointerInfo.pickInfo) === null || _a === void 0 ? void 0 : _a.pickedMesh) === mesh) {
22
+ this._execute(context);
36
23
  }
37
24
  });
38
- this._meshDisposeObserver = this._meshToPick.onDisposeObservable.add(() => this._stopListening());
25
+ const disposeObserver = mesh.onDisposeObservable.add(() => this._onDispose);
26
+ context._setExecutionVariable(this, "meshPickObserver", pickObserver);
27
+ context._setExecutionVariable(this, "meshDisposeObserver", disposeObserver);
39
28
  }
40
29
  }
30
+ _onDispose(context) {
31
+ this._cancelPendingTasks(context);
32
+ context._removePendingBlock(this);
33
+ }
41
34
  /**
42
35
  * @internal
43
36
  */
44
- _stopListening() {
45
- this._meshToPick.getScene().onPointerObservable.remove(this._meshPickObserver);
46
- this._meshPickObserver = null;
47
- this._meshToPick.onDisposeObservable.remove(this._meshDisposeObserver);
48
- this._meshDisposeObserver = null;
37
+ _cancelPendingTasks(context) {
38
+ const mesh = context.getVariable(this._meshVariableName);
39
+ const pickObserver = context._getExecutionVariable(this, "meshPickObserver");
40
+ const disposeObserver = context._getExecutionVariable(this, "meshDisposeObserver");
41
+ mesh.getScene().onPointerObservable.remove(pickObserver);
42
+ mesh.onDisposeObservable.remove(disposeObserver);
43
+ context._deleteExecutionVariable(this, "meshPickObserver");
44
+ context._deleteExecutionVariable(this, "meshDisposeObserver");
49
45
  }
50
46
  }
51
47
  //# sourceMappingURL=flowGraphMeshPickEventBlock.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"flowGraphMeshPickEventBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FlowGraph/Blocks/Event/flowGraphMeshPickEventBlock.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAEhE,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAIlE;;;GAGG;AACH,MAAM,OAAO,2BAA4B,SAAQ,mBAAmB;IAKhE,YAAmB,KAAgB,EAAE,UAAwB;QACzD,KAAK,CAAC,KAAK,CAAC,CAAC;QACb,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;IAClC,CAAC;IAED,IAAW,UAAU,CAAC,IAAkB;QACpC,IAAI,IAAI,CAAC,WAAW,KAAK,IAAI,EAAE;YAC3B,MAAM,YAAY,GAAG,CAAC,CAAC,IAAI,CAAC,iBAAiB,CAAC;YAC9C,IAAI,YAAY,EAAE;gBACd,IAAI,CAAC,cAAc,EAAE,CAAC;aACzB;YACD,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;YACxB,IAAI,YAAY,EAAE;gBACd,IAAI,CAAC,eAAe,EAAE,CAAC;aAC1B;SACJ;IACL,CAAC;IAED,IAAW,UAAU;QACjB,OAAO,IAAI,CAAC,WAAW,CAAC;IAC5B,CAAC;IAED;;OAEG;IACI,eAAe;QAClB,IAAI,CAAC,IAAI,CAAC,iBAAiB,EAAE;YACzB,IAAI,CAAC,iBAAiB,GAAG,IAAI,CAAC,WAAW,CAAC,QAAQ,EAAE,CAAC,mBAAmB,CAAC,GAAG,CAAC,CAAC,WAAW,EAAE,EAAE;;gBACzF,IAAI,WAAW,CAAC,IAAI,KAAK,iBAAiB,CAAC,WAAW,IAAI,CAAA,MAAA,WAAW,CAAC,QAAQ,0CAAE,UAAU,MAAK,IAAI,CAAC,WAAW,EAAE;oBAC7G,IAAI,CAAC,QAAQ,EAAE,CAAC;iBACnB;YACL,CAAC,CAAC,CAAC;YACH,IAAI,CAAC,oBAAoB,GAAG,IAAI,CAAC,WAAW,CAAC,mBAAmB,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,cAAc,EAAE,CAAC,CAAC;SACrG;IACL,CAAC;IAED;;OAEG;IACI,cAAc;QACjB,IAAI,CAAC,WAAW,CAAC,QAAQ,EAAE,CAAC,mBAAmB,CAAC,MAAM,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;QAC/E,IAAI,CAAC,iBAAiB,GAAG,IAAI,CAAC;QAC9B,IAAI,CAAC,WAAW,CAAC,mBAAmB,CAAC,MAAM,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC;QACvE,IAAI,CAAC,oBAAoB,GAAG,IAAI,CAAC;IACrC,CAAC;CACJ","sourcesContent":["import type { Observer } from \"../../../Misc/observable\";\r\nimport type { AbstractMesh } from \"../../../Meshes/abstractMesh\";\r\nimport type { FlowGraph } from \"../../flowGraph\";\r\nimport { FlowGraphEventBlock } from \"../../flowGraphEventBlock\";\r\nimport type { PointerInfo } from \"../../../Events/pointerEvents\";\r\nimport { PointerEventTypes } from \"../../../Events/pointerEvents\";\r\nimport type { Nullable } from \"../../../types\";\r\nimport type { Node } from \"../../../node\";\r\n\r\n/**\r\n * @experimental\r\n * A block that activates when a mesh is picked.\r\n */\r\nexport class FlowGraphMeshPickEventBlock extends FlowGraphEventBlock {\r\n private _meshToPick: AbstractMesh;\r\n private _meshPickObserver: Nullable<Observer<PointerInfo>>;\r\n private _meshDisposeObserver: Nullable<Observer<Node>>;\r\n\r\n public constructor(graph: FlowGraph, meshToPick: AbstractMesh) {\r\n super(graph);\r\n this._meshToPick = meshToPick;\r\n }\r\n\r\n public set meshToPick(mesh: AbstractMesh) {\r\n if (this._meshToPick !== mesh) {\r\n const wasListening = !!this._meshPickObserver;\r\n if (wasListening) {\r\n this._stopListening();\r\n }\r\n this._meshToPick = mesh;\r\n if (wasListening) {\r\n this._startListening();\r\n }\r\n }\r\n }\r\n\r\n public get meshToPick(): AbstractMesh {\r\n return this._meshToPick;\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _startListening(): void {\r\n if (!this._meshPickObserver) {\r\n this._meshPickObserver = this._meshToPick.getScene().onPointerObservable.add((pointerInfo) => {\r\n if (pointerInfo.type === PointerEventTypes.POINTERPICK && pointerInfo.pickInfo?.pickedMesh === this._meshToPick) {\r\n this._execute();\r\n }\r\n });\r\n this._meshDisposeObserver = this._meshToPick.onDisposeObservable.add(() => this._stopListening());\r\n }\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _stopListening(): void {\r\n this._meshToPick.getScene().onPointerObservable.remove(this._meshPickObserver);\r\n this._meshPickObserver = null;\r\n this._meshToPick.onDisposeObservable.remove(this._meshDisposeObserver);\r\n this._meshDisposeObserver = null;\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"flowGraphMeshPickEventBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FlowGraph/Blocks/Event/flowGraphMeshPickEventBlock.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AASlE;;;GAGG;AACH,MAAM,OAAO,2BAA4B,SAAQ,mBAAmB;IAGhE,YAAmB,MAAgC;QAC/C,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,iBAAiB,GAAG,MAAM,CAAC,gBAAgB,CAAC;IACrD,CAAC;IAED;;OAEG;IACI,oBAAoB,CAAC,OAAyB;QACjD,IAAI,YAAY,GAAG,OAAO,CAAC,qBAAqB,CAAC,IAAI,EAAE,kBAAkB,CAAC,CAAC;QAC3E,IAAI,CAAC,YAAY,EAAE;YACf,MAAM,IAAI,GAAG,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,iBAAiB,CAAiB,CAAC;YACzE,YAAY,GAAG,IAAI,CAAC,QAAQ,EAAE,CAAC,mBAAmB,CAAC,GAAG,CAAC,CAAC,WAAW,EAAE,EAAE;;gBACnE,IAAI,WAAW,CAAC,IAAI,KAAK,iBAAiB,CAAC,WAAW,IAAI,CAAA,MAAA,WAAW,CAAC,QAAQ,0CAAE,UAAU,MAAK,IAAI,EAAE;oBACjG,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;iBAC1B;YACL,CAAC,CAAC,CAAC;YACH,MAAM,eAAe,GAAG,IAAI,CAAC,mBAAmB,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;YAC5E,OAAO,CAAC,qBAAqB,CAAC,IAAI,EAAE,kBAAkB,EAAE,YAAY,CAAC,CAAC;YACtE,OAAO,CAAC,qBAAqB,CAAC,IAAI,EAAE,qBAAqB,EAAE,eAAe,CAAC,CAAC;SAC/E;IACL,CAAC;IAEM,UAAU,CAAC,OAAyB;QACvC,IAAI,CAAC,mBAAmB,CAAC,OAAO,CAAC,CAAC;QAClC,OAAO,CAAC,mBAAmB,CAAC,IAAI,CAAC,CAAC;IACtC,CAAC;IAED;;OAEG;IACI,mBAAmB,CAAC,OAAyB;QAChD,MAAM,IAAI,GAAG,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,iBAAiB,CAAiB,CAAC;QACzE,MAAM,YAAY,GAAG,OAAO,CAAC,qBAAqB,CAAC,IAAI,EAAE,kBAAkB,CAAC,CAAC;QAC7E,MAAM,eAAe,GAAG,OAAO,CAAC,qBAAqB,CAAC,IAAI,EAAE,qBAAqB,CAAC,CAAC;QAEnF,IAAI,CAAC,QAAQ,EAAE,CAAC,mBAAmB,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;QACzD,IAAI,CAAC,mBAAmB,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC;QAEjD,OAAO,CAAC,wBAAwB,CAAC,IAAI,EAAE,kBAAkB,CAAC,CAAC;QAC3D,OAAO,CAAC,wBAAwB,CAAC,IAAI,EAAE,qBAAqB,CAAC,CAAC;IAClE,CAAC;CACJ","sourcesContent":["import type { AbstractMesh } from \"../../../Meshes/abstractMesh\";\r\nimport { FlowGraphEventBlock } from \"../../flowGraphEventBlock\";\r\nimport { PointerEventTypes } from \"../../../Events/pointerEvents\";\r\nimport type { FlowGraphContext } from \"core/FlowGraph/flowGraphContext\";\r\n\r\n/**\r\n * @experimental\r\n */\r\nexport interface IFlowGraphMeshPickParams {\r\n meshVariableName: string;\r\n}\r\n/**\r\n * @experimental\r\n * A block that activates when a mesh is picked.\r\n */\r\nexport class FlowGraphMeshPickEventBlock extends FlowGraphEventBlock {\r\n private _meshVariableName: string;\r\n\r\n public constructor(params: IFlowGraphMeshPickParams) {\r\n super();\r\n this._meshVariableName = params.meshVariableName;\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _preparePendingTasks(context: FlowGraphContext): void {\r\n let pickObserver = context._getExecutionVariable(this, \"meshPickObserver\");\r\n if (!pickObserver) {\r\n const mesh = context.getVariable(this._meshVariableName) as AbstractMesh;\r\n pickObserver = mesh.getScene().onPointerObservable.add((pointerInfo) => {\r\n if (pointerInfo.type === PointerEventTypes.POINTERPICK && pointerInfo.pickInfo?.pickedMesh === mesh) {\r\n this._execute(context);\r\n }\r\n });\r\n const disposeObserver = mesh.onDisposeObservable.add(() => this._onDispose);\r\n context._setExecutionVariable(this, \"meshPickObserver\", pickObserver);\r\n context._setExecutionVariable(this, \"meshDisposeObserver\", disposeObserver);\r\n }\r\n }\r\n\r\n public _onDispose(context: FlowGraphContext) {\r\n this._cancelPendingTasks(context);\r\n context._removePendingBlock(this);\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _cancelPendingTasks(context: FlowGraphContext): void {\r\n const mesh = context.getVariable(this._meshVariableName) as AbstractMesh;\r\n const pickObserver = context._getExecutionVariable(this, \"meshPickObserver\");\r\n const disposeObserver = context._getExecutionVariable(this, \"meshDisposeObserver\");\r\n\r\n mesh.getScene().onPointerObservable.remove(pickObserver);\r\n mesh.onDisposeObservable.remove(disposeObserver);\r\n\r\n context._deleteExecutionVariable(this, \"meshPickObserver\");\r\n context._deleteExecutionVariable(this, \"meshDisposeObserver\");\r\n }\r\n}\r\n"]}
@@ -0,0 +1,25 @@
1
+ import type { FlowGraphContext } from "../../flowGraphContext";
2
+ import { FlowGraphEventBlock } from "../../flowGraphEventBlock";
3
+ import type { FlowGraphDataConnection } from "../../flowGraphDataConnection";
4
+ /**
5
+ * @experimental
6
+ * Parameters used to create a FlowGraphReceiveCustomEventBlock.
7
+ */
8
+ export interface IFlowGraphReceiveCustomEventBlockParameters {
9
+ eventId: string;
10
+ }
11
+ /**
12
+ * @experimental
13
+ * A block that receives a custom event. It saves the data sent in the eventData output.
14
+ */
15
+ export declare class FlowGraphReceiveCustomEventBlock extends FlowGraphEventBlock {
16
+ private _params;
17
+ private _eventObserver;
18
+ /**
19
+ * Output connection: The data sent with the event.
20
+ */
21
+ eventData: FlowGraphDataConnection<any>;
22
+ constructor(_params: IFlowGraphReceiveCustomEventBlockParameters);
23
+ _preparePendingTasks(context: FlowGraphContext): void;
24
+ _cancelPendingTasks(context: FlowGraphContext): void;
25
+ }
@@ -0,0 +1,31 @@
1
+ import { FlowGraphEventBlock } from "../../flowGraphEventBlock.js";
2
+ import { Tools } from "../../../Misc/tools.js";
3
+ import { RichTypeAny } from "../../flowGraphRichTypes.js";
4
+ /**
5
+ * @experimental
6
+ * A block that receives a custom event. It saves the data sent in the eventData output.
7
+ */
8
+ export class FlowGraphReceiveCustomEventBlock extends FlowGraphEventBlock {
9
+ constructor(_params) {
10
+ super();
11
+ this._params = _params;
12
+ this.eventData = this._registerDataOutput("eventData", RichTypeAny);
13
+ }
14
+ _preparePendingTasks(context) {
15
+ const observable = context.graphVariables.eventCoordinator.getCustomEventObservable(this._params.eventId);
16
+ this._eventObserver = observable.add((event) => {
17
+ this.eventData.value = event;
18
+ this._execute(context);
19
+ });
20
+ }
21
+ _cancelPendingTasks(context) {
22
+ const observable = context.graphVariables.eventCoordinator.getCustomEventObservable(this._params.eventId);
23
+ if (observable) {
24
+ observable.remove(this._eventObserver);
25
+ }
26
+ else {
27
+ Tools.Warn(`FlowGraphReceiveCustomEventBlock: Missing observable for event ${this._params.eventId}`);
28
+ }
29
+ }
30
+ }
31
+ //# sourceMappingURL=flowGraphReceiveCustomEventBlock.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"flowGraphReceiveCustomEventBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FlowGraph/Blocks/Event/flowGraphReceiveCustomEventBlock.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAGhE,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAE5C,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAUvD;;;GAGG;AACH,MAAM,OAAO,gCAAiC,SAAQ,mBAAmB;IAQrE,YAAoB,OAAoD;QACpE,KAAK,EAAE,CAAC;QADQ,YAAO,GAAP,OAAO,CAA6C;QAEpE,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,mBAAmB,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;IACxE,CAAC;IACM,oBAAoB,CAAC,OAAyB;QACjD,MAAM,UAAU,GAAG,OAAO,CAAC,cAAc,CAAC,gBAAgB,CAAC,wBAAwB,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QAC1G,IAAI,CAAC,cAAc,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE;YAC3C,IAAI,CAAC,SAAS,CAAC,KAAK,GAAG,KAAK,CAAC;YAC7B,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QAC3B,CAAC,CAAC,CAAC;IACP,CAAC;IACM,mBAAmB,CAAC,OAAyB;QAChD,MAAM,UAAU,GAAG,OAAO,CAAC,cAAc,CAAC,gBAAgB,CAAC,wBAAwB,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QAC1G,IAAI,UAAU,EAAE;YACZ,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;SAC1C;aAAM;YACH,KAAK,CAAC,IAAI,CAAC,kEAAkE,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC;SACxG;IACL,CAAC;CACJ","sourcesContent":["import type { Observer } from \"../../../Misc/observable\";\r\nimport type { FlowGraphContext } from \"../../flowGraphContext\";\r\nimport { FlowGraphEventBlock } from \"../../flowGraphEventBlock\";\r\nimport type { FlowGraphCustomEvent } from \"../../flowGraphCustomEvent\";\r\nimport type { Nullable } from \"../../../types\";\r\nimport { Tools } from \"../../../Misc/tools\";\r\nimport type { FlowGraphDataConnection } from \"../../flowGraphDataConnection\";\r\nimport { RichTypeAny } from \"../../flowGraphRichTypes\";\r\n\r\n/**\r\n * @experimental\r\n * Parameters used to create a FlowGraphReceiveCustomEventBlock.\r\n */\r\nexport interface IFlowGraphReceiveCustomEventBlockParameters {\r\n eventId: string;\r\n}\r\n\r\n/**\r\n * @experimental\r\n * A block that receives a custom event. It saves the data sent in the eventData output.\r\n */\r\nexport class FlowGraphReceiveCustomEventBlock extends FlowGraphEventBlock {\r\n private _eventObserver: Nullable<Observer<FlowGraphCustomEvent>>;\r\n\r\n /**\r\n * Output connection: The data sent with the event.\r\n */\r\n public eventData: FlowGraphDataConnection<any>;\r\n\r\n constructor(private _params: IFlowGraphReceiveCustomEventBlockParameters) {\r\n super();\r\n this.eventData = this._registerDataOutput(\"eventData\", RichTypeAny);\r\n }\r\n public _preparePendingTasks(context: FlowGraphContext): void {\r\n const observable = context.graphVariables.eventCoordinator.getCustomEventObservable(this._params.eventId);\r\n this._eventObserver = observable.add((event) => {\r\n this.eventData.value = event;\r\n this._execute(context);\r\n });\r\n }\r\n public _cancelPendingTasks(context: FlowGraphContext): void {\r\n const observable = context.graphVariables.eventCoordinator.getCustomEventObservable(this._params.eventId);\r\n if (observable) {\r\n observable.remove(this._eventObserver);\r\n } else {\r\n Tools.Warn(`FlowGraphReceiveCustomEventBlock: Missing observable for event ${this._params.eventId}`);\r\n }\r\n }\r\n}\r\n"]}
@@ -1,20 +1,16 @@
1
- import type { Scene } from "../../../scene";
2
- import type { FlowGraph } from "../../flowGraph";
3
1
  import { FlowGraphEventBlock } from "../../flowGraphEventBlock";
2
+ import type { FlowGraphContext } from "../../flowGraphContext.js";
4
3
  /**
5
4
  * @experimental
6
5
  * Block that triggers when a scene is ready.
7
6
  */
8
7
  export declare class FlowGraphSceneReadyEventBlock extends FlowGraphEventBlock {
9
- private _scene;
10
- private _sceneReadyObserver;
11
- constructor(graph: FlowGraph, scene: Scene);
12
8
  /**
13
9
  * @internal
14
10
  */
15
- _startListening(): void;
11
+ _preparePendingTasks(context: FlowGraphContext): void;
16
12
  /**
17
13
  * @internal
18
14
  */
19
- _stopListening(): void;
15
+ _cancelPendingTasks(context: FlowGraphContext): void;
20
16
  }
@@ -4,26 +4,26 @@ import { FlowGraphEventBlock } from "../../flowGraphEventBlock.js";
4
4
  * Block that triggers when a scene is ready.
5
5
  */
6
6
  export class FlowGraphSceneReadyEventBlock extends FlowGraphEventBlock {
7
- constructor(graph, scene) {
8
- super(graph);
9
- this._scene = scene;
10
- }
11
7
  /**
12
8
  * @internal
13
9
  */
14
- _startListening() {
15
- if (!this._sceneReadyObserver) {
16
- this._sceneReadyObserver = this._scene.onReadyObservable.add(() => {
17
- this._execute();
10
+ _preparePendingTasks(context) {
11
+ if (!context._getExecutionVariable(this, "sceneReadyObserver")) {
12
+ const scene = context.graphVariables.scene;
13
+ const contextObserver = scene.onReadyObservable.add(() => {
14
+ this._execute(context);
18
15
  });
16
+ context._setExecutionVariable(this, "sceneReadyObserver", contextObserver);
19
17
  }
20
18
  }
21
19
  /**
22
20
  * @internal
23
21
  */
24
- _stopListening() {
25
- this._scene.onReadyObservable.remove(this._sceneReadyObserver);
26
- this._sceneReadyObserver = null;
22
+ _cancelPendingTasks(context) {
23
+ const contextObserver = context._getExecutionVariable(this, "sceneReadyObserver");
24
+ const scene = context.graphVariables.scene;
25
+ scene.onReadyObservable.remove(contextObserver);
26
+ context._deleteExecutionVariable(this, "sceneReadyObserver");
27
27
  }
28
28
  }
29
29
  //# sourceMappingURL=flowGraphSceneReadyEventBlock.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"flowGraphSceneReadyEventBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FlowGraph/Blocks/Event/flowGraphSceneReadyEventBlock.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAEhE;;;GAGG;AACH,MAAM,OAAO,6BAA8B,SAAQ,mBAAmB;IAIlE,YAAmB,KAAgB,EAAE,KAAY;QAC7C,KAAK,CAAC,KAAK,CAAC,CAAC;QACb,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;IACxB,CAAC;IAED;;OAEG;IACI,eAAe;QAClB,IAAI,CAAC,IAAI,CAAC,mBAAmB,EAAE;YAC3B,IAAI,CAAC,mBAAmB,GAAG,IAAI,CAAC,MAAM,CAAC,iBAAiB,CAAC,GAAG,CAAC,GAAG,EAAE;gBAC9D,IAAI,CAAC,QAAQ,EAAE,CAAC;YACpB,CAAC,CAAC,CAAC;SACN;IACL,CAAC;IAED;;OAEG;IACI,cAAc;QACjB,IAAI,CAAC,MAAM,CAAC,iBAAiB,CAAC,MAAM,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC;QAC/D,IAAI,CAAC,mBAAmB,GAAG,IAAI,CAAC;IACpC,CAAC;CACJ","sourcesContent":["import type { Nullable } from \"../../../types\";\r\nimport type { Observer } from \"../../../Misc/observable\";\r\nimport type { Scene } from \"../../../scene\";\r\nimport type { FlowGraph } from \"../../flowGraph\";\r\nimport { FlowGraphEventBlock } from \"../../flowGraphEventBlock\";\r\n\r\n/**\r\n * @experimental\r\n * Block that triggers when a scene is ready.\r\n */\r\nexport class FlowGraphSceneReadyEventBlock extends FlowGraphEventBlock {\r\n private _scene: Scene;\r\n private _sceneReadyObserver: Nullable<Observer<Scene>>;\r\n\r\n public constructor(graph: FlowGraph, scene: Scene) {\r\n super(graph);\r\n this._scene = scene;\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _startListening(): void {\r\n if (!this._sceneReadyObserver) {\r\n this._sceneReadyObserver = this._scene.onReadyObservable.add(() => {\r\n this._execute();\r\n });\r\n }\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _stopListening() {\r\n this._scene.onReadyObservable.remove(this._sceneReadyObserver);\r\n this._sceneReadyObserver = null;\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"flowGraphSceneReadyEventBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FlowGraph/Blocks/Event/flowGraphSceneReadyEventBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAGhE;;;GAGG;AACH,MAAM,OAAO,6BAA8B,SAAQ,mBAAmB;IAClE;;OAEG;IACI,oBAAoB,CAAC,OAAyB;QACjD,IAAI,CAAC,OAAO,CAAC,qBAAqB,CAAC,IAAI,EAAE,oBAAoB,CAAC,EAAE;YAC5D,MAAM,KAAK,GAAG,OAAO,CAAC,cAAc,CAAC,KAAK,CAAC;YAC3C,MAAM,eAAe,GAAG,KAAK,CAAC,iBAAiB,CAAC,GAAG,CAAC,GAAG,EAAE;gBACrD,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;YAC3B,CAAC,CAAC,CAAC;YACH,OAAO,CAAC,qBAAqB,CAAC,IAAI,EAAE,oBAAoB,EAAE,eAAe,CAAC,CAAC;SAC9E;IACL,CAAC;IAED;;OAEG;IACI,mBAAmB,CAAC,OAAyB;QAChD,MAAM,eAAe,GAAG,OAAO,CAAC,qBAAqB,CAAC,IAAI,EAAE,oBAAoB,CAAC,CAAC;QAClF,MAAM,KAAK,GAAG,OAAO,CAAC,cAAc,CAAC,KAAK,CAAC;QAC3C,KAAK,CAAC,iBAAiB,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC;QAChD,OAAO,CAAC,wBAAwB,CAAC,IAAI,EAAE,oBAAoB,CAAC,CAAC;IACjE,CAAC;CACJ","sourcesContent":["import { FlowGraphEventBlock } from \"../../flowGraphEventBlock\";\r\nimport type { FlowGraphContext } from \"core/FlowGraph/flowGraphContext\";\r\n\r\n/**\r\n * @experimental\r\n * Block that triggers when a scene is ready.\r\n */\r\nexport class FlowGraphSceneReadyEventBlock extends FlowGraphEventBlock {\r\n /**\r\n * @internal\r\n */\r\n public _preparePendingTasks(context: FlowGraphContext): void {\r\n if (!context._getExecutionVariable(this, \"sceneReadyObserver\")) {\r\n const scene = context.graphVariables.scene;\r\n const contextObserver = scene.onReadyObservable.add(() => {\r\n this._execute(context);\r\n });\r\n context._setExecutionVariable(this, \"sceneReadyObserver\", contextObserver);\r\n }\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _cancelPendingTasks(context: FlowGraphContext) {\r\n const contextObserver = context._getExecutionVariable(this, \"sceneReadyObserver\");\r\n const scene = context.graphVariables.scene;\r\n scene.onReadyObservable.remove(contextObserver);\r\n context._deleteExecutionVariable(this, \"sceneReadyObserver\");\r\n }\r\n}\r\n"]}
@@ -1,2 +1,3 @@
1
1
  export * from "./flowGraphMeshPickEventBlock";
2
2
  export * from "./flowGraphSceneReadyEventBlock";
3
+ export * from "./flowGraphReceiveCustomEventBlock";
@@ -1,3 +1,4 @@
1
1
  export * from "./flowGraphMeshPickEventBlock.js";
2
2
  export * from "./flowGraphSceneReadyEventBlock.js";
3
+ export * from "./flowGraphReceiveCustomEventBlock.js";
3
4
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FlowGraph/Blocks/Event/index.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAC;AAC9C,cAAc,iCAAiC,CAAC","sourcesContent":["export * from \"./flowGraphMeshPickEventBlock\";\r\nexport * from \"./flowGraphSceneReadyEventBlock\";\r\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FlowGraph/Blocks/Event/index.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAC;AAC9C,cAAc,iCAAiC,CAAC;AAChD,cAAc,oCAAoC,CAAC","sourcesContent":["export * from \"./flowGraphMeshPickEventBlock\";\r\nexport * from \"./flowGraphSceneReadyEventBlock\";\r\nexport * from \"./flowGraphReceiveCustomEventBlock\";\r\n"]}
@@ -0,0 +1,24 @@
1
+ import type { FlowGraphContext } from "../../flowGraphContext";
2
+ import type { FlowGraphDataConnection } from "../../flowGraphDataConnection";
3
+ import { FlowGraphExecutionBlock } from "../../flowGraphExecutionBlock";
4
+ import type { FlowGraphSignalConnection } from "../../flowGraphSignalConnection";
5
+ /**
6
+ * @experimental
7
+ * A block that evaluates a condition and executes one of two branches.
8
+ */
9
+ export declare class FlowGraphConditionalBlock extends FlowGraphExecutionBlock {
10
+ /**
11
+ * Input connection: The condition to evaluate.
12
+ */
13
+ readonly condition: FlowGraphDataConnection<boolean>;
14
+ /**
15
+ * Output connection: The branch to execute if the condition is true.
16
+ */
17
+ readonly onTrue: FlowGraphSignalConnection;
18
+ /**
19
+ * Output connection: The branch to execute if the condition is false.
20
+ */
21
+ readonly onFalse: FlowGraphSignalConnection;
22
+ constructor();
23
+ _execute(context: FlowGraphContext): void;
24
+ }
@@ -0,0 +1,23 @@
1
+ import { RichTypeBoolean } from "../../flowGraphRichTypes.js";
2
+ import { FlowGraphExecutionBlock } from "../../flowGraphExecutionBlock.js";
3
+ /**
4
+ * @experimental
5
+ * A block that evaluates a condition and executes one of two branches.
6
+ */
7
+ export class FlowGraphConditionalBlock extends FlowGraphExecutionBlock {
8
+ constructor() {
9
+ super();
10
+ this.condition = this._registerDataInput("condition", RichTypeBoolean);
11
+ this.onTrue = this._registerSignalOutput("onTrue");
12
+ this.onFalse = this._registerSignalOutput("onFalse");
13
+ }
14
+ _execute(context) {
15
+ if (this.condition.getValue(context)) {
16
+ this.onTrue._activateSignal(context);
17
+ }
18
+ else {
19
+ this.onFalse._activateSignal(context);
20
+ }
21
+ }
22
+ }
23
+ //# sourceMappingURL=flowGraphConditionalBlock.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"flowGraphConditionalBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FlowGraph/Blocks/Execution/flowGraphConditionalBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAG3D,OAAO,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAC;AAGxE;;;GAGG;AACH,MAAM,OAAO,yBAA0B,SAAQ,uBAAuB;IAclE;QACI,KAAK,EAAE,CAAC;QAER,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,kBAAkB,CAAC,WAAW,EAAE,eAAe,CAAC,CAAC;QAEvE,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;CACJ","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\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 FlowGraphConditionalBlock 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() {\r\n super();\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"]}
@@ -1,43 +1,40 @@
1
- import type { FlowGraph } from "../../flowGraph";
2
1
  import type { FlowGraphSignalConnection } from "../../flowGraphSignalConnection";
3
2
  import type { FlowGraphDataConnection } from "../../flowGraphDataConnection";
4
3
  import { FlowGraphWithOnDoneExecutionBlock } from "../../flowGraphWithOnDoneExecutionBlock.js";
4
+ import type { FlowGraphContext } from "../../flowGraphContext";
5
5
  /**
6
6
  * @experimental
7
- * Block that executes a loop.
7
+ * Block that executes an action in a loop.
8
8
  */
9
9
  export declare class FlowGraphForLoopBlock extends FlowGraphWithOnDoneExecutionBlock {
10
10
  /**
11
- * The start index of the loop.
11
+ * Input connection: The start index of the loop.
12
12
  */
13
13
  readonly startIndex: FlowGraphDataConnection<number>;
14
14
  /**
15
- * The end index of the loop.
15
+ * Input connection: The end index of the loop.
16
16
  */
17
17
  readonly endIndex: FlowGraphDataConnection<number>;
18
18
  /**
19
- * The step of the loop.
19
+ * Input connection: The step of the loop.
20
20
  */
21
21
  readonly step: FlowGraphDataConnection<number>;
22
22
  /**
23
- * The current index of the loop.
23
+ * Output connection: The current index of the loop.
24
24
  */
25
25
  readonly index: FlowGraphDataConnection<number>;
26
26
  /**
27
- * The signal that is activated when the loop body is executed.
27
+ * Output connection: The signal that is activated when the loop body is executed.
28
28
  */
29
29
  readonly onLoop: FlowGraphSignalConnection;
30
30
  /**
31
- * The signal that is activated when the loop is done.
31
+ * Output connection: The signal that is activated when the loop is done.
32
32
  */
33
33
  readonly onDone: FlowGraphSignalConnection;
34
- private _currentIndex;
35
- private _cachedEndIndex;
36
- private _cachedStep;
37
- constructor(graph: FlowGraph);
34
+ constructor();
38
35
  private _executeLoop;
39
36
  /**
40
37
  * @internal
41
38
  */
42
- _execute(): void;
39
+ _execute(context: FlowGraphContext): void;
43
40
  }