@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,32 +1,49 @@
1
1
  import { FlowGraphConnection } from "./flowGraphConnection.js";
2
2
  import { RegisterClass } from "../Misc/typeStore.js";
3
3
  /**
4
- * @experimental
5
4
  * Represents a connection point for a signal.
6
5
  * When an output point is activated, it will activate the connected input point.
7
6
  * When an input point is activated, it will execute the block it belongs to.
8
7
  */
9
8
  export class FlowGraphSignalConnection extends FlowGraphConnection {
10
- /**
11
- * @internal
12
- * A signal input can be connected to more than one signal output,
13
- * but a signal output can only connect to one signal input
14
- * @returns true if the connection is singular
15
- */
9
+ constructor() {
10
+ super(...arguments);
11
+ /**
12
+ * The priority of the signal. Signals with higher priority will be executed first.
13
+ * Set priority before adding the connection as sorting happens only when the connection is added.
14
+ */
15
+ this.priority = 0;
16
+ }
16
17
  _isSingularConnection() {
17
- return this.connectionType === 1 /* FlowGraphConnectionType.Output */;
18
+ return false;
19
+ }
20
+ connectTo(point) {
21
+ super.connectTo(point);
22
+ // sort according to priority to handle execution order
23
+ this._connectedPoint.sort((a, b) => b.priority - a.priority);
18
24
  }
19
25
  /**
20
26
  * @internal
21
27
  */
22
28
  _activateSignal(context) {
29
+ context.logger?.addLogItem({
30
+ action: "ActivateSignal" /* FlowGraphAction.ActivateSignal */,
31
+ className: this._ownerBlock.getClassName(),
32
+ uniqueId: this._ownerBlock.uniqueId,
33
+ payload: {
34
+ connectionType: this.connectionType,
35
+ name: this.name,
36
+ },
37
+ });
23
38
  if (this.connectionType === 0 /* FlowGraphConnectionType.Input */) {
24
39
  context._notifyExecuteNode(this._ownerBlock);
25
40
  this._ownerBlock._execute(context, this);
26
41
  context._increaseExecutionId();
27
42
  }
28
43
  else {
29
- this._connectedPoint[0]?._activateSignal(context);
44
+ for (const connectedPoint of this._connectedPoint) {
45
+ connectedPoint._activateSignal(context);
46
+ }
30
47
  }
31
48
  }
32
49
  }
@@ -1 +1 @@
1
- {"version":3,"file":"flowGraphSignalConnection.js","sourceRoot":"","sources":["../../../../dev/core/src/FlowGraph/flowGraphSignalConnection.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAA2B,MAAM,uBAAuB,CAAC;AAErF,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAElD;;;;;GAKG;AACH,MAAM,OAAO,yBAA0B,SAAQ,mBAAuE;IAClH;;;;;OAKG;IACa,qBAAqB;QACjC,OAAO,IAAI,CAAC,cAAc,2CAAmC,CAAC;IAClE,CAAC;IAED;;OAEG;IACI,eAAe,CAAC,OAAyB;QAC5C,IAAI,IAAI,CAAC,cAAc,0CAAkC,EAAE,CAAC;YACxD,OAAO,CAAC,kBAAkB,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;YAC7C,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;YACzC,OAAO,CAAC,oBAAoB,EAAE,CAAC;QACnC,CAAC;aAAM,CAAC;YACJ,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,EAAE,eAAe,CAAC,OAAO,CAAC,CAAC;QACtD,CAAC;IACL,CAAC;CACJ;AAED,aAAa,CAAC,2BAA2B,EAAE,yBAAyB,CAAC,CAAC","sourcesContent":["import type { FlowGraphExecutionBlock } from \"./flowGraphExecutionBlock\";\r\nimport { FlowGraphConnection, FlowGraphConnectionType } from \"./flowGraphConnection\";\r\nimport type { FlowGraphContext } from \"./flowGraphContext\";\r\nimport { RegisterClass } from \"../Misc/typeStore\";\r\n\r\n/**\r\n * @experimental\r\n * Represents a connection point for a signal.\r\n * When an output point is activated, it will activate the connected input point.\r\n * When an input point is activated, it will execute the block it belongs to.\r\n */\r\nexport class FlowGraphSignalConnection extends FlowGraphConnection<FlowGraphExecutionBlock, FlowGraphSignalConnection> {\r\n /**\r\n * @internal\r\n * A signal input can be connected to more than one signal output,\r\n * but a signal output can only connect to one signal input\r\n * @returns true if the connection is singular\r\n */\r\n public override _isSingularConnection(): boolean {\r\n return this.connectionType === FlowGraphConnectionType.Output;\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _activateSignal(context: FlowGraphContext): void {\r\n if (this.connectionType === FlowGraphConnectionType.Input) {\r\n context._notifyExecuteNode(this._ownerBlock);\r\n this._ownerBlock._execute(context, this);\r\n context._increaseExecutionId();\r\n } else {\r\n this._connectedPoint[0]?._activateSignal(context);\r\n }\r\n }\r\n}\r\n\r\nRegisterClass(\"FlowGraphSignalConnection\", FlowGraphSignalConnection);\r\n"]}
1
+ {"version":3,"file":"flowGraphSignalConnection.js","sourceRoot":"","sources":["../../../../dev/core/src/FlowGraph/flowGraphSignalConnection.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAA2B,MAAM,uBAAuB,CAAC;AAErF,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAGlD;;;;GAIG;AACH,MAAM,OAAO,yBAA0B,SAAQ,mBAAuE;IAAtH;;QAMI;;;WAGG;QACI,aAAQ,GAAW,CAAC,CAAC;IAmChC,CAAC;IAjCmB,qBAAqB;QACjC,OAAO,KAAK,CAAC;IACjB,CAAC;IAEe,SAAS,CAAC,KAAgC;QACtD,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;QACvB,uDAAuD;QACvD,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,GAAG,CAAC,CAAC,QAAQ,CAAC,CAAC;IACjE,CAAC;IAED;;OAEG;IACI,eAAe,CAAC,OAAyB;QAC5C,OAAO,CAAC,MAAM,EAAE,UAAU,CAAC;YACvB,MAAM,uDAAgC;YACtC,SAAS,EAAE,IAAI,CAAC,WAAW,CAAC,YAAY,EAAE;YAC1C,QAAQ,EAAE,IAAI,CAAC,WAAW,CAAC,QAAQ;YACnC,OAAO,EAAE;gBACL,cAAc,EAAE,IAAI,CAAC,cAAc;gBACnC,IAAI,EAAE,IAAI,CAAC,IAAI;aAClB;SACJ,CAAC,CAAC;QACH,IAAI,IAAI,CAAC,cAAc,0CAAkC,EAAE,CAAC;YACxD,OAAO,CAAC,kBAAkB,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;YAC7C,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;YACzC,OAAO,CAAC,oBAAoB,EAAE,CAAC;QACnC,CAAC;aAAM,CAAC;YACJ,KAAK,MAAM,cAAc,IAAI,IAAI,CAAC,eAAe,EAAE,CAAC;gBAChD,cAAc,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;YAC5C,CAAC;QACL,CAAC;IACL,CAAC;CACJ;AAED,aAAa,CAAC,2BAA2B,EAAE,yBAAyB,CAAC,CAAC","sourcesContent":["import type { FlowGraphExecutionBlock } from \"./flowGraphExecutionBlock\";\r\nimport { FlowGraphConnection, FlowGraphConnectionType } from \"./flowGraphConnection\";\r\nimport type { FlowGraphContext } from \"./flowGraphContext\";\r\nimport { RegisterClass } from \"../Misc/typeStore\";\r\nimport { FlowGraphAction } from \"./flowGraphLogger\";\r\n\r\n/**\r\n * Represents a connection point for a signal.\r\n * When an output point is activated, it will activate the connected input point.\r\n * When an input point is activated, it will execute the block it belongs to.\r\n */\r\nexport class FlowGraphSignalConnection extends FlowGraphConnection<FlowGraphExecutionBlock, FlowGraphSignalConnection> {\r\n /**\r\n * Optional payload. Can be used, for example, when an error is thrown to pass additional information.\r\n */\r\n public payload: any;\r\n\r\n /**\r\n * The priority of the signal. Signals with higher priority will be executed first.\r\n * Set priority before adding the connection as sorting happens only when the connection is added.\r\n */\r\n public priority: number = 0;\r\n\r\n public override _isSingularConnection(): boolean {\r\n return false;\r\n }\r\n\r\n public override connectTo(point: FlowGraphSignalConnection): void {\r\n super.connectTo(point);\r\n // sort according to priority to handle execution order\r\n this._connectedPoint.sort((a, b) => b.priority - a.priority);\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _activateSignal(context: FlowGraphContext): void {\r\n context.logger?.addLogItem({\r\n action: FlowGraphAction.ActivateSignal,\r\n className: this._ownerBlock.getClassName(),\r\n uniqueId: this._ownerBlock.uniqueId,\r\n payload: {\r\n connectionType: this.connectionType,\r\n name: this.name,\r\n },\r\n });\r\n if (this.connectionType === FlowGraphConnectionType.Input) {\r\n context._notifyExecuteNode(this._ownerBlock);\r\n this._ownerBlock._execute(context, this);\r\n context._increaseExecutionId();\r\n } else {\r\n for (const connectedPoint of this._connectedPoint) {\r\n connectedPoint._activateSignal(context);\r\n }\r\n }\r\n }\r\n}\r\n\r\nRegisterClass(\"FlowGraphSignalConnection\", FlowGraphSignalConnection);\r\n"]}
@@ -7,7 +7,12 @@ export * from "./flowGraphRichTypes";
7
7
  export * from "./flowGraphContext";
8
8
  export * from "./flowGraphCoordinator";
9
9
  export * from "./typeDefinitions";
10
- export * from "./flowGraphContextLogger";
11
10
  export * from "./flowGraphConnection";
12
11
  export * from "./flowGraphDataConnection";
12
+ export * from "./flowGraphAssetsContext";
13
+ export * from "./flowGraphParser";
14
+ export * from "./flowGraphPathConverter";
15
+ export * from "./flowGraphPathConverterComponent";
16
+ export * from "./flowGraphLogger";
13
17
  export * from "./Blocks/index";
18
+ export * from "./CustomTypes/index";
@@ -7,9 +7,15 @@ export * from "./flowGraphRichTypes.js";
7
7
  export * from "./flowGraphContext.js";
8
8
  export * from "./flowGraphCoordinator.js";
9
9
  export * from "./typeDefinitions.js";
10
- export * from "./flowGraphContextLogger.js";
11
10
  export * from "./flowGraphConnection.js";
12
11
  export * from "./flowGraphDataConnection.js";
12
+ export * from "./flowGraphAssetsContext.js";
13
+ export * from "./flowGraphParser.js";
14
+ export * from "./flowGraphPathConverter.js";
15
+ export * from "./flowGraphPathConverterComponent.js";
16
+ export * from "./flowGraphLogger.js";
13
17
  // eslint-disable-next-line import/no-internal-modules
14
18
  export * from "./Blocks/index.js";
19
+ // eslint-disable-next-line import/no-internal-modules
20
+ export * from "./CustomTypes/index.js";
15
21
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../dev/core/src/FlowGraph/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC;AACjC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC;AAClC,cAAc,0BAA0B,CAAC;AACzC,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,sDAAsD;AACtD,cAAc,gBAAgB,CAAC","sourcesContent":["export * from \"./flowGraph\";\r\nexport * from \"./flowGraphBlock\";\r\nexport * from \"./flowGraphSignalConnection\";\r\nexport * from \"./flowGraphExecutionBlock\";\r\nexport * from \"./flowGraphEventBlock\";\r\nexport * from \"./flowGraphRichTypes\";\r\nexport * from \"./flowGraphContext\";\r\nexport * from \"./flowGraphCoordinator\";\r\nexport * from \"./typeDefinitions\";\r\nexport * from \"./flowGraphContextLogger\";\r\nexport * from \"./flowGraphConnection\";\r\nexport * from \"./flowGraphDataConnection\";\r\n// eslint-disable-next-line import/no-internal-modules\r\nexport * from \"./Blocks/index\";\r\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../dev/core/src/FlowGraph/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC;AACjC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,0BAA0B,CAAC;AACzC,cAAc,mBAAmB,CAAC;AAClC,cAAc,0BAA0B,CAAC;AACzC,cAAc,mCAAmC,CAAC;AAClD,cAAc,mBAAmB,CAAC;AAClC,sDAAsD;AACtD,cAAc,gBAAgB,CAAC;AAC/B,sDAAsD;AACtD,cAAc,qBAAqB,CAAC","sourcesContent":["export * from \"./flowGraph\";\r\nexport * from \"./flowGraphBlock\";\r\nexport * from \"./flowGraphSignalConnection\";\r\nexport * from \"./flowGraphExecutionBlock\";\r\nexport * from \"./flowGraphEventBlock\";\r\nexport * from \"./flowGraphRichTypes\";\r\nexport * from \"./flowGraphContext\";\r\nexport * from \"./flowGraphCoordinator\";\r\nexport * from \"./typeDefinitions\";\r\nexport * from \"./flowGraphConnection\";\r\nexport * from \"./flowGraphDataConnection\";\r\nexport * from \"./flowGraphAssetsContext\";\r\nexport * from \"./flowGraphParser\";\r\nexport * from \"./flowGraphPathConverter\";\r\nexport * from \"./flowGraphPathConverterComponent\";\r\nexport * from \"./flowGraphLogger\";\r\n// eslint-disable-next-line import/no-internal-modules\r\nexport * from \"./Blocks/index\";\r\n// eslint-disable-next-line import/no-internal-modules\r\nexport * from \"./CustomTypes/index\";\r\n"]}
@@ -1,4 +1,6 @@
1
+ import type { IAssetContainer } from "../IAssetContainer.js";
1
2
  import type { Scene } from "../scene";
3
+ import { FlowGraphBlockNames } from "./Blocks/flowGraphBlockNames";
2
4
  /**
3
5
  * The default function that serializes values in a context object to a serialization object
4
6
  * @param key the key where the value should be stored in the serialization object
@@ -10,10 +12,11 @@ export declare function defaultValueSerializationFunction(key: string, value: an
10
12
  * The default function that parses values stored in a serialization object
11
13
  * @param key the key to the value that will be parsed
12
14
  * @param serializationObject the object that will be parsed
15
+ * @param assetsContainer the assets container that will be used to find the objects
13
16
  * @param scene
14
17
  * @returns
15
18
  */
16
- export declare function defaultValueParseFunction(key: string, serializationObject: any, scene: Scene): any;
19
+ export declare function defaultValueParseFunction(key: string, serializationObject: any, assetsContainer: IAssetContainer, scene: Scene): any;
17
20
  /**
18
21
  * Given a name of a flow graph block class, return if this
19
22
  * class needs to be created with a path converter. Used in
@@ -21,4 +24,4 @@ export declare function defaultValueParseFunction(key: string, serializationObje
21
24
  * @param className the name of the flow graph block class
22
25
  * @returns a boolean indicating if the class needs a path converter
23
26
  */
24
- export declare function needsPathConverter(className: string): className is "FGSetPropertyBlock" | "FGGetPropertyBlock" | "FGPlayAnimationBlock" | "FGMeshPickEventBlock";
27
+ export declare function needsPathConverter(className: string): className is FlowGraphBlockNames.JsonPointerParser;
@@ -1,6 +1,8 @@
1
1
  import { Color3, Color4 } from "../Maths/math.color.js";
2
2
  import { Matrix, Quaternion, Vector2, Vector3, Vector4 } from "../Maths/math.vector.js";
3
- import { FlowGraphInteger } from "./flowGraphInteger.js";
3
+ import { FlowGraphInteger } from "./CustomTypes/flowGraphInteger.js";
4
+ import { getRichTypeByFlowGraphType } from "./flowGraphRichTypes.js";
5
+ import { FlowGraphMatrix2D, FlowGraphMatrix3D } from "./CustomTypes/flowGraphMatrix.js";
4
6
  function isMeshClassName(className) {
5
7
  return (className === "Mesh" ||
6
8
  className === "AbstractMesh" ||
@@ -12,25 +14,43 @@ function isMeshClassName(className) {
12
14
  className === "TrailMesh");
13
15
  }
14
16
  function isVectorClassName(className) {
15
- return className === "Vector2" || className === "Vector3" || className === "Vector4" || className === "Quaternion" || className === "Color3" || className === "Color4";
17
+ return (className === "Vector2" /* FlowGraphTypes.Vector2 */ ||
18
+ className === "Vector3" /* FlowGraphTypes.Vector3 */ ||
19
+ className === "Vector4" /* FlowGraphTypes.Vector4 */ ||
20
+ className === "Quaternion" /* FlowGraphTypes.Quaternion */ ||
21
+ className === "Color3" /* FlowGraphTypes.Color3 */ ||
22
+ className === "Color4" /* FlowGraphTypes.Color4 */);
16
23
  }
17
- function parseVector(className, value) {
18
- if (className === "Vector2") {
24
+ function isMatrixClassName(className) {
25
+ return className === "Matrix" /* FlowGraphTypes.Matrix */ || className === "Matrix2D" /* FlowGraphTypes.Matrix2D */ || className === "Matrix3D" /* FlowGraphTypes.Matrix3D */;
26
+ }
27
+ function isAnimationGroupClassName(className) {
28
+ return className === "AnimationGroup";
29
+ }
30
+ function parseVector(className, value, flipHandedness = false) {
31
+ if (className === "Vector2" /* FlowGraphTypes.Vector2 */) {
19
32
  return Vector2.FromArray(value);
20
33
  }
21
- else if (className === "Vector3") {
34
+ else if (className === "Vector3" /* FlowGraphTypes.Vector3 */) {
35
+ if (flipHandedness) {
36
+ value[2] *= -1;
37
+ }
22
38
  return Vector3.FromArray(value);
23
39
  }
24
- else if (className === "Vector4") {
40
+ else if (className === "Vector4" /* FlowGraphTypes.Vector4 */) {
25
41
  return Vector4.FromArray(value);
26
42
  }
27
- else if (className === "Quaternion") {
43
+ else if (className === "Quaternion" /* FlowGraphTypes.Quaternion */) {
44
+ if (flipHandedness) {
45
+ value[2] *= -1;
46
+ value[3] *= -1;
47
+ }
28
48
  return Quaternion.FromArray(value);
29
49
  }
30
- else if (className === "Color3") {
50
+ else if (className === "Color3" /* FlowGraphTypes.Color3 */) {
31
51
  return new Color3(value[0], value[1], value[2]);
32
52
  }
33
- else if (className === "Color4") {
53
+ else if (className === "Color4" /* FlowGraphTypes.Color4 */) {
34
54
  return new Color4(value[0], value[1], value[2], value[3]);
35
55
  }
36
56
  else {
@@ -45,50 +65,102 @@ function parseVector(className, value) {
45
65
  */
46
66
  export function defaultValueSerializationFunction(key, value, serializationObject) {
47
67
  const className = value?.getClassName?.() ?? "";
48
- if (isMeshClassName(className)) {
68
+ if (isVectorClassName(className) || isMatrixClassName(className)) {
49
69
  serializationObject[key] = {
50
- name: value.name,
70
+ value: value.asArray(),
51
71
  className,
52
72
  };
53
73
  }
54
- else if (isVectorClassName(className)) {
74
+ else if (className === "FlowGraphInteger" /* FlowGraphTypes.Integer */) {
55
75
  serializationObject[key] = {
56
- value: value.asArray(),
76
+ value: value.value,
57
77
  className,
58
78
  };
59
79
  }
60
80
  else {
61
- serializationObject[key] = value;
81
+ if (className && (value.id || value.name)) {
82
+ serializationObject[key] = {
83
+ id: value.id,
84
+ name: value.name,
85
+ className,
86
+ };
87
+ }
88
+ else {
89
+ // only if it is not an object
90
+ if (typeof value !== "object") {
91
+ serializationObject[key] = value;
92
+ }
93
+ else {
94
+ throw new Error(`Could not serialize value ${value}`);
95
+ }
96
+ }
62
97
  }
63
98
  }
64
99
  /**
65
100
  * The default function that parses values stored in a serialization object
66
101
  * @param key the key to the value that will be parsed
67
102
  * @param serializationObject the object that will be parsed
103
+ * @param assetsContainer the assets container that will be used to find the objects
68
104
  * @param scene
69
105
  * @returns
70
106
  */
71
- export function defaultValueParseFunction(key, serializationObject, scene) {
107
+ export function defaultValueParseFunction(key, serializationObject, assetsContainer, scene) {
72
108
  const intermediateValue = serializationObject[key];
73
109
  let finalValue;
74
- const className = intermediateValue?.className;
110
+ const className = intermediateValue?.type ?? intermediateValue?.className;
75
111
  if (isMeshClassName(className)) {
76
- finalValue = scene.getMeshByName(intermediateValue.name);
112
+ let nodes = scene.meshes.filter((m) => (intermediateValue.id ? m.id === intermediateValue.id : m.name === intermediateValue.name));
113
+ if (nodes.length === 0) {
114
+ nodes = scene.transformNodes.filter((m) => (intermediateValue.id ? m.id === intermediateValue.id : m.name === intermediateValue.name));
115
+ }
116
+ finalValue = intermediateValue.uniqueId ? nodes.find((m) => m.uniqueId === intermediateValue.uniqueId) : nodes[0];
77
117
  }
78
118
  else if (isVectorClassName(className)) {
79
119
  finalValue = parseVector(className, intermediateValue.value);
80
120
  }
81
- else if (className === "Matrix") {
121
+ else if (isAnimationGroupClassName(className)) {
122
+ // do not use the scene.getAnimationGroupByName because it is possible that two AGs will have the same name
123
+ const ags = scene.animationGroups.filter((ag) => ag.name === intermediateValue.name);
124
+ // uniqueId changes on each load. this is used for the glTF loader, that uses serialization after the scene was loaded.
125
+ finalValue = ags.length === 1 ? ags[0] : ags.find((ag) => ag.uniqueId === intermediateValue.uniqueId);
126
+ }
127
+ else if (className === "Matrix" /* FlowGraphTypes.Matrix */) {
82
128
  finalValue = Matrix.FromArray(intermediateValue.value);
83
129
  }
84
- else if (className === FlowGraphInteger.ClassName) {
85
- finalValue = FlowGraphInteger.Parse(intermediateValue);
130
+ else if (className === "Matrix2D" /* FlowGraphTypes.Matrix2D */) {
131
+ finalValue = new FlowGraphMatrix2D(intermediateValue.value);
132
+ }
133
+ else if (className === "Matrix3D" /* FlowGraphTypes.Matrix3D */) {
134
+ finalValue = new FlowGraphMatrix3D(intermediateValue.value);
135
+ }
136
+ else if (className === "FlowGraphInteger" /* FlowGraphTypes.Integer */) {
137
+ finalValue = FlowGraphInteger.FromValue(intermediateValue.value);
138
+ }
139
+ else if (className === "number" /* FlowGraphTypes.Number */ || className === "string" /* FlowGraphTypes.String */ || className === "boolean" /* FlowGraphTypes.Boolean */) {
140
+ finalValue = intermediateValue.value[0];
86
141
  }
87
142
  else if (intermediateValue && intermediateValue.value !== undefined) {
88
143
  finalValue = intermediateValue.value;
89
144
  }
90
145
  else {
91
- finalValue = intermediateValue;
146
+ if (Array.isArray(intermediateValue)) {
147
+ // configuration data of an event
148
+ finalValue = intermediateValue.reduce((acc, val) => {
149
+ if (!val.eventData) {
150
+ return acc;
151
+ }
152
+ acc[val.id] = {
153
+ type: getRichTypeByFlowGraphType(val.type),
154
+ };
155
+ if (typeof val.value !== "undefined") {
156
+ acc[val.id].value = defaultValueParseFunction("value", val, assetsContainer, scene);
157
+ }
158
+ return acc;
159
+ }, {});
160
+ }
161
+ else {
162
+ finalValue = intermediateValue;
163
+ }
92
164
  }
93
165
  return finalValue;
94
166
  }
@@ -102,6 +174,6 @@ export function defaultValueParseFunction(key, serializationObject, scene) {
102
174
  export function needsPathConverter(className) {
103
175
  // I am not using the ClassName property here because it was causing a circular dependency
104
176
  // that jest didn't like!
105
- return className === "FGSetPropertyBlock" || className === "FGGetPropertyBlock" || className === "FGPlayAnimationBlock" || className === "FGMeshPickEventBlock";
177
+ return className === "FlowGraphJsonPointerParserBlock" /* FlowGraphBlockNames.JsonPointerParser */;
106
178
  }
107
179
  //# sourceMappingURL=serialization.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"serialization.js","sourceRoot":"","sources":["../../../../dev/core/src/FlowGraph/serialization.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAErF,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD,SAAS,eAAe,CAAC,SAAiB;IACtC,OAAO,CACH,SAAS,KAAK,MAAM;QACpB,SAAS,KAAK,cAAc;QAC5B,SAAS,KAAK,YAAY;QAC1B,SAAS,KAAK,cAAc;QAC5B,SAAS,KAAK,WAAW;QACzB,SAAS,KAAK,cAAc;QAC5B,SAAS,KAAK,iBAAiB;QAC/B,SAAS,KAAK,WAAW,CAC5B,CAAC;AACN,CAAC;AAED,SAAS,iBAAiB,CAAC,SAAiB;IACxC,OAAO,SAAS,KAAK,SAAS,IAAI,SAAS,KAAK,SAAS,IAAI,SAAS,KAAK,SAAS,IAAI,SAAS,KAAK,YAAY,IAAI,SAAS,KAAK,QAAQ,IAAI,SAAS,KAAK,QAAQ,CAAC;AAC3K,CAAC;AAED,SAAS,WA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OAAO,UAAU,CAAC;AACtB,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,kBAAkB,CAAC,SAAiB;IAChD,0FAA0F;IAC1F,yBAAyB;IACzB,OAAO,SAAS,KAAK,oBAAoB,IAAI,SAAS,KAAK,oBAAoB,IAAI,SAAS,KAAK,sBAAsB,IAAI,SAAS,KAAK,sBAAsB,CAAC;AACpK,CAAC","sourcesContent":["import { Color3, Color4 } from \"../Maths/math.color\";\r\nimport { Matrix, Quaternion, Vector2, Vector3, Vector4 } from \"../Maths/math.vector\";\r\nimport type { Scene } from \"../scene\";\r\nimport { FlowGraphInteger } from \"./flowGraphInteger\";\r\n\r\nfunction isMeshClassName(className: string) {\r\n return (\r\n className === \"Mesh\" ||\r\n className === \"AbstractMesh\" ||\r\n className === \"GroundMesh\" ||\r\n className === \"InstanceMesh\" ||\r\n className === \"LinesMesh\" ||\r\n className === \"GoldbergMesh\" ||\r\n className === \"GreasedLineMesh\" ||\r\n className === \"TrailMesh\"\r\n );\r\n}\r\n\r\nfunction isVectorClassName(className: string) {\r\n return className === \"Vector2\" || className === \"Vector3\" || className === \"Vector4\" || className === \"Quaternion\" || className === \"Color3\" || className === \"Color4\";\r\n}\r\n\r\nfunction parseVector(className: string, value: Array<number>) {\r\n if (className === \"Vector2\") {\r\n return Vector2.FromArray(value);\r\n } else if (className === \"Vector3\") {\r\n return Vector3.FromArray(value);\r\n } else if (className === \"Vector4\") {\r\n return Vector4.FromArray(value);\r\n } else if (className === \"Quaternion\") {\r\n return Quaternion.FromArray(value);\r\n } else if (className === \"Color3\") {\r\n return new Color3(value[0], value[1], value[2]);\r\n } else if (className === \"Color4\") {\r\n return new Color4(value[0], value[1], value[2], value[3]);\r\n } else {\r\n throw new Error(`Unknown vector class name ${className}`);\r\n }\r\n}\r\n\r\n/**\r\n * The default function that serializes values in a context object to a serialization object\r\n * @param key the key where the value should be stored in the serialization object\r\n * @param value the value to store\r\n * @param serializationObject the object where the value will be stored\r\n */\r\nexport function defaultValueSerializationFunction(key: string, value: any, serializationObject: any) {\r\n const className = value?.getClassName?.() ?? \"\";\r\n if (isMeshClassName(className)) {\r\n serializationObject[key] = {\r\n name: value.name,\r\n className,\r\n };\r\n } else if (isVectorClassName(className)) {\r\n serializationObject[key] = {\r\n value: value.asArray(),\r\n className,\r\n };\r\n } else {\r\n serializationObject[key] = value;\r\n }\r\n}\r\n\r\n/**\r\n * The default function that parses values stored in a serialization object\r\n * @param key the key to the value that will be parsed\r\n * @param serializationObject the object that will be parsed\r\n * @param scene\r\n * @returns\r\n */\r\nexport function defaultValueParseFunction(key: string, serializationObject: any, scene: Scene) {\r\n const intermediateValue = serializationObject[key];\r\n let finalValue;\r\n const className = intermediateValue?.className;\r\n if (isMeshClassName(className)) {\r\n finalValue = scene.getMeshByName(intermediateValue.name);\r\n } else if (isVectorClassName(className)) {\r\n finalValue = parseVector(className, intermediateValue.value);\r\n } else if (className === \"Matrix\") {\r\n finalValue = Matrix.FromArray(intermediateValue.value);\r\n } else if (className === FlowGraphInteger.ClassName) {\r\n finalValue = FlowGraphInteger.Parse(intermediateValue);\r\n } else if (intermediateValue && intermediateValue.value !== undefined) {\r\n finalValue = intermediateValue.value;\r\n } else {\r\n finalValue = intermediateValue;\r\n }\r\n return finalValue;\r\n}\r\n\r\n/**\r\n * Given a name of a flow graph block class, return if this\r\n * class needs to be created with a path converter. Used in\r\n * parsing.\r\n * @param className the name of the flow graph block class\r\n * @returns a boolean indicating if the class needs a path converter\r\n */\r\nexport function needsPathConverter(className: string) {\r\n // I am not using the ClassName property here because it was causing a circular dependency\r\n // that jest didn't like!\r\n return className === \"FGSetPropertyBlock\" || className === \"FGGetPropertyBlock\" || className === \"FGPlayAnimationBlock\" || className === \"FGMeshPickEventBlock\";\r\n}\r\n"]}
1
+ {"version":3,"file":"serialization.js","sourceRoot":"","sources":["../../../../dev/core/src/FlowGraph/serialization.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,q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CAAC,KAAK,GAAG,yBAAyB,CAAC,OAAO,EAAE,GAAG,EAAE,eAAe,EAAE,KAAK,CAAC,CAAC;gBACxF,CAAC;gBACD,OAAO,GAAG,CAAC;YACf,CAAC,EAAE,EAAE,CAAC,CAAC;QACX,CAAC;aAAM,CAAC;YACJ,UAAU,GAAG,iBAAiB,CAAC;QACnC,CAAC;IACL,CAAC;IACD,OAAO,UAAU,CAAC;AACtB,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,kBAAkB,CAAC,SAAiB;IAChD,0FAA0F;IAC1F,yBAAyB;IACzB,OAAO,SAAS,kFAA0C,CAAC;AAC/D,CAAC","sourcesContent":["import type { IAssetContainer } from \"core/IAssetContainer\";\r\nimport { Color3, Color4 } from \"../Maths/math.color\";\r\nimport { Matrix, Quaternion, Vector2, Vector3, Vector4 } from \"../Maths/math.vector\";\r\nimport type { Scene } from \"../scene\";\r\nimport { FlowGraphBlockNames } from \"./Blocks/flowGraphBlockNames\";\r\nimport { FlowGraphInteger } from \"./CustomTypes/flowGraphInteger\";\r\nimport { FlowGraphTypes, getRichTypeByFlowGraphType } from \"./flowGraphRichTypes\";\r\nimport type { TransformNode } from \"core/Meshes/transformNode\";\r\nimport { FlowGraphMatrix2D, FlowGraphMatrix3D } from \"./CustomTypes/flowGraphMatrix\";\r\n\r\nfunction isMeshClassName(className: string) {\r\n return (\r\n className === \"Mesh\" ||\r\n className === \"AbstractMesh\" ||\r\n className === \"GroundMesh\" ||\r\n className === \"InstanceMesh\" ||\r\n className === \"LinesMesh\" ||\r\n className === \"GoldbergMesh\" ||\r\n className === \"GreasedLineMesh\" ||\r\n className === \"TrailMesh\"\r\n );\r\n}\r\n\r\nfunction isVectorClassName(className: string) {\r\n return (\r\n className === FlowGraphTypes.Vector2 ||\r\n className === FlowGraphTypes.Vector3 ||\r\n className === FlowGraphTypes.Vector4 ||\r\n className === FlowGraphTypes.Quaternion ||\r\n className === FlowGraphTypes.Color3 ||\r\n className === FlowGraphTypes.Color4\r\n );\r\n}\r\n\r\nfunction isMatrixClassName(className: string) {\r\n return className === FlowGraphTypes.Matrix || className === FlowGraphTypes.Matrix2D || className === FlowGraphTypes.Matrix3D;\r\n}\r\n\r\nfunction isAnimationGroupClassName(className: string) {\r\n return className === \"AnimationGroup\";\r\n}\r\n\r\nfunction parseVector(className: string, value: Array<number>, flipHandedness = false) {\r\n if (className === FlowGraphTypes.Vector2) {\r\n return Vector2.FromArray(value);\r\n } else if (className === FlowGraphTypes.Vector3) {\r\n if (flipHandedness) {\r\n value[2] *= -1;\r\n }\r\n return Vector3.FromArray(value);\r\n } else if (className === FlowGraphTypes.Vector4) {\r\n return Vector4.FromArray(value);\r\n } else if (className === FlowGraphTypes.Quaternion) {\r\n if (flipHandedness) {\r\n value[2] *= -1;\r\n value[3] *= -1;\r\n }\r\n return Quaternion.FromArray(value);\r\n } else if (className === FlowGraphTypes.Color3) {\r\n return new Color3(value[0], value[1], value[2]);\r\n } else if (className === FlowGraphTypes.Color4) {\r\n return new Color4(value[0], value[1], value[2], value[3]);\r\n } else {\r\n throw new Error(`Unknown vector class name ${className}`);\r\n }\r\n}\r\n\r\n/**\r\n * The default function that serializes values in a context object to a serialization object\r\n * @param key the key where the value should be stored in the serialization object\r\n * @param value the value to store\r\n * @param serializationObject the object where the value will be stored\r\n */\r\nexport function defaultValueSerializationFunction(key: string, value: any, serializationObject: any) {\r\n const className = value?.getClassName?.() ?? \"\";\r\n if (isVectorClassName(className) || isMatrixClassName(className)) {\r\n serializationObject[key] = {\r\n value: value.asArray(),\r\n className,\r\n };\r\n } else if (className === FlowGraphTypes.Integer) {\r\n serializationObject[key] = {\r\n value: value.value,\r\n className,\r\n };\r\n } else {\r\n if (className && (value.id || value.name)) {\r\n serializationObject[key] = {\r\n id: value.id,\r\n name: value.name,\r\n className,\r\n };\r\n } else {\r\n // only if it is not an object\r\n if (typeof value !== \"object\") {\r\n serializationObject[key] = value;\r\n } else {\r\n throw new Error(`Could not serialize value ${value}`);\r\n }\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * The default function that parses values stored in a serialization object\r\n * @param key the key to the value that will be parsed\r\n * @param serializationObject the object that will be parsed\r\n * @param assetsContainer the assets container that will be used to find the objects\r\n * @param scene\r\n * @returns\r\n */\r\nexport function defaultValueParseFunction(key: string, serializationObject: any, assetsContainer: IAssetContainer, scene: Scene) {\r\n const intermediateValue = serializationObject[key];\r\n let finalValue;\r\n const className = intermediateValue?.type ?? intermediateValue?.className;\r\n if (isMeshClassName(className)) {\r\n let nodes: TransformNode[] = scene.meshes.filter((m) => (intermediateValue.id ? m.id === intermediateValue.id : m.name === intermediateValue.name));\r\n if (nodes.length === 0) {\r\n nodes = scene.transformNodes.filter((m) => (intermediateValue.id ? m.id === intermediateValue.id : m.name === intermediateValue.name));\r\n }\r\n finalValue = intermediateValue.uniqueId ? nodes.find((m) => m.uniqueId === intermediateValue.uniqueId) : nodes[0];\r\n } else if (isVectorClassName(className)) {\r\n finalValue = parseVector(className, intermediateValue.value);\r\n } else if (isAnimationGroupClassName(className)) {\r\n // do not use the scene.getAnimationGroupByName because it is possible that two AGs will have the same name\r\n const ags = scene.animationGroups.filter((ag) => ag.name === intermediateValue.name);\r\n // uniqueId changes on each load. this is used for the glTF loader, that uses serialization after the scene was loaded.\r\n finalValue = ags.length === 1 ? ags[0] : ags.find((ag) => ag.uniqueId === intermediateValue.uniqueId);\r\n } else if (className === FlowGraphTypes.Matrix) {\r\n finalValue = Matrix.FromArray(intermediateValue.value);\r\n } else if (className === FlowGraphTypes.Matrix2D) {\r\n finalValue = new FlowGraphMatrix2D(intermediateValue.value);\r\n } else if (className === FlowGraphTypes.Matrix3D) {\r\n finalValue = new FlowGraphMatrix3D(intermediateValue.value);\r\n } else if (className === FlowGraphTypes.Integer) {\r\n finalValue = FlowGraphInteger.FromValue(intermediateValue.value);\r\n } else if (className === FlowGraphTypes.Number || className === FlowGraphTypes.String || className === FlowGraphTypes.Boolean) {\r\n finalValue = intermediateValue.value[0];\r\n } else if (intermediateValue && intermediateValue.value !== undefined) {\r\n finalValue = intermediateValue.value;\r\n } else {\r\n if (Array.isArray(intermediateValue)) {\r\n // configuration data of an event\r\n finalValue = intermediateValue.reduce((acc, val) => {\r\n if (!val.eventData) {\r\n return acc;\r\n }\r\n acc[val.id] = {\r\n type: getRichTypeByFlowGraphType(val.type),\r\n };\r\n if (typeof val.value !== \"undefined\") {\r\n acc[val.id].value = defaultValueParseFunction(\"value\", val, assetsContainer, scene);\r\n }\r\n return acc;\r\n }, {});\r\n } else {\r\n finalValue = intermediateValue;\r\n }\r\n }\r\n return finalValue;\r\n}\r\n\r\n/**\r\n * Given a name of a flow graph block class, return if this\r\n * class needs to be created with a path converter. Used in\r\n * parsing.\r\n * @param className the name of the flow graph block class\r\n * @returns a boolean indicating if the class needs a path converter\r\n */\r\nexport function needsPathConverter(className: string) {\r\n // I am not using the ClassName property here because it was causing a circular dependency\r\n // that jest didn't like!\r\n return className === FlowGraphBlockNames.JsonPointerParser;\r\n}\r\n"]}
@@ -1,28 +1,72 @@
1
+ import type { IAnimatable } from "../Animations/animatable.interface.js";
2
+ import type { Animation } from "../Animations/animation.js";
1
3
  import type { FlowGraphConnectionType } from "./flowGraphConnection";
4
+ /**
5
+ * Interpolation generator
6
+ */
7
+ export interface IInterpolationPropertyInfo {
8
+ /**
9
+ * type of the interpolation
10
+ */
11
+ type: number;
12
+ /**
13
+ * The name of the property
14
+ */
15
+ name: string;
16
+ /** @internal */
17
+ getValue: (target: any, source: Float32Array, offset: number, scale: number) => any;
18
+ /** @internal */
19
+ getStride: (target: any) => number;
20
+ /**
21
+ * @internal
22
+ */
23
+ buildAnimations(target: any, name: string, fps: number, keys: any[]): {
24
+ babylonAnimatable: IAnimatable;
25
+ babylonAnimation: Animation;
26
+ }[];
27
+ }
2
28
  /**
3
29
  * An accessor that allows modifying properties on some other object.
4
30
  */
5
- export interface IObjectAccessor {
31
+ export interface IObjectAccessor<GLTFTargetType = any, BabylonTargetType = any, BabylonValueType = any> {
32
+ /**
33
+ * The number of components that are changed in the property when setting this value.
34
+ * This will usually be 1. But, for example, Babylon has both orthoLeft and orthoRight (two components) properties that are changed when setting xmag (single value in glTF).
35
+ * Defaults to 1 if not provided!
36
+ */
37
+ componentsCount?: number;
6
38
  /**
7
- * The type of the object that is converted
39
+ * The (babylon) type of the property.
8
40
  */
9
41
  type: string;
10
42
  /**
11
- * Get a property value from the object.
12
- * @param args any necessary arguments to get the property value
43
+ * Get the value of the property.
13
44
  */
14
- get(...args: any[]): any;
45
+ get: (target: GLTFTargetType, index?: number, payload?: any) => BabylonValueType | undefined;
15
46
  /**
16
- * Set a property value on the object.
17
- * @param value the value to set
18
- * @param args any necessary arguments to set the property value
47
+ * Get the target of the property.
19
48
  */
20
- set(value: any, ...args: any[]): void;
49
+ getTarget: (target: GLTFTargetType, index?: number, payload?: any) => BabylonTargetType | undefined;
21
50
  /**
22
- * Get the original object
23
- * @param args any necessary arguments to get the original object
51
+ * is the property readonly?
24
52
  */
25
- getObject(...args: any[]): any;
53
+ isReadOnly?: boolean;
54
+ /**
55
+ * @deprecated Use get instead
56
+ */
57
+ getPropertyName?: Array<(target: GLTFTargetType) => string>;
58
+ /**
59
+ * Set a new value to the property.
60
+ * @param newValue the new value to set
61
+ * @param target the target object
62
+ * @param index the index of the target object in the array (optional)
63
+ */
64
+ set?: (newValue: BabylonValueType, target: GLTFTargetType, index?: number, payload?: any) => void;
65
+ /**
66
+ * Interpolation/animation information for the property.
67
+ * This is an array that can be used to animate the value over time.
68
+ */
69
+ interpolation?: IInterpolationPropertyInfo[];
26
70
  }
27
71
  /**
28
72
  * A Serialized Flow Graph Context
@@ -44,6 +88,16 @@ export interface ISerializedFlowGraphContext {
44
88
  _connectionValues: {
45
89
  [key: string]: any;
46
90
  };
91
+ /**
92
+ * Assets context, if not the scene
93
+ */
94
+ _assetsContext?: {
95
+ [key: string]: any;
96
+ };
97
+ /**
98
+ * Should logging be enabled?
99
+ */
100
+ enableLogging?: boolean;
47
101
  }
48
102
  /**
49
103
  * A Serialized Flow Graph Connection
@@ -74,6 +128,10 @@ export interface ISerializedFlowGraphBlock {
74
128
  * The class name of the block
75
129
  */
76
130
  className: string;
131
+ /**
132
+ * The glTF type of the block
133
+ */
134
+ type: string;
77
135
  /**
78
136
  * Configuration parameters for the block
79
137
  */
@@ -115,4 +173,8 @@ export interface ISerializedFlowGraph {
115
173
  * Blocks belonging to the flow graph
116
174
  */
117
175
  allBlocks: ISerializedFlowGraphBlock[];
176
+ /**
177
+ * Is the flow graph in RHS mode?
178
+ */
179
+ rightHanded?: boolean;
118
180
  }
@@ -1 +1 @@
1
- {"version":3,"file":"typeDefinitions.js","sourceRoot":"","sources":["../../../../dev/core/src/FlowGraph/typeDefinitions.ts"],"names":[],"mappings":"","sourcesContent":["import type { FlowGraphConnectionType } from \"./flowGraphConnection\";\r\n\r\n/**\r\n * An accessor that allows modifying properties on some other object.\r\n */\r\nexport interface IObjectAccessor {\r\n /**\r\n * The type of the object that is converted\r\n */\r\n type: string;\r\n /**\r\n * Get a property value from the object.\r\n * @param args any necessary arguments to get the property value\r\n */\r\n get(...args: any[]): any;\r\n /**\r\n * Set a property value on the object.\r\n * @param value the value to set\r\n * @param args any necessary arguments to set the property value\r\n */\r\n set(value: any, ...args: any[]): void;\r\n /**\r\n * Get the original object\r\n * @param args any necessary arguments to get the original object\r\n */\r\n getObject(...args: any[]): any;\r\n}\r\n\r\n/**\r\n * A Serialized Flow Graph Context\r\n */\r\nexport interface ISerializedFlowGraphContext {\r\n /**\r\n * The unique id of the context\r\n */\r\n uniqueId: string;\r\n /**\r\n * User variables\r\n */\r\n _userVariables: { [key: string]: any };\r\n /**\r\n * Values of the connection points\r\n */\r\n _connectionValues: { [key: string]: any };\r\n}\r\n\r\n/**\r\n * A Serialized Flow Graph Connection\r\n */\r\nexport interface ISerializedFlowGraphConnection {\r\n /**\r\n * The unique id of the connection\r\n */\r\n uniqueId: string;\r\n /**\r\n * The name of the connection\r\n */\r\n name: string;\r\n /**\r\n * The type of the connection\r\n */\r\n _connectionType: FlowGraphConnectionType;\r\n /**\r\n * The id of the connection that this is connected to\r\n */\r\n connectedPointIds: string[];\r\n}\r\n\r\n/**\r\n * A Serialized Flow Graph Block\r\n */\r\nexport interface ISerializedFlowGraphBlock {\r\n /**\r\n * The class name of the block\r\n */\r\n className: string;\r\n /**\r\n * Configuration parameters for the block\r\n */\r\n config: any;\r\n /**\r\n * The unique id of the block\r\n */\r\n uniqueId: string;\r\n /**\r\n * Input connection data\r\n */\r\n dataInputs: ISerializedFlowGraphConnection[];\r\n /**\r\n * Output connection data\r\n */\r\n dataOutputs: ISerializedFlowGraphConnection[];\r\n /**\r\n * Metadata for the block\r\n */\r\n metadata: any;\r\n /**\r\n * Input connection signal\r\n */\r\n signalInputs: ISerializedFlowGraphConnection[];\r\n /**\r\n * Output connection signal\r\n */\r\n signalOutputs: ISerializedFlowGraphConnection[];\r\n}\r\n\r\n/**\r\n * A Serialized Flow Graph\r\n */\r\nexport interface ISerializedFlowGraph {\r\n /**\r\n * Contexts belonging to the flow graph\r\n */\r\n executionContexts: ISerializedFlowGraphContext[];\r\n /**\r\n * Blocks belonging to the flow graph\r\n */\r\n allBlocks: ISerializedFlowGraphBlock[];\r\n}\r\n"]}
1
+ {"version":3,"file":"typeDefinitions.js","sourceRoot":"","sources":["../../../../dev/core/src/FlowGraph/typeDefinitions.ts"],"names":[],"mappings":"","sourcesContent":["import type { IAnimatable } from \"core/Animations/animatable.interface\";\r\nimport type { Animation } from \"core/Animations/animation\";\r\nimport type { FlowGraphConnectionType } from \"./flowGraphConnection\";\r\n\r\n/**\r\n * Interpolation generator\r\n */\r\nexport interface IInterpolationPropertyInfo {\r\n /**\r\n * type of the interpolation\r\n */\r\n type: number;\r\n /**\r\n * The name of the property\r\n */\r\n name: string;\r\n /** @internal */\r\n getValue: (target: any, source: Float32Array, offset: number, scale: number) => any;\r\n /** @internal */\r\n getStride: (target: any) => number;\r\n /**\r\n * @internal\r\n */\r\n buildAnimations(target: any, name: string, fps: number, keys: any[]): { babylonAnimatable: IAnimatable; babylonAnimation: Animation }[];\r\n}\r\n\r\n/**\r\n * An accessor that allows modifying properties on some other object.\r\n */\r\nexport interface IObjectAccessor<GLTFTargetType = any, BabylonTargetType = any, BabylonValueType = any> {\r\n /**\r\n * The number of components that are changed in the property when setting this value.\r\n * This will usually be 1. But, for example, Babylon has both orthoLeft and orthoRight (two components) properties that are changed when setting xmag (single value in glTF).\r\n * Defaults to 1 if not provided!\r\n */\r\n componentsCount?: number;\r\n /**\r\n * The (babylon) type of the property.\r\n */\r\n type: string;\r\n /**\r\n * Get the value of the property.\r\n */\r\n get: (target: GLTFTargetType, index?: number, payload?: any) => BabylonValueType | undefined;\r\n /**\r\n * Get the target of the property.\r\n */\r\n getTarget: (target: GLTFTargetType, index?: number, payload?: any) => BabylonTargetType | undefined;\r\n /**\r\n * is the property readonly?\r\n */\r\n isReadOnly?: boolean;\r\n /**\r\n * @deprecated Use get instead\r\n */\r\n getPropertyName?: Array<(target: GLTFTargetType) => string>;\r\n /**\r\n * Set a new value to the property.\r\n * @param newValue the new value to set\r\n * @param target the target object\r\n * @param index the index of the target object in the array (optional)\r\n */\r\n set?: (newValue: BabylonValueType, target: GLTFTargetType, index?: number, payload?: any) => void;\r\n /**\r\n * Interpolation/animation information for the property.\r\n * This is an array that can be used to animate the value over time.\r\n */\r\n interpolation?: IInterpolationPropertyInfo[];\r\n}\r\n\r\n/**\r\n * A Serialized Flow Graph Context\r\n */\r\nexport interface ISerializedFlowGraphContext {\r\n /**\r\n * The unique id of the context\r\n */\r\n uniqueId: string;\r\n /**\r\n * User variables\r\n */\r\n _userVariables: { [key: string]: any };\r\n /**\r\n * Values of the connection points\r\n */\r\n _connectionValues: { [key: string]: any };\r\n\r\n /**\r\n * Assets context, if not the scene\r\n */\r\n _assetsContext?: { [key: string]: any };\r\n\r\n /**\r\n * Should logging be enabled?\r\n */\r\n enableLogging?: boolean;\r\n}\r\n\r\n/**\r\n * A Serialized Flow Graph Connection\r\n */\r\nexport interface ISerializedFlowGraphConnection {\r\n /**\r\n * The unique id of the connection\r\n */\r\n uniqueId: string;\r\n /**\r\n * The name of the connection\r\n */\r\n name: string;\r\n /**\r\n * The type of the connection\r\n */\r\n _connectionType: FlowGraphConnectionType;\r\n /**\r\n * The id of the connection that this is connected to\r\n */\r\n connectedPointIds: string[];\r\n}\r\n\r\n/**\r\n * A Serialized Flow Graph Block\r\n */\r\nexport interface ISerializedFlowGraphBlock {\r\n /**\r\n * The class name of the block\r\n */\r\n className: string;\r\n /**\r\n * The glTF type of the block\r\n */\r\n type: string;\r\n /**\r\n * Configuration parameters for the block\r\n */\r\n config: any;\r\n /**\r\n * The unique id of the block\r\n */\r\n uniqueId: string;\r\n /**\r\n * Input connection data\r\n */\r\n dataInputs: ISerializedFlowGraphConnection[];\r\n /**\r\n * Output connection data\r\n */\r\n dataOutputs: ISerializedFlowGraphConnection[];\r\n /**\r\n * Metadata for the block\r\n */\r\n metadata: any;\r\n /**\r\n * Input connection signal\r\n */\r\n signalInputs: ISerializedFlowGraphConnection[];\r\n /**\r\n * Output connection signal\r\n */\r\n signalOutputs: ISerializedFlowGraphConnection[];\r\n}\r\n\r\n/**\r\n * A Serialized Flow Graph\r\n */\r\nexport interface ISerializedFlowGraph {\r\n /**\r\n * Contexts belonging to the flow graph\r\n */\r\n executionContexts: ISerializedFlowGraphContext[];\r\n /**\r\n * Blocks belonging to the flow graph\r\n */\r\n allBlocks: ISerializedFlowGraphBlock[];\r\n\r\n /**\r\n * Is the flow graph in RHS mode?\r\n */\r\n rightHanded?: boolean;\r\n}\r\n"]}
@@ -1,4 +1,7 @@
1
+ import type { Matrix, Quaternion, Vector2, Vector3, Vector4 } from "../Maths/math.vector.js";
1
2
  import type { Node } from "../node";
3
+ import type { FlowGraphInteger } from "./CustomTypes/flowGraphInteger";
4
+ import type { FlowGraphMatrix2D, FlowGraphMatrix3D } from "./CustomTypes/flowGraphMatrix";
2
5
  /**
3
6
  * @internal
4
7
  * Returns if mesh1 is a descendant of mesh2
@@ -7,3 +10,47 @@ import type { Node } from "../node";
7
10
  * @returns
8
11
  */
9
12
  export declare function _isADescendantOf(mesh1: Node, mesh2: Node): boolean;
13
+ export type FlowGraphNumber = number | FlowGraphInteger;
14
+ export type FlowGraphVector = Vector2 | Vector3 | Vector4 | Quaternion;
15
+ export type FlowGraphMatrix = Matrix | FlowGraphMatrix2D | FlowGraphMatrix3D;
16
+ export type FlowGraphMathOperationType = FlowGraphNumber | FlowGraphVector | FlowGraphMatrix | boolean;
17
+ /**
18
+ * @internal
19
+ */
20
+ export declare function _getClassNameOf(v: any): any;
21
+ /**
22
+ * @internal
23
+ * Check if two classname are the same and are vector classes.
24
+ * @param className the first class name
25
+ * @param className2 the second class name
26
+ * @returns whether the two class names are the same and are vector classes.
27
+ */
28
+ export declare function _areSameVectorClass(className: string, className2: string): boolean;
29
+ /**
30
+ * @internal
31
+ * Check if two classname are the same and are matrix classes.
32
+ * @param className the first class name
33
+ * @param className2 the second class name
34
+ * @returns whether the two class names are the same and are matrix classes.
35
+ */
36
+ export declare function _areSameMatrixClass(className: string, className2: string): boolean;
37
+ /**
38
+ * @internal
39
+ * Check if two classname are the same and are integer classes.
40
+ * @param className the first class name
41
+ * @param className2 the second class name
42
+ * @returns whether the two class names are the same and are integer classes.
43
+ */
44
+ export declare function _areSameIntegerClass(className: string, className2: string): boolean;
45
+ /**
46
+ * Check if an object has a numeric value.
47
+ * @param a the object to check if it is a number.
48
+ * @returns whether a is a FlowGraphNumber (Integer or number).
49
+ */
50
+ export declare function isNumeric(a: FlowGraphMathOperationType): a is FlowGraphNumber;
51
+ /**
52
+ * Get the numeric value of a FlowGraphNumber.
53
+ * @param a the object to get the numeric value from.
54
+ * @returns the numeric value.
55
+ */
56
+ export declare function getNumericValue(a: FlowGraphNumber): number;