@babylonjs/core 7.51.1 → 7.51.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (313) hide show
  1. package/Animations/animation.js +2 -1
  2. package/Animations/animation.js.map +1 -1
  3. package/Buffers/bufferUtils.d.ts +7 -5
  4. package/Buffers/bufferUtils.js +13 -9
  5. package/Buffers/bufferUtils.js.map +1 -1
  6. package/Engines/abstractEngine.js +2 -2
  7. package/Engines/abstractEngine.js.map +1 -1
  8. package/Engines/constants.d.ts +32 -0
  9. package/Engines/constants.js +33 -0
  10. package/Engines/constants.js.map +1 -1
  11. package/Engines/webgpuEngine.js +6 -3
  12. package/Engines/webgpuEngine.js.map +1 -1
  13. package/FlowGraph/Blocks/Data/Math/flowGraphMathBlocks.d.ts +148 -465
  14. package/FlowGraph/Blocks/Data/Math/flowGraphMathBlocks.js +394 -691
  15. package/FlowGraph/Blocks/Data/Math/flowGraphMathBlocks.js.map +1 -1
  16. package/FlowGraph/Blocks/Data/Math/flowGraphMathCombineExtractBlocks.d.ts +142 -0
  17. package/FlowGraph/Blocks/Data/Math/flowGraphMathCombineExtractBlocks.js +342 -0
  18. package/FlowGraph/Blocks/Data/Math/flowGraphMathCombineExtractBlocks.js.map +1 -0
  19. package/FlowGraph/Blocks/Data/Math/flowGraphMatrixMathBlocks.d.ts +107 -0
  20. package/FlowGraph/Blocks/Data/Math/flowGraphMatrixMathBlocks.js +130 -0
  21. package/FlowGraph/Blocks/Data/Math/flowGraphMatrixMathBlocks.js.map +1 -0
  22. package/FlowGraph/Blocks/Data/Math/flowGraphVectorMathBlocks.d.ts +77 -0
  23. package/FlowGraph/Blocks/Data/Math/flowGraphVectorMathBlocks.js +139 -0
  24. package/FlowGraph/Blocks/Data/Math/flowGraphVectorMathBlocks.js.map +1 -0
  25. package/FlowGraph/Blocks/Data/Math/index.d.ts +3 -0
  26. package/FlowGraph/Blocks/Data/Math/index.js +3 -0
  27. package/FlowGraph/Blocks/Data/Math/index.js.map +1 -1
  28. package/FlowGraph/Blocks/Data/Transformers/flowGraphJsonPointerParserBlock.d.ts +85 -0
  29. package/FlowGraph/Blocks/Data/Transformers/flowGraphJsonPointerParserBlock.js +133 -0
  30. package/FlowGraph/Blocks/Data/Transformers/flowGraphJsonPointerParserBlock.js.map +1 -0
  31. package/FlowGraph/Blocks/Data/Transformers/flowGraphTypeToTypeBlocks.d.ts +49 -0
  32. package/FlowGraph/Blocks/Data/Transformers/flowGraphTypeToTypeBlocks.js +71 -0
  33. package/FlowGraph/Blocks/Data/Transformers/flowGraphTypeToTypeBlocks.js.map +1 -0
  34. package/FlowGraph/Blocks/Data/Transformers/index.d.ts +2 -0
  35. package/FlowGraph/Blocks/Data/Transformers/index.js +3 -0
  36. package/FlowGraph/Blocks/Data/Transformers/index.js.map +1 -0
  37. package/FlowGraph/Blocks/Data/Utils/flowGraphArrayIndexBlock.d.ts +39 -0
  38. package/FlowGraph/Blocks/Data/Utils/flowGraphArrayIndexBlock.js +46 -0
  39. package/FlowGraph/Blocks/Data/Utils/flowGraphArrayIndexBlock.js.map +1 -0
  40. package/FlowGraph/Blocks/Data/Utils/flowGraphCodeExecutionBlock.d.ts +35 -0
  41. package/FlowGraph/Blocks/Data/Utils/flowGraphCodeExecutionBlock.js +34 -0
  42. package/FlowGraph/Blocks/Data/Utils/flowGraphCodeExecutionBlock.js.map +1 -0
  43. package/FlowGraph/Blocks/Data/Utils/flowGraphContextBlock.d.ts +20 -0
  44. package/FlowGraph/Blocks/Data/Utils/flowGraphContextBlock.js +25 -0
  45. package/FlowGraph/Blocks/Data/Utils/flowGraphContextBlock.js.map +1 -0
  46. package/FlowGraph/Blocks/Data/Utils/flowGraphFunctionReferenceBlock.d.ts +34 -0
  47. package/FlowGraph/Blocks/Data/Utils/flowGraphFunctionReferenceBlock.js +35 -0
  48. package/FlowGraph/Blocks/Data/Utils/flowGraphFunctionReferenceBlock.js.map +1 -0
  49. package/FlowGraph/Blocks/Data/Utils/flowGraphIndexOfBlock.d.ts +39 -0
  50. package/FlowGraph/Blocks/Data/Utils/flowGraphIndexOfBlock.js +42 -0
  51. package/FlowGraph/Blocks/Data/Utils/flowGraphIndexOfBlock.js.map +1 -0
  52. package/FlowGraph/Blocks/Data/Utils/index.d.ts +5 -0
  53. package/FlowGraph/Blocks/Data/Utils/index.js +6 -0
  54. package/FlowGraph/Blocks/Data/Utils/index.js.map +1 -0
  55. package/FlowGraph/Blocks/Data/flowGraphBinaryOperationBlock.d.ts +0 -1
  56. package/FlowGraph/Blocks/Data/flowGraphBinaryOperationBlock.js +3 -2
  57. package/FlowGraph/Blocks/Data/flowGraphBinaryOperationBlock.js.map +1 -1
  58. package/FlowGraph/Blocks/Data/flowGraphCachedOperationBlock.d.ts +1 -1
  59. package/FlowGraph/Blocks/Data/flowGraphCachedOperationBlock.js +4 -4
  60. package/FlowGraph/Blocks/Data/flowGraphCachedOperationBlock.js.map +1 -1
  61. package/FlowGraph/Blocks/Data/flowGraphConditionalDataBlock.d.ts +6 -3
  62. package/FlowGraph/Blocks/Data/flowGraphConditionalDataBlock.js +12 -6
  63. package/FlowGraph/Blocks/Data/flowGraphConditionalDataBlock.js.map +1 -1
  64. package/FlowGraph/Blocks/Data/flowGraphConstantBlock.d.ts +0 -2
  65. package/FlowGraph/Blocks/Data/flowGraphConstantBlock.js +2 -3
  66. package/FlowGraph/Blocks/Data/flowGraphConstantBlock.js.map +1 -1
  67. package/FlowGraph/Blocks/Data/flowGraphConstantOperationBlock.d.ts +5 -4
  68. package/FlowGraph/Blocks/Data/flowGraphConstantOperationBlock.js +5 -4
  69. package/FlowGraph/Blocks/Data/flowGraphConstantOperationBlock.js.map +1 -1
  70. package/FlowGraph/Blocks/Data/flowGraphGetAssetBlock.d.ts +62 -0
  71. package/FlowGraph/Blocks/Data/flowGraphGetAssetBlock.js +41 -0
  72. package/FlowGraph/Blocks/Data/flowGraphGetAssetBlock.js.map +1 -0
  73. package/FlowGraph/Blocks/Data/flowGraphGetPropertyBlock.d.ts +38 -33
  74. package/FlowGraph/Blocks/Data/flowGraphGetPropertyBlock.js +42 -25
  75. package/FlowGraph/Blocks/Data/flowGraphGetPropertyBlock.js.map +1 -1
  76. package/FlowGraph/Blocks/Data/flowGraphGetVariableBlock.d.ts +11 -16
  77. package/FlowGraph/Blocks/Data/flowGraphGetVariableBlock.js +9 -17
  78. package/FlowGraph/Blocks/Data/flowGraphGetVariableBlock.js.map +1 -1
  79. package/FlowGraph/Blocks/Data/flowGraphTernaryOperationBlock.d.ts +1 -1
  80. package/FlowGraph/Blocks/Data/flowGraphTernaryOperationBlock.js +1 -1
  81. package/FlowGraph/Blocks/Data/flowGraphTernaryOperationBlock.js.map +1 -1
  82. package/FlowGraph/Blocks/Data/{flowGraphCoordinateTransformBlock.d.ts → flowGraphTransformCoordinatesSystemBlock.d.ts} +1 -2
  83. package/FlowGraph/Blocks/Data/{flowGraphCoordinateTransformBlock.js → flowGraphTransformCoordinatesSystemBlock.js} +4 -5
  84. package/FlowGraph/Blocks/Data/flowGraphTransformCoordinatesSystemBlock.js.map +1 -0
  85. package/FlowGraph/Blocks/Data/flowGraphUnaryOperationBlock.d.ts +1 -1
  86. package/FlowGraph/Blocks/Data/flowGraphUnaryOperationBlock.js +1 -1
  87. package/FlowGraph/Blocks/Data/flowGraphUnaryOperationBlock.js.map +1 -1
  88. package/FlowGraph/Blocks/Data/index.d.ts +7 -3
  89. package/FlowGraph/Blocks/Data/index.js +9 -4
  90. package/FlowGraph/Blocks/Data/index.js.map +1 -1
  91. package/FlowGraph/Blocks/Event/flowGraphMeshPickEventBlock.d.ts +45 -24
  92. package/FlowGraph/Blocks/Event/flowGraphMeshPickEventBlock.js +45 -51
  93. package/FlowGraph/Blocks/Event/flowGraphMeshPickEventBlock.js.map +1 -1
  94. package/FlowGraph/Blocks/Event/flowGraphPointerOutEventBlock.d.ts +61 -0
  95. package/FlowGraph/Blocks/Event/flowGraphPointerOutEventBlock.js +39 -0
  96. package/FlowGraph/Blocks/Event/flowGraphPointerOutEventBlock.js.map +1 -0
  97. package/FlowGraph/Blocks/Event/flowGraphPointerOverEventBlock.d.ts +61 -0
  98. package/FlowGraph/Blocks/Event/flowGraphPointerOverEventBlock.js +40 -0
  99. package/FlowGraph/Blocks/Event/flowGraphPointerOverEventBlock.js.map +1 -0
  100. package/FlowGraph/Blocks/Event/flowGraphReceiveCustomEventBlock.d.ts +12 -14
  101. package/FlowGraph/Blocks/Event/flowGraphReceiveCustomEventBlock.js +19 -26
  102. package/FlowGraph/Blocks/Event/flowGraphReceiveCustomEventBlock.js.map +1 -1
  103. package/FlowGraph/Blocks/Event/flowGraphSceneReadyEventBlock.d.ts +6 -12
  104. package/FlowGraph/Blocks/Event/flowGraphSceneReadyEventBlock.js +13 -24
  105. package/FlowGraph/Blocks/Event/flowGraphSceneReadyEventBlock.js.map +1 -1
  106. package/FlowGraph/Blocks/Event/flowGraphSceneTickEventBlock.d.ts +31 -7
  107. package/FlowGraph/Blocks/Event/flowGraphSceneTickEventBlock.js +22 -20
  108. package/FlowGraph/Blocks/Event/flowGraphSceneTickEventBlock.js.map +1 -1
  109. package/FlowGraph/Blocks/{Execution → Event}/flowGraphSendCustomEventBlock.d.ts +12 -7
  110. package/FlowGraph/Blocks/Event/flowGraphSendCustomEventBlock.js +39 -0
  111. package/FlowGraph/Blocks/Event/flowGraphSendCustomEventBlock.js.map +1 -0
  112. package/FlowGraph/Blocks/Event/index.d.ts +3 -0
  113. package/FlowGraph/Blocks/Event/index.js +3 -0
  114. package/FlowGraph/Blocks/Event/index.js.map +1 -1
  115. package/FlowGraph/Blocks/Execution/Animation/flowGraphBezierCurveEasingBlock.d.ts +44 -0
  116. package/FlowGraph/Blocks/Execution/Animation/flowGraphBezierCurveEasingBlock.js +46 -0
  117. package/FlowGraph/Blocks/Execution/Animation/flowGraphBezierCurveEasingBlock.js.map +1 -0
  118. package/FlowGraph/Blocks/Execution/Animation/flowGraphEasingBlock.d.ts +60 -0
  119. package/FlowGraph/Blocks/Execution/Animation/flowGraphEasingBlock.js +93 -0
  120. package/FlowGraph/Blocks/Execution/Animation/flowGraphEasingBlock.js.map +1 -0
  121. package/FlowGraph/Blocks/Execution/Animation/flowGraphInterpolationBlock.d.ts +82 -0
  122. package/FlowGraph/Blocks/Execution/Animation/flowGraphInterpolationBlock.js +105 -0
  123. package/FlowGraph/Blocks/Execution/Animation/flowGraphInterpolationBlock.js.map +1 -0
  124. package/FlowGraph/Blocks/Execution/Animation/flowGraphPauseAnimationBlock.d.ts +2 -2
  125. package/FlowGraph/Blocks/Execution/Animation/flowGraphPauseAnimationBlock.js +2 -2
  126. package/FlowGraph/Blocks/Execution/Animation/flowGraphPauseAnimationBlock.js.map +1 -1
  127. package/FlowGraph/Blocks/Execution/Animation/flowGraphPlayAnimationBlock.d.ts +40 -42
  128. package/FlowGraph/Blocks/Execution/Animation/flowGraphPlayAnimationBlock.js +116 -50
  129. package/FlowGraph/Blocks/Execution/Animation/flowGraphPlayAnimationBlock.js.map +1 -1
  130. package/FlowGraph/Blocks/Execution/Animation/flowGraphStopAnimationBlock.d.ts +12 -4
  131. package/FlowGraph/Blocks/Execution/Animation/flowGraphStopAnimationBlock.js +86 -8
  132. package/FlowGraph/Blocks/Execution/Animation/flowGraphStopAnimationBlock.js.map +1 -1
  133. package/FlowGraph/Blocks/Execution/Animation/index.d.ts +3 -0
  134. package/FlowGraph/Blocks/Execution/Animation/index.js +3 -0
  135. package/FlowGraph/Blocks/Execution/Animation/index.js.map +1 -1
  136. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphBranchBlock.d.ts +1 -2
  137. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphBranchBlock.js +3 -4
  138. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphBranchBlock.js.map +1 -1
  139. package/FlowGraph/Blocks/Execution/{Audio/flowGraphStopAudioBlock.d.ts → ControlFlow/flowGraphCancelDelayBlock.d.ts} +6 -8
  140. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphCancelDelayBlock.js +31 -0
  141. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphCancelDelayBlock.js.map +1 -0
  142. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphCounterBlock.d.ts +2 -2
  143. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphCounterBlock.js +5 -5
  144. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphCounterBlock.js.map +1 -1
  145. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDebounceBlock.d.ts +0 -1
  146. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDebounceBlock.js +2 -3
  147. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDebounceBlock.js.map +1 -1
  148. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDoNBlock.d.ts +5 -10
  149. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDoNBlock.js +11 -15
  150. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDoNBlock.js.map +1 -1
  151. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphFlipFlopBlock.d.ts +11 -3
  152. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphFlipFlopBlock.js +5 -6
  153. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphFlipFlopBlock.js.map +1 -1
  154. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphForLoopBlock.d.ts +27 -7
  155. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphForLoopBlock.js +28 -30
  156. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphForLoopBlock.js.map +1 -1
  157. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphMultiGateBlock.d.ts +13 -16
  158. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphMultiGateBlock.js +50 -52
  159. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphMultiGateBlock.js.map +1 -1
  160. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphSequenceBlock.d.ts +8 -9
  161. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphSequenceBlock.js +26 -13
  162. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphSequenceBlock.js.map +1 -1
  163. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphSetDelayBlock.d.ts +32 -0
  164. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphSetDelayBlock.js +84 -0
  165. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphSetDelayBlock.js.map +1 -0
  166. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphSwitchBlock.d.ts +20 -6
  167. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphSwitchBlock.js +55 -16
  168. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphSwitchBlock.js.map +1 -1
  169. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphThrottleBlock.d.ts +3 -4
  170. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphThrottleBlock.js +36 -13
  171. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphThrottleBlock.js.map +1 -1
  172. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWaitAllBlock.d.ts +13 -5
  173. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWaitAllBlock.js +22 -17
  174. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWaitAllBlock.js.map +1 -1
  175. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWhileLoopBlock.d.ts +12 -16
  176. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWhileLoopBlock.js +21 -21
  177. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWhileLoopBlock.js.map +1 -1
  178. package/FlowGraph/Blocks/Execution/ControlFlow/index.d.ts +2 -1
  179. package/FlowGraph/Blocks/Execution/ControlFlow/index.js +2 -1
  180. package/FlowGraph/Blocks/Execution/ControlFlow/index.js.map +1 -1
  181. package/FlowGraph/Blocks/Execution/flowGraphConsoleLogBlock.d.ts +4 -5
  182. package/FlowGraph/Blocks/Execution/flowGraphConsoleLogBlock.js +13 -8
  183. package/FlowGraph/Blocks/Execution/flowGraphConsoleLogBlock.js.map +1 -1
  184. package/FlowGraph/Blocks/Execution/flowGraphSetPropertyBlock.d.ts +33 -36
  185. package/FlowGraph/Blocks/Execution/flowGraphSetPropertyBlock.js +42 -26
  186. package/FlowGraph/Blocks/Execution/flowGraphSetPropertyBlock.js.map +1 -1
  187. package/FlowGraph/Blocks/Execution/flowGraphSetVariableBlock.d.ts +10 -25
  188. package/FlowGraph/Blocks/Execution/flowGraphSetVariableBlock.js +38 -24
  189. package/FlowGraph/Blocks/Execution/flowGraphSetVariableBlock.js.map +1 -1
  190. package/FlowGraph/Blocks/Execution/index.d.ts +0 -3
  191. package/FlowGraph/Blocks/Execution/index.js +0 -3
  192. package/FlowGraph/Blocks/Execution/index.js.map +1 -1
  193. package/FlowGraph/Blocks/flowGraphBlockFactory.d.ts +16 -0
  194. package/FlowGraph/Blocks/flowGraphBlockFactory.js +292 -0
  195. package/FlowGraph/Blocks/flowGraphBlockFactory.js.map +1 -0
  196. package/FlowGraph/Blocks/flowGraphBlockNames.d.ts +145 -0
  197. package/FlowGraph/Blocks/flowGraphBlockNames.js +147 -0
  198. package/FlowGraph/Blocks/flowGraphBlockNames.js.map +1 -0
  199. package/FlowGraph/Blocks/index.d.ts +2 -0
  200. package/FlowGraph/Blocks/index.js +2 -0
  201. package/FlowGraph/Blocks/index.js.map +1 -1
  202. package/FlowGraph/{flowGraphInteger.d.ts → CustomTypes/flowGraphInteger.d.ts} +2 -3
  203. package/FlowGraph/{flowGraphInteger.js → CustomTypes/flowGraphInteger.js} +4 -5
  204. package/FlowGraph/CustomTypes/flowGraphInteger.js.map +1 -0
  205. package/FlowGraph/CustomTypes/flowGraphMatrix.d.ts +196 -0
  206. package/FlowGraph/CustomTypes/flowGraphMatrix.js +272 -0
  207. package/FlowGraph/CustomTypes/flowGraphMatrix.js.map +1 -0
  208. package/FlowGraph/CustomTypes/index.d.ts +2 -0
  209. package/FlowGraph/CustomTypes/index.js +3 -0
  210. package/FlowGraph/CustomTypes/index.js.map +1 -0
  211. package/FlowGraph/flowGraph.d.ts +29 -34
  212. package/FlowGraph/flowGraph.js +120 -104
  213. package/FlowGraph/flowGraph.js.map +1 -1
  214. package/FlowGraph/flowGraphAssetsContext.d.ts +29 -0
  215. package/FlowGraph/flowGraphAssetsContext.js +52 -0
  216. package/FlowGraph/flowGraphAssetsContext.js.map +1 -0
  217. package/FlowGraph/flowGraphAsyncExecutionBlock.d.ts +15 -8
  218. package/FlowGraph/flowGraphAsyncExecutionBlock.js +25 -5
  219. package/FlowGraph/flowGraphAsyncExecutionBlock.js.map +1 -1
  220. package/FlowGraph/flowGraphBlock.d.ts +22 -15
  221. package/FlowGraph/flowGraphBlock.js +31 -52
  222. package/FlowGraph/flowGraphBlock.js.map +1 -1
  223. package/FlowGraph/flowGraphConnection.d.ts +13 -12
  224. package/FlowGraph/flowGraphConnection.js +31 -16
  225. package/FlowGraph/flowGraphConnection.js.map +1 -1
  226. package/FlowGraph/flowGraphContext.d.ts +89 -13
  227. package/FlowGraph/flowGraphContext.js +210 -23
  228. package/FlowGraph/flowGraphContext.js.map +1 -1
  229. package/FlowGraph/flowGraphCoordinator.d.ts +4 -10
  230. package/FlowGraph/flowGraphCoordinator.js +4 -16
  231. package/FlowGraph/flowGraphCoordinator.js.map +1 -1
  232. package/FlowGraph/flowGraphDataConnection.d.ts +52 -14
  233. package/FlowGraph/flowGraphDataConnection.js +73 -26
  234. package/FlowGraph/flowGraphDataConnection.js.map +1 -1
  235. package/FlowGraph/flowGraphEventBlock.d.ts +17 -1
  236. package/FlowGraph/flowGraphEventBlock.js +13 -2
  237. package/FlowGraph/flowGraphEventBlock.js.map +1 -1
  238. package/FlowGraph/flowGraphEventType.d.ts +16 -0
  239. package/FlowGraph/flowGraphEventType.js +18 -0
  240. package/FlowGraph/flowGraphEventType.js.map +1 -0
  241. package/FlowGraph/flowGraphExecutionBlock.d.ts +11 -1
  242. package/FlowGraph/flowGraphExecutionBlock.js +21 -2
  243. package/FlowGraph/flowGraphExecutionBlock.js.map +1 -1
  244. package/FlowGraph/flowGraphExecutionBlockWithOutSignal.d.ts +2 -2
  245. package/FlowGraph/flowGraphExecutionBlockWithOutSignal.js +0 -1
  246. package/FlowGraph/flowGraphExecutionBlockWithOutSignal.js.map +1 -1
  247. package/FlowGraph/flowGraphLogger.d.ts +60 -0
  248. package/FlowGraph/flowGraphLogger.js +53 -0
  249. package/FlowGraph/flowGraphLogger.js.map +1 -0
  250. package/FlowGraph/flowGraphParser.d.ts +85 -0
  251. package/FlowGraph/flowGraphParser.js +271 -0
  252. package/FlowGraph/flowGraphParser.js.map +1 -0
  253. package/FlowGraph/flowGraphPathConverter.d.ts +1 -1
  254. package/FlowGraph/flowGraphPathConverter.js +3 -2
  255. package/FlowGraph/flowGraphPathConverter.js.map +1 -1
  256. package/FlowGraph/flowGraphPathConverterComponent.d.ts +8 -1
  257. package/FlowGraph/flowGraphPathConverterComponent.js +18 -2
  258. package/FlowGraph/flowGraphPathConverterComponent.js.map +1 -1
  259. package/FlowGraph/flowGraphRichTypes.d.ts +51 -9
  260. package/FlowGraph/flowGraphRichTypes.js +160 -50
  261. package/FlowGraph/flowGraphRichTypes.js.map +1 -1
  262. package/FlowGraph/flowGraphSceneEventCoordinator.d.ts +45 -0
  263. package/FlowGraph/flowGraphSceneEventCoordinator.js +77 -0
  264. package/FlowGraph/flowGraphSceneEventCoordinator.js.map +1 -0
  265. package/FlowGraph/flowGraphSignalConnection.d.ts +8 -5
  266. package/FlowGraph/flowGraphSignalConnection.js +26 -9
  267. package/FlowGraph/flowGraphSignalConnection.js.map +1 -1
  268. package/FlowGraph/index.d.ts +6 -1
  269. package/FlowGraph/index.js +7 -1
  270. package/FlowGraph/index.js.map +1 -1
  271. package/FlowGraph/serialization.d.ts +5 -2
  272. package/FlowGraph/serialization.js +94 -22
  273. package/FlowGraph/serialization.js.map +1 -1
  274. package/FlowGraph/typeDefinitions.d.ts +74 -12
  275. package/FlowGraph/typeDefinitions.js.map +1 -1
  276. package/FlowGraph/utils.d.ts +47 -0
  277. package/FlowGraph/utils.js +55 -0
  278. package/FlowGraph/utils.js.map +1 -1
  279. package/Maths/math.path.js +3 -0
  280. package/Maths/math.path.js.map +1 -1
  281. package/Meshes/geometry.d.ts +2 -1
  282. package/Meshes/geometry.js +8 -2
  283. package/Meshes/geometry.js.map +1 -1
  284. package/Meshes/mesh.d.ts +2 -1
  285. package/Meshes/mesh.js +3 -2
  286. package/Meshes/mesh.js.map +1 -1
  287. package/ObjectModel/objectModelInterfaces.d.ts +2 -2
  288. package/ObjectModel/objectModelInterfaces.js.map +1 -1
  289. package/package.json +1 -1
  290. package/FlowGraph/Blocks/Data/Logic/flowGraphLogicBlocks.d.ts +0 -24
  291. package/FlowGraph/Blocks/Data/Logic/flowGraphLogicBlocks.js +0 -39
  292. package/FlowGraph/Blocks/Data/Logic/flowGraphLogicBlocks.js.map +0 -1
  293. package/FlowGraph/Blocks/Data/Logic/index.d.ts +0 -1
  294. package/FlowGraph/Blocks/Data/Logic/index.js +0 -2
  295. package/FlowGraph/Blocks/Data/Logic/index.js.map +0 -1
  296. package/FlowGraph/Blocks/Data/flowGraphCoordinateTransformBlock.js.map +0 -1
  297. package/FlowGraph/Blocks/Execution/Audio/flowGraphPlayAudioBlock.d.ts +0 -19
  298. package/FlowGraph/Blocks/Execution/Audio/flowGraphPlayAudioBlock.js +0 -26
  299. package/FlowGraph/Blocks/Execution/Audio/flowGraphPlayAudioBlock.js.map +0 -1
  300. package/FlowGraph/Blocks/Execution/Audio/flowGraphStopAudioBlock.js +0 -25
  301. package/FlowGraph/Blocks/Execution/Audio/flowGraphStopAudioBlock.js.map +0 -1
  302. package/FlowGraph/Blocks/Execution/Audio/index.d.ts +0 -2
  303. package/FlowGraph/Blocks/Execution/Audio/index.js +0 -3
  304. package/FlowGraph/Blocks/Execution/Audio/index.js.map +0 -1
  305. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphTimerBlock.d.ts +0 -31
  306. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphTimerBlock.js +0 -69
  307. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphTimerBlock.js.map +0 -1
  308. package/FlowGraph/Blocks/Execution/flowGraphSendCustomEventBlock.js +0 -38
  309. package/FlowGraph/Blocks/Execution/flowGraphSendCustomEventBlock.js.map +0 -1
  310. package/FlowGraph/flowGraphContextLogger.d.ts +0 -9
  311. package/FlowGraph/flowGraphContextLogger.js +0 -14
  312. package/FlowGraph/flowGraphContextLogger.js.map +0 -1
  313. package/FlowGraph/flowGraphInteger.js.map +0 -1
@@ -1,53 +1,33 @@
1
1
  import { RegisterClass } from "../../../../Misc/typeStore.js";
2
- import { RichTypeAny, RichTypeBoolean, RichTypeFlowGraphInteger, RichTypeMatrix, RichTypeNumber, RichTypeVector2, RichTypeVector3 } from "../../../flowGraphRichTypes.js";
2
+ import { getRichTypeByFlowGraphType, RichTypeAny, RichTypeBoolean, RichTypeFlowGraphInteger, RichTypeNumber } from "../../../flowGraphRichTypes.js";
3
3
  import { FlowGraphBinaryOperationBlock } from "../flowGraphBinaryOperationBlock.js";
4
4
  import { FlowGraphConstantOperationBlock } from "../flowGraphConstantOperationBlock.js";
5
- import { Matrix, Vector2, Vector3, Vector4 } from "../../../../Maths/math.vector.js";
5
+ import { Quaternion, Matrix, Vector2, Vector3, Vector4 } from "../../../../Maths/math.vector.js";
6
6
  import { FlowGraphUnaryOperationBlock } from "../flowGraphUnaryOperationBlock.js";
7
7
  import { FlowGraphTernaryOperationBlock } from "../flowGraphTernaryOperationBlock.js";
8
- import { FlowGraphInteger } from "../../../flowGraphInteger.js";
8
+ import { FlowGraphInteger } from "../../../CustomTypes/flowGraphInteger.js";
9
+ import { FlowGraphMatrix2D, FlowGraphMatrix3D } from "../../../CustomTypes/flowGraphMatrix.js";
10
+ import { _areSameIntegerClass, _areSameMatrixClass, _areSameVectorClass, _getClassNameOf, getNumericValue, isNumeric } from "../../../utils.js";
9
11
  /**
10
- * @internal
11
- */
12
- function _getClassNameOf(v) {
13
- if (v.getClassName) {
14
- return v.getClassName();
15
- }
16
- return "";
17
- }
18
- /**
19
- * @internal
20
- * @returns
21
- */
22
- function _areSameVectorClass(className, className2) {
23
- return (className === "Vector2" && className2 === "Vector2") || (className === "Vector3" && className2 === "Vector3") || (className === "Vector4" && className2 === "Vector4");
24
- }
25
- /**
26
- * @internal
27
- * @returns
28
- */
29
- function _areSameMatrixClass(className, className2) {
30
- return className === "Matrix" && className2 === "Matrix";
31
- }
32
- /**
33
- * @internal
34
- * @returns
35
- */
36
- function _areSameIntegerClass(className, className2) {
37
- return className === "FlowGraphInteger" && className2 === "FlowGraphInteger";
38
- }
39
- /**
40
- * @experimental
41
12
  * Polymorphic add block.
42
13
  */
43
14
  export class FlowGraphAddBlock extends FlowGraphBinaryOperationBlock {
15
+ /**
16
+ * Construct a new add block.
17
+ * @param config optional configuration
18
+ */
44
19
  constructor(config) {
45
- super(RichTypeAny, RichTypeAny, RichTypeAny, (a, b) => this._polymorphicAdd(a, b), FlowGraphAddBlock.ClassName, config);
20
+ super(getRichTypeByFlowGraphType(config?.type), getRichTypeByFlowGraphType(config?.type), getRichTypeByFlowGraphType(config?.type), (a, b) => this._polymorphicAdd(a, b), "FlowGraphAddBlock" /* FlowGraphBlockNames.Add */, config);
46
21
  }
47
22
  _polymorphicAdd(a, b) {
48
23
  const aClassName = _getClassNameOf(a);
49
24
  const bClassName = _getClassNameOf(b);
50
25
  if (_areSameVectorClass(aClassName, bClassName) || _areSameMatrixClass(aClassName, bClassName) || _areSameIntegerClass(aClassName, bClassName)) {
26
+ // cast to vector3, but any other cast will be fine
27
+ return a.add(b);
28
+ }
29
+ else if (aClassName === "Quaternion" /* FlowGraphTypes.Quaternion */ || bClassName === "Quaternion" /* FlowGraphTypes.Quaternion */) {
30
+ // this is a simple add, and should be also supported between Quat and Vector4. Therefore -
51
31
  return a.add(b);
52
32
  }
53
33
  else {
@@ -55,46 +35,41 @@ export class FlowGraphAddBlock extends FlowGraphBinaryOperationBlock {
55
35
  }
56
36
  }
57
37
  }
38
+ RegisterClass("FlowGraphAddBlock" /* FlowGraphBlockNames.Add */, FlowGraphAddBlock);
58
39
  /**
59
- * the class name of the block.
60
- */
61
- FlowGraphAddBlock.ClassName = "FGAddBlock";
62
- RegisterClass(FlowGraphAddBlock.ClassName, FlowGraphAddBlock);
63
- /**
64
- * @experimental
65
- * Polymorphic add block.
40
+ * Polymorphic subtract block.
66
41
  */
67
42
  export class FlowGraphSubtractBlock extends FlowGraphBinaryOperationBlock {
43
+ /**
44
+ * Construct a new subtract block.
45
+ * @param config optional configuration
46
+ */
68
47
  constructor(config) {
69
- super(RichTypeAny, RichTypeAny, RichTypeAny, (a, b) => this._polymorphicAdd(a, b), FlowGraphSubtractBlock.ClassName, config);
48
+ super(getRichTypeByFlowGraphType(config?.type), getRichTypeByFlowGraphType(config?.type), getRichTypeByFlowGraphType(config?.type), (a, b) => this._polymorphicSubtract(a, b), "FlowGraphSubtractBlock" /* FlowGraphBlockNames.Subtract */, config);
70
49
  }
71
- _polymorphicAdd(a, b) {
50
+ _polymorphicSubtract(a, b) {
72
51
  const aClassName = _getClassNameOf(a);
73
52
  const bClassName = _getClassNameOf(b);
74
- if (_areSameVectorClass(aClassName, bClassName) || _areSameIntegerClass(aClassName, bClassName)) {
53
+ if (_areSameVectorClass(aClassName, bClassName) || _areSameIntegerClass(aClassName, bClassName) || _areSameMatrixClass(aClassName, bClassName)) {
75
54
  return a.subtract(b);
76
55
  }
77
- else if (_areSameMatrixClass(aClassName, bClassName)) {
78
- return a.add(b.scale(-1));
56
+ else if (aClassName === "Quaternion" /* FlowGraphTypes.Quaternion */ || bClassName === "Quaternion" /* FlowGraphTypes.Quaternion */) {
57
+ // this is a simple subtract, and should be also supported between Quat and Vector4. Therefore -
58
+ return a.subtract(b);
79
59
  }
80
60
  else {
81
61
  return a - b;
82
62
  }
83
63
  }
84
64
  }
65
+ RegisterClass("FlowGraphSubtractBlock" /* FlowGraphBlockNames.Subtract */, FlowGraphSubtractBlock);
85
66
  /**
86
- * the class name of the block.
87
- */
88
- FlowGraphSubtractBlock.ClassName = "FGSubBlock";
89
- RegisterClass(FlowGraphSubtractBlock.ClassName, FlowGraphSubtractBlock);
90
- /**
91
- * @experimental
92
67
  * Polymorphic multiply block.
93
- * In case of matrix, it is a component wise multiplication.
68
+ * In case of matrix, it is configurable whether the multiplication is done per component.
94
69
  */
95
70
  export class FlowGraphMultiplyBlock extends FlowGraphBinaryOperationBlock {
96
71
  constructor(config) {
97
- super(RichTypeAny, RichTypeAny, RichTypeAny, (a, b) => this._polymorphicMultiply(a, b), FlowGraphMultiplyBlock.ClassName, config);
72
+ super(getRichTypeByFlowGraphType(config?.type), getRichTypeByFlowGraphType(config?.type), getRichTypeByFlowGraphType(config?.type), (a, b) => this._polymorphicMultiply(a, b), "FlowGraphMultiplyBlock" /* FlowGraphBlockNames.Multiply */, config);
98
73
  }
99
74
  _polymorphicMultiply(a, b) {
100
75
  const aClassName = _getClassNameOf(a);
@@ -102,351 +77,378 @@ export class FlowGraphMultiplyBlock extends FlowGraphBinaryOperationBlock {
102
77
  if (_areSameVectorClass(aClassName, bClassName) || _areSameIntegerClass(aClassName, bClassName)) {
103
78
  return a.multiply(b);
104
79
  }
80
+ else if (aClassName === "Quaternion" /* FlowGraphTypes.Quaternion */ || bClassName === "Quaternion" /* FlowGraphTypes.Quaternion */) {
81
+ // this is a simple multiply (per component!), and should be also supported between Quat and Vector4. Therefore -
82
+ const aClone = a.clone();
83
+ aClone.x *= b.x;
84
+ aClone.y *= b.y;
85
+ aClone.z *= b.z;
86
+ aClone.w *= b.w;
87
+ return aClone;
88
+ }
105
89
  else if (_areSameMatrixClass(aClassName, bClassName)) {
106
- return Matrix.FromValues(a.m[0] * b.m[0], a.m[4] * b.m[4], a.m[8] * b.m[8], a.m[12] * b.m[12], a.m[1] * b.m[1], a.m[5] * b.m[5], a.m[9] * b.m[9], a.m[13] * b.m[13], a.m[2] * b.m[2], a.m[6] * b.m[6], a.m[10] * b.m[10], a.m[14] * b.m[14], a.m[3] * b.m[3], a.m[7] * b.m[7], a.m[11] * b.m[11], a.m[15] * b.m[15]);
90
+ if (this.config?.useMatrixPerComponent) {
91
+ // this is the definition of multiplication of glTF interactivity
92
+ // get a's m as array, and multiply each component with b's m
93
+ const aM = a.m;
94
+ for (let i = 0; i < aM.length; i++) {
95
+ aM[i] *= b.m[i];
96
+ }
97
+ if (aClassName === "Matrix2D" /* FlowGraphTypes.Matrix2D */) {
98
+ return new FlowGraphMatrix2D(aM);
99
+ }
100
+ else if (aClassName === "Matrix3D" /* FlowGraphTypes.Matrix3D */) {
101
+ return new FlowGraphMatrix3D(aM);
102
+ }
103
+ else {
104
+ return Matrix.FromArray(aM);
105
+ }
106
+ }
107
+ else {
108
+ a = a;
109
+ b = b;
110
+ return a.multiply(b);
111
+ }
107
112
  }
108
113
  else {
109
114
  return a * b;
110
115
  }
111
116
  }
112
117
  }
118
+ RegisterClass("FlowGraphMultiplyBlock" /* FlowGraphBlockNames.Multiply */, FlowGraphMultiplyBlock);
113
119
  /**
114
- * the class name of the block.
115
- */
116
- FlowGraphMultiplyBlock.ClassName = "FGMultiplyBlock";
117
- RegisterClass(FlowGraphMultiplyBlock.ClassName, FlowGraphMultiplyBlock);
118
- /**
119
- * @experimental
120
120
  * Polymorphic division block.
121
121
  */
122
122
  export class FlowGraphDivideBlock extends FlowGraphBinaryOperationBlock {
123
+ /**
124
+ * Construct a new divide block.
125
+ * @param config - Optional configuration
126
+ */
123
127
  constructor(config) {
124
- super(RichTypeAny, RichTypeAny, RichTypeAny, (a, b) => this._polymorphicDivide(a, b), FlowGraphDivideBlock.ClassName, config);
128
+ super(getRichTypeByFlowGraphType(config?.type), getRichTypeByFlowGraphType(config?.type), getRichTypeByFlowGraphType(config?.type), (a, b) => this._polymorphicDivide(a, b), "FlowGraphDivideBlock" /* FlowGraphBlockNames.Divide */, config);
125
129
  }
126
130
  _polymorphicDivide(a, b) {
127
131
  const aClassName = _getClassNameOf(a);
128
132
  const bClassName = _getClassNameOf(b);
129
133
  if (_areSameVectorClass(aClassName, bClassName) || _areSameIntegerClass(aClassName, bClassName)) {
134
+ // cast to vector3, but it can be casted to any vector type
130
135
  return a.divide(b);
131
136
  }
137
+ else if (aClassName === "Quaternion" /* FlowGraphTypes.Quaternion */ || bClassName === "Quaternion" /* FlowGraphTypes.Quaternion */) {
138
+ // this is a simple division (per component!), and should be also supported between Quat and Vector4. Therefore -
139
+ const aClone = a.clone();
140
+ aClone.x /= b.x;
141
+ aClone.y /= b.y;
142
+ aClone.z /= b.z;
143
+ aClone.w /= b.w;
144
+ return aClone;
145
+ }
132
146
  else if (_areSameMatrixClass(aClassName, bClassName)) {
133
- return Matrix.FromValues(a.m[0] / b.m[0], a.m[4] / b.m[4], a.m[8] / b.m[8], a.m[12] / b.m[12], a.m[1] / b.m[1], a.m[5] / b.m[5], a.m[9] / b.m[9], a.m[13] / b.m[13], a.m[2] / b.m[2], a.m[6] / b.m[6], a.m[10] / b.m[10], a.m[14] / b.m[14], a.m[3] / b.m[3], a.m[7] / b.m[7], a.m[11] / b.m[11], a.m[15] / b.m[15]);
147
+ if (this.config?.useMatrixPerComponent) {
148
+ // get a's m as array, and divide each component with b's m
149
+ const aM = a.m;
150
+ for (let i = 0; i < aM.length; i++) {
151
+ aM[i] /= b.m[i];
152
+ }
153
+ if (aClassName === "Matrix2D" /* FlowGraphTypes.Matrix2D */) {
154
+ return new FlowGraphMatrix2D(aM);
155
+ }
156
+ else if (aClassName === "Matrix3D" /* FlowGraphTypes.Matrix3D */) {
157
+ return new FlowGraphMatrix3D(aM);
158
+ }
159
+ else {
160
+ return Matrix.FromArray(aM);
161
+ }
162
+ }
163
+ else {
164
+ a = a;
165
+ b = b;
166
+ return a.divide(b);
167
+ }
134
168
  }
135
169
  else {
136
170
  return a / b;
137
171
  }
138
172
  }
139
173
  }
174
+ RegisterClass("FlowGraphDivideBlock" /* FlowGraphBlockNames.Divide */, FlowGraphDivideBlock);
140
175
  /**
141
- * the class name of the block.
142
- */
143
- FlowGraphDivideBlock.ClassName = "FGDivideBlock";
144
- RegisterClass(FlowGraphDivideBlock.ClassName, FlowGraphDivideBlock);
145
- /**
146
- * @experimental
147
- * Random number between 0 and 1.
176
+ * Random number between min and max (defaults to 0 to 1)
177
+ *
178
+ * This node will cache the result for he same node reference. i.e., a Math.eq that references the SAME random node will always return true.
148
179
  */
149
180
  export class FlowGraphRandomBlock extends FlowGraphConstantOperationBlock {
181
+ /**
182
+ * Construct a new random block.
183
+ * @param config optional configuration
184
+ */
150
185
  constructor(config) {
151
- super(RichTypeNumber, () => Math.random(), FlowGraphRandomBlock.ClassName, config);
186
+ super(RichTypeNumber, (context) => this._random(context), "FlowGraphRandomBlock" /* FlowGraphBlockNames.Random */, config);
187
+ this.min = this.registerDataInput("min", RichTypeNumber, config?.min ?? 0);
188
+ this.max = this.registerDataInput("max", RichTypeNumber, config?.max ?? 1);
189
+ if (config?.seed) {
190
+ this._seed = config.seed;
191
+ }
152
192
  }
153
- }
154
- /**
155
- * the class name of the block.
156
- */
157
- FlowGraphRandomBlock.ClassName = "FGRandomBlock";
158
- RegisterClass(FlowGraphRandomBlock.ClassName, FlowGraphRandomBlock);
159
- /**
160
- * @experimental
161
- * Dot product block.
162
- */
163
- export class FlowGraphDotBlock extends FlowGraphBinaryOperationBlock {
164
- constructor(config) {
165
- super(RichTypeAny, RichTypeAny, RichTypeNumber, (a, b) => this._polymorphicDot(a, b), FlowGraphDotBlock.ClassName, config);
166
- }
167
- _polymorphicDot(a, b) {
168
- const className = _getClassNameOf(a);
169
- switch (className) {
170
- case "Vector2":
171
- return Vector2.Dot(a, b);
172
- case "Vector3":
173
- return Vector3.Dot(a, b);
174
- case "Vector4":
175
- return Vector4.Dot(a, b);
176
- default:
177
- throw new Error(`Cannot get dot product of ${a} and ${b}`);
193
+ _isSeed(seed = this._seed) {
194
+ return seed !== undefined;
195
+ }
196
+ _getRandomValue() {
197
+ if (this._isSeed(this._seed)) {
198
+ // compute seed-based random number, deterministic randomness!
199
+ const x = Math.sin(this._seed++) * 10000;
200
+ return x - Math.floor(x);
178
201
  }
202
+ return Math.random();
203
+ }
204
+ _random(context) {
205
+ const min = this.min.getValue(context);
206
+ const max = this.max.getValue(context);
207
+ return this._getRandomValue() * (max - min) + min;
179
208
  }
180
209
  }
210
+ RegisterClass("FlowGraphRandomBlock" /* FlowGraphBlockNames.Random */, FlowGraphRandomBlock);
181
211
  /**
182
- * the class name of the block.
183
- */
184
- FlowGraphDotBlock.ClassName = "FGDotBlock";
185
- RegisterClass(FlowGraphDotBlock.ClassName, FlowGraphDotBlock);
186
- /**
187
- * @experimental
188
212
  * E constant.
189
213
  */
190
214
  export class FlowGraphEBlock extends FlowGraphConstantOperationBlock {
191
215
  constructor(config) {
192
- super(RichTypeNumber, () => Math.E, FlowGraphEBlock.ClassName, config);
216
+ super(RichTypeNumber, () => Math.E, "FlowGraphEBlock" /* FlowGraphBlockNames.E */, config);
193
217
  }
194
218
  }
219
+ RegisterClass("FlowGraphEBlock" /* FlowGraphBlockNames.E */, FlowGraphEBlock);
195
220
  /**
196
- * the class name of the block.
197
- */
198
- FlowGraphEBlock.ClassName = "FGEBlock";
199
- RegisterClass(FlowGraphEBlock.ClassName, FlowGraphEBlock);
200
- /**
201
- * @experimental
202
221
  * Pi constant.
203
222
  */
204
223
  export class FlowGraphPiBlock extends FlowGraphConstantOperationBlock {
205
224
  constructor(config) {
206
- super(RichTypeNumber, () => Math.PI, FlowGraphPiBlock.ClassName, config);
225
+ super(RichTypeNumber, () => Math.PI, "FlowGraphPIBlock" /* FlowGraphBlockNames.PI */, config);
207
226
  }
208
227
  }
228
+ RegisterClass("FlowGraphPIBlock" /* FlowGraphBlockNames.PI */, FlowGraphPiBlock);
209
229
  /**
210
- * the class name of the block.
211
- */
212
- FlowGraphPiBlock.ClassName = "FGPIBlock";
213
- RegisterClass(FlowGraphPiBlock.ClassName, FlowGraphPiBlock);
214
- /**
215
- * @experimental
216
230
  * Positive inf constant.
217
231
  */
218
232
  export class FlowGraphInfBlock extends FlowGraphConstantOperationBlock {
219
233
  constructor(config) {
220
- super(RichTypeNumber, () => Number.POSITIVE_INFINITY, FlowGraphInfBlock.ClassName, config);
234
+ super(RichTypeNumber, () => Number.POSITIVE_INFINITY, "FlowGraphInfBlock" /* FlowGraphBlockNames.Inf */, config);
221
235
  }
222
236
  }
237
+ RegisterClass("FlowGraphInfBlock" /* FlowGraphBlockNames.Inf */, FlowGraphInfBlock);
223
238
  /**
224
- * the class name of the block.
225
- */
226
- FlowGraphInfBlock.ClassName = "FGInfBlock";
227
- RegisterClass(FlowGraphInfBlock.ClassName, FlowGraphInfBlock);
228
- /**
229
- * @experimental
230
239
  * NaN constant.
231
240
  */
232
241
  export class FlowGraphNaNBlock extends FlowGraphConstantOperationBlock {
233
242
  constructor(config) {
234
- super(RichTypeNumber, () => Number.NaN, FlowGraphNaNBlock.ClassName, config);
243
+ super(RichTypeNumber, () => Number.NaN, "FlowGraphNaNBlock" /* FlowGraphBlockNames.NaN */, config);
235
244
  }
236
245
  }
237
- /**
238
- * the class name of the block.
239
- */
240
- FlowGraphNaNBlock.ClassName = "FGNaNBlock";
241
- RegisterClass(FlowGraphNaNBlock.ClassName, FlowGraphNaNBlock);
246
+ RegisterClass("FlowGraphNaNBlock" /* FlowGraphBlockNames.NaN */, FlowGraphNaNBlock);
242
247
  function _componentWiseUnaryOperation(a, op) {
243
248
  const aClassName = _getClassNameOf(a);
244
249
  switch (aClassName) {
245
250
  case "FlowGraphInteger":
251
+ a = a;
246
252
  return new FlowGraphInteger(op(a.value));
247
- case "Vector2":
253
+ case "Vector2" /* FlowGraphTypes.Vector2 */:
254
+ a = a;
248
255
  return new Vector2(op(a.x), op(a.y));
249
- case "Vector3":
256
+ case "Vector3" /* FlowGraphTypes.Vector3 */:
257
+ a = a;
250
258
  return new Vector3(op(a.x), op(a.y), op(a.z));
251
- case "Vector4":
259
+ case "Vector4" /* FlowGraphTypes.Vector4 */:
260
+ a = a;
252
261
  return new Vector4(op(a.x), op(a.y), op(a.z), op(a.w));
253
- case "Matrix":
254
- return Matrix.FromValues(op(a.m[0]), op(a.m[4]), op(a.m[8]), op(a.m[12]), op(a.m[1]), op(a.m[5]), op(a.m[9]), op(a.m[13]), op(a.m[2]), op(a.m[6]), op(a.m[10]), op(a.m[14]), op(a.m[3]), op(a.m[7]), op(a.m[11]), op(a.m[15]));
262
+ case "Quaternion" /* FlowGraphTypes.Quaternion */:
263
+ a = a;
264
+ return new Quaternion(op(a.x), op(a.y), op(a.z), op(a.w));
265
+ case "Matrix" /* FlowGraphTypes.Matrix */:
266
+ a = a;
267
+ return Matrix.FromArray(a.m.map(op));
268
+ case "Matrix2D" /* FlowGraphTypes.Matrix2D */:
269
+ a = a;
270
+ // reason for not using .map is performance
271
+ return new FlowGraphMatrix2D(a.m.map(op));
272
+ case "Matrix3D" /* FlowGraphTypes.Matrix3D */:
273
+ a = a;
274
+ return new FlowGraphMatrix3D(a.m.map(op));
255
275
  default:
276
+ a = a;
256
277
  return op(a);
257
278
  }
258
279
  }
259
280
  /**
260
- * @experimental
261
281
  * Absolute value block.
262
282
  */
263
283
  export class FlowGraphAbsBlock extends FlowGraphUnaryOperationBlock {
264
284
  constructor(config) {
265
- super(RichTypeAny, RichTypeAny, (a) => this._polymorphicAbs(a), FlowGraphAbsBlock.ClassName, config);
285
+ super(RichTypeNumber, RichTypeNumber, (a) => this._polymorphicAbs(a), "FlowGraphAbsBlock" /* FlowGraphBlockNames.Abs */, config);
266
286
  }
267
287
  _polymorphicAbs(a) {
268
288
  return _componentWiseUnaryOperation(a, Math.abs);
269
289
  }
270
290
  }
291
+ RegisterClass("FlowGraphAbsBlock" /* FlowGraphBlockNames.Abs */, FlowGraphAbsBlock);
271
292
  /**
272
- * the class name of the block.
273
- */
274
- FlowGraphAbsBlock.ClassName = "FGAbsBlock";
275
- RegisterClass(FlowGraphAbsBlock.ClassName, FlowGraphAbsBlock);
276
- /**
277
- * @experimental
278
293
  * Sign block.
279
294
  */
280
295
  export class FlowGraphSignBlock extends FlowGraphUnaryOperationBlock {
281
296
  constructor(config) {
282
- super(RichTypeAny, RichTypeAny, (a) => this._polymorphicSign(a), FlowGraphSignBlock.ClassName, config);
297
+ super(RichTypeNumber, RichTypeNumber, (a) => this._polymorphicSign(a), "FlowGraphSignBlock" /* FlowGraphBlockNames.Sign */, config);
283
298
  }
284
299
  _polymorphicSign(a) {
285
300
  return _componentWiseUnaryOperation(a, Math.sign);
286
301
  }
287
302
  }
303
+ RegisterClass("FlowGraphSignBlock" /* FlowGraphBlockNames.Sign */, FlowGraphSignBlock);
288
304
  /**
289
- * the class name of the block.
290
- */
291
- FlowGraphSignBlock.ClassName = "FGSignBlock";
292
- RegisterClass(FlowGraphSignBlock.ClassName, FlowGraphSignBlock);
293
- /**
294
- * @experimental
295
305
  * Truncation block.
296
306
  */
297
307
  export class FlowGraphTruncBlock extends FlowGraphUnaryOperationBlock {
298
308
  constructor(config) {
299
- super(RichTypeAny, RichTypeAny, (a) => this._polymorphicTrunc(a), FlowGraphTruncBlock.ClassName, config);
309
+ super(RichTypeNumber, RichTypeNumber, (a) => this._polymorphicTrunc(a), "FlowGraphTruncBlock" /* FlowGraphBlockNames.Trunc */, config);
300
310
  }
301
311
  _polymorphicTrunc(a) {
302
312
  return _componentWiseUnaryOperation(a, Math.trunc);
303
313
  }
304
314
  }
315
+ RegisterClass("FlowGraphTruncBlock" /* FlowGraphBlockNames.Trunc */, FlowGraphTruncBlock);
305
316
  /**
306
- * the class name of the block.
307
- */
308
- FlowGraphTruncBlock.ClassName = "FGTruncBlock";
309
- RegisterClass(FlowGraphTruncBlock.ClassName, FlowGraphTruncBlock);
310
- /**
311
- * @experimental
312
317
  * Floor block.
313
318
  */
314
319
  export class FlowGraphFloorBlock extends FlowGraphUnaryOperationBlock {
315
320
  constructor(config) {
316
- super(RichTypeAny, RichTypeAny, (a) => this._polymorphicFloor(a), FlowGraphFloorBlock.ClassName, config);
321
+ super(RichTypeNumber, RichTypeNumber, (a) => this._polymorphicFloor(a), "FlowGraphFloorBlock" /* FlowGraphBlockNames.Floor */, config);
317
322
  }
318
323
  _polymorphicFloor(a) {
319
324
  return _componentWiseUnaryOperation(a, Math.floor);
320
325
  }
321
326
  }
327
+ RegisterClass("FlowGraphFloorBlock" /* FlowGraphBlockNames.Floor */, FlowGraphFloorBlock);
322
328
  /**
323
- * the class name of the block.
324
- */
325
- FlowGraphFloorBlock.ClassName = "FGFloorBlock";
326
- RegisterClass(FlowGraphFloorBlock.ClassName, FlowGraphFloorBlock);
327
- /**
328
- * @experimental
329
329
  * Ceiling block.
330
330
  */
331
331
  export class FlowGraphCeilBlock extends FlowGraphUnaryOperationBlock {
332
332
  constructor(config) {
333
- super(RichTypeAny, RichTypeAny, (a) => this._polymorphicCeiling(a), FlowGraphCeilBlock.ClassName, config);
333
+ super(RichTypeAny, RichTypeAny, (a) => this._polymorphicCeiling(a), "FlowGraphCeilBlock" /* FlowGraphBlockNames.Ceil */, config);
334
334
  }
335
335
  _polymorphicCeiling(a) {
336
336
  return _componentWiseUnaryOperation(a, Math.ceil);
337
337
  }
338
338
  }
339
+ RegisterClass("FlowGraphCeilBlock" /* FlowGraphBlockNames.Ceil */, FlowGraphCeilBlock);
339
340
  /**
340
- * the class name of the block.
341
+ * Round block.
341
342
  */
342
- FlowGraphCeilBlock.ClassName = "FGCeilBlock";
343
- RegisterClass(FlowGraphCeilBlock.ClassName, FlowGraphCeilBlock);
343
+ export class FlowGraphRoundBlock extends FlowGraphUnaryOperationBlock {
344
+ constructor(config) {
345
+ super(RichTypeAny, RichTypeAny, (a) => this._polymorphicRound(a), "FlowGraphRoundBlock" /* FlowGraphBlockNames.Round */, config);
346
+ }
347
+ _polymorphicRound(a) {
348
+ return _componentWiseUnaryOperation(a, (a) => (a < 0 && this.config?.roundHalfAwayFromZero ? -Math.round(-a) : Math.round(a)));
349
+ }
350
+ }
351
+ RegisterClass("FlowGraphRoundBlock" /* FlowGraphBlockNames.Round */, FlowGraphRoundBlock);
344
352
  /**
345
- * @experimental
346
- * Fract block.
353
+ * A block that returns the fractional part of a number.
347
354
  */
348
- export class FlowGraphFractBlock extends FlowGraphUnaryOperationBlock {
355
+ export class FlowGraphFractionBlock extends FlowGraphUnaryOperationBlock {
349
356
  constructor(config) {
350
- super(RichTypeAny, RichTypeAny, (a) => this._polymorphicFract(a), FlowGraphFractBlock.ClassName, config);
357
+ super(RichTypeAny, RichTypeAny, (a) => this._polymorphicFraction(a), "FlowGraphFractBlock" /* FlowGraphBlockNames.Fraction */, config);
351
358
  }
352
- _polymorphicFract(a) {
359
+ _polymorphicFraction(a) {
353
360
  return _componentWiseUnaryOperation(a, (a) => a - Math.floor(a));
354
361
  }
355
362
  }
363
+ RegisterClass("FlowGraphFractBlock" /* FlowGraphBlockNames.Fraction */, FlowGraphFractionBlock);
356
364
  /**
357
- * the class name of the block.
358
- */
359
- FlowGraphFractBlock.ClassName = "FGFractBlock";
360
- RegisterClass(FlowGraphFractBlock.ClassName, FlowGraphFractBlock);
361
- /**
362
- * @experimental
363
365
  * Negation block.
364
366
  */
365
- export class FlowGraphNegBlock extends FlowGraphUnaryOperationBlock {
367
+ export class FlowGraphNegationBlock extends FlowGraphUnaryOperationBlock {
366
368
  /**
367
369
  * construct a new negation block.
368
370
  * @param config optional configuration
369
371
  */
370
372
  constructor(config) {
371
- super(RichTypeAny, RichTypeAny, (a) => this._polymorphicNeg(a), FlowGraphNegBlock.ClassName, config);
373
+ super(RichTypeAny, RichTypeAny, (a) => this._polymorphicNeg(a), "FlowGraphNegationBlock" /* FlowGraphBlockNames.Negation */, config);
372
374
  }
373
375
  _polymorphicNeg(a) {
374
376
  return _componentWiseUnaryOperation(a, (a) => -a);
375
377
  }
376
378
  }
377
- /**
378
- * the class name of the block.
379
- */
380
- FlowGraphNegBlock.ClassName = "FGNegBlock";
381
- RegisterClass(FlowGraphNegBlock.ClassName, FlowGraphNegBlock);
379
+ RegisterClass("FlowGraphNegationBlock" /* FlowGraphBlockNames.Negation */, FlowGraphNegationBlock);
382
380
  function _componentWiseBinaryOperation(a, b, op) {
383
381
  const aClassName = _getClassNameOf(a);
384
382
  switch (aClassName) {
385
383
  case "FlowGraphInteger":
384
+ a = a;
385
+ b = b;
386
386
  return new FlowGraphInteger(op(a.value, b.value));
387
- case "Vector2":
387
+ case "Vector2" /* FlowGraphTypes.Vector2 */:
388
+ a = a;
389
+ b = b;
388
390
  return new Vector2(op(a.x, b.x), op(a.y, b.y));
389
- case "Vector3":
391
+ case "Vector3" /* FlowGraphTypes.Vector3 */:
392
+ a = a;
393
+ b = b;
390
394
  return new Vector3(op(a.x, b.x), op(a.y, b.y), op(a.z, b.z));
391
- case "Vector4":
395
+ case "Vector4" /* FlowGraphTypes.Vector4 */:
396
+ a = a;
397
+ b = b;
392
398
  return new Vector4(op(a.x, b.x), op(a.y, b.y), op(a.z, b.z), op(a.w, b.w));
393
- case "Matrix":
394
- return Matrix.FromValues(op(a.m[0], b.m[0]), op(a.m[4], b.m[4]), op(a.m[8], b.m[8]), op(a.m[12], b.m[12]), op(a.m[1], b.m[1]), op(a.m[5], b.m[5]), op(a.m[9], b.m[9]), op(a.m[13], b.m[13]), op(a.m[2], b.m[2]), op(a.m[6], b.m[6]), op(a.m[10], b.m[10]), op(a.m[14], b.m[14]), op(a.m[3], b.m[3]), op(a.m[7], b.m[7]), op(a.m[11], b.m[11]), op(a.m[15], b.m[15]));
399
+ case "Quaternion" /* FlowGraphTypes.Quaternion */:
400
+ a = a;
401
+ b = b;
402
+ return new Quaternion(op(a.x, b.x), op(a.y, b.y), op(a.z, b.z), op(a.w, b.w));
403
+ case "Matrix" /* FlowGraphTypes.Matrix */:
404
+ a = a;
405
+ return Matrix.FromArray(a.m.map((v, i) => op(v, b.m[i])));
406
+ case "Matrix2D" /* FlowGraphTypes.Matrix2D */:
407
+ a = a;
408
+ return new FlowGraphMatrix2D(a.m.map((v, i) => op(v, b.m[i])));
409
+ case "Matrix3D" /* FlowGraphTypes.Matrix3D */:
410
+ a = a;
411
+ return new FlowGraphMatrix3D(a.m.map((v, i) => op(v, b.m[i])));
395
412
  default:
396
413
  return op(a, b);
397
414
  }
398
415
  }
399
416
  /**
400
- * @experimental
401
417
  * Remainder block.
402
418
  */
403
- export class FlowGraphRemainderBlock extends FlowGraphBinaryOperationBlock {
419
+ export class FlowGraphModuloBlock extends FlowGraphBinaryOperationBlock {
404
420
  constructor(config) {
405
- super(RichTypeAny, RichTypeAny, RichTypeAny, (a, b) => this._polymorphicRemainder(a, b), FlowGraphRemainderBlock.ClassName, config);
421
+ super(RichTypeAny, RichTypeAny, RichTypeAny, (a, b) => this._polymorphicRemainder(a, b), "FlowGraphModuloBlock" /* FlowGraphBlockNames.Modulo */, config);
406
422
  }
407
423
  _polymorphicRemainder(a, b) {
408
424
  return _componentWiseBinaryOperation(a, b, (a, b) => a % b);
409
425
  }
410
426
  }
427
+ RegisterClass("FlowGraphModuloBlock" /* FlowGraphBlockNames.Modulo */, FlowGraphModuloBlock);
411
428
  /**
412
- * the class name of the block.
413
- */
414
- FlowGraphRemainderBlock.ClassName = "FGRemainderBlock";
415
- RegisterClass(FlowGraphRemainderBlock.ClassName, FlowGraphRemainderBlock);
416
- /**
417
- * @experimental
418
429
  * Min block.
419
430
  */
420
431
  export class FlowGraphMinBlock extends FlowGraphBinaryOperationBlock {
421
432
  constructor(config) {
422
- super(RichTypeAny, RichTypeAny, RichTypeAny, (a, b) => this._polymorphicMin(a, b), FlowGraphMinBlock.ClassName, config);
433
+ super(RichTypeAny, RichTypeAny, RichTypeAny, (a, b) => this._polymorphicMin(a, b), "FlowGraphMinBlock" /* FlowGraphBlockNames.Min */, config);
423
434
  }
424
435
  _polymorphicMin(a, b) {
425
436
  return _componentWiseBinaryOperation(a, b, Math.min);
426
437
  }
427
438
  }
439
+ RegisterClass("FlowGraphMinBlock" /* FlowGraphBlockNames.Min */, FlowGraphMinBlock);
428
440
  /**
429
- * the class name of the block.
430
- */
431
- FlowGraphMinBlock.ClassName = "FGMinBlock";
432
- RegisterClass(FlowGraphMinBlock.ClassName, FlowGraphMinBlock);
433
- /**
434
- * @experimental
435
441
  * Max block
436
442
  */
437
443
  export class FlowGraphMaxBlock extends FlowGraphBinaryOperationBlock {
438
444
  constructor(config) {
439
- super(RichTypeAny, RichTypeAny, RichTypeAny, (a, b) => this._polymorphicMax(a, b), FlowGraphMaxBlock.ClassName, config);
445
+ super(RichTypeAny, RichTypeAny, RichTypeAny, (a, b) => this._polymorphicMax(a, b), "FlowGraphMaxBlock" /* FlowGraphBlockNames.Max */, config);
440
446
  }
441
447
  _polymorphicMax(a, b) {
442
448
  return _componentWiseBinaryOperation(a, b, Math.max);
443
449
  }
444
450
  }
445
- /**
446
- * the class name of the block.
447
- */
448
- FlowGraphMaxBlock.ClassName = "FGMaxBlock";
449
- RegisterClass(FlowGraphMaxBlock.ClassName, FlowGraphMaxBlock);
451
+ RegisterClass("FlowGraphMaxBlock" /* FlowGraphBlockNames.Max */, FlowGraphMaxBlock);
450
452
  function _clamp(a, b, c) {
451
453
  return Math.min(Math.max(a, Math.min(b, c)), Math.max(b, c));
452
454
  }
@@ -454,83 +456,88 @@ function _componentWiseTernaryOperation(a, b, c, op) {
454
456
  const aClassName = _getClassNameOf(a);
455
457
  switch (aClassName) {
456
458
  case "FlowGraphInteger":
459
+ a = a;
460
+ b = b;
461
+ c = c;
457
462
  return new FlowGraphInteger(op(a.value, b.value, c.value));
458
- case "Vector2":
463
+ case "Vector2" /* FlowGraphTypes.Vector2 */:
464
+ a = a;
465
+ b = b;
466
+ c = c;
459
467
  return new Vector2(op(a.x, b.x, c.x), op(a.y, b.y, c.y));
460
- case "Vector3":
468
+ case "Vector3" /* FlowGraphTypes.Vector3 */:
469
+ a = a;
470
+ b = b;
471
+ c = c;
461
472
  return new Vector3(op(a.x, b.x, c.x), op(a.y, b.y, c.y), op(a.z, b.z, c.z));
462
- case "Vector4":
473
+ case "Vector4" /* FlowGraphTypes.Vector4 */:
474
+ a = a;
475
+ b = b;
476
+ c = c;
463
477
  return new Vector4(op(a.x, b.x, c.x), op(a.y, b.y, c.y), op(a.z, b.z, c.z), op(a.w, b.w, c.w));
464
- case "Matrix":
465
- return Matrix.FromValues(op(a.m[0], b.m[0], c.m[0]), op(a.m[4], b.m[4], c.m[4]), op(a.m[8], b.m[8], c.m[8]), op(a.m[12], b.m[12], c.m[12]), op(a.m[1], b.m[1], c.m[1]), op(a.m[5], b.m[5], c.m[5]), op(a.m[9], b.m[9], c.m[9]), op(a.m[13], b.m[13], c.m[13]), op(a.m[2], b.m[2], c.m[2]), op(a.m[6], b.m[6], c.m[6]), op(a.m[10], b.m[10], c.m[10]), op(a.m[14], b.m[14], c.m[14]), op(a.m[3], b.m[3], c.m[3]), op(a.m[7], b.m[7], c.m[7]), op(a.m[11], b.m[11], c.m[11]), op(a.m[15], b.m[15], c.m[15]));
478
+ case "Quaternion" /* FlowGraphTypes.Quaternion */:
479
+ a = a;
480
+ b = b;
481
+ c = c;
482
+ return new Quaternion(op(a.x, b.x, c.x), op(a.y, b.y, c.y), op(a.z, b.z, c.z), op(a.w, b.w, c.w));
483
+ case "Matrix" /* FlowGraphTypes.Matrix */:
484
+ return Matrix.FromArray(a.m.map((v, i) => op(v, b.m[i], c.m[i])));
485
+ case "Matrix2D" /* FlowGraphTypes.Matrix2D */:
486
+ return new FlowGraphMatrix2D(a.m.map((v, i) => op(v, b.m[i], c.m[i])));
487
+ case "Matrix3D" /* FlowGraphTypes.Matrix3D */:
488
+ return new FlowGraphMatrix3D(a.m.map((v, i) => op(v, b.m[i], c.m[i])));
466
489
  default:
467
490
  return op(a, b, c);
468
491
  }
469
492
  }
470
493
  /**
471
- * @experimental
472
494
  * Clamp block.
473
495
  */
474
496
  export class FlowGraphClampBlock extends FlowGraphTernaryOperationBlock {
475
497
  constructor(config) {
476
- super(RichTypeAny, RichTypeAny, RichTypeAny, RichTypeAny, (a, b, c) => this._polymorphicClamp(a, b, c), FlowGraphClampBlock.ClassName, config);
498
+ super(RichTypeAny, RichTypeAny, RichTypeAny, RichTypeAny, (a, b, c) => this._polymorphicClamp(a, b, c), "FlowGraphClampBlock" /* FlowGraphBlockNames.Clamp */, config);
477
499
  }
478
500
  _polymorphicClamp(a, b, c) {
479
501
  return _componentWiseTernaryOperation(a, b, c, _clamp);
480
502
  }
481
503
  }
482
- /**
483
- * the class name of the block.
484
- */
485
- FlowGraphClampBlock.ClassName = "FGClampBlock";
486
- RegisterClass(FlowGraphClampBlock.ClassName, FlowGraphClampBlock);
504
+ RegisterClass("FlowGraphClampBlock" /* FlowGraphBlockNames.Clamp */, FlowGraphClampBlock);
487
505
  function _saturate(a) {
488
506
  return Math.min(Math.max(a, 0), 1);
489
507
  }
490
508
  /**
491
- * @experimental
492
509
  * Saturate block.
493
510
  */
494
511
  export class FlowGraphSaturateBlock extends FlowGraphUnaryOperationBlock {
495
512
  constructor(config) {
496
- super(RichTypeAny, RichTypeAny, (a) => this._polymorphicSaturate(a), FlowGraphSaturateBlock.ClassName, config);
513
+ super(RichTypeAny, RichTypeAny, (a) => this._polymorphicSaturate(a), "FlowGraphSaturateBlock" /* FlowGraphBlockNames.Saturate */, config);
497
514
  }
498
515
  _polymorphicSaturate(a) {
499
516
  return _componentWiseUnaryOperation(a, _saturate);
500
517
  }
501
518
  }
519
+ RegisterClass("FlowGraphSaturateBlock" /* FlowGraphBlockNames.Saturate */, FlowGraphSaturateBlock);
520
+ function _interpolate(a, b, c) {
521
+ return (1 - c) * a + c * b;
522
+ }
502
523
  /**
503
- * the class name of the block.
504
- */
505
- FlowGraphSaturateBlock.ClassName = "FGSaturateBlock";
506
- RegisterClass(FlowGraphSaturateBlock.ClassName, FlowGraphSaturateBlock);
507
- /**
508
- * @experimental
509
524
  * Interpolate block.
510
525
  */
511
- export class FlowGraphInterpolateBlock extends FlowGraphTernaryOperationBlock {
526
+ export class FlowGraphMathInterpolationBlock extends FlowGraphTernaryOperationBlock {
512
527
  constructor(config) {
513
- super(RichTypeAny, RichTypeAny, RichTypeAny, RichTypeAny, (a, b, c) => this._polymorphicInterpolate(a, b, c), FlowGraphInterpolateBlock.ClassName, config);
514
- }
515
- _interpolate(a, b, c) {
516
- return (1 - c) * a + c * b;
528
+ super(RichTypeAny, RichTypeAny, RichTypeAny, RichTypeAny, (a, b, c) => this._polymorphicInterpolate(a, b, c), "FlowGraphMathInterpolationBlock" /* FlowGraphBlockNames.MathInterpolation */, config);
517
529
  }
518
530
  _polymorphicInterpolate(a, b, c) {
519
- return _componentWiseTernaryOperation(a, b, c, this._interpolate);
531
+ return _componentWiseTernaryOperation(a, b, c, _interpolate);
520
532
  }
521
533
  }
534
+ RegisterClass("FlowGraphMathInterpolationBlock" /* FlowGraphBlockNames.MathInterpolation */, FlowGraphMathInterpolationBlock);
522
535
  /**
523
- * the class name of the block.
524
- */
525
- FlowGraphInterpolateBlock.ClassName = "FGInterpolateBlock";
526
- RegisterClass(FlowGraphInterpolateBlock.ClassName, FlowGraphInterpolateBlock);
527
- /**
528
- * @experimental
529
536
  * Equals block.
530
537
  */
531
- export class FlowGraphEqBlock extends FlowGraphBinaryOperationBlock {
538
+ export class FlowGraphEqualityBlock extends FlowGraphBinaryOperationBlock {
532
539
  constructor(config) {
533
- super(RichTypeAny, RichTypeAny, RichTypeBoolean, (a, b) => this._polymorphicEq(a, b), FlowGraphEqBlock.ClassName, config);
540
+ super(RichTypeAny, RichTypeAny, RichTypeBoolean, (a, b) => this._polymorphicEq(a, b), "FlowGraphEqualityBlock" /* FlowGraphBlockNames.Equality */, config);
534
541
  }
535
542
  _polymorphicEq(a, b) {
536
543
  const aClassName = _getClassNameOf(a);
@@ -543,153 +550,107 @@ export class FlowGraphEqBlock extends FlowGraphBinaryOperationBlock {
543
550
  }
544
551
  }
545
552
  }
546
- /**
547
- * the class name of the block.
548
- */
549
- FlowGraphEqBlock.ClassName = "FGEqBlock";
550
- RegisterClass(FlowGraphEqBlock.ClassName, FlowGraphEqBlock);
553
+ RegisterClass("FlowGraphEqualityBlock" /* FlowGraphBlockNames.Equality */, FlowGraphEqualityBlock);
551
554
  function _comparisonOperators(a, b, op) {
552
- const aClassName = _getClassNameOf(a);
553
- const bClassName = _getClassNameOf(b);
554
- if (aClassName === bClassName) {
555
- // float
556
- if (aClassName === "") {
557
- return op(a, b);
558
- }
559
- else if (aClassName === "FlowGraphInteger") {
560
- return op(a.value, b.value);
561
- }
562
- else {
563
- throw new Error(`Cannot compare ${a} and ${b}`);
564
- }
555
+ if (isNumeric(a) && isNumeric(b)) {
556
+ return op(getNumericValue(a), getNumericValue(b));
557
+ }
558
+ else {
559
+ throw new Error(`Cannot compare ${a} and ${b}`);
565
560
  }
566
- throw new Error(`${a} and ${b} are of different types.`);
567
561
  }
568
562
  /**
569
- * @experimental
570
563
  * Less than block.
571
564
  */
572
565
  export class FlowGraphLessThanBlock extends FlowGraphBinaryOperationBlock {
573
566
  constructor(config) {
574
- super(RichTypeAny, RichTypeAny, RichTypeBoolean, (a, b) => this._polymorphicLessThan(a, b), FlowGraphLessThanBlock.ClassName, config);
567
+ super(RichTypeAny, RichTypeAny, RichTypeBoolean, (a, b) => this._polymorphicLessThan(a, b), "FlowGraphLessThanBlock" /* FlowGraphBlockNames.LessThan */, config);
575
568
  }
576
569
  _polymorphicLessThan(a, b) {
577
570
  return _comparisonOperators(a, b, (a, b) => a < b);
578
571
  }
579
572
  }
573
+ RegisterClass("FlowGraphLessThanBlock" /* FlowGraphBlockNames.LessThan */, FlowGraphLessThanBlock);
580
574
  /**
581
- * the class name of the block.
582
- */
583
- FlowGraphLessThanBlock.ClassName = "FGLessThanBlock";
584
- RegisterClass(FlowGraphLessThanBlock.ClassName, FlowGraphLessThanBlock);
585
- /**
586
- * @experimental
587
575
  * Less than or equal block.
588
576
  */
589
577
  export class FlowGraphLessThanOrEqualBlock extends FlowGraphBinaryOperationBlock {
590
578
  constructor(config) {
591
- super(RichTypeAny, RichTypeAny, RichTypeBoolean, (a, b) => this._polymorphicLessThanOrEqual(a, b), FlowGraphLessThanOrEqualBlock.ClassName, config);
579
+ super(RichTypeAny, RichTypeAny, RichTypeBoolean, (a, b) => this._polymorphicLessThanOrEqual(a, b), "FlowGraphLessThanOrEqualBlock" /* FlowGraphBlockNames.LessThanOrEqual */, config);
592
580
  }
593
581
  _polymorphicLessThanOrEqual(a, b) {
594
582
  return _comparisonOperators(a, b, (a, b) => a <= b);
595
583
  }
596
584
  }
585
+ RegisterClass("FlowGraphLessThanOrEqualBlock" /* FlowGraphBlockNames.LessThanOrEqual */, FlowGraphLessThanOrEqualBlock);
597
586
  /**
598
- * the class name of the block.
599
- */
600
- FlowGraphLessThanOrEqualBlock.ClassName = "FGLessThanOrEqualBlock";
601
- /**
602
- * @experimental
603
587
  * Greater than block.
604
588
  */
605
589
  export class FlowGraphGreaterThanBlock extends FlowGraphBinaryOperationBlock {
606
590
  constructor(config) {
607
- super(RichTypeAny, RichTypeAny, RichTypeBoolean, (a, b) => this._polymorphicGreaterThan(a, b), FlowGraphGreaterThanBlock.ClassName, config);
591
+ super(RichTypeAny, RichTypeAny, RichTypeBoolean, (a, b) => this._polymorphicGreaterThan(a, b), "FlowGraphGreaterThanBlock" /* FlowGraphBlockNames.GreaterThan */, config);
608
592
  }
609
593
  _polymorphicGreaterThan(a, b) {
610
594
  return _comparisonOperators(a, b, (a, b) => a > b);
611
595
  }
612
596
  }
597
+ RegisterClass("FlowGraphGreaterThanBlock" /* FlowGraphBlockNames.GreaterThan */, FlowGraphGreaterThanBlock);
613
598
  /**
614
- * the class name of the block.
615
- */
616
- FlowGraphGreaterThanBlock.ClassName = "FGGreaterThanBlock";
617
- RegisterClass(FlowGraphGreaterThanBlock.ClassName, FlowGraphGreaterThanBlock);
618
- /**
619
- * @experimental
620
599
  * Greater than or equal block.
621
600
  */
622
601
  export class FlowGraphGreaterThanOrEqualBlock extends FlowGraphBinaryOperationBlock {
623
602
  constructor(config) {
624
- super(RichTypeAny, RichTypeAny, RichTypeBoolean, (a, b) => this._polymorphicGreaterThanOrEqual(a, b), FlowGraphGreaterThanOrEqualBlock.ClassName, config);
603
+ super(RichTypeAny, RichTypeAny, RichTypeBoolean, (a, b) => this._polymorphicGreaterThanOrEqual(a, b), "FlowGraphGreaterThanOrEqualBlock" /* FlowGraphBlockNames.GreaterThanOrEqual */, config);
625
604
  }
626
605
  _polymorphicGreaterThanOrEqual(a, b) {
627
606
  return _comparisonOperators(a, b, (a, b) => a >= b);
628
607
  }
629
608
  }
609
+ RegisterClass("FlowGraphGreaterThanOrEqualBlock" /* FlowGraphBlockNames.GreaterThanOrEqual */, FlowGraphGreaterThanOrEqualBlock);
630
610
  /**
631
- * the class name of the block.
632
- */
633
- FlowGraphGreaterThanOrEqualBlock.ClassName = "FGGreaterThanOrEqualBlock";
634
- RegisterClass(FlowGraphGreaterThanOrEqualBlock.ClassName, FlowGraphGreaterThanOrEqualBlock);
635
- /**
636
- * @experimental
637
611
  * Is NaN block.
638
612
  */
639
613
  export class FlowGraphIsNanBlock extends FlowGraphUnaryOperationBlock {
640
614
  constructor(config) {
641
- super(RichTypeAny, RichTypeBoolean, (a) => this._polymorphicIsNan(a), FlowGraphIsNanBlock.ClassName, config);
615
+ super(RichTypeAny, RichTypeBoolean, (a) => this._polymorphicIsNan(a), "FlowGraphIsNaNBlock" /* FlowGraphBlockNames.IsNaN */, config);
642
616
  }
643
617
  _polymorphicIsNan(a) {
644
- const aClassName = _getClassNameOf(a);
645
- if (aClassName === "") {
646
- return isNaN(a);
647
- }
648
- else if (aClassName === "FlowGraphInteger") {
649
- return isNaN(a.value);
618
+ if (isNumeric(a)) {
619
+ return isNaN(getNumericValue(a));
650
620
  }
651
621
  else {
652
622
  throw new Error(`Cannot get NaN of ${a}`);
653
623
  }
654
624
  }
655
625
  }
626
+ RegisterClass("FlowGraphIsNaNBlock" /* FlowGraphBlockNames.IsNaN */, FlowGraphIsNanBlock);
656
627
  /**
657
- * the class name of the block.
658
- */
659
- FlowGraphIsNanBlock.ClassName = "FGIsNanBlock";
660
- RegisterClass(FlowGraphIsNanBlock.ClassName, FlowGraphIsNanBlock);
661
- /**
662
- * @experimental
663
628
  * Is Inf block.
664
629
  */
665
- export class FlowGraphIsInfBlock extends FlowGraphUnaryOperationBlock {
630
+ export class FlowGraphIsInfinityBlock extends FlowGraphUnaryOperationBlock {
666
631
  constructor(config) {
667
- super(RichTypeAny, RichTypeBoolean, (a) => this._polymorphicIsInf(a), FlowGraphIsInfBlock.ClassName, config);
632
+ super(RichTypeAny, RichTypeBoolean, (a) => this._polymorphicIsInf(a), "FlowGraphIsInfBlock" /* FlowGraphBlockNames.IsInfinity */, config);
668
633
  }
669
634
  _polymorphicIsInf(a) {
670
- const aClassName = _getClassNameOf(a);
671
- if (aClassName === "") {
672
- return !isFinite(a);
673
- }
674
- else if (aClassName === "FlowGraphInteger") {
675
- return !isFinite(a.value);
635
+ if (isNumeric(a)) {
636
+ return !isFinite(getNumericValue(a));
676
637
  }
677
638
  else {
678
639
  throw new Error(`Cannot get isInf of ${a}`);
679
640
  }
680
641
  }
681
642
  }
643
+ RegisterClass("FlowGraphIsInfBlock" /* FlowGraphBlockNames.IsInfinity */, FlowGraphIsInfinityBlock);
682
644
  /**
683
- * the class name of the block.
684
- */
685
- FlowGraphIsInfBlock.ClassName = "FGIsInfBlock";
686
- /**
687
- * @experimental
688
645
  * Convert degrees to radians block.
689
646
  */
690
647
  export class FlowGraphDegToRadBlock extends FlowGraphUnaryOperationBlock {
648
+ /**
649
+ * Constructs a new instance of the flow graph math block.
650
+ * @param config - Optional configuration for the flow graph block.
651
+ */
691
652
  constructor(config) {
692
- super(RichTypeAny, RichTypeAny, (a) => this._polymorphicDegToRad(a), FlowGraphDegToRadBlock.ClassName, config);
653
+ super(RichTypeAny, RichTypeAny, (a) => this._polymorphicDegToRad(a), "FlowGraphDegToRadBlock" /* FlowGraphBlockNames.DegToRad */, config);
693
654
  }
694
655
  _degToRad(a) {
695
656
  return (a * Math.PI) / 180;
@@ -698,18 +659,13 @@ export class FlowGraphDegToRadBlock extends FlowGraphUnaryOperationBlock {
698
659
  return _componentWiseUnaryOperation(a, this._degToRad);
699
660
  }
700
661
  }
662
+ RegisterClass("FlowGraphDegToRadBlock" /* FlowGraphBlockNames.DegToRad */, FlowGraphDegToRadBlock);
701
663
  /**
702
- * the class name of the block.
703
- */
704
- FlowGraphDegToRadBlock.ClassName = "FGDegToRadBlock";
705
- RegisterClass(FlowGraphDegToRadBlock.ClassName, FlowGraphDegToRadBlock);
706
- /**
707
- * @experimental
708
664
  * Convert radians to degrees block.
709
665
  */
710
666
  export class FlowGraphRadToDegBlock extends FlowGraphUnaryOperationBlock {
711
667
  constructor(config) {
712
- super(RichTypeAny, RichTypeAny, (a) => this._polymorphicRadToDeg(a), FlowGraphRadToDegBlock.ClassName, config);
668
+ super(RichTypeAny, RichTypeAny, (a) => this._polymorphicRadToDeg(a), "FlowGraphRadToDegBlock" /* FlowGraphBlockNames.RadToDeg */, config);
713
669
  }
714
670
  _radToDeg(a) {
715
671
  return (a * 180) / Math.PI;
@@ -718,616 +674,368 @@ export class FlowGraphRadToDegBlock extends FlowGraphUnaryOperationBlock {
718
674
  return _componentWiseUnaryOperation(a, this._radToDeg);
719
675
  }
720
676
  }
677
+ RegisterClass("FlowGraphRadToDegBlock" /* FlowGraphBlockNames.RadToDeg */, FlowGraphRadToDegBlock);
721
678
  /**
722
- * the class name of the block.
723
- */
724
- FlowGraphRadToDegBlock.ClassName = "FGRadToDegBlock";
725
- RegisterClass(FlowGraphRadToDegBlock.ClassName, FlowGraphRadToDegBlock);
726
- /**
727
- * @experimental
728
679
  * Sin block.
729
680
  */
730
681
  export class FlowGraphSinBlock extends FlowGraphUnaryOperationBlock {
731
682
  constructor(config) {
732
- super(RichTypeAny, RichTypeAny, (a) => this._polymorphicSin(a), FlowGraphSinBlock.ClassName, config);
683
+ super(RichTypeNumber, RichTypeNumber, (a) => this._polymorphicSin(a), "FlowGraphSinBlock" /* FlowGraphBlockNames.Sin */, config);
733
684
  }
734
685
  _polymorphicSin(a) {
735
686
  return _componentWiseUnaryOperation(a, Math.sin);
736
687
  }
737
688
  }
738
689
  /**
739
- * the class name of the block.
740
- */
741
- FlowGraphSinBlock.ClassName = "FGSinBlock";
742
- RegisterClass(FlowGraphSinBlock.ClassName, FlowGraphSinBlock);
743
- /**
744
- * @experimental
745
690
  * Cos block.
746
691
  */
747
692
  export class FlowGraphCosBlock extends FlowGraphUnaryOperationBlock {
748
693
  constructor(config) {
749
- super(RichTypeAny, RichTypeAny, (a) => this._polymorphicCos(a), FlowGraphCosBlock.ClassName, config);
694
+ super(RichTypeNumber, RichTypeNumber, (a) => this._polymorphicCos(a), "FlowGraphCosBlock" /* FlowGraphBlockNames.Cos */, config);
750
695
  }
751
696
  _polymorphicCos(a) {
752
697
  return _componentWiseUnaryOperation(a, Math.cos);
753
698
  }
754
699
  }
755
700
  /**
756
- * the class name of the block.
757
- */
758
- FlowGraphCosBlock.ClassName = "FGCosBlock";
759
- RegisterClass(FlowGraphCosBlock.ClassName, FlowGraphCosBlock);
760
- /**
761
- * @experimental
762
701
  * Tan block.
763
702
  */
764
703
  export class FlowGraphTanBlock extends FlowGraphUnaryOperationBlock {
765
704
  constructor(config) {
766
- super(RichTypeAny, RichTypeAny, (a) => this._polymorphicTan(a), FlowGraphTanBlock.ClassName, config);
705
+ super(RichTypeNumber, RichTypeNumber, (a) => this._polymorphicTan(a), "FlowGraphTanBlock" /* FlowGraphBlockNames.Tan */, config);
767
706
  }
768
707
  _polymorphicTan(a) {
769
708
  return _componentWiseUnaryOperation(a, Math.tan);
770
709
  }
771
710
  }
772
711
  /**
773
- * the class name of the block.
774
- */
775
- FlowGraphTanBlock.ClassName = "FGTanBlock";
776
- RegisterClass(FlowGraphTanBlock.ClassName, FlowGraphTanBlock);
777
- /**
778
- * @experimental
779
712
  * Arcsin block.
780
713
  */
781
714
  export class FlowGraphAsinBlock extends FlowGraphUnaryOperationBlock {
782
715
  constructor(config) {
783
- super(RichTypeAny, RichTypeAny, (a) => this._polymorphicAsin(a), FlowGraphAsinBlock.ClassName, config);
716
+ super(RichTypeNumber, RichTypeNumber, (a) => this._polymorphicAsin(a), "FlowGraphASinBlock" /* FlowGraphBlockNames.Asin */, config);
784
717
  }
785
718
  _polymorphicAsin(a) {
786
719
  return _componentWiseUnaryOperation(a, Math.asin);
787
720
  }
788
721
  }
722
+ RegisterClass("FlowGraphASinBlock" /* FlowGraphBlockNames.Asin */, FlowGraphAsinBlock);
789
723
  /**
790
- * the class name of the block.
791
- */
792
- FlowGraphAsinBlock.ClassName = "FGAsinBlock";
793
- RegisterClass(FlowGraphAsinBlock.ClassName, FlowGraphAsinBlock);
794
- /**
795
- * @experimental
796
724
  * Arccos block.
797
725
  */
798
726
  export class FlowGraphAcosBlock extends FlowGraphUnaryOperationBlock {
799
727
  constructor(config) {
800
- super(RichTypeAny, RichTypeAny, (a) => this._polymorphicAcos(a), FlowGraphAcosBlock.ClassName, config);
728
+ super(RichTypeNumber, RichTypeNumber, (a) => this._polymorphicAcos(a), "FlowGraphACosBlock" /* FlowGraphBlockNames.Acos */, config);
801
729
  }
802
730
  _polymorphicAcos(a) {
803
731
  return _componentWiseUnaryOperation(a, Math.acos);
804
732
  }
805
733
  }
734
+ RegisterClass("FlowGraphACosBlock" /* FlowGraphBlockNames.Acos */, FlowGraphAcosBlock);
806
735
  /**
807
- * the class name of the block.
808
- */
809
- FlowGraphAcosBlock.ClassName = "FGAcosBlock";
810
- RegisterClass(FlowGraphAcosBlock.ClassName, FlowGraphAcosBlock);
811
- /**
812
- * @experimental
813
736
  * Arctan block.
814
737
  */
815
738
  export class FlowGraphAtanBlock extends FlowGraphUnaryOperationBlock {
816
739
  constructor(config) {
817
- super(RichTypeAny, RichTypeAny, (a) => this._polymorphicAtan(a), FlowGraphAtanBlock.ClassName, config);
740
+ super(RichTypeNumber, RichTypeNumber, (a) => this._polymorphicAtan(a), "FlowGraphATanBlock" /* FlowGraphBlockNames.Atan */, config);
818
741
  }
819
742
  _polymorphicAtan(a) {
820
743
  return _componentWiseUnaryOperation(a, Math.atan);
821
744
  }
822
745
  }
746
+ RegisterClass("FlowGraphATanBlock" /* FlowGraphBlockNames.Atan */, FlowGraphAtanBlock);
823
747
  /**
824
- * the class name of the block.
825
- */
826
- FlowGraphAtanBlock.ClassName = "FGAtanBlock";
827
- RegisterClass(FlowGraphAtanBlock.ClassName, FlowGraphAtanBlock);
828
- /**
829
- * @experimental
830
748
  * Arctan2 block.
831
749
  */
832
750
  export class FlowGraphAtan2Block extends FlowGraphBinaryOperationBlock {
833
751
  constructor(config) {
834
- super(RichTypeAny, RichTypeAny, RichTypeAny, (a, b) => this._polymorphicAtan2(a, b), FlowGraphAtan2Block.ClassName, config);
752
+ super(RichTypeAny, RichTypeAny, RichTypeAny, (a, b) => this._polymorphicAtan2(a, b), "FlowGraphATan2Block" /* FlowGraphBlockNames.Atan2 */, config);
835
753
  }
836
754
  _polymorphicAtan2(a, b) {
837
755
  return _componentWiseBinaryOperation(a, b, Math.atan2);
838
756
  }
839
757
  }
758
+ RegisterClass("FlowGraphATan2Block" /* FlowGraphBlockNames.Atan2 */, FlowGraphAtan2Block);
840
759
  /**
841
- * the class name of the block.
842
- */
843
- FlowGraphAtan2Block.ClassName = "FGAtan2Block";
844
- RegisterClass(FlowGraphAtan2Block.ClassName, FlowGraphAtan2Block);
845
- /**
846
- * @experimental
847
760
  * Hyperbolic sin block.
848
761
  */
849
762
  export class FlowGraphSinhBlock extends FlowGraphUnaryOperationBlock {
850
763
  constructor(config) {
851
- super(RichTypeAny, RichTypeAny, (a) => this._polymorphicSinh(a), FlowGraphSinhBlock.ClassName, config);
764
+ super(RichTypeAny, RichTypeAny, (a) => this._polymorphicSinh(a), "FlowGraphSinhBlock" /* FlowGraphBlockNames.Sinh */, config);
852
765
  }
853
766
  _polymorphicSinh(a) {
854
767
  return _componentWiseUnaryOperation(a, Math.sinh);
855
768
  }
856
769
  }
770
+ RegisterClass("FlowGraphSinhBlock" /* FlowGraphBlockNames.Sinh */, FlowGraphSinhBlock);
857
771
  /**
858
- * the class name of the block.
859
- */
860
- FlowGraphSinhBlock.ClassName = "FGSinhBlock";
861
- RegisterClass(FlowGraphSinhBlock.ClassName, FlowGraphSinhBlock);
862
- /**
863
- * @experimental
864
772
  * Hyperbolic cos block.
865
773
  */
866
774
  export class FlowGraphCoshBlock extends FlowGraphUnaryOperationBlock {
867
775
  constructor(config) {
868
- super(RichTypeAny, RichTypeAny, (a) => this._polymorphicCosh(a), FlowGraphCoshBlock.ClassName, config);
776
+ super(RichTypeAny, RichTypeAny, (a) => this._polymorphicCosh(a), "FlowGraphCoshBlock" /* FlowGraphBlockNames.Cosh */, config);
869
777
  }
870
778
  _polymorphicCosh(a) {
871
779
  return _componentWiseUnaryOperation(a, Math.cosh);
872
780
  }
873
781
  }
782
+ RegisterClass("FlowGraphCoshBlock" /* FlowGraphBlockNames.Cosh */, FlowGraphCoshBlock);
874
783
  /**
875
- * the class name of the block.
876
- */
877
- FlowGraphCoshBlock.ClassName = "FGCoshBlock";
878
- RegisterClass(FlowGraphCoshBlock.ClassName, FlowGraphCoshBlock);
879
- /**
880
- * @experimental
881
784
  * Hyperbolic tan block.
882
785
  */
883
786
  export class FlowGraphTanhBlock extends FlowGraphUnaryOperationBlock {
884
787
  constructor(config) {
885
- super(RichTypeAny, RichTypeAny, (a) => this._polymorphicTanh(a), FlowGraphTanhBlock.ClassName, config);
788
+ super(RichTypeAny, RichTypeAny, (a) => this._polymorphicTanh(a), "FlowGraphTanhBlock" /* FlowGraphBlockNames.Tanh */, config);
886
789
  }
887
790
  _polymorphicTanh(a) {
888
791
  return _componentWiseUnaryOperation(a, Math.tanh);
889
792
  }
890
793
  }
794
+ RegisterClass("FlowGraphTanhBlock" /* FlowGraphBlockNames.Tanh */, FlowGraphTanhBlock);
891
795
  /**
892
- * the class name of the block.
893
- */
894
- FlowGraphTanhBlock.ClassName = "FGTanhBlock";
895
- RegisterClass(FlowGraphTanhBlock.ClassName, FlowGraphTanhBlock);
896
- /**
897
- * @experimental
898
796
  * Hyperbolic arcsin block.
899
797
  */
900
798
  export class FlowGraphAsinhBlock extends FlowGraphUnaryOperationBlock {
901
799
  constructor(config) {
902
- super(RichTypeAny, RichTypeNumber, (a) => this._polymorphicAsinh(a), FlowGraphAsinhBlock.ClassName, config);
800
+ super(RichTypeAny, RichTypeNumber, (a) => this._polymorphicAsinh(a), "FlowGraphASinhBlock" /* FlowGraphBlockNames.Asinh */, config);
903
801
  }
904
802
  _polymorphicAsinh(a) {
905
803
  return _componentWiseUnaryOperation(a, Math.asinh);
906
804
  }
907
805
  }
806
+ RegisterClass("FlowGraphASinhBlock" /* FlowGraphBlockNames.Asinh */, FlowGraphAsinhBlock);
908
807
  /**
909
- * the class name of the block.
910
- */
911
- FlowGraphAsinhBlock.ClassName = "FGAsinhBlock";
912
- RegisterClass(FlowGraphAsinhBlock.ClassName, FlowGraphAsinhBlock);
913
- /**
914
- * @experimental
915
808
  * Hyperbolic arccos block.
916
809
  */
917
810
  export class FlowGraphAcoshBlock extends FlowGraphUnaryOperationBlock {
918
811
  constructor(config) {
919
- super(RichTypeAny, RichTypeNumber, (a) => this._polymorphicAcosh(a), FlowGraphAcoshBlock.ClassName, config);
812
+ super(RichTypeAny, RichTypeNumber, (a) => this._polymorphicAcosh(a), "FlowGraphACoshBlock" /* FlowGraphBlockNames.Acosh */, config);
920
813
  }
921
814
  _polymorphicAcosh(a) {
922
815
  return _componentWiseUnaryOperation(a, Math.acosh);
923
816
  }
924
817
  }
818
+ RegisterClass("FlowGraphACoshBlock" /* FlowGraphBlockNames.Acosh */, FlowGraphAcoshBlock);
925
819
  /**
926
- * the class name of the block.
927
- */
928
- FlowGraphAcoshBlock.ClassName = "FGAcoshBlock";
929
- RegisterClass(FlowGraphAcoshBlock.ClassName, FlowGraphAcoshBlock);
930
- /**
931
- * @experimental
932
820
  * Hyperbolic arctan block.
933
821
  */
934
822
  export class FlowGraphAtanhBlock extends FlowGraphUnaryOperationBlock {
935
823
  constructor(config) {
936
- super(RichTypeAny, RichTypeNumber, (a) => this._polymorphicAtanh(a), FlowGraphAtanhBlock.ClassName, config);
824
+ super(RichTypeAny, RichTypeNumber, (a) => this._polymorphicAtanh(a), "FlowGraphATanhBlock" /* FlowGraphBlockNames.Atanh */, config);
937
825
  }
938
826
  _polymorphicAtanh(a) {
939
827
  return _componentWiseUnaryOperation(a, Math.atanh);
940
828
  }
941
829
  }
830
+ RegisterClass("FlowGraphATanhBlock" /* FlowGraphBlockNames.Atanh */, FlowGraphAtanhBlock);
942
831
  /**
943
- * the class name of the block.
944
- */
945
- FlowGraphAtanhBlock.ClassName = "FGAtanhBlock";
946
- RegisterClass(FlowGraphAtanhBlock.ClassName, FlowGraphAtanhBlock);
947
- /**
948
- * @experimental
949
832
  * Exponential block.
950
833
  */
951
834
  export class FlowGraphExpBlock extends FlowGraphUnaryOperationBlock {
952
835
  constructor(config) {
953
- super(RichTypeAny, RichTypeNumber, (a) => this._polymorphicExp(a), FlowGraphExpBlock.ClassName, config);
836
+ super(RichTypeAny, RichTypeNumber, (a) => this._polymorphicExp(a), "FlowGraphExponentialBlock" /* FlowGraphBlockNames.Exponential */, config);
954
837
  }
955
838
  _polymorphicExp(a) {
956
839
  return _componentWiseUnaryOperation(a, Math.exp);
957
840
  }
958
841
  }
842
+ RegisterClass("FlowGraphExponentialBlock" /* FlowGraphBlockNames.Exponential */, FlowGraphExpBlock);
959
843
  /**
960
- * the class name of the block.
961
- */
962
- FlowGraphExpBlock.ClassName = "FGExpBlock";
963
- RegisterClass(FlowGraphExpBlock.ClassName, FlowGraphExpBlock);
964
- /**
965
- * @experimental
966
844
  * Logarithm block.
967
845
  */
968
846
  export class FlowGraphLogBlock extends FlowGraphUnaryOperationBlock {
969
847
  constructor(config) {
970
- super(RichTypeAny, RichTypeNumber, (a) => this._polymorphicLog(a), FlowGraphLogBlock.ClassName, config);
848
+ super(RichTypeAny, RichTypeNumber, (a) => this._polymorphicLog(a), "FlowGraphLogBlock" /* FlowGraphBlockNames.Log */, config);
971
849
  }
972
850
  _polymorphicLog(a) {
973
851
  return _componentWiseUnaryOperation(a, Math.log);
974
852
  }
975
853
  }
854
+ RegisterClass("FlowGraphLogBlock" /* FlowGraphBlockNames.Log */, FlowGraphLogBlock);
976
855
  /**
977
- * the class name of the block.
978
- */
979
- FlowGraphLogBlock.ClassName = "FGLogBlock";
980
- RegisterClass(FlowGraphLogBlock.ClassName, FlowGraphLogBlock);
981
- /**
982
- * @experimental
983
856
  * Base 2 logarithm block.
984
857
  */
985
858
  export class FlowGraphLog2Block extends FlowGraphUnaryOperationBlock {
986
859
  constructor(config) {
987
- super(RichTypeAny, RichTypeNumber, (a) => this._polymorphicLog2(a), FlowGraphLog2Block.ClassName, config);
860
+ super(RichTypeAny, RichTypeNumber, (a) => this._polymorphicLog2(a), "FlowGraphLog2Block" /* FlowGraphBlockNames.Log2 */, config);
988
861
  }
989
862
  _polymorphicLog2(a) {
990
863
  return _componentWiseUnaryOperation(a, Math.log2);
991
864
  }
992
865
  }
866
+ RegisterClass("FlowGraphLog2Block" /* FlowGraphBlockNames.Log2 */, FlowGraphLog2Block);
993
867
  /**
994
- * the class name of the block.
995
- */
996
- FlowGraphLog2Block.ClassName = "FGLog2Block";
997
- RegisterClass(FlowGraphLog2Block.ClassName, FlowGraphLog2Block);
998
- /**
999
- * @experimental
1000
868
  * Base 10 logarithm block.
1001
869
  */
1002
870
  export class FlowGraphLog10Block extends FlowGraphUnaryOperationBlock {
1003
871
  constructor(config) {
1004
- super(RichTypeAny, RichTypeNumber, (a) => this._polymorphicLog10(a), FlowGraphLog10Block.ClassName, config);
872
+ super(RichTypeAny, RichTypeNumber, (a) => this._polymorphicLog10(a), "FlowGraphLog10Block" /* FlowGraphBlockNames.Log10 */, config);
1005
873
  }
1006
874
  _polymorphicLog10(a) {
1007
875
  return _componentWiseUnaryOperation(a, Math.log10);
1008
876
  }
1009
877
  }
878
+ RegisterClass("FlowGraphLog10Block" /* FlowGraphBlockNames.Log10 */, FlowGraphLog10Block);
1010
879
  /**
1011
- * the class name of the block.
1012
- */
1013
- FlowGraphLog10Block.ClassName = "FGLog10Block";
1014
- RegisterClass(FlowGraphLog10Block.ClassName, FlowGraphLog10Block);
1015
- /**
1016
- * @experimental
1017
880
  * Square root block.
1018
881
  */
1019
- export class FlowGraphSqrtBlock extends FlowGraphUnaryOperationBlock {
882
+ export class FlowGraphSquareRootBlock extends FlowGraphUnaryOperationBlock {
1020
883
  constructor(config) {
1021
- super(RichTypeAny, RichTypeNumber, (a) => this._polymorphicSqrt(a), FlowGraphSqrtBlock.ClassName, config);
884
+ super(RichTypeAny, RichTypeNumber, (a) => this._polymorphicSqrt(a), "FlowGraphSquareRootBlock" /* FlowGraphBlockNames.SquareRoot */, config);
1022
885
  }
1023
886
  _polymorphicSqrt(a) {
1024
887
  return _componentWiseUnaryOperation(a, Math.sqrt);
1025
888
  }
1026
889
  }
890
+ RegisterClass("FlowGraphSquareRootBlock" /* FlowGraphBlockNames.SquareRoot */, FlowGraphSquareRootBlock);
1027
891
  /**
1028
- * the class name of the block.
1029
- */
1030
- FlowGraphSqrtBlock.ClassName = "FGSqrtBlock";
1031
- RegisterClass(FlowGraphSqrtBlock.ClassName, FlowGraphSqrtBlock);
1032
- /**
1033
- * @experimental
1034
892
  * Cube root block.
1035
893
  */
1036
894
  export class FlowGraphCubeRootBlock extends FlowGraphUnaryOperationBlock {
1037
895
  constructor(config) {
1038
- super(RichTypeAny, RichTypeNumber, (a) => this._polymorphicCubeRoot(a), FlowGraphCubeRootBlock.ClassName, config);
896
+ super(RichTypeAny, RichTypeNumber, (a) => this._polymorphicCubeRoot(a), "FlowGraphCubeRootBlock" /* FlowGraphBlockNames.CubeRoot */, config);
1039
897
  }
1040
898
  _polymorphicCubeRoot(a) {
1041
899
  return _componentWiseUnaryOperation(a, Math.cbrt);
1042
900
  }
1043
901
  }
902
+ RegisterClass("FlowGraphCubeRootBlock" /* FlowGraphBlockNames.CubeRoot */, FlowGraphCubeRootBlock);
1044
903
  /**
1045
- * the class name of the block.
1046
- */
1047
- FlowGraphCubeRootBlock.ClassName = "FGCubeRootBlock";
1048
- RegisterClass(FlowGraphCubeRootBlock.ClassName, FlowGraphCubeRootBlock);
1049
- /**
1050
- * @experimental
1051
904
  * Power block.
1052
905
  */
1053
- export class FlowGraphPowBlock extends FlowGraphBinaryOperationBlock {
906
+ export class FlowGraphPowerBlock extends FlowGraphBinaryOperationBlock {
1054
907
  constructor(config) {
1055
- super(RichTypeAny, RichTypeNumber, RichTypeNumber, (a, b) => this._polymorphicPow(a, b), FlowGraphPowBlock.ClassName, config);
908
+ super(RichTypeAny, RichTypeNumber, RichTypeNumber, (a, b) => this._polymorphicPow(a, b), "FlowGraphPowerBlock" /* FlowGraphBlockNames.Power */, config);
1056
909
  }
1057
910
  _polymorphicPow(a, b) {
1058
911
  return _componentWiseBinaryOperation(a, b, Math.pow);
1059
912
  }
1060
913
  }
914
+ RegisterClass("FlowGraphPowerBlock" /* FlowGraphBlockNames.Power */, FlowGraphPowerBlock);
1061
915
  /**
1062
- * the class name of the block.
1063
- */
1064
- FlowGraphPowBlock.ClassName = "FGPowBlock";
1065
- RegisterClass(FlowGraphPowBlock.ClassName, FlowGraphPowBlock);
1066
- /**
1067
- * @experimental
1068
- * Vector length block.
1069
- */
1070
- export class FlowGraphLengthBlock extends FlowGraphUnaryOperationBlock {
1071
- constructor(config) {
1072
- super(RichTypeAny, RichTypeNumber, (a) => this._polymorphicLength(a), FlowGraphLengthBlock.ClassName, config);
1073
- }
1074
- _polymorphicLength(a) {
1075
- const aClassName = _getClassNameOf(a);
1076
- switch (aClassName) {
1077
- case "Vector2":
1078
- case "Vector3":
1079
- case "Vector4":
1080
- return a.length();
1081
- default:
1082
- throw new Error(`Cannot compute length of value ${a}`);
1083
- }
1084
- }
1085
- }
1086
- /**
1087
- * the class name of the block.
1088
- */
1089
- FlowGraphLengthBlock.ClassName = "FGLengthBlock";
1090
- RegisterClass(FlowGraphLengthBlock.ClassName, FlowGraphLengthBlock);
1091
- /**
1092
- * @experimental
1093
- * Vector normalize block.
1094
- */
1095
- export class FlowGraphNormalizeBlock extends FlowGraphUnaryOperationBlock {
1096
- constructor(config) {
1097
- super(RichTypeAny, RichTypeAny, (a) => this._polymorphicNormalize(a), FlowGraphNormalizeBlock.ClassName, config);
1098
- }
1099
- _polymorphicNormalize(a) {
1100
- const aClassName = _getClassNameOf(a);
1101
- switch (aClassName) {
1102
- case "Vector2":
1103
- case "Vector3":
1104
- case "Vector4":
1105
- return a.normalize();
1106
- default:
1107
- throw new Error(`Cannot normalize value ${a}`);
1108
- }
1109
- }
1110
- }
1111
- /**
1112
- * the class name of the block.
1113
- */
1114
- FlowGraphNormalizeBlock.ClassName = "FGNormalizeBlock";
1115
- RegisterClass(FlowGraphNormalizeBlock.ClassName, FlowGraphNormalizeBlock);
1116
- /**
1117
- * @experimental
1118
- * Cross product block.
1119
- */
1120
- export class FlowGraphCrossBlock extends FlowGraphBinaryOperationBlock {
1121
- constructor(config) {
1122
- super(RichTypeVector3, RichTypeVector3, RichTypeVector3, (a, b) => Vector3.Cross(a, b), FlowGraphCrossBlock.ClassName, config);
1123
- }
1124
- }
1125
- /**
1126
- * the class name of the block.
1127
- */
1128
- FlowGraphCrossBlock.ClassName = "FGCrossBlock";
1129
- RegisterClass(FlowGraphCrossBlock.ClassName, FlowGraphCrossBlock);
1130
- /**
1131
- * @experimental
1132
- * 2D rotation block.
1133
- */
1134
- export class FlowGraphRotate2DBlock extends FlowGraphBinaryOperationBlock {
1135
- constructor(config) {
1136
- super(RichTypeVector2, RichTypeNumber, RichTypeVector2, (a, b) => Vector2.Transform(a, Matrix.RotationZ(b)), FlowGraphRotate2DBlock.ClassName, config);
1137
- }
1138
- }
1139
- /**
1140
- * the class name of the block.
1141
- */
1142
- FlowGraphRotate2DBlock.ClassName = "FGRotate2DBlock";
1143
- RegisterClass(FlowGraphRotate2DBlock.ClassName, FlowGraphRotate2DBlock);
1144
- /**
1145
- * @experimental
1146
- * 3D rotation block.
1147
- */
1148
- export class FlowGraphRotate3DBlock extends FlowGraphTernaryOperationBlock {
1149
- constructor(config) {
1150
- super(RichTypeVector3, RichTypeVector3, RichTypeNumber, RichTypeVector3, (a, b, c) => Vector3.TransformCoordinates(a, Matrix.RotationAxis(b, c)), FlowGraphRotate3DBlock.ClassName, config);
1151
- }
1152
- }
1153
- /**
1154
- * the class name of the block.
1155
- */
1156
- FlowGraphRotate3DBlock.ClassName = "FGRotate3DBlock";
1157
- RegisterClass(FlowGraphRotate3DBlock.ClassName, FlowGraphRotate3DBlock);
1158
- /**
1159
- * @experimental
1160
- * Transposes a matrix.
1161
- */
1162
- export class FlowGraphTransposeBlock extends FlowGraphUnaryOperationBlock {
1163
- constructor(config) {
1164
- super(RichTypeMatrix, RichTypeMatrix, (a) => Matrix.Transpose(a), FlowGraphTransposeBlock.ClassName, config);
1165
- }
1166
- }
1167
- /**
1168
- * the class name of the block.
1169
- */
1170
- FlowGraphTransposeBlock.ClassName = "FGTransposeBlock";
1171
- RegisterClass(FlowGraphTransposeBlock.ClassName, FlowGraphTransposeBlock);
1172
- /**
1173
- * @experimental
1174
- * Gets the determinant of a matrix.
1175
- */
1176
- export class FlowGraphDeterminantBlock extends FlowGraphUnaryOperationBlock {
1177
- constructor(config) {
1178
- super(RichTypeMatrix, RichTypeNumber, (a) => a.determinant(), FlowGraphDeterminantBlock.ClassName, config);
1179
- }
1180
- }
1181
- /**
1182
- * the class name of the block.
1183
- */
1184
- FlowGraphDeterminantBlock.ClassName = "FGDeterminantBlock";
1185
- RegisterClass(FlowGraphDeterminantBlock.ClassName, FlowGraphDeterminantBlock);
1186
- /**
1187
- * @experimental
1188
- * Inverts a matrix.
1189
- */
1190
- export class FlowGraphInvertMatrixBlock extends FlowGraphUnaryOperationBlock {
1191
- constructor(config) {
1192
- super(RichTypeMatrix, RichTypeMatrix, (a) => Matrix.Invert(a), FlowGraphInvertMatrixBlock.ClassName, config);
1193
- }
1194
- }
1195
- /**
1196
- * the class name of the block.
1197
- */
1198
- FlowGraphInvertMatrixBlock.ClassName = "FGInvertMatrixBlock";
1199
- RegisterClass(FlowGraphInvertMatrixBlock.ClassName, FlowGraphInvertMatrixBlock);
1200
- /**
1201
- * @experimental
1202
- * Multiplies two matrices.
1203
- */
1204
- export class FlowGraphMatMulBlock extends FlowGraphBinaryOperationBlock {
1205
- constructor(config) {
1206
- super(RichTypeMatrix, RichTypeMatrix, RichTypeMatrix, (a, b) => b.multiply(a), FlowGraphMatMulBlock.ClassName, config);
1207
- }
1208
- }
1209
- /**
1210
- * the class name of the block.
1211
- */
1212
- FlowGraphMatMulBlock.ClassName = "FGMatMulBlock";
1213
- RegisterClass(FlowGraphMatMulBlock.ClassName, FlowGraphMatMulBlock);
1214
- /**
1215
- * @experimental
1216
916
  * Bitwise NOT operation
1217
917
  */
1218
918
  export class FlowGraphBitwiseNotBlock extends FlowGraphUnaryOperationBlock {
1219
919
  constructor(config) {
1220
- super(RichTypeFlowGraphInteger, RichTypeFlowGraphInteger, (a) => new FlowGraphInteger(~a.value), FlowGraphBitwiseNotBlock.ClassName, config);
920
+ super(getRichTypeByFlowGraphType(config?.valueType || "FlowGraphInteger" /* FlowGraphTypes.Integer */), getRichTypeByFlowGraphType(config?.valueType || "FlowGraphInteger" /* FlowGraphTypes.Integer */), (a) => {
921
+ if (typeof a === "boolean") {
922
+ return !a;
923
+ }
924
+ else if (typeof a === "number") {
925
+ return ~a;
926
+ }
927
+ return new FlowGraphInteger(~a.value);
928
+ }, "FlowGraphBitwiseNotBlock" /* FlowGraphBlockNames.BitwiseNot */, config);
1221
929
  }
1222
930
  }
931
+ RegisterClass("FlowGraphBitwiseNotBlock" /* FlowGraphBlockNames.BitwiseNot */, FlowGraphBitwiseNotBlock);
1223
932
  /**
1224
- * the class name of the block.
1225
- */
1226
- FlowGraphBitwiseNotBlock.ClassName = "FGBitwiseNotBlock";
1227
- RegisterClass(FlowGraphBitwiseNotBlock.ClassName, FlowGraphBitwiseNotBlock);
1228
- /**
1229
- * @experimental
1230
933
  * Bitwise AND operation
1231
934
  */
1232
935
  export class FlowGraphBitwiseAndBlock extends FlowGraphBinaryOperationBlock {
1233
936
  constructor(config) {
1234
- super(RichTypeFlowGraphInteger, RichTypeFlowGraphInteger, RichTypeFlowGraphInteger, (a, b) => new FlowGraphInteger(a.value & b.value), FlowGraphBitwiseAndBlock.ClassName, config);
937
+ super(getRichTypeByFlowGraphType(config?.valueType || "FlowGraphInteger" /* FlowGraphTypes.Integer */), getRichTypeByFlowGraphType(config?.valueType || "FlowGraphInteger" /* FlowGraphTypes.Integer */), getRichTypeByFlowGraphType(config?.valueType || "FlowGraphInteger" /* FlowGraphTypes.Integer */), (a, b) => {
938
+ if (typeof a === "boolean" && typeof b === "boolean") {
939
+ return a && b;
940
+ }
941
+ else if (typeof a === "number" && typeof b === "number") {
942
+ return a & b;
943
+ }
944
+ else if (typeof a === "object" && typeof b === "object") {
945
+ return new FlowGraphInteger(a.value & b.value);
946
+ }
947
+ else {
948
+ throw new Error(`Cannot perform bitwise AND on ${a} and ${b}`);
949
+ }
950
+ }, "FlowGraphBitwiseAndBlock" /* FlowGraphBlockNames.BitwiseAnd */, config);
1235
951
  }
1236
952
  }
953
+ RegisterClass("FlowGraphBitwiseAndBlock" /* FlowGraphBlockNames.BitwiseAnd */, FlowGraphBitwiseAndBlock);
1237
954
  /**
1238
- * the class name of the block.
1239
- */
1240
- FlowGraphBitwiseAndBlock.ClassName = "FGBitwiseAndBlock";
1241
- RegisterClass(FlowGraphBitwiseAndBlock.ClassName, FlowGraphBitwiseAndBlock);
1242
- /**
1243
- * @experimental
1244
955
  * Bitwise OR operation
1245
956
  */
1246
957
  export class FlowGraphBitwiseOrBlock extends FlowGraphBinaryOperationBlock {
1247
958
  constructor(config) {
1248
- super(RichTypeFlowGraphInteger, RichTypeFlowGraphInteger, RichTypeFlowGraphInteger, (a, b) => new FlowGraphInteger(a.value | b.value), FlowGraphBitwiseOrBlock.ClassName, config);
959
+ super(getRichTypeByFlowGraphType(config?.valueType || "FlowGraphInteger" /* FlowGraphTypes.Integer */), getRichTypeByFlowGraphType(config?.valueType || "FlowGraphInteger" /* FlowGraphTypes.Integer */), getRichTypeByFlowGraphType(config?.valueType || "FlowGraphInteger" /* FlowGraphTypes.Integer */), (a, b) => {
960
+ if (typeof a === "boolean" && typeof b === "boolean") {
961
+ return a || b;
962
+ }
963
+ else if (typeof a === "number" && typeof b === "number") {
964
+ return a | b;
965
+ }
966
+ else if (typeof a === "object" && typeof b === "object") {
967
+ return new FlowGraphInteger(a.value | b.value);
968
+ }
969
+ else {
970
+ throw new Error(`Cannot perform bitwise OR on ${a} and ${b}`);
971
+ }
972
+ }, "FlowGraphBitwiseOrBlock" /* FlowGraphBlockNames.BitwiseOr */, config);
1249
973
  }
1250
974
  }
975
+ RegisterClass("FlowGraphBitwiseOrBlock" /* FlowGraphBlockNames.BitwiseOr */, FlowGraphBitwiseOrBlock);
1251
976
  /**
1252
- * the class name of the block.
1253
- */
1254
- FlowGraphBitwiseOrBlock.ClassName = "FGBitwiseOrBlock";
1255
- RegisterClass(FlowGraphBitwiseOrBlock.ClassName, FlowGraphBitwiseOrBlock);
1256
- /**
1257
- * @experimental
1258
977
  * Bitwise XOR operation
1259
978
  */
1260
979
  export class FlowGraphBitwiseXorBlock extends FlowGraphBinaryOperationBlock {
1261
980
  constructor(config) {
1262
- super(RichTypeFlowGraphInteger, RichTypeFlowGraphInteger, RichTypeFlowGraphInteger, (a, b) => new FlowGraphInteger(a.value ^ b.value), FlowGraphBitwiseXorBlock.ClassName, config);
981
+ super(getRichTypeByFlowGraphType(config?.valueType || "FlowGraphInteger" /* FlowGraphTypes.Integer */), getRichTypeByFlowGraphType(config?.valueType || "FlowGraphInteger" /* FlowGraphTypes.Integer */), getRichTypeByFlowGraphType(config?.valueType || "FlowGraphInteger" /* FlowGraphTypes.Integer */), (a, b) => {
982
+ if (typeof a === "boolean" && typeof b === "boolean") {
983
+ return a !== b;
984
+ }
985
+ else if (typeof a === "number" && typeof b === "number") {
986
+ return a ^ b;
987
+ }
988
+ else if (typeof a === "object" && typeof b === "object") {
989
+ return new FlowGraphInteger(a.value ^ b.value);
990
+ }
991
+ else {
992
+ throw new Error(`Cannot perform bitwise XOR on ${a} and ${b}`);
993
+ }
994
+ }, "FlowGraphBitwiseXorBlock" /* FlowGraphBlockNames.BitwiseXor */, config);
1263
995
  }
1264
996
  }
997
+ RegisterClass("FlowGraphBitwiseXorBlock" /* FlowGraphBlockNames.BitwiseXor */, FlowGraphBitwiseXorBlock);
1265
998
  /**
1266
- * the class name of the block.
1267
- */
1268
- FlowGraphBitwiseXorBlock.ClassName = "FGBitwiseXorBlock";
1269
- RegisterClass(FlowGraphBitwiseXorBlock.ClassName, FlowGraphBitwiseXorBlock);
1270
- /**
1271
- * @experimental
1272
999
  * Bitwise left shift operation
1273
1000
  */
1274
1001
  export class FlowGraphBitwiseLeftShiftBlock extends FlowGraphBinaryOperationBlock {
1275
1002
  constructor(config) {
1276
- super(RichTypeFlowGraphInteger, RichTypeFlowGraphInteger, RichTypeFlowGraphInteger, (a, b) => new FlowGraphInteger(a.value << b.value), FlowGraphBitwiseLeftShiftBlock.ClassName, config);
1003
+ super(RichTypeFlowGraphInteger, RichTypeFlowGraphInteger, RichTypeFlowGraphInteger, (a, b) => new FlowGraphInteger(a.value << b.value), "FlowGraphBitwiseLeftShiftBlock" /* FlowGraphBlockNames.BitwiseLeftShift */, config);
1277
1004
  }
1278
1005
  }
1006
+ RegisterClass("FlowGraphBitwiseLeftShiftBlock" /* FlowGraphBlockNames.BitwiseLeftShift */, FlowGraphBitwiseLeftShiftBlock);
1279
1007
  /**
1280
- * the class name of the block.
1281
- */
1282
- FlowGraphBitwiseLeftShiftBlock.ClassName = "FGBitwiseLeftShiftBlock";
1283
- RegisterClass(FlowGraphBitwiseLeftShiftBlock.ClassName, FlowGraphBitwiseLeftShiftBlock);
1284
- /**
1285
- * @experimental
1286
1008
  * Bitwise right shift operation
1287
1009
  */
1288
1010
  export class FlowGraphBitwiseRightShiftBlock extends FlowGraphBinaryOperationBlock {
1289
1011
  constructor(config) {
1290
- super(RichTypeFlowGraphInteger, RichTypeFlowGraphInteger, RichTypeFlowGraphInteger, (a, b) => new FlowGraphInteger(a.value >> b.value), FlowGraphBitwiseRightShiftBlock.ClassName, config);
1012
+ super(RichTypeFlowGraphInteger, RichTypeFlowGraphInteger, RichTypeFlowGraphInteger, (a, b) => new FlowGraphInteger(a.value >> b.value), "FlowGraphBitwiseRightShiftBlock" /* FlowGraphBlockNames.BitwiseRightShift */, config);
1291
1013
  }
1292
1014
  }
1015
+ RegisterClass("FlowGraphBitwiseRightShiftBlock" /* FlowGraphBlockNames.BitwiseRightShift */, FlowGraphBitwiseRightShiftBlock);
1293
1016
  /**
1294
- * the class name of the block.
1295
- */
1296
- FlowGraphBitwiseRightShiftBlock.ClassName = "FGBitwiseRightShiftBlock";
1297
- RegisterClass(FlowGraphBitwiseRightShiftBlock.ClassName, FlowGraphBitwiseRightShiftBlock);
1298
- /**
1299
- * @experimental
1300
1017
  * Count leading zeros operation
1301
1018
  */
1302
- export class FlowGraphCountLeadingZerosBlock extends FlowGraphUnaryOperationBlock {
1019
+ export class FlowGraphLeadingZerosBlock extends FlowGraphUnaryOperationBlock {
1303
1020
  constructor(config) {
1304
- super(RichTypeFlowGraphInteger, RichTypeFlowGraphInteger, (a) => new FlowGraphInteger(Math.clz32(a.value)), FlowGraphCountLeadingZerosBlock.ClassName, config);
1021
+ super(RichTypeFlowGraphInteger, RichTypeFlowGraphInteger, (a) => new FlowGraphInteger(Math.clz32(a.value)), "FlowGraphLeadingZerosBlock" /* FlowGraphBlockNames.LeadingZeros */, config);
1305
1022
  }
1306
1023
  }
1024
+ RegisterClass("FlowGraphLeadingZerosBlock" /* FlowGraphBlockNames.LeadingZeros */, FlowGraphLeadingZerosBlock);
1307
1025
  /**
1308
- * the class name of the block.
1309
- */
1310
- FlowGraphCountLeadingZerosBlock.ClassName = "FGCountLeadingZerosBlock";
1311
- RegisterClass(FlowGraphCountLeadingZerosBlock.ClassName, FlowGraphCountLeadingZerosBlock);
1312
- /**
1313
- * @experimental
1314
1026
  * Count trailing zeros operation
1315
1027
  */
1316
- export class FlowGraphCountTrailingZerosBlock extends FlowGraphUnaryOperationBlock {
1028
+ export class FlowGraphTrailingZerosBlock extends FlowGraphUnaryOperationBlock {
1317
1029
  constructor(config) {
1318
- super(RichTypeFlowGraphInteger, RichTypeFlowGraphInteger, (a) => new FlowGraphInteger(a.value ? 31 - Math.clz32(a.value & -a.value) : 32), FlowGraphCountTrailingZerosBlock.ClassName, config);
1030
+ super(RichTypeFlowGraphInteger, RichTypeFlowGraphInteger, (a) => new FlowGraphInteger(a.value ? 31 - Math.clz32(a.value & -a.value) : 32), "FlowGraphTrailingZerosBlock" /* FlowGraphBlockNames.TrailingZeros */, config);
1319
1031
  }
1320
1032
  }
1321
- /**
1322
- * the class name of the block.
1323
- */
1324
- FlowGraphCountTrailingZerosBlock.ClassName = "FGCountTrailingZerosBlock";
1325
- RegisterClass(FlowGraphCountTrailingZerosBlock.ClassName, FlowGraphCountTrailingZerosBlock);
1033
+ RegisterClass("FlowGraphTrailingZerosBlock" /* FlowGraphBlockNames.TrailingZeros */, FlowGraphTrailingZerosBlock);
1326
1034
  /**
1327
1035
  * Given a number (which is converted to a 32-bit integer), return the
1328
1036
  * number of bits set to one on that number.
1329
- * @internal
1330
- * @param n
1037
+ * @param n the number to run the op on
1038
+ * @returns the number of bits set to one on that number
1331
1039
  */
1332
1040
  function _countOnes(n) {
1333
1041
  let result = 0;
@@ -1341,17 +1049,12 @@ function _countOnes(n) {
1341
1049
  return result;
1342
1050
  }
1343
1051
  /**
1344
- * @experimental
1345
1052
  * Count one bits operation
1346
1053
  */
1347
- export class FlowGraphCountOneBitsBlock extends FlowGraphUnaryOperationBlock {
1054
+ export class FlowGraphOneBitsCounterBlock extends FlowGraphUnaryOperationBlock {
1348
1055
  constructor(config) {
1349
- super(RichTypeFlowGraphInteger, RichTypeFlowGraphInteger, (a) => new FlowGraphInteger(_countOnes(a.value)), FlowGraphCountOneBitsBlock.ClassName, config);
1056
+ super(RichTypeFlowGraphInteger, RichTypeFlowGraphInteger, (a) => new FlowGraphInteger(_countOnes(a.value)), "FlowGraphOneBitsCounterBlock" /* FlowGraphBlockNames.OneBitsCounter */, config);
1350
1057
  }
1351
1058
  }
1352
- /**
1353
- * the class name of the block.
1354
- */
1355
- FlowGraphCountOneBitsBlock.ClassName = "FGCountOneBitsBlock";
1356
- RegisterClass(FlowGraphCountOneBitsBlock.ClassName, FlowGraphCountOneBitsBlock);
1059
+ RegisterClass("FlowGraphOneBitsCounterBlock" /* FlowGraphBlockNames.OneBitsCounter */, FlowGraphOneBitsCounterBlock);
1357
1060
  //# sourceMappingURL=flowGraphMathBlocks.js.map