@babylonjs/core 6.30.0 → 6.32.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (227) hide show
  1. package/Actions/action.js.map +1 -1
  2. package/Animations/animation.d.ts +8 -2
  3. package/Animations/animation.js +21 -13
  4. package/Animations/animation.js.map +1 -1
  5. package/Animations/runtimeAnimation.js +6 -15
  6. package/Animations/runtimeAnimation.js.map +1 -1
  7. package/Cameras/Inputs/freeCameraDeviceOrientationInput.js.map +1 -1
  8. package/Cameras/camera.js +1 -1
  9. package/Cameras/camera.js.map +1 -1
  10. package/Culling/ray.js +24 -24
  11. package/Culling/ray.js.map +1 -1
  12. package/Debug/skeletonViewer.d.ts +2 -2
  13. package/Debug/skeletonViewer.js +38 -12
  14. package/Debug/skeletonViewer.js.map +1 -1
  15. package/DeviceInput/InputDevices/deviceSource.js.map +1 -1
  16. package/DeviceInput/InputDevices/deviceTypes.js.map +1 -1
  17. package/DeviceInput/webDeviceInputSystem.js.map +1 -1
  18. package/Engines/Extensions/engine.views.d.ts +8 -5
  19. package/Engines/Extensions/engine.views.js +14 -8
  20. package/Engines/Extensions/engine.views.js.map +1 -1
  21. package/Engines/Processors/shaderCodeNode.js.map +1 -1
  22. package/Engines/WebGPU/Extensions/engine.multiRender.js +6 -3
  23. package/Engines/WebGPU/Extensions/engine.multiRender.js.map +1 -1
  24. package/Engines/WebGPU/webgpuShaderProcessorsGLSL.js.map +1 -1
  25. package/Engines/WebGPU/webgpuShaderProcessorsWGSL.js.map +1 -1
  26. package/Engines/WebGPU/webgpuTextureHelper.js.map +1 -1
  27. package/Engines/engine.d.ts +16 -1
  28. package/Engines/engine.js +1 -1
  29. package/Engines/engine.js.map +1 -1
  30. package/Engines/thinEngine.js +2 -2
  31. package/Engines/thinEngine.js.map +1 -1
  32. package/Engines/webgpuEngine.js.map +1 -1
  33. package/FlowGraph/Blocks/Data/Math/flowGraphMatrixBlocks.js +12 -12
  34. package/FlowGraph/Blocks/Data/Math/flowGraphMatrixBlocks.js.map +1 -1
  35. package/FlowGraph/Blocks/Data/Math/flowGraphNumberMathBlocks.js +4 -4
  36. package/FlowGraph/Blocks/Data/Math/flowGraphNumberMathBlocks.js.map +1 -1
  37. package/FlowGraph/Blocks/Data/Math/flowGraphVector2MathBlocks.js +9 -9
  38. package/FlowGraph/Blocks/Data/Math/flowGraphVector2MathBlocks.js.map +1 -1
  39. package/FlowGraph/Blocks/Data/Math/flowGraphVector3MathBlocks.js +11 -11
  40. package/FlowGraph/Blocks/Data/Math/flowGraphVector3MathBlocks.js.map +1 -1
  41. package/FlowGraph/Blocks/Data/Math/flowGraphVector4MathBlocks.js +10 -10
  42. package/FlowGraph/Blocks/Data/Math/flowGraphVector4MathBlocks.js.map +1 -1
  43. package/FlowGraph/Blocks/Data/flowGraphBinaryOperationBlock.js +2 -2
  44. package/FlowGraph/Blocks/Data/flowGraphBinaryOperationBlock.js.map +1 -1
  45. package/FlowGraph/Blocks/Data/flowGraphCachedOperationBlock.js +1 -1
  46. package/FlowGraph/Blocks/Data/flowGraphCachedOperationBlock.js.map +1 -1
  47. package/FlowGraph/Blocks/Data/flowGraphConditionalDataBlock.js +4 -4
  48. package/FlowGraph/Blocks/Data/flowGraphConditionalDataBlock.js.map +1 -1
  49. package/FlowGraph/Blocks/Data/flowGraphConstantBlock.js +1 -1
  50. package/FlowGraph/Blocks/Data/flowGraphConstantBlock.js.map +1 -1
  51. package/FlowGraph/Blocks/Data/flowGraphCoordinateTransformBlock.js +4 -4
  52. package/FlowGraph/Blocks/Data/flowGraphCoordinateTransformBlock.js.map +1 -1
  53. package/FlowGraph/Blocks/Data/flowGraphGetVariableBlock.js +2 -2
  54. package/FlowGraph/Blocks/Data/flowGraphGetVariableBlock.js.map +1 -1
  55. package/FlowGraph/Blocks/Data/flowGraphUnaryOperationBlock.js +1 -1
  56. package/FlowGraph/Blocks/Data/flowGraphUnaryOperationBlock.js.map +1 -1
  57. package/FlowGraph/Blocks/Event/flowGraphMeshPickEventBlock.d.ts +4 -4
  58. package/FlowGraph/Blocks/Event/flowGraphMeshPickEventBlock.js +16 -6
  59. package/FlowGraph/Blocks/Event/flowGraphMeshPickEventBlock.js.map +1 -1
  60. package/FlowGraph/Blocks/Event/flowGraphReceiveCustomEventBlock.d.ts +1 -0
  61. package/FlowGraph/Blocks/Event/flowGraphReceiveCustomEventBlock.js +5 -1
  62. package/FlowGraph/Blocks/Event/flowGraphReceiveCustomEventBlock.js.map +1 -1
  63. package/FlowGraph/Blocks/Execution/Animation/flowGraphPauseAnimationBlock.js +1 -1
  64. package/FlowGraph/Blocks/Execution/Animation/flowGraphPauseAnimationBlock.js.map +1 -1
  65. package/FlowGraph/Blocks/Execution/Animation/flowGraphPlayAnimationBlock.d.ts +17 -6
  66. package/FlowGraph/Blocks/Execution/Animation/flowGraphPlayAnimationBlock.js +16 -9
  67. package/FlowGraph/Blocks/Execution/Animation/flowGraphPlayAnimationBlock.js.map +1 -1
  68. package/FlowGraph/Blocks/Execution/Animation/flowGraphStopAnimationBlock.js +1 -1
  69. package/FlowGraph/Blocks/Execution/Animation/flowGraphStopAnimationBlock.js.map +1 -1
  70. package/FlowGraph/Blocks/Execution/Audio/flowGraphPlayAudioBlock.js +1 -1
  71. package/FlowGraph/Blocks/Execution/Audio/flowGraphPlayAudioBlock.js.map +1 -1
  72. package/FlowGraph/Blocks/Execution/Audio/flowGraphStopAudioBlock.js +1 -1
  73. package/FlowGraph/Blocks/Execution/Audio/flowGraphStopAudioBlock.js.map +1 -1
  74. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphBranchBlock.js +1 -1
  75. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphBranchBlock.js.map +1 -1
  76. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphCounterBlock.js +1 -1
  77. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphCounterBlock.js.map +1 -1
  78. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDebounceBlock.js +2 -2
  79. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDebounceBlock.js.map +1 -1
  80. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDoNBlock.js +2 -2
  81. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDoNBlock.js.map +1 -1
  82. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphFlipFlopBlock.js +1 -1
  83. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphFlipFlopBlock.js.map +1 -1
  84. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphForLoopBlock.js +4 -4
  85. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphForLoopBlock.js.map +1 -1
  86. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphMultiGateBlock.d.ts +1 -0
  87. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphMultiGateBlock.js +8 -1
  88. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphMultiGateBlock.js.map +1 -1
  89. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphSwitchBlock.d.ts +1 -0
  90. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphSwitchBlock.js +5 -1
  91. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphSwitchBlock.js.map +1 -1
  92. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphThrottleBlock.js +2 -2
  93. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphThrottleBlock.js.map +1 -1
  94. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphTimerBlock.js +1 -1
  95. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphTimerBlock.js.map +1 -1
  96. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWaitAllBlock.d.ts +1 -0
  97. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWaitAllBlock.js +4 -0
  98. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWaitAllBlock.js.map +1 -1
  99. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWhileLoopBlock.d.ts +1 -0
  100. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWhileLoopBlock.js +6 -1
  101. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWhileLoopBlock.js.map +1 -1
  102. package/FlowGraph/Blocks/Execution/flowGraphLogBlock.js +1 -1
  103. package/FlowGraph/Blocks/Execution/flowGraphLogBlock.js.map +1 -1
  104. package/FlowGraph/Blocks/Execution/flowGraphSendCustomEventBlock.js +2 -2
  105. package/FlowGraph/Blocks/Execution/flowGraphSendCustomEventBlock.js.map +1 -1
  106. package/FlowGraph/Blocks/Execution/flowGraphSetPropertyBlock.d.ts +8 -12
  107. package/FlowGraph/Blocks/Execution/flowGraphSetPropertyBlock.js +9 -19
  108. package/FlowGraph/Blocks/Execution/flowGraphSetPropertyBlock.js.map +1 -1
  109. package/FlowGraph/Blocks/Execution/flowGraphSetVariableBlock.js +2 -2
  110. package/FlowGraph/Blocks/Execution/flowGraphSetVariableBlock.js.map +1 -1
  111. package/FlowGraph/flowGraphBlock.d.ts +2 -2
  112. package/FlowGraph/flowGraphBlock.js +20 -4
  113. package/FlowGraph/flowGraphBlock.js.map +1 -1
  114. package/FlowGraph/flowGraphContext.d.ts +4 -4
  115. package/FlowGraph/flowGraphContext.js +22 -40
  116. package/FlowGraph/flowGraphContext.js.map +1 -1
  117. package/FlowGraph/flowGraphPath.d.ts +27 -0
  118. package/FlowGraph/flowGraphPath.js +136 -0
  119. package/FlowGraph/flowGraphPath.js.map +1 -0
  120. package/FlowGraph/flowGraphPathComponent.d.ts +42 -0
  121. package/FlowGraph/flowGraphPathComponent.js +51 -0
  122. package/FlowGraph/flowGraphPathComponent.js.map +1 -0
  123. package/FlowGraph/index.d.ts +1 -0
  124. package/FlowGraph/index.js +1 -0
  125. package/FlowGraph/index.js.map +1 -1
  126. package/Gizmos/axisDragGizmo.d.ts +4 -2
  127. package/Gizmos/axisDragGizmo.js +18 -6
  128. package/Gizmos/axisDragGizmo.js.map +1 -1
  129. package/Gizmos/axisScaleGizmo.d.ts +2 -2
  130. package/Gizmos/axisScaleGizmo.js +1 -1
  131. package/Gizmos/axisScaleGizmo.js.map +1 -1
  132. package/Gizmos/planeDragGizmo.d.ts +4 -4
  133. package/Gizmos/planeDragGizmo.js +1 -1
  134. package/Gizmos/planeDragGizmo.js.map +1 -1
  135. package/Gizmos/planeRotationGizmo.d.ts +13 -7
  136. package/Gizmos/planeRotationGizmo.js +26 -10
  137. package/Gizmos/planeRotationGizmo.js.map +1 -1
  138. package/Lights/Shadows/shadowGenerator.d.ts +8 -0
  139. package/Lights/Shadows/shadowGenerator.js +12 -0
  140. package/Lights/Shadows/shadowGenerator.js.map +1 -1
  141. package/Loading/sceneLoader.js.map +1 -1
  142. package/Materials/GreasedLine/greasedLineSimpleMaterial.js.map +1 -1
  143. package/Materials/Node/Blocks/Fragment/perturbNormalBlock.js.map +1 -1
  144. package/Materials/Node/Blocks/Teleport/teleportInBlock.d.ts +6 -0
  145. package/Materials/Node/Blocks/Teleport/teleportInBlock.js +22 -0
  146. package/Materials/Node/Blocks/Teleport/teleportInBlock.js.map +1 -1
  147. package/Materials/Node/Blocks/modBlock.js +1 -0
  148. package/Materials/Node/Blocks/modBlock.js.map +1 -1
  149. package/Materials/Textures/Procedurals/proceduralTexture.d.ts +1 -1
  150. package/Materials/Textures/Procedurals/proceduralTexture.js +1 -1
  151. package/Materials/Textures/Procedurals/proceduralTexture.js.map +1 -1
  152. package/Materials/Textures/multiRenderTarget.d.ts +14 -10
  153. package/Materials/Textures/multiRenderTarget.js +7 -5
  154. package/Materials/Textures/multiRenderTarget.js.map +1 -1
  155. package/Materials/imageProcessingConfiguration.d.ts +2 -2
  156. package/Materials/imageProcessingConfiguration.js +2 -2
  157. package/Materials/imageProcessingConfiguration.js.map +1 -1
  158. package/Maths/math.size.d.ts +6 -0
  159. package/Maths/math.size.js +8 -0
  160. package/Maths/math.size.js.map +1 -1
  161. package/Maths/math.vector.d.ts +5 -5
  162. package/Maths/math.vector.js +6 -5
  163. package/Maths/math.vector.js.map +1 -1
  164. package/Meshes/Builders/linesBuilder.js +4 -2
  165. package/Meshes/Builders/linesBuilder.js.map +1 -1
  166. package/Meshes/GreasedLine/greasedLineBaseMesh.d.ts +1 -1
  167. package/Meshes/GreasedLine/greasedLineBaseMesh.js +1 -1
  168. package/Meshes/GreasedLine/greasedLineBaseMesh.js.map +1 -1
  169. package/Meshes/geometry.d.ts +8 -0
  170. package/Meshes/geometry.js +20 -1
  171. package/Meshes/geometry.js.map +1 -1
  172. package/Meshes/groundMesh.js +1 -1
  173. package/Meshes/groundMesh.js.map +1 -1
  174. package/Meshes/mesh.d.ts +8 -0
  175. package/Meshes/mesh.js +14 -2
  176. package/Meshes/mesh.js.map +1 -1
  177. package/Meshes/mesh.vertexData.js.map +1 -1
  178. package/Misc/dds.js.map +1 -1
  179. package/Misc/greasedLineTools.js.map +1 -1
  180. package/Misc/tools.js.map +1 -1
  181. package/Physics/physicsHelper.d.ts +1 -1
  182. package/Physics/physicsHelper.js +1 -1
  183. package/Physics/physicsHelper.js.map +1 -1
  184. package/PostProcesses/RenderPipeline/Pipelines/ssrRenderingPipeline.d.ts +1 -1
  185. package/PostProcesses/RenderPipeline/Pipelines/ssrRenderingPipeline.js +1 -1
  186. package/PostProcesses/RenderPipeline/Pipelines/ssrRenderingPipeline.js.map +1 -1
  187. package/PostProcesses/bloomEffect.d.ts +1 -1
  188. package/PostProcesses/bloomEffect.js +1 -1
  189. package/PostProcesses/bloomEffect.js.map +1 -1
  190. package/PostProcesses/postProcess.d.ts +10 -2
  191. package/PostProcesses/postProcess.js +17 -7
  192. package/PostProcesses/postProcess.js.map +1 -1
  193. package/Rendering/depthPeelingRenderer.d.ts +5 -0
  194. package/Rendering/depthPeelingRenderer.js +33 -9
  195. package/Rendering/depthPeelingRenderer.js.map +1 -1
  196. package/Rendering/depthRenderer.js +9 -0
  197. package/Rendering/depthRenderer.js.map +1 -1
  198. package/Rendering/geometryBufferRenderer.d.ts +6 -3
  199. package/Rendering/geometryBufferRenderer.js +28 -10
  200. package/Rendering/geometryBufferRenderer.js.map +1 -1
  201. package/Rendering/geometryBufferRendererSceneComponent.d.ts +5 -2
  202. package/Rendering/geometryBufferRendererSceneComponent.js.map +1 -1
  203. package/Shaders/ShadersInclude/bonesDeclaration.js +1 -1
  204. package/Shaders/ShadersInclude/bonesDeclaration.js.map +1 -1
  205. package/Shaders/depth.vertex.d.ts +2 -0
  206. package/Shaders/depth.vertex.js +4 -0
  207. package/Shaders/depth.vertex.js.map +1 -1
  208. package/XR/features/WebXRAbstractFeature.d.ts +10 -1
  209. package/XR/features/WebXRAbstractFeature.js +13 -0
  210. package/XR/features/WebXRAbstractFeature.js.map +1 -1
  211. package/XR/features/WebXRLightEstimation.d.ts +5 -0
  212. package/XR/features/WebXRLightEstimation.js +14 -2
  213. package/XR/features/WebXRLightEstimation.js.map +1 -1
  214. package/XR/features/WebXRRawCameraAccess.d.ts +81 -0
  215. package/XR/features/WebXRRawCameraAccess.js +169 -0
  216. package/XR/features/WebXRRawCameraAccess.js.map +1 -0
  217. package/XR/features/index.d.ts +1 -0
  218. package/XR/features/index.js +1 -0
  219. package/XR/features/index.js.map +1 -1
  220. package/XR/webXRFeaturesManager.d.ts +13 -0
  221. package/XR/webXRFeaturesManager.js +4 -0
  222. package/XR/webXRFeaturesManager.js.map +1 -1
  223. package/package.json +1 -1
  224. package/scene.d.ts +1 -1
  225. package/scene.js +11 -6
  226. package/scene.js.map +1 -1
  227. package/types.js.map +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"flowGraphVector4MathBlocks.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FlowGraph/Blocks/Data/Math/flowGraphVector4MathBlocks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,uCAA0C;AACpF,OAAO,EAAE,6BAA6B,EAAE,MAAM,kCAAkC,CAAC;AACjF,OAAO,EAAE,OAAO,EAAE,MAAM,+B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AAC,CAAC;QACpC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC;IACxC,CAAC;IAEM,YAAY;QACf,OAAO,SAAS,CAAC;IACrB,CAAC;CACJ;AACD,aAAa,CAAC,SAAS,EAAE,0BAA0B,CAAC,CAAC","sourcesContent":["import { RichTypeNumber, RichTypeVector4 } from \"core/FlowGraph/flowGraphRichTypes\";\r\nimport { FlowGraphBinaryOperationBlock } from \"../flowGraphBinaryOperationBlock\";\r\nimport { Vector4 } from \"../../../../Maths/math.vector\";\r\nimport { FlowGraphUnaryOperationBlock } from \"../flowGraphUnaryOperationBlock\";\r\nimport type { IFlowGraphBlockConfiguration } from \"../../../flowGraphBlock\";\r\nimport { FlowGraphBlock } from \"../../../flowGraphBlock\";\r\nimport { RegisterClass } from \"../../../../Misc/typeStore\";\r\nimport type { FlowGraphContext } from \"../../../flowGraphContext\";\r\nimport type { FlowGraphDataConnection } from \"../../../flowGraphDataConnection\";\r\n\r\nconst ADDNAME = \"FGAddVector4Block\";\r\n/**\r\n * Add two vectors together.\r\n * @experimental\r\n */\r\nexport class FlowGraphAddVector4Block extends FlowGraphBinaryOperationBlock<Vector4, Vector4, Vector4> {\r\n constructor(config?: IFlowGraphBlockConfiguration) {\r\n super(RichTypeVector4, RichTypeVector4, RichTypeVector4, (left, right) => left.add(right), ADDNAME, config);\r\n }\r\n}\r\nRegisterClass(ADDNAME, FlowGraphAddVector4Block);\r\n\r\nconst SUBNAME = \"FGSubtractVector4Block\";\r\n/**\r\n * Subtract two vectors.\r\n * @experimental\r\n */\r\nexport class FlowGraphSubtractVector4Block extends FlowGraphBinaryOperationBlock<Vector4, Vector4, Vector4> {\r\n constructor(config?: IFlowGraphBlockConfiguration) {\r\n super(RichTypeVector4, RichTypeVector4, RichTypeVector4, (left, right) => left.subtract(right), SUBNAME, config);\r\n }\r\n}\r\nRegisterClass(SUBNAME, FlowGraphSubtractVector4Block);\r\n\r\nconst MULNAME = \"FGMultiplyVector4Block\";\r\n/**\r\n * Multiply two vectors together.\r\n * @experimental\r\n */\r\nexport class FlowGraphMultiplyVector4Block extends FlowGraphBinaryOperationBlock<Vector4, Vector4, Vector4> {\r\n constructor(config?: IFlowGraphBlockConfiguration) {\r\n super(RichTypeVector4, RichTypeVector4, RichTypeVector4, (left, right) => left.multiply(right), MULNAME, config);\r\n }\r\n}\r\nRegisterClass(MULNAME, FlowGraphMultiplyVector4Block);\r\n\r\nconst DIVNAME = \"FGDivideVector4Block\";\r\n/**\r\n * Divide two vectors.\r\n * @experimental\r\n */\r\nexport class FlowGraphDivideVector4Block extends FlowGraphBinaryOperationBlock<Vector4, Vector4, Vector4> {\r\n constructor(config?: IFlowGraphBlockConfiguration) {\r\n super(RichTypeVector4, RichTypeVector4, RichTypeVector4, (left, right) => left.divide(right), DIVNAME, config);\r\n }\r\n}\r\nRegisterClass(DIVNAME, FlowGraphDivideVector4Block);\r\n\r\nconst SCALNAME = \"FGScaleVector4Block\";\r\n/**\r\n * Scale a vector by a number.\r\n * @experimental\r\n */\r\nexport class FlowGraphScaleVector4Block extends FlowGraphBinaryOperationBlock<Vector4, number, Vector4> {\r\n constructor(config?: IFlowGraphBlockConfiguration) {\r\n super(RichTypeVector4, RichTypeNumber, RichTypeVector4, (left, right) => left.scale(right), SCALNAME, config);\r\n }\r\n}\r\nRegisterClass(SCALNAME, FlowGraphScaleVector4Block);\r\n\r\nconst LENGTHNAME = \"FGLengthVector4Block\";\r\n/**\r\n * Get the length of a vector.\r\n * @experimental\r\n */\r\nexport class FlowGraphLengthVector4Block extends FlowGraphUnaryOperationBlock<Vector4, number> {\r\n constructor(config?: IFlowGraphBlockConfiguration) {\r\n super(RichTypeVector4, RichTypeNumber, (value) => value.length(), LENGTHNAME, config);\r\n }\r\n}\r\nRegisterClass(LENGTHNAME, FlowGraphLengthVector4Block);\r\n\r\nconst NORMALIZENAME = \"FGNormalizeVector4Block\";\r\n/**\r\n * Normalize a vector.\r\n * @experimental\r\n */\r\nexport class FlowGraphNormalizeVector4Block extends FlowGraphUnaryOperationBlock<Vector4, Vector4> {\r\n constructor(config?: IFlowGraphBlockConfiguration) {\r\n super(\r\n RichTypeVector4,\r\n RichTypeVector4,\r\n (value: Vector4) => {\r\n const clone = value.clone();\r\n clone.normalize();\r\n return clone;\r\n },\r\n NORMALIZENAME,\r\n config\r\n );\r\n }\r\n\r\n public getClassName(): string {\r\n return NORMALIZENAME;\r\n }\r\n}\r\nRegisterClass(NORMALIZENAME, FlowGraphNormalizeVector4Block);\r\n\r\nconst CREATENAME = \"FGCreateVector4Block\";\r\n/**\r\n * Create a vector from its components.\r\n * @experimental\r\n */\r\nexport class FlowGraphCreateVector4Block extends FlowGraphBlock {\r\n /**\r\n * Input connection: The x component of the vector.\r\n */\r\n public readonly x: FlowGraphDataConnection<number>;\r\n /**\r\n * Input connection: The y component of the vector.\r\n */\r\n public readonly y: FlowGraphDataConnection<number>;\r\n /**\r\n * Input connection: The z component of the vector.\r\n */\r\n public readonly z: FlowGraphDataConnection<number>;\r\n /**\r\n * Input connection: The w component of the vector.\r\n */\r\n public readonly w: FlowGraphDataConnection<number>;\r\n /**\r\n * Output connection: The created vector.\r\n */\r\n public readonly vector: FlowGraphDataConnection<Vector4>;\r\n\r\n private _cachedVector: Vector4 = Vector4.Zero();\r\n\r\n constructor(config?: IFlowGraphBlockConfiguration) {\r\n super(config);\r\n\r\n this.x = this._registerDataInput(\"x\", RichTypeNumber);\r\n this.y = this._registerDataInput(\"y\", RichTypeNumber);\r\n this.z = this._registerDataInput(\"y\", RichTypeNumber);\r\n this.w = this._registerDataInput(\"w\", RichTypeNumber);\r\n this.vector = this._registerDataOutput(\"vector\", RichTypeVector4);\r\n }\r\n\r\n public _updateOutputs(_context: FlowGraphContext): void {\r\n this._cachedVector.x = this.x.getValue(_context);\r\n this._cachedVector.y = this.y.getValue(_context);\r\n this._cachedVector.z = this.z.getValue(_context);\r\n this._cachedVector.w = this.w.getValue(_context);\r\n this.vector.setValue(this._cachedVector, _context);\r\n }\r\n\r\n public getClassName(): string {\r\n return CREATENAME;\r\n }\r\n}\r\nRegisterClass(CREATENAME, FlowGraphCreateVector4Block);\r\n\r\nconst SPLITNAME = \"FGSplitVector4Block\";\r\n/**\r\n * Split a vector into its components.\r\n * @experimental\r\n */\r\nexport class FlowGraphSplitVector4Block extends FlowGraphBlock {\r\n /**\r\n * Input connection: The vector to split.\r\n */\r\n public readonly vector: FlowGraphDataConnection<Vector4>;\r\n /**\r\n * Output connection: The x component of the vector.\r\n */\r\n public readonly x: FlowGraphDataConnection<number>;\r\n /**\r\n * Output connection: The y component of the vector.\r\n */\r\n public readonly y: FlowGraphDataConnection<number>;\r\n /**\r\n * Input connection: The z component of the vector.\r\n */\r\n public readonly z: FlowGraphDataConnection<number>;\r\n /**\r\n * Input connection: The w component of the vector.\r\n */\r\n public readonly w: FlowGraphDataConnection<number>;\r\n\r\n constructor(config?: IFlowGraphBlockConfiguration) {\r\n super(config);\r\n\r\n this.vector = this._registerDataInput(\"vector\", RichTypeVector4);\r\n this.x = this._registerDataOutput(\"x\", RichTypeNumber);\r\n this.y = this._registerDataOutput(\"y\", RichTypeNumber);\r\n this.z = this._registerDataOutput(\"z\", RichTypeNumber);\r\n this.w = this._registerDataOutput(\"w\", RichTypeNumber);\r\n }\r\n\r\n public _updateOutputs(_context: FlowGraphContext): void {\r\n const vector = this.vector.getValue(_context);\r\n this.x.setValue(vector.x, _context);\r\n this.y.setValue(vector.y, _context);\r\n this.z.setValue(vector.z, _context);\r\n this.w.setValue(vector.w, _context);\r\n }\r\n\r\n public getClassName(): string {\r\n return SPLITNAME;\r\n }\r\n}\r\nRegisterClass(SPLITNAME, FlowGraphSplitVector4Block);\r\n"]}
1
+ {"version":3,"file":"flowGraphVector4MathBlocks.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FlowGraph/Blocks/Data/Math/flowGraphVector4MathBlocks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc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MAAM,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC;QACpC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC;QACpC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC;IACxC,CAAC;IAEM,YAAY;QACf,OAAO,SAAS,CAAC;IACrB,CAAC;CACJ;AACD,aAAa,CAAC,SAAS,EAAE,0BAA0B,CAAC,CAAC","sourcesContent":["import { RichTypeNumber, RichTypeVector4 } from \"core/FlowGraph/flowGraphRichTypes\";\r\nimport { FlowGraphBinaryOperationBlock } from \"../flowGraphBinaryOperationBlock\";\r\nimport { Vector4 } from \"../../../../Maths/math.vector\";\r\nimport { FlowGraphUnaryOperationBlock } from \"../flowGraphUnaryOperationBlock\";\r\nimport type { IFlowGraphBlockConfiguration } from \"../../../flowGraphBlock\";\r\nimport { FlowGraphBlock } from \"../../../flowGraphBlock\";\r\nimport { RegisterClass } from \"../../../../Misc/typeStore\";\r\nimport type { FlowGraphContext } from \"../../../flowGraphContext\";\r\nimport type { FlowGraphDataConnection } from \"../../../flowGraphDataConnection\";\r\n\r\nconst ADDNAME = \"FGAddVector4Block\";\r\n/**\r\n * Add two vectors together.\r\n * @experimental\r\n */\r\nexport class FlowGraphAddVector4Block extends FlowGraphBinaryOperationBlock<Vector4, Vector4, Vector4> {\r\n constructor(config?: IFlowGraphBlockConfiguration) {\r\n super(RichTypeVector4, RichTypeVector4, RichTypeVector4, (left, right) => left.add(right), ADDNAME, config);\r\n }\r\n}\r\nRegisterClass(ADDNAME, FlowGraphAddVector4Block);\r\n\r\nconst SUBNAME = \"FGSubtractVector4Block\";\r\n/**\r\n * Subtract two vectors.\r\n * @experimental\r\n */\r\nexport class FlowGraphSubtractVector4Block extends FlowGraphBinaryOperationBlock<Vector4, Vector4, Vector4> {\r\n constructor(config?: IFlowGraphBlockConfiguration) {\r\n super(RichTypeVector4, RichTypeVector4, RichTypeVector4, (left, right) => left.subtract(right), SUBNAME, config);\r\n }\r\n}\r\nRegisterClass(SUBNAME, FlowGraphSubtractVector4Block);\r\n\r\nconst MULNAME = \"FGMultiplyVector4Block\";\r\n/**\r\n * Multiply two vectors together.\r\n * @experimental\r\n */\r\nexport class FlowGraphMultiplyVector4Block extends FlowGraphBinaryOperationBlock<Vector4, Vector4, Vector4> {\r\n constructor(config?: IFlowGraphBlockConfiguration) {\r\n super(RichTypeVector4, RichTypeVector4, RichTypeVector4, (left, right) => left.multiply(right), MULNAME, config);\r\n }\r\n}\r\nRegisterClass(MULNAME, FlowGraphMultiplyVector4Block);\r\n\r\nconst DIVNAME = \"FGDivideVector4Block\";\r\n/**\r\n * Divide two vectors.\r\n * @experimental\r\n */\r\nexport class FlowGraphDivideVector4Block extends FlowGraphBinaryOperationBlock<Vector4, Vector4, Vector4> {\r\n constructor(config?: IFlowGraphBlockConfiguration) {\r\n super(RichTypeVector4, RichTypeVector4, RichTypeVector4, (left, right) => left.divide(right), DIVNAME, config);\r\n }\r\n}\r\nRegisterClass(DIVNAME, FlowGraphDivideVector4Block);\r\n\r\nconst SCALNAME = \"FGScaleVector4Block\";\r\n/**\r\n * Scale a vector by a number.\r\n * @experimental\r\n */\r\nexport class FlowGraphScaleVector4Block extends FlowGraphBinaryOperationBlock<Vector4, number, Vector4> {\r\n constructor(config?: IFlowGraphBlockConfiguration) {\r\n super(RichTypeVector4, RichTypeNumber, RichTypeVector4, (left, right) => left.scale(right), SCALNAME, config);\r\n }\r\n}\r\nRegisterClass(SCALNAME, FlowGraphScaleVector4Block);\r\n\r\nconst LENGTHNAME = \"FGLengthVector4Block\";\r\n/**\r\n * Get the length of a vector.\r\n * @experimental\r\n */\r\nexport class FlowGraphLengthVector4Block extends FlowGraphUnaryOperationBlock<Vector4, number> {\r\n constructor(config?: IFlowGraphBlockConfiguration) {\r\n super(RichTypeVector4, RichTypeNumber, (value) => value.length(), LENGTHNAME, config);\r\n }\r\n}\r\nRegisterClass(LENGTHNAME, FlowGraphLengthVector4Block);\r\n\r\nconst NORMALIZENAME = \"FGNormalizeVector4Block\";\r\n/**\r\n * Normalize a vector.\r\n * @experimental\r\n */\r\nexport class FlowGraphNormalizeVector4Block extends FlowGraphUnaryOperationBlock<Vector4, Vector4> {\r\n constructor(config?: IFlowGraphBlockConfiguration) {\r\n super(\r\n RichTypeVector4,\r\n RichTypeVector4,\r\n (value: Vector4) => {\r\n const clone = value.clone();\r\n clone.normalize();\r\n return clone;\r\n },\r\n NORMALIZENAME,\r\n config\r\n );\r\n }\r\n\r\n public getClassName(): string {\r\n return NORMALIZENAME;\r\n }\r\n}\r\nRegisterClass(NORMALIZENAME, FlowGraphNormalizeVector4Block);\r\n\r\nconst CREATENAME = \"FGCreateVector4Block\";\r\n/**\r\n * Create a vector from its components.\r\n * @experimental\r\n */\r\nexport class FlowGraphCreateVector4Block extends FlowGraphBlock {\r\n /**\r\n * Input connection: The x component of the vector.\r\n */\r\n public readonly x: FlowGraphDataConnection<number>;\r\n /**\r\n * Input connection: The y component of the vector.\r\n */\r\n public readonly y: FlowGraphDataConnection<number>;\r\n /**\r\n * Input connection: The z component of the vector.\r\n */\r\n public readonly z: FlowGraphDataConnection<number>;\r\n /**\r\n * Input connection: The w component of the vector.\r\n */\r\n public readonly w: FlowGraphDataConnection<number>;\r\n /**\r\n * Output connection: The created vector.\r\n */\r\n public readonly vector: FlowGraphDataConnection<Vector4>;\r\n\r\n private _cachedVector: Vector4 = Vector4.Zero();\r\n\r\n constructor(config?: IFlowGraphBlockConfiguration) {\r\n super(config);\r\n\r\n this.x = this.registerDataInput(\"x\", RichTypeNumber);\r\n this.y = this.registerDataInput(\"y\", RichTypeNumber);\r\n this.z = this.registerDataInput(\"y\", RichTypeNumber);\r\n this.w = this.registerDataInput(\"w\", RichTypeNumber);\r\n this.vector = this.registerDataOutput(\"vector\", RichTypeVector4);\r\n }\r\n\r\n public _updateOutputs(_context: FlowGraphContext): void {\r\n this._cachedVector.x = this.x.getValue(_context);\r\n this._cachedVector.y = this.y.getValue(_context);\r\n this._cachedVector.z = this.z.getValue(_context);\r\n this._cachedVector.w = this.w.getValue(_context);\r\n this.vector.setValue(this._cachedVector, _context);\r\n }\r\n\r\n public getClassName(): string {\r\n return CREATENAME;\r\n }\r\n}\r\nRegisterClass(CREATENAME, FlowGraphCreateVector4Block);\r\n\r\nconst SPLITNAME = \"FGSplitVector4Block\";\r\n/**\r\n * Split a vector into its components.\r\n * @experimental\r\n */\r\nexport class FlowGraphSplitVector4Block extends FlowGraphBlock {\r\n /**\r\n * Input connection: The vector to split.\r\n */\r\n public readonly vector: FlowGraphDataConnection<Vector4>;\r\n /**\r\n * Output connection: The x component of the vector.\r\n */\r\n public readonly x: FlowGraphDataConnection<number>;\r\n /**\r\n * Output connection: The y component of the vector.\r\n */\r\n public readonly y: FlowGraphDataConnection<number>;\r\n /**\r\n * Input connection: The z component of the vector.\r\n */\r\n public readonly z: FlowGraphDataConnection<number>;\r\n /**\r\n * Input connection: The w component of the vector.\r\n */\r\n public readonly w: FlowGraphDataConnection<number>;\r\n\r\n constructor(config?: IFlowGraphBlockConfiguration) {\r\n super(config);\r\n\r\n this.vector = this.registerDataInput(\"vector\", RichTypeVector4);\r\n this.x = this.registerDataOutput(\"x\", RichTypeNumber);\r\n this.y = this.registerDataOutput(\"y\", RichTypeNumber);\r\n this.z = this.registerDataOutput(\"z\", RichTypeNumber);\r\n this.w = this.registerDataOutput(\"w\", RichTypeNumber);\r\n }\r\n\r\n public _updateOutputs(_context: FlowGraphContext): void {\r\n const vector = this.vector.getValue(_context);\r\n this.x.setValue(vector.x, _context);\r\n this.y.setValue(vector.y, _context);\r\n this.z.setValue(vector.z, _context);\r\n this.w.setValue(vector.w, _context);\r\n }\r\n\r\n public getClassName(): string {\r\n return SPLITNAME;\r\n }\r\n}\r\nRegisterClass(SPLITNAME, FlowGraphSplitVector4Block);\r\n"]}
@@ -9,8 +9,8 @@ export class FlowGraphBinaryOperationBlock extends FlowGraphCachedOperationBlock
9
9
  super(resultRichType, config);
10
10
  this._operation = _operation;
11
11
  this._className = _className;
12
- this.leftInput = this._registerDataInput("leftInput", leftRichType);
13
- this.rightInput = this._registerDataInput("rightInput", rightRichType);
12
+ this.leftInput = this.registerDataInput("leftInput", leftRichType);
13
+ this.rightInput = this.registerDataInput("rightInput", rightRichType);
14
14
  }
15
15
  _doOperation(context) {
16
16
  return this._operation(this.leftInput.getValue(context), this.rightInput.getValue(context));
@@ -1 +1 @@
1
- {"version":3,"file":"flowGraphBinaryOperationBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FlowGraph/Blocks/Data/flowGraphBinaryOperationBlock.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,6BAA6B,EAAE,MAAM,iCAAiC,CAAC;AAChF;;;;GAIG;AACH,MAAM,OAAO,6BAAsD,SAAQ,6BAAsC;IAI7G,YACI,YAA6B,EAC7B,aAA+B,EAC/B,cAAiC,EACzB,UAAmD,EACnD,UAAkB,EAC1B,MAAqC;QAErC,KAAK,CAAC,cAAc,EAAE,MAAM,CAAC,CAAC;QAJtB,eAAU,GAAV,UAAU,CAAyC;QACnD,eAAU,GAAV,UAAU,CAAQ;QAI1B,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,kBAAkB,CAAC,WAAW,EAAE,YAAY,CAAC,CAAC;QACpE,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,kBAAkB,CAAC,YAAY,EAAE,aAAa,CAAC,CAAC;IAC3E,CAAC;IAEe,YAAY,CAAC,OAAyB;QAClD,OAAO,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC;IAChG,CAAC;IAEM,YAAY;QACf,OAAO,IAAI,CAAC,UAAU,CAAC;IAC3B,CAAC;CACJ","sourcesContent":["import type { FlowGraphDataConnection } from \"../../flowGraphDataConnection\";\r\nimport type { RichType } from \"../../flowGraphRichTypes\";\r\nimport type { FlowGraphContext } from \"../../flowGraphContext\";\r\nimport type { IFlowGraphBlockConfiguration } from \"../../flowGraphBlock\";\r\nimport { FlowGraphCachedOperationBlock } from \"./flowGraphCachedOperationBlock\";\r\n/**\r\n * @experimental\r\n * The base block for all binary operation blocks. Receives an input of type\r\n * LeftT, one of type RightT, and outputs a value of type ResultT.\r\n */\r\nexport class FlowGraphBinaryOperationBlock<LeftT, RightT, ResultT> extends FlowGraphCachedOperationBlock<ResultT> {\r\n leftInput: FlowGraphDataConnection<LeftT>;\r\n rightInput: FlowGraphDataConnection<RightT>;\r\n\r\n constructor(\r\n leftRichType: RichType<LeftT>,\r\n rightRichType: RichType<RightT>,\r\n resultRichType: RichType<ResultT>,\r\n private _operation: (left: LeftT, right: RightT) => ResultT,\r\n private _className: string,\r\n config?: IFlowGraphBlockConfiguration\r\n ) {\r\n super(resultRichType, config);\r\n this.leftInput = this._registerDataInput(\"leftInput\", leftRichType);\r\n this.rightInput = this._registerDataInput(\"rightInput\", rightRichType);\r\n }\r\n\r\n public override _doOperation(context: FlowGraphContext): ResultT {\r\n return this._operation(this.leftInput.getValue(context), this.rightInput.getValue(context));\r\n }\r\n\r\n public getClassName(): string {\r\n return this._className;\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"flowGraphBinaryOperationBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FlowGraph/Blocks/Data/flowGraphBinaryOperationBlock.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,6BAA6B,EAAE,MAAM,iCAAiC,CAAC;AAChF;;;;GAIG;AACH,MAAM,OAAO,6BAAsD,SAAQ,6BAAsC;IAI7G,YACI,YAA6B,EAC7B,aAA+B,EAC/B,cAAiC,EACzB,UAAmD,EACnD,UAAkB,EAC1B,MAAqC;QAErC,KAAK,CAAC,cAAc,EAAE,MAAM,CAAC,CAAC;QAJtB,eAAU,GAAV,UAAU,CAAyC;QACnD,eAAU,GAAV,UAAU,CAAQ;QAI1B,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,iBAAiB,CAAC,WAAW,EAAE,YAAY,CAAC,CAAC;QACnE,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,iBAAiB,CAAC,YAAY,EAAE,aAAa,CAAC,CAAC;IAC1E,CAAC;IAEe,YAAY,CAAC,OAAyB;QAClD,OAAO,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC;IAChG,CAAC;IAEM,YAAY;QACf,OAAO,IAAI,CAAC,UAAU,CAAC;IAC3B,CAAC;CACJ","sourcesContent":["import type { FlowGraphDataConnection } from \"../../flowGraphDataConnection\";\r\nimport type { RichType } from \"../../flowGraphRichTypes\";\r\nimport type { FlowGraphContext } from \"../../flowGraphContext\";\r\nimport type { IFlowGraphBlockConfiguration } from \"../../flowGraphBlock\";\r\nimport { FlowGraphCachedOperationBlock } from \"./flowGraphCachedOperationBlock\";\r\n/**\r\n * @experimental\r\n * The base block for all binary operation blocks. Receives an input of type\r\n * LeftT, one of type RightT, and outputs a value of type ResultT.\r\n */\r\nexport class FlowGraphBinaryOperationBlock<LeftT, RightT, ResultT> extends FlowGraphCachedOperationBlock<ResultT> {\r\n leftInput: FlowGraphDataConnection<LeftT>;\r\n rightInput: FlowGraphDataConnection<RightT>;\r\n\r\n constructor(\r\n leftRichType: RichType<LeftT>,\r\n rightRichType: RichType<RightT>,\r\n resultRichType: RichType<ResultT>,\r\n private _operation: (left: LeftT, right: RightT) => ResultT,\r\n private _className: string,\r\n config?: IFlowGraphBlockConfiguration\r\n ) {\r\n super(resultRichType, config);\r\n this.leftInput = this.registerDataInput(\"leftInput\", leftRichType);\r\n this.rightInput = this.registerDataInput(\"rightInput\", rightRichType);\r\n }\r\n\r\n public override _doOperation(context: FlowGraphContext): ResultT {\r\n return this._operation(this.leftInput.getValue(context), this.rightInput.getValue(context));\r\n }\r\n\r\n public getClassName(): string {\r\n return this._className;\r\n }\r\n}\r\n"]}
@@ -7,7 +7,7 @@ const CACHE_EXEC_ID_NAME = "cachedExecutionId";
7
7
  export class FlowGraphCachedOperationBlock extends FlowGraphBlock {
8
8
  constructor(outputRichType, config) {
9
9
  super(config);
10
- this.output = this._registerDataOutput("output", outputRichType);
10
+ this.output = this.registerDataOutput("output", outputRichType);
11
11
  }
12
12
  _updateOutputs(context) {
13
13
  const cachedExecutionId = context._getExecutionVariable(this, CACHE_EXEC_ID_NAME);
@@ -1 +1 @@
1
- {"version":3,"file":"flowGraphCachedOperationBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FlowGraph/Blocks/Data/flowGraphCachedOperationBlock.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAKtD,MAAM,UAAU,GAAG,sBAAsB,CAAC;AAC1C,MAAM,kBAAkB,GAAG,mBAAmB,CAAC;AAE/C;;GAEG;AACH,MAAM,OAAgB,6BAAuC,SAAQ,cAAc;IAM/E,YAAY,cAAiC,EAAE,MAAqC;QAChF,KAAK,CAAC,MAAM,CAAC,CAAC;QAEd,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,mBAAmB,CAAC,QAAQ,EAAE,cAAc,CAAC,CAAC;IACrE,CAAC;IASM,cAAc,CAAC,OAAyB;QAC3C,MAAM,iBAAiB,GAAG,OAAO,CAAC,qBAAqB,CAAC,IAAI,EAAE,kBAAkB,CAAC,CAAC;QAClF,MAAM,WAAW,GAAG,OAAO,CAAC,qBAAqB,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;QACpE,IAAI,WAAW,KAAK,SAAS,IAAI,iBAAiB,KAAK,OAAO,CAAC,WAAW,EAAE;YACxE,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;SAC9C;aAAM;YACH,MAAM,eAAe,GAAG,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;YACnD,OAAO,CAAC,qBAAqB,CAAC,IAAI,EAAE,UAAU,EAAE,eAAe,CAAC,CAAC;YACjE,OAAO,CAAC,qBAAqB,CAAC,IAAI,EAAE,kBAAkB,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;YAC7E,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,eAAe,EAAE,OAAO,CAAC,CAAC;SAClD;IACL,CAAC;CACJ","sourcesContent":["import type { IFlowGraphBlockConfiguration } from \"../../flowGraphBlock\";\r\nimport { FlowGraphBlock } from \"../../flowGraphBlock\";\r\nimport type { FlowGraphContext } from \"../../flowGraphContext\";\r\nimport type { FlowGraphDataConnection } from \"../../flowGraphDataConnection\";\r\nimport type { RichType } from \"../../flowGraphRichTypes\";\r\n\r\nconst CACHE_NAME = \"cachedOperationValue\";\r\nconst CACHE_EXEC_ID_NAME = \"cachedExecutionId\";\r\n\r\n/**\r\n * @experimental\r\n */\r\nexport abstract class FlowGraphCachedOperationBlock<OutputT> extends FlowGraphBlock {\r\n /**\r\n * The output of the operation\r\n */\r\n public readonly output: FlowGraphDataConnection<OutputT>;\r\n\r\n constructor(outputRichType: RichType<OutputT>, config?: IFlowGraphBlockConfiguration) {\r\n super(config);\r\n\r\n this.output = this._registerDataOutput(\"output\", outputRichType);\r\n }\r\n\r\n /**\r\n * @internal\r\n * Operation to realize\r\n * @param context the graph context\r\n */\r\n public abstract _doOperation(context: FlowGraphContext): OutputT;\r\n\r\n public _updateOutputs(context: FlowGraphContext) {\r\n const cachedExecutionId = context._getExecutionVariable(this, CACHE_EXEC_ID_NAME);\r\n const cachedValue = context._getExecutionVariable(this, CACHE_NAME);\r\n if (cachedValue !== undefined && cachedExecutionId === context.executionId) {\r\n this.output.setValue(cachedValue, context);\r\n } else {\r\n const calculatedValue = this._doOperation(context);\r\n context._setExecutionVariable(this, CACHE_NAME, calculatedValue);\r\n context._setExecutionVariable(this, CACHE_EXEC_ID_NAME, context.executionId);\r\n this.output.setValue(calculatedValue, context);\r\n }\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"flowGraphCachedOperationBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FlowGraph/Blocks/Data/flowGraphCachedOperationBlock.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAKtD,MAAM,UAAU,GAAG,sBAAsB,CAAC;AAC1C,MAAM,kBAAkB,GAAG,mBAAmB,CAAC;AAE/C;;GAEG;AACH,MAAM,OAAgB,6BAAuC,SAAQ,cAAc;IAM/E,YAAY,cAAiC,EAAE,MAAqC;QAChF,KAAK,CAAC,MAAM,CAAC,CAAC;QAEd,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,kBAAkB,CAAC,QAAQ,EAAE,cAAc,CAAC,CAAC;IACpE,CAAC;IASM,cAAc,CAAC,OAAyB;QAC3C,MAAM,iBAAiB,GAAG,OAAO,CAAC,qBAAqB,CAAC,IAAI,EAAE,kBAAkB,CAAC,CAAC;QAClF,MAAM,WAAW,GAAG,OAAO,CAAC,qBAAqB,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;QACpE,IAAI,WAAW,KAAK,SAAS,IAAI,iBAAiB,KAAK,OAAO,CAAC,WAAW,EAAE;YACxE,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;SAC9C;aAAM;YACH,MAAM,eAAe,GAAG,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;YACnD,OAAO,CAAC,qBAAqB,CAAC,IAAI,EAAE,UAAU,EAAE,eAAe,CAAC,CAAC;YACjE,OAAO,CAAC,qBAAqB,CAAC,IAAI,EAAE,kBAAkB,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;YAC7E,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,eAAe,EAAE,OAAO,CAAC,CAAC;SAClD;IACL,CAAC;CACJ","sourcesContent":["import type { IFlowGraphBlockConfiguration } from \"../../flowGraphBlock\";\r\nimport { FlowGraphBlock } from \"../../flowGraphBlock\";\r\nimport type { FlowGraphContext } from \"../../flowGraphContext\";\r\nimport type { FlowGraphDataConnection } from \"../../flowGraphDataConnection\";\r\nimport type { RichType } from \"../../flowGraphRichTypes\";\r\n\r\nconst CACHE_NAME = \"cachedOperationValue\";\r\nconst CACHE_EXEC_ID_NAME = \"cachedExecutionId\";\r\n\r\n/**\r\n * @experimental\r\n */\r\nexport abstract class FlowGraphCachedOperationBlock<OutputT> extends FlowGraphBlock {\r\n /**\r\n * The output of the operation\r\n */\r\n public readonly output: FlowGraphDataConnection<OutputT>;\r\n\r\n constructor(outputRichType: RichType<OutputT>, config?: IFlowGraphBlockConfiguration) {\r\n super(config);\r\n\r\n this.output = this.registerDataOutput(\"output\", outputRichType);\r\n }\r\n\r\n /**\r\n * @internal\r\n * Operation to realize\r\n * @param context the graph context\r\n */\r\n public abstract _doOperation(context: FlowGraphContext): OutputT;\r\n\r\n public _updateOutputs(context: FlowGraphContext) {\r\n const cachedExecutionId = context._getExecutionVariable(this, CACHE_EXEC_ID_NAME);\r\n const cachedValue = context._getExecutionVariable(this, CACHE_NAME);\r\n if (cachedValue !== undefined && cachedExecutionId === context.executionId) {\r\n this.output.setValue(cachedValue, context);\r\n } else {\r\n const calculatedValue = this._doOperation(context);\r\n context._setExecutionVariable(this, CACHE_NAME, calculatedValue);\r\n context._setExecutionVariable(this, CACHE_EXEC_ID_NAME, context.executionId);\r\n this.output.setValue(calculatedValue, context);\r\n }\r\n }\r\n}\r\n"]}
@@ -8,10 +8,10 @@ import { RegisterClass } from "../../../Misc/typeStore.js";
8
8
  export class FlowGraphConditionalDataBlock extends FlowGraphBlock {
9
9
  constructor(config) {
10
10
  super(config);
11
- this.condition = this._registerDataInput("condition", RichTypeBoolean);
12
- this.trueValue = this._registerDataInput("trueValue", RichTypeAny);
13
- this.falseValue = this._registerDataInput("falseValue", RichTypeAny);
14
- this.output = this._registerDataOutput("output", RichTypeAny);
11
+ this.condition = this.registerDataInput("condition", RichTypeBoolean);
12
+ this.trueValue = this.registerDataInput("trueValue", RichTypeAny);
13
+ this.falseValue = this.registerDataInput("falseValue", RichTypeAny);
14
+ this.output = this.registerDataOutput("output", RichTypeAny);
15
15
  }
16
16
  /**
17
17
  * @internal
@@ -1 +1 @@
1
- {"version":3,"file":"flowGraphConditionalDataBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FlowGraph/Blocks/Data/flowGraphConditionalDataBlock.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAExE,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD;;;GAGG;AACH,MAAM,OAAO,6BAAiC,SAAQ,cAAc;IAmBhE,YAAY,MAAqC;QAC7C,KAAK,CAAC,MAAM,CAAC,CAAC;QAEd,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,kBAAkB,CAAC,WAAW,EAAE,eAAe,CAAC,CAAC;QACvE,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,kBAAkB,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;QACnE,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,kBAAkB,CAAC,YAAY,EAAE,WAAW,CAAC,CAAC;QAErE,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,mBAAmB,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;IAClE,CAAC;IAED;;OAEG;IACI,cAAc,CAAC,OAAyB;QAC3C,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,CAAC;IAC3I,CAAC;IAEM,YAAY;QACf,OAAO,wBAAwB,CAAC;IACpC,CAAC;CACJ;AACD,aAAa,CAAC,wBAAwB,EAAE,6BAA6B,CAAC,CAAC","sourcesContent":["import type { FlowGraphContext } from \"../../flowGraphContext\";\r\nimport { FlowGraphBlock } from \"../../flowGraphBlock\";\r\nimport type { FlowGraphDataConnection } from \"../../flowGraphDataConnection\";\r\nimport { RichTypeBoolean, RichTypeAny } from \"../../flowGraphRichTypes\";\r\nimport type { IFlowGraphBlockConfiguration } from \"../../flowGraphBlock\";\r\nimport { RegisterClass } from \"../../../Misc/typeStore\";\r\n/**\r\n * @experimental\r\n * Block that returns a value based on a condition.\r\n */\r\nexport class FlowGraphConditionalDataBlock<T> extends FlowGraphBlock {\r\n /**\r\n * Input connection: The condition to check.\r\n */\r\n public readonly condition: FlowGraphDataConnection<boolean>;\r\n /**\r\n * Input connection: The value to return if the condition is true.\r\n */\r\n public readonly trueValue: FlowGraphDataConnection<T>;\r\n /**\r\n * Input connection: The value to return if the condition is false.\r\n */\r\n public readonly falseValue: FlowGraphDataConnection<T>;\r\n\r\n /**\r\n * Output connection: The value that was returned.\r\n */\r\n public readonly output: FlowGraphDataConnection<T>;\r\n\r\n constructor(config?: IFlowGraphBlockConfiguration) {\r\n super(config);\r\n\r\n this.condition = this._registerDataInput(\"condition\", RichTypeBoolean);\r\n this.trueValue = this._registerDataInput(\"trueValue\", RichTypeAny);\r\n this.falseValue = this._registerDataInput(\"falseValue\", RichTypeAny);\r\n\r\n this.output = this._registerDataOutput(\"output\", RichTypeAny);\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _updateOutputs(context: FlowGraphContext): void {\r\n this.output.setValue(this.condition.getValue(context) ? this.trueValue.getValue(context) : this.falseValue.getValue(context), context);\r\n }\r\n\r\n public getClassName(): string {\r\n return \"FGConditionalDataBlock\";\r\n }\r\n}\r\nRegisterClass(\"FGConditionalDataBlock\", FlowGraphConditionalDataBlock);\r\n"]}
1
+ {"version":3,"file":"flowGraphConditionalDataBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FlowGraph/Blocks/Data/flowGraphConditionalDataBlock.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAExE,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD;;;GAGG;AACH,MAAM,OAAO,6BAAiC,SAAQ,cAAc;IAmBhE,YAAY,MAAqC;QAC7C,KAAK,CAAC,MAAM,CAAC,CAAC;QAEd,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,iBAAiB,CAAC,WAAW,EAAE,eAAe,CAAC,CAAC;QACtE,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,iBAAiB,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;QAClE,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,iBAAiB,CAAC,YAAY,EAAE,WAAW,CAAC,CAAC;QAEpE,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,kBAAkB,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;IACjE,CAAC;IAED;;OAEG;IACI,cAAc,CAAC,OAAyB;QAC3C,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,CAAC;IAC3I,CAAC;IAEM,YAAY;QACf,OAAO,wBAAwB,CAAC;IACpC,CAAC;CACJ;AACD,aAAa,CAAC,wBAAwB,EAAE,6BAA6B,CAAC,CAAC","sourcesContent":["import type { FlowGraphContext } from \"../../flowGraphContext\";\r\nimport { FlowGraphBlock } from \"../../flowGraphBlock\";\r\nimport type { FlowGraphDataConnection } from \"../../flowGraphDataConnection\";\r\nimport { RichTypeBoolean, RichTypeAny } from \"../../flowGraphRichTypes\";\r\nimport type { IFlowGraphBlockConfiguration } from \"../../flowGraphBlock\";\r\nimport { RegisterClass } from \"../../../Misc/typeStore\";\r\n/**\r\n * @experimental\r\n * Block that returns a value based on a condition.\r\n */\r\nexport class FlowGraphConditionalDataBlock<T> extends FlowGraphBlock {\r\n /**\r\n * Input connection: The condition to check.\r\n */\r\n public readonly condition: FlowGraphDataConnection<boolean>;\r\n /**\r\n * Input connection: The value to return if the condition is true.\r\n */\r\n public readonly trueValue: FlowGraphDataConnection<T>;\r\n /**\r\n * Input connection: The value to return if the condition is false.\r\n */\r\n public readonly falseValue: FlowGraphDataConnection<T>;\r\n\r\n /**\r\n * Output connection: The value that was returned.\r\n */\r\n public readonly output: FlowGraphDataConnection<T>;\r\n\r\n constructor(config?: IFlowGraphBlockConfiguration) {\r\n super(config);\r\n\r\n this.condition = this.registerDataInput(\"condition\", RichTypeBoolean);\r\n this.trueValue = this.registerDataInput(\"trueValue\", RichTypeAny);\r\n this.falseValue = this.registerDataInput(\"falseValue\", RichTypeAny);\r\n\r\n this.output = this.registerDataOutput(\"output\", RichTypeAny);\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _updateOutputs(context: FlowGraphContext): void {\r\n this.output.setValue(this.condition.getValue(context) ? this.trueValue.getValue(context) : this.falseValue.getValue(context), context);\r\n }\r\n\r\n public getClassName(): string {\r\n return \"FGConditionalDataBlock\";\r\n }\r\n}\r\nRegisterClass(\"FGConditionalDataBlock\", FlowGraphConditionalDataBlock);\r\n"]}
@@ -9,7 +9,7 @@ export class FlowGraphConstantBlock extends FlowGraphBlock {
9
9
  constructor(config) {
10
10
  super(config);
11
11
  this.config = config;
12
- this.output = this._registerDataOutput("output", getRichTypeFromValue(config.value));
12
+ this.output = this.registerDataOutput("output", getRichTypeFromValue(config.value));
13
13
  }
14
14
  _updateOutputs(context) {
15
15
  this.output.setValue(this.config.value, context);
@@ -1 +1 @@
1
- {"version":3,"file":"flowGraphConstantBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FlowGraph/Blocks/Data/flowGraphConstantBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,gCAAsC;AAG/D,OAAO,EAAE,oBAAoB,EAAE,oCAA0C;AAEzE,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAWxD;;;GAGG;AACH,MAAM,OAAO,sBAA0B,SAAQ,cAAc;IAMzD,YAAmB,MAA+C;QAC9D,KAAK,CAAC,MAAM,CAAC,CAAC;QADC,WAAM,GAAN,MAAM,CAAyC;QAG9D,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,mBAAmB,CAAC,QAAQ,EAAE,oBAAoB,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;IACzF,CAAC;IAEM,cAAc,CAAC,OAAyB;QAC3C,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;IACrD,CAAC;IAEM,YAAY;QACf,OAAO,iBAAiB,CAAC;IAC7B,CAAC;CACJ;AACD,aAAa,CAAC,iBAAiB,EAAE,sBAAsB,CAAC,CAAC","sourcesContent":["import { FlowGraphBlock } from \"core/FlowGraph/flowGraphBlock\";\r\nimport type { FlowGraphContext } from \"core/FlowGraph/flowGraphContext\";\r\nimport type { FlowGraphDataConnection } from \"core/FlowGraph/flowGraphDataConnection\";\r\nimport { getRichTypeFromValue } from \"core/FlowGraph/flowGraphRichTypes\";\r\nimport type { IFlowGraphBlockConfiguration } from \"../../flowGraphBlock\";\r\nimport { RegisterClass } from \"../../../Misc/typeStore\";\r\n/**\r\n * @experimental\r\n * Configuration for a constant block.\r\n */\r\nexport interface IFlowGraphConstantBlockConfiguration<T> extends IFlowGraphBlockConfiguration {\r\n /**\r\n * The value of the constant.\r\n */\r\n value: T;\r\n}\r\n/**\r\n * @experimental\r\n * Block that returns a constant value.\r\n */\r\nexport class FlowGraphConstantBlock<T> extends FlowGraphBlock {\r\n /**\r\n * Output connection: The constant value.\r\n */\r\n public readonly output: FlowGraphDataConnection<T>;\r\n\r\n constructor(public config: IFlowGraphConstantBlockConfiguration<T>) {\r\n super(config);\r\n\r\n this.output = this._registerDataOutput(\"output\", getRichTypeFromValue(config.value));\r\n }\r\n\r\n public _updateOutputs(context: FlowGraphContext): void {\r\n this.output.setValue(this.config.value, context);\r\n }\r\n\r\n public getClassName(): string {\r\n return \"FGConstantBlock\";\r\n }\r\n}\r\nRegisterClass(\"FGConstantBlock\", FlowGraphConstantBlock);\r\n"]}
1
+ {"version":3,"file":"flowGraphConstantBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FlowGraph/Blocks/Data/flowGraphConstantBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,gCAAsC;AAG/D,OAAO,EAAE,oBAAoB,EAAE,oCAA0C;AAEzE,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAWxD;;;GAGG;AACH,MAAM,OAAO,sBAA0B,SAAQ,cAAc;IAMzD,YAAmB,MAA+C;QAC9D,KAAK,CAAC,MAAM,CAAC,CAAC;QADC,WAAM,GAAN,MAAM,CAAyC;QAG9D,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,kBAAkB,CAAC,QAAQ,EAAE,oBAAoB,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;IACxF,CAAC;IAEM,cAAc,CAAC,OAAyB;QAC3C,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;IACrD,CAAC;IAEM,YAAY;QACf,OAAO,iBAAiB,CAAC;IAC7B,CAAC;CACJ;AACD,aAAa,CAAC,iBAAiB,EAAE,sBAAsB,CAAC,CAAC","sourcesContent":["import { FlowGraphBlock } from \"core/FlowGraph/flowGraphBlock\";\r\nimport type { FlowGraphContext } from \"core/FlowGraph/flowGraphContext\";\r\nimport type { FlowGraphDataConnection } from \"core/FlowGraph/flowGraphDataConnection\";\r\nimport { getRichTypeFromValue } from \"core/FlowGraph/flowGraphRichTypes\";\r\nimport type { IFlowGraphBlockConfiguration } from \"../../flowGraphBlock\";\r\nimport { RegisterClass } from \"../../../Misc/typeStore\";\r\n/**\r\n * @experimental\r\n * Configuration for a constant block.\r\n */\r\nexport interface IFlowGraphConstantBlockConfiguration<T> extends IFlowGraphBlockConfiguration {\r\n /**\r\n * The value of the constant.\r\n */\r\n value: T;\r\n}\r\n/**\r\n * @experimental\r\n * Block that returns a constant value.\r\n */\r\nexport class FlowGraphConstantBlock<T> extends FlowGraphBlock {\r\n /**\r\n * Output connection: The constant value.\r\n */\r\n public readonly output: FlowGraphDataConnection<T>;\r\n\r\n constructor(public config: IFlowGraphConstantBlockConfiguration<T>) {\r\n super(config);\r\n\r\n this.output = this.registerDataOutput(\"output\", getRichTypeFromValue(config.value));\r\n }\r\n\r\n public _updateOutputs(context: FlowGraphContext): void {\r\n this.output.setValue(this.config.value, context);\r\n }\r\n\r\n public getClassName(): string {\r\n return \"FGConstantBlock\";\r\n }\r\n}\r\nRegisterClass(\"FGConstantBlock\", FlowGraphConstantBlock);\r\n"]}
@@ -12,10 +12,10 @@ export class FlowGraphCoordinateTransformBlock extends FlowGraphBlock {
12
12
  */
13
13
  constructor(config) {
14
14
  super(config);
15
- this.sourceSystem = this._registerDataInput("sourceSystem", RichTypeAny);
16
- this.destinationSystem = this._registerDataInput("destinationSystem", RichTypeAny);
17
- this.inputCoordinates = this._registerDataInput("inputCoordinates", RichTypeVector3);
18
- this.outputCoordinates = this._registerDataOutput("outputCoordinates", RichTypeVector3);
15
+ this.sourceSystem = this.registerDataInput("sourceSystem", RichTypeAny);
16
+ this.destinationSystem = this.registerDataInput("destinationSystem", RichTypeAny);
17
+ this.inputCoordinates = this.registerDataInput("inputCoordinates", RichTypeVector3);
18
+ this.outputCoordinates = this.registerDataOutput("outputCoordinates", RichTypeVector3);
19
19
  }
20
20
  _updateOutputs(_context) {
21
21
  const sourceSystemValue = this.sourceSystem.getValue(_context);
@@ -1 +1 @@
1
- {"version":3,"file":"flowGraphCoordinateTransformBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FlowGraph/Blocks/Data/flowGraphCoordinateTransformBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAGtD,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AACxE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAGjE,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD;;;GAGG;AACH,MAAM,OAAO,iCAAkC,SAAQ,cAAc;IAkBjE;;OAEG;IACH,YAAY,MAAqC;QAC7C,KAAK,CAAC,MAAM,CAAC,CAAC;QAEd,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,kBAAkB,CAAC,cAAc,EAAE,WAAW,CAAC,CAAC;QACzE,IAAI,CAAC,iBAAiB,GAAG,IAAI,CAAC,kBAAkB,CAAC,mBAAmB,EAAE,WAAW,CAAC,CAAC;QACnF,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC,kBAAkB,CAAC,kBAAkB,EAAE,eAAe,CAAC,CAAC;QACrF,IAAI,CAAC,iBAAiB,GAAG,IAAI,CAAC,mBAAmB,CAAC,mBAAmB,EAAE,eAAe,CAAC,CAAC;IAC5F,CAAC;IAEM,cAAc,CAAC,QAA0B;QAC5C,MAAM,iBAAiB,GAAG,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;QAC/D,MAAM,sBAAsB,GAAG,IAAI,CAAC,iBAAiB,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;QACzE,MAAM,qBAAqB,GAAG,IAAI,CAAC,gBAAgB,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;QAEvE,qDAAqD;QACrD,MAAM,WAAW,GAAG,iBAAiB,CAAC,cAAc,EAAE,CAAC;QACvD,0DAA0D;QAC1D,MAAM,gBAAgB,GAAG,sBAAsB,CAAC,cAAc,EAAE,CAAC;QACjE,MAAM,uBAAuB,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CAAC;QAChF,0DAA0D;QAC1D,uBAAuB,CAAC,MAAM,EAAE,CAAC;QAEjC,MAAM,mBAAmB,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;QACjD,0EAA0E;QAC1E,uBAAuB,CAAC,aAAa,CAAC,WAAW,EAAE,mBAAmB,CAAC,CAAC;QACxE,MAAM,sBAAsB,GAAG,IAAI,CAAC,iBAAiB,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;QAEzE,OAAO,CAAC,yBAAyB,CAAC,qBAAqB,EAAE,mBAAmB,EAAE,sBAAsB,CAAC,CAAC;IAC1G,CAAC;IAEM,YAAY;QACf,OAAO,4BAA4B,CAAC;IACxC,CAAC;CACJ;AACD,aAAa,CAAC,4BAA4B,EAAE,iCAAiC,CAAC,CAAC","sourcesContent":["import { FlowGraphBlock } from \"../../flowGraphBlock\";\r\nimport type { FlowGraphContext } from \"../../flowGraphContext\";\r\nimport type { FlowGraphDataConnection } from \"../../flowGraphDataConnection\";\r\nimport { RichTypeAny, RichTypeVector3 } from \"../../flowGraphRichTypes\";\r\nimport { TmpVectors, Vector3 } from \"../../../Maths/math.vector\";\r\nimport type { TransformNode } from \"../../../Meshes/transformNode\";\r\nimport type { IFlowGraphBlockConfiguration } from \"../../flowGraphBlock\";\r\nimport { RegisterClass } from \"../../../Misc/typeStore\";\r\n/**\r\n * @experimental\r\n * This blocks transforms a vector from one coordinate system to another.\r\n */\r\nexport class FlowGraphCoordinateTransformBlock extends FlowGraphBlock {\r\n /**\r\n * Input connection: The source coordinate system.\r\n */\r\n public readonly sourceSystem: FlowGraphDataConnection<TransformNode>;\r\n /**\r\n * Input connection: The destination coordinate system.\r\n */\r\n public readonly destinationSystem: FlowGraphDataConnection<TransformNode>;\r\n /**\r\n * Input connection: The coordinates to transform.\r\n */\r\n public readonly inputCoordinates: FlowGraphDataConnection<Vector3>;\r\n /**\r\n * Output connection: The transformed coordinates.\r\n */\r\n public readonly outputCoordinates: FlowGraphDataConnection<Vector3>;\r\n\r\n /**\r\n * Creates a new FlowGraphCoordinateTransformBlock\r\n */\r\n constructor(config?: IFlowGraphBlockConfiguration) {\r\n super(config);\r\n\r\n this.sourceSystem = this._registerDataInput(\"sourceSystem\", RichTypeAny);\r\n this.destinationSystem = this._registerDataInput(\"destinationSystem\", RichTypeAny);\r\n this.inputCoordinates = this._registerDataInput(\"inputCoordinates\", RichTypeVector3);\r\n this.outputCoordinates = this._registerDataOutput(\"outputCoordinates\", RichTypeVector3);\r\n }\r\n\r\n public _updateOutputs(_context: FlowGraphContext): void {\r\n const sourceSystemValue = this.sourceSystem.getValue(_context);\r\n const destinationSystemValue = this.destinationSystem.getValue(_context);\r\n const inputCoordinatesValue = this.inputCoordinates.getValue(_context);\r\n\r\n // takes coordinates from source space to world space\r\n const sourceWorld = sourceSystemValue.getWorldMatrix();\r\n // takes coordinates from destination space to world space\r\n const destinationWorld = destinationSystemValue.getWorldMatrix();\r\n const destinationWorldInverse = TmpVectors.Matrix[0].copyFrom(destinationWorld);\r\n // takes coordinates from world space to destination space\r\n destinationWorldInverse.invert();\r\n\r\n const sourceToDestination = TmpVectors.Matrix[1];\r\n // takes coordinates from source space to world space to destination space\r\n destinationWorldInverse.multiplyToRef(sourceWorld, sourceToDestination);\r\n const outputCoordinatesValue = this.outputCoordinates.getValue(_context);\r\n\r\n Vector3.TransformCoordinatesToRef(inputCoordinatesValue, sourceToDestination, outputCoordinatesValue);\r\n }\r\n\r\n public getClassName(): string {\r\n return \"FGCoordinateTransformBlock\";\r\n }\r\n}\r\nRegisterClass(\"FGCoordinateTransformBlock\", FlowGraphCoordinateTransformBlock);\r\n"]}
1
+ {"version":3,"file":"flowGraphCoordinateTransformBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FlowGraph/Blocks/Data/flowGraphCoordinateTransformBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAGtD,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AACxE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAGjE,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD;;;GAGG;AACH,MAAM,OAAO,iCAAkC,SAAQ,cAAc;IAkBjE;;OAEG;IACH,YAAY,MAAqC;QAC7C,KAAK,CAAC,MAAM,CAAC,CAAC;QAEd,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,iBAAiB,CAAC,cAAc,EAAE,WAAW,CAAC,CAAC;QACxE,IAAI,CAAC,iBAAiB,GAAG,IAAI,CAAC,iBAAiB,CAAC,mBAAmB,EAAE,WAAW,CAAC,CAAC;QAClF,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC,iBAAiB,CAAC,kBAAkB,EAAE,eAAe,CAAC,CAAC;QACpF,IAAI,CAAC,iBAAiB,GAAG,IAAI,CAAC,kBAAkB,CAAC,mBAAmB,EAAE,eAAe,CAAC,CAAC;IAC3F,CAAC;IAEM,cAAc,CAAC,QAA0B;QAC5C,MAAM,iBAAiB,GAAG,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;QAC/D,MAAM,sBAAsB,GAAG,IAAI,CAAC,iBAAiB,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;QACzE,MAAM,qBAAqB,GAAG,IAAI,CAAC,gBAAgB,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;QAEvE,qDAAqD;QACrD,MAAM,WAAW,GAAG,iBAAiB,CAAC,cAAc,EAAE,CAAC;QACvD,0DAA0D;QAC1D,MAAM,gBAAgB,GAAG,sBAAsB,CAAC,cAAc,EAAE,CAAC;QACjE,MAAM,uBAAuB,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CAAC;QAChF,0DAA0D;QAC1D,uBAAuB,CAAC,MAAM,EAAE,CAAC;QAEjC,MAAM,mBAAmB,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;QACjD,0EAA0E;QAC1E,uBAAuB,CAAC,aAAa,CAAC,WAAW,EAAE,mBAAmB,CAAC,CAAC;QACxE,MAAM,sBAAsB,GAAG,IAAI,CAAC,iBAAiB,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;QAEzE,OAAO,CAAC,yBAAyB,CAAC,qBAAqB,EAAE,mBAAmB,EAAE,sBAAsB,CAAC,CAAC;IAC1G,CAAC;IAEM,YAAY;QACf,OAAO,4BAA4B,CAAC;IACxC,CAAC;CACJ;AACD,aAAa,CAAC,4BAA4B,EAAE,iCAAiC,CAAC,CAAC","sourcesContent":["import { FlowGraphBlock } from \"../../flowGraphBlock\";\r\nimport type { FlowGraphContext } from \"../../flowGraphContext\";\r\nimport type { FlowGraphDataConnection } from \"../../flowGraphDataConnection\";\r\nimport { RichTypeAny, RichTypeVector3 } from \"../../flowGraphRichTypes\";\r\nimport { TmpVectors, Vector3 } from \"../../../Maths/math.vector\";\r\nimport type { TransformNode } from \"../../../Meshes/transformNode\";\r\nimport type { IFlowGraphBlockConfiguration } from \"../../flowGraphBlock\";\r\nimport { RegisterClass } from \"../../../Misc/typeStore\";\r\n/**\r\n * @experimental\r\n * This blocks transforms a vector from one coordinate system to another.\r\n */\r\nexport class FlowGraphCoordinateTransformBlock extends FlowGraphBlock {\r\n /**\r\n * Input connection: The source coordinate system.\r\n */\r\n public readonly sourceSystem: FlowGraphDataConnection<TransformNode>;\r\n /**\r\n * Input connection: The destination coordinate system.\r\n */\r\n public readonly destinationSystem: FlowGraphDataConnection<TransformNode>;\r\n /**\r\n * Input connection: The coordinates to transform.\r\n */\r\n public readonly inputCoordinates: FlowGraphDataConnection<Vector3>;\r\n /**\r\n * Output connection: The transformed coordinates.\r\n */\r\n public readonly outputCoordinates: FlowGraphDataConnection<Vector3>;\r\n\r\n /**\r\n * Creates a new FlowGraphCoordinateTransformBlock\r\n */\r\n constructor(config?: IFlowGraphBlockConfiguration) {\r\n super(config);\r\n\r\n this.sourceSystem = this.registerDataInput(\"sourceSystem\", RichTypeAny);\r\n this.destinationSystem = this.registerDataInput(\"destinationSystem\", RichTypeAny);\r\n this.inputCoordinates = this.registerDataInput(\"inputCoordinates\", RichTypeVector3);\r\n this.outputCoordinates = this.registerDataOutput(\"outputCoordinates\", RichTypeVector3);\r\n }\r\n\r\n public _updateOutputs(_context: FlowGraphContext): void {\r\n const sourceSystemValue = this.sourceSystem.getValue(_context);\r\n const destinationSystemValue = this.destinationSystem.getValue(_context);\r\n const inputCoordinatesValue = this.inputCoordinates.getValue(_context);\r\n\r\n // takes coordinates from source space to world space\r\n const sourceWorld = sourceSystemValue.getWorldMatrix();\r\n // takes coordinates from destination space to world space\r\n const destinationWorld = destinationSystemValue.getWorldMatrix();\r\n const destinationWorldInverse = TmpVectors.Matrix[0].copyFrom(destinationWorld);\r\n // takes coordinates from world space to destination space\r\n destinationWorldInverse.invert();\r\n\r\n const sourceToDestination = TmpVectors.Matrix[1];\r\n // takes coordinates from source space to world space to destination space\r\n destinationWorldInverse.multiplyToRef(sourceWorld, sourceToDestination);\r\n const outputCoordinatesValue = this.outputCoordinates.getValue(_context);\r\n\r\n Vector3.TransformCoordinatesToRef(inputCoordinatesValue, sourceToDestination, outputCoordinatesValue);\r\n }\r\n\r\n public getClassName(): string {\r\n return \"FGCoordinateTransformBlock\";\r\n }\r\n}\r\nRegisterClass(\"FGCoordinateTransformBlock\", FlowGraphCoordinateTransformBlock);\r\n"]}
@@ -12,8 +12,8 @@ export class FlowGraphGetVariableBlock extends FlowGraphBlock {
12
12
  */
13
13
  constructor(config) {
14
14
  super(config);
15
- this.variableName = this._registerDataInput("variableName", RichTypeString);
16
- this.output = this._registerDataOutput("output", RichTypeAny);
15
+ this.variableName = this.registerDataInput("variableName", RichTypeString);
16
+ this.output = this.registerDataOutput("output", RichTypeAny);
17
17
  }
18
18
  /**
19
19
  * @internal
@@ -1 +1 @@
1
- {"version":3,"file":"flowGraphGetVariableBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FlowGraph/Blocks/Data/flowGraphGetVariableBlock.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvE,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAExD;;;GAGG;AACH,MAAM,OAAO,yBAA6B,SAAQ,cAAc;IAU5D;;;OAGG;IACH,YAAY,MAAqC;QAC7C,KAAK,CAAC,MAAM,CAAC,CAAC;QAEd,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,kBAAkB,CAAC,cAAc,EAAE,cAAc,CAAC,CAAC;QAC5E,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,mBAAmB,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;IAClE,CAAC;IAED;;OAEG;IACI,cAAc,CAAC,OAAyB;QAC3C,MAAM,iBAAiB,GAAG,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QAC9D,IAAI,OAAO,CAAC,WAAW,CAAC,iBAAiB,CAAC,EAAE;YACxC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,WAAW,CAAC,iBAAiB,CAAC,EAAE,OAAO,CAAC,CAAC;SACzE;IACL,CAAC;IAEM,YAAY;QACf,OAAO,oBAAoB,CAAC;IAChC,CAAC;CACJ;AACD,aAAa,CAAC,oBAAoB,EAAE,yBAAyB,CAAC,CAAC","sourcesContent":["import type { FlowGraphContext } from \"../../flowGraphContext\";\r\nimport type { IFlowGraphBlockConfiguration } from \"../../flowGraphBlock\";\r\nimport { FlowGraphBlock } from \"../../flowGraphBlock\";\r\nimport type { FlowGraphDataConnection } from \"../../flowGraphDataConnection\";\r\nimport { RichTypeString, RichTypeAny } from \"../../flowGraphRichTypes\";\r\nimport { RegisterClass } from \"../../../Misc/typeStore\";\r\n\r\n/**\r\n * A block that gets the value of a variable.\r\n * @experimental\r\n */\r\nexport class FlowGraphGetVariableBlock<T> extends FlowGraphBlock {\r\n /**\r\n * Input connection: The name of the variable to get.\r\n */\r\n public readonly variableName: FlowGraphDataConnection<string>;\r\n /**\r\n * Output connection: The value of the variable.\r\n */\r\n public readonly output: FlowGraphDataConnection<T>;\r\n\r\n /**\r\n * Construct a FlowGraphGetVariableBlock.\r\n * @param params optional construction parameters\r\n */\r\n constructor(config?: IFlowGraphBlockConfiguration) {\r\n super(config);\r\n\r\n this.variableName = this._registerDataInput(\"variableName\", RichTypeString);\r\n this.output = this._registerDataOutput(\"output\", RichTypeAny);\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _updateOutputs(context: FlowGraphContext): void {\r\n const variableNameValue = this.variableName.getValue(context);\r\n if (context.hasVariable(variableNameValue)) {\r\n this.output.setValue(context.getVariable(variableNameValue), context);\r\n }\r\n }\r\n\r\n public getClassName(): string {\r\n return \"FGGetVariableBlock\";\r\n }\r\n}\r\nRegisterClass(\"FGGetVariableBlock\", FlowGraphGetVariableBlock);\r\n"]}
1
+ {"version":3,"file":"flowGraphGetVariableBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FlowGraph/Blocks/Data/flowGraphGetVariableBlock.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvE,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAExD;;;GAGG;AACH,MAAM,OAAO,yBAA6B,SAAQ,cAAc;IAU5D;;;OAGG;IACH,YAAY,MAAqC;QAC7C,KAAK,CAAC,MAAM,CAAC,CAAC;QAEd,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,iBAAiB,CAAC,cAAc,EAAE,cAAc,CAAC,CAAC;QAC3E,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,kBAAkB,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;IACjE,CAAC;IAED;;OAEG;IACI,cAAc,CAAC,OAAyB;QAC3C,MAAM,iBAAiB,GAAG,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QAC9D,IAAI,OAAO,CAAC,WAAW,CAAC,iBAAiB,CAAC,EAAE;YACxC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,WAAW,CAAC,iBAAiB,CAAC,EAAE,OAAO,CAAC,CAAC;SACzE;IACL,CAAC;IAEM,YAAY;QACf,OAAO,oBAAoB,CAAC;IAChC,CAAC;CACJ;AACD,aAAa,CAAC,oBAAoB,EAAE,yBAAyB,CAAC,CAAC","sourcesContent":["import type { FlowGraphContext } from \"../../flowGraphContext\";\r\nimport type { IFlowGraphBlockConfiguration } from \"../../flowGraphBlock\";\r\nimport { FlowGraphBlock } from \"../../flowGraphBlock\";\r\nimport type { FlowGraphDataConnection } from \"../../flowGraphDataConnection\";\r\nimport { RichTypeString, RichTypeAny } from \"../../flowGraphRichTypes\";\r\nimport { RegisterClass } from \"../../../Misc/typeStore\";\r\n\r\n/**\r\n * A block that gets the value of a variable.\r\n * @experimental\r\n */\r\nexport class FlowGraphGetVariableBlock<T> extends FlowGraphBlock {\r\n /**\r\n * Input connection: The name of the variable to get.\r\n */\r\n public readonly variableName: FlowGraphDataConnection<string>;\r\n /**\r\n * Output connection: The value of the variable.\r\n */\r\n public readonly output: FlowGraphDataConnection<T>;\r\n\r\n /**\r\n * Construct a FlowGraphGetVariableBlock.\r\n * @param params optional construction parameters\r\n */\r\n constructor(config?: IFlowGraphBlockConfiguration) {\r\n super(config);\r\n\r\n this.variableName = this.registerDataInput(\"variableName\", RichTypeString);\r\n this.output = this.registerDataOutput(\"output\", RichTypeAny);\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _updateOutputs(context: FlowGraphContext): void {\r\n const variableNameValue = this.variableName.getValue(context);\r\n if (context.hasVariable(variableNameValue)) {\r\n this.output.setValue(context.getVariable(variableNameValue), context);\r\n }\r\n }\r\n\r\n public getClassName(): string {\r\n return \"FGGetVariableBlock\";\r\n }\r\n}\r\nRegisterClass(\"FGGetVariableBlock\", FlowGraphGetVariableBlock);\r\n"]}
@@ -8,7 +8,7 @@ export class FlowGraphUnaryOperationBlock extends FlowGraphCachedOperationBlock
8
8
  super(resultRichType, config);
9
9
  this._operation = _operation;
10
10
  this._className = _className;
11
- this.input = this._registerDataInput("input", inputRichType);
11
+ this.input = this.registerDataInput("input", inputRichType);
12
12
  }
13
13
  _doOperation(context) {
14
14
  return this._operation(this.input.getValue(context));
@@ -1 +1 @@
1
- {"version":3,"file":"flowGraphUnaryOperationBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FlowGraph/Blocks/Data/flowGraphUnaryOperationBlock.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,6BAA6B,EAAE,MAAM,iCAAiC,CAAC;AAEhF;;;GAGG;AACH,MAAM,OAAO,4BAA8C,SAAQ,6BAAsC;IAGrG,YACI,aAA+B,EAC/B,cAAiC,EACzB,UAAsC,EACtC,UAAkB,EAC1B,MAAqC;QAErC,KAAK,CAAC,cAAc,EAAE,MAAM,CAAC,CAAC;QAJtB,eAAU,GAAV,UAAU,CAA4B;QACtC,eAAU,GAAV,UAAU,CAAQ;QAI1B,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,kBAAkB,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC;IACjE,CAAC;IACe,YAAY,CAAC,OAAyB;QAClD,OAAO,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC;IACzD,CAAC;IAEM,YAAY;QACf,OAAO,IAAI,CAAC,UAAU,CAAC;IAC3B,CAAC;CACJ","sourcesContent":["import type { FlowGraphDataConnection } from \"../../flowGraphDataConnection\";\r\nimport type { IFlowGraphBlockConfiguration } from \"../../flowGraphBlock\";\r\nimport type { RichType } from \"../../flowGraphRichTypes\";\r\nimport type { FlowGraphContext } from \"../../flowGraphContext\";\r\nimport { FlowGraphCachedOperationBlock } from \"./flowGraphCachedOperationBlock\";\r\n\r\n/**\r\n * @experimental\r\n * The base block for all unary operation blocks. Receives an input of type InputT, and outputs a value of type ResultT.\r\n */\r\nexport class FlowGraphUnaryOperationBlock<InputT, ResultT> extends FlowGraphCachedOperationBlock<ResultT> {\r\n input: FlowGraphDataConnection<InputT>;\r\n\r\n constructor(\r\n inputRichType: RichType<InputT>,\r\n resultRichType: RichType<ResultT>,\r\n private _operation: (input: InputT) => ResultT,\r\n private _className: string,\r\n config?: IFlowGraphBlockConfiguration\r\n ) {\r\n super(resultRichType, config);\r\n this.input = this._registerDataInput(\"input\", inputRichType);\r\n }\r\n public override _doOperation(context: FlowGraphContext): ResultT {\r\n return this._operation(this.input.getValue(context));\r\n }\r\n\r\n public getClassName(): string {\r\n return this._className;\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"flowGraphUnaryOperationBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FlowGraph/Blocks/Data/flowGraphUnaryOperationBlock.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,6BAA6B,EAAE,MAAM,iCAAiC,CAAC;AAEhF;;;GAGG;AACH,MAAM,OAAO,4BAA8C,SAAQ,6BAAsC;IAGrG,YACI,aAA+B,EAC/B,cAAiC,EACzB,UAAsC,EACtC,UAAkB,EAC1B,MAAqC;QAErC,KAAK,CAAC,cAAc,EAAE,MAAM,CAAC,CAAC;QAJtB,eAAU,GAAV,UAAU,CAA4B;QACtC,eAAU,GAAV,UAAU,CAAQ;QAI1B,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,iBAAiB,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC;IAChE,CAAC;IACe,YAAY,CAAC,OAAyB;QAClD,OAAO,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC;IACzD,CAAC;IAEM,YAAY;QACf,OAAO,IAAI,CAAC,UAAU,CAAC;IAC3B,CAAC;CACJ","sourcesContent":["import type { FlowGraphDataConnection } from \"../../flowGraphDataConnection\";\r\nimport type { IFlowGraphBlockConfiguration } from \"../../flowGraphBlock\";\r\nimport type { RichType } from \"../../flowGraphRichTypes\";\r\nimport type { FlowGraphContext } from \"../../flowGraphContext\";\r\nimport { FlowGraphCachedOperationBlock } from \"./flowGraphCachedOperationBlock\";\r\n\r\n/**\r\n * @experimental\r\n * The base block for all unary operation blocks. Receives an input of type InputT, and outputs a value of type ResultT.\r\n */\r\nexport class FlowGraphUnaryOperationBlock<InputT, ResultT> extends FlowGraphCachedOperationBlock<ResultT> {\r\n input: FlowGraphDataConnection<InputT>;\r\n\r\n constructor(\r\n inputRichType: RichType<InputT>,\r\n resultRichType: RichType<ResultT>,\r\n private _operation: (input: InputT) => ResultT,\r\n private _className: string,\r\n config?: IFlowGraphBlockConfiguration\r\n ) {\r\n super(resultRichType, config);\r\n this.input = this.registerDataInput(\"input\", inputRichType);\r\n }\r\n public override _doOperation(context: FlowGraphContext): ResultT {\r\n return this._operation(this.input.getValue(context));\r\n }\r\n\r\n public getClassName(): string {\r\n return this._className;\r\n }\r\n}\r\n"]}
@@ -1,11 +1,12 @@
1
1
  import { FlowGraphEventBlock } from "../../flowGraphEventBlock";
2
- import type { FlowGraphContext } from "../../flowGraphContext.js";
2
+ import type { FlowGraphContext } from "../../flowGraphContext";
3
3
  import type { IFlowGraphBlockConfiguration } from "../../flowGraphBlock";
4
+ import type { FlowGraphPath } from "../../flowGraphPath";
4
5
  /**
5
6
  * @experimental
6
7
  */
7
8
  export interface IFlowGraphMeshPickEventBlockConfiguration extends IFlowGraphBlockConfiguration {
8
- meshVariableName: string;
9
+ path: FlowGraphPath;
9
10
  }
10
11
  /**
11
12
  * @experimental
@@ -13,9 +14,7 @@ export interface IFlowGraphMeshPickEventBlockConfiguration extends IFlowGraphBlo
13
14
  */
14
15
  export declare class FlowGraphMeshPickEventBlock extends FlowGraphEventBlock {
15
16
  config: IFlowGraphMeshPickEventBlockConfiguration;
16
- private _meshVariableName;
17
17
  constructor(config: IFlowGraphMeshPickEventBlockConfiguration);
18
- configure(): void;
19
18
  /**
20
19
  * @internal
21
20
  */
@@ -26,4 +25,5 @@ export declare class FlowGraphMeshPickEventBlock extends FlowGraphEventBlock {
26
25
  */
27
26
  _cancelPendingTasks(context: FlowGraphContext): void;
28
27
  getClassName(): string;
28
+ serialize(serializationObject?: any): void;
29
29
  }
@@ -1,26 +1,31 @@
1
+ import { AbstractMesh } from "../../../Meshes/abstractMesh.js";
1
2
  import { FlowGraphEventBlock } from "../../flowGraphEventBlock.js";
2
3
  import { PointerEventTypes } from "../../../Events/pointerEvents.js";
3
4
  import { RegisterClass } from "../../../Misc/typeStore.js";
5
+ import { Tools } from "../../../Misc/tools.js";
4
6
  /**
5
7
  * @experimental
6
8
  * A block that activates when a mesh is picked.
7
9
  */
8
10
  export class FlowGraphMeshPickEventBlock extends FlowGraphEventBlock {
9
11
  constructor(config) {
12
+ if (config.path.hasTemplateStrings) {
13
+ Tools.Warn("Template strings are not supported in the path of mesh pick event blocks.");
14
+ }
10
15
  super(config);
11
16
  this.config = config;
12
17
  }
13
- configure() {
14
- super.configure();
15
- this._meshVariableName = this.config.meshVariableName;
16
- }
17
18
  /**
18
19
  * @internal
19
20
  */
20
21
  _preparePendingTasks(context) {
21
22
  let pickObserver = context._getExecutionVariable(this, "meshPickObserver");
22
23
  if (!pickObserver) {
23
- const mesh = context.getVariable(this._meshVariableName);
24
+ const mesh = this.config.path.getProperty(context);
25
+ if (!mesh || !(mesh instanceof AbstractMesh)) {
26
+ throw new Error("Mesh pick event block requires a valid mesh");
27
+ }
28
+ context._setExecutionVariable(this, "mesh", mesh);
24
29
  pickObserver = mesh.getScene().onPointerObservable.add((pointerInfo) => {
25
30
  var _a;
26
31
  if (pointerInfo.type === PointerEventTypes.POINTERPICK && ((_a = pointerInfo.pickInfo) === null || _a === void 0 ? void 0 : _a.pickedMesh) === mesh) {
@@ -40,17 +45,22 @@ export class FlowGraphMeshPickEventBlock extends FlowGraphEventBlock {
40
45
  * @internal
41
46
  */
42
47
  _cancelPendingTasks(context) {
43
- const mesh = context.getVariable(this._meshVariableName);
48
+ const mesh = context._getExecutionVariable(this, "mesh");
44
49
  const pickObserver = context._getExecutionVariable(this, "meshPickObserver");
45
50
  const disposeObserver = context._getExecutionVariable(this, "meshDisposeObserver");
46
51
  mesh.getScene().onPointerObservable.remove(pickObserver);
47
52
  mesh.onDisposeObservable.remove(disposeObserver);
53
+ context._deleteExecutionVariable(this, "mesh");
48
54
  context._deleteExecutionVariable(this, "meshPickObserver");
49
55
  context._deleteExecutionVariable(this, "meshDisposeObserver");
50
56
  }
51
57
  getClassName() {
52
58
  return "FGMeshPickEventBlock";
53
59
  }
60
+ serialize(serializationObject) {
61
+ super.serialize(serializationObject);
62
+ serializationObject.config.path = this.config.path.serialize();
63
+ }
54
64
  }
55
65
  RegisterClass("FGMeshPickEventBlock", FlowGraphMeshPickEventBlock);
56
66
  //# sourceMappingURL=flowGraphMeshPickEventBlock.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"flowGraphMeshPickEventBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FlowGraph/Blocks/Event/flowGraphMeshPickEventBl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AAI,EAAE,qBAAqB,EAAE,eAAe,CAAC,CAAC;SAC/E;IACL,CAAC;IAEM,UAAU,CAAC,OAAyB;QACvC,IAAI,CAAC,mBAAmB,CAAC,OAAO,CAAC,CAAC;QAClC,OAAO,CAAC,mBAAmB,CAAC,IAAI,CAAC,CAAC;IACtC,CAAC;IAED;;OAEG;IACI,mBAAmB,CAAC,OAAyB;QAChD,MAAM,IAAI,GAAG,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,iBAAiB,CAAiB,CAAC;QACzE,MAAM,YAAY,GAAG,OAAO,CAAC,qBAAqB,CAAC,IAAI,EAAE,kBAAkB,CAAC,CAAC;QAC7E,MAAM,eAAe,GAAG,OAAO,CAAC,qBAAqB,CAAC,IAAI,EAAE,qBAAqB,CAAC,CAAC;QAEnF,IAAI,CAAC,QAAQ,EAAE,CAAC,mBAAmB,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;QACzD,IAAI,CAAC,mBAAmB,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC;QAEjD,OAAO,CAAC,wBAAwB,CAAC,IAAI,EAAE,kBAAkB,CAAC,CAAC;QAC3D,OAAO,CAAC,wBAAwB,CAAC,IAAI,EAAE,qBAAqB,CAAC,CAAC;IAClE,CAAC;IAEM,YAAY;QACf,OAAO,sBAAsB,CAAC;IAClC,CAAC;CACJ;AACD,aAAa,CAAC,sBAAsB,EAAE,2BAA2B,CAAC,CAAC","sourcesContent":["import type { AbstractMesh } from \"../../../Meshes/abstractMesh\";\r\nimport { FlowGraphEventBlock } from \"../../flowGraphEventBlock\";\r\nimport { PointerEventTypes } from \"../../../Events/pointerEvents\";\r\nimport type { FlowGraphContext } from \"core/FlowGraph/flowGraphContext\";\r\nimport type { IFlowGraphBlockConfiguration } from \"../../flowGraphBlock\";\r\nimport { RegisterClass } from \"../../../Misc/typeStore\";\r\n/**\r\n * @experimental\r\n */\r\nexport interface IFlowGraphMeshPickEventBlockConfiguration extends IFlowGraphBlockConfiguration {\r\n meshVariableName: string;\r\n}\r\n/**\r\n * @experimental\r\n * A block that activates when a mesh is picked.\r\n */\r\nexport class FlowGraphMeshPickEventBlock extends FlowGraphEventBlock {\r\n private _meshVariableName: string;\r\n\r\n public constructor(public config: IFlowGraphMeshPickEventBlockConfiguration) {\r\n super(config);\r\n }\r\n\r\n public configure() {\r\n super.configure();\r\n this._meshVariableName = this.config.meshVariableName;\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _preparePendingTasks(context: FlowGraphContext): void {\r\n let pickObserver = context._getExecutionVariable(this, \"meshPickObserver\");\r\n if (!pickObserver) {\r\n const mesh = context.getVariable(this._meshVariableName) as AbstractMesh;\r\n pickObserver = mesh.getScene().onPointerObservable.add((pointerInfo) => {\r\n if (pointerInfo.type === PointerEventTypes.POINTERPICK && pointerInfo.pickInfo?.pickedMesh === mesh) {\r\n this._execute(context);\r\n }\r\n });\r\n const disposeObserver = mesh.onDisposeObservable.add(() => this._onDispose);\r\n context._setExecutionVariable(this, \"meshPickObserver\", pickObserver);\r\n context._setExecutionVariable(this, \"meshDisposeObserver\", disposeObserver);\r\n }\r\n }\r\n\r\n public _onDispose(context: FlowGraphContext) {\r\n this._cancelPendingTasks(context);\r\n context._removePendingBlock(this);\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _cancelPendingTasks(context: FlowGraphContext): void {\r\n const mesh = context.getVariable(this._meshVariableName) as AbstractMesh;\r\n const pickObserver = context._getExecutionVariable(this, \"meshPickObserver\");\r\n const disposeObserver = context._getExecutionVariable(this, \"meshDisposeObserver\");\r\n\r\n mesh.getScene().onPointerObservable.remove(pickObserver);\r\n mesh.onDisposeObservable.remove(disposeObserver);\r\n\r\n context._deleteExecutionVariable(this, \"meshPickObserver\");\r\n context._deleteExecutionVariable(this, \"meshDisposeObserver\");\r\n }\r\n\r\n public getClassName(): string {\r\n return \"FGMeshPickEventBlock\";\r\n }\r\n}\r\nRegisterClass(\"FGMeshPickEventBlock\", FlowGraphMeshPickEventBlock);\r\n"]}
1
+ {"version":3,"file":"flowGraphMeshPickEventBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FlowGraph/Blocks/Event/flowGraphMeshPickEventBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAGlE,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAExD,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAO5C;;;GAGG;AACH,MAAM,OAAO,2BAA4B,SAAQ,mBAAmB;IAChE,YAA0B,MAAiD;QACvE,IAAI,MAAM,CAAC,IAAI,CAAC,kBAAkB,EAAE;YAChC,KAAK,CAAC,IAAI,CAAC,2EAA2E,CAAC,CAAC;SAC3F;QACD,KAAK,CAAC,MAAM,CAAC,CAAC;QAJQ,WAAM,GAAN,MAAM,CAA2C;IAK3E,CAAC;IAED;;OAEG;IACI,oBAAoB,CAAC,OAAyB;QACjD,IAAI,YAAY,GAAG,OAAO,CAAC,qBAAqB,CAAC,IAAI,EAAE,kBAAkB,CAAC,CAAC;QAC3E,IAAI,CAAC,YAAY,EAAE;YACf,MAAM,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;YACnD,IAAI,CAAC,IAAI,IAAI,CAAC,CAAC,IAAI,YAAY,YAAY,CAAC,EAAE;gBAC1C,MAAM,IAAI,KAAK,CAAC,6CAA6C,CAAC,CAAC;aAClE;YACD,OAAO,CAAC,qBAAqB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;YAClD,YAAY,GAAG,IAAI,CAAC,QAAQ,EAAE,CAAC,mBAAmB,CAAC,GAAG,CAAC,CAAC,WAAW,EAAE,EAAE;;gBACnE,IAAI,WAAW,CAAC,IA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ClE,CAAC;IAEM,YAAY;QACf,OAAO,sBAAsB,CAAC;IAClC,CAAC;IAEM,SAAS,CAAC,mBAAyB;QACtC,KAAK,CAAC,SAAS,CAAC,mBAAmB,CAAC,CAAC;QACrC,mBAAmB,CAAC,MAAM,CAAC,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC;IACnE,CAAC;CACJ;AACD,aAAa,CAAC,sBAAsB,EAAE,2BAA2B,CAAC,CAAC","sourcesContent":["import { AbstractMesh } from \"../../../Meshes/abstractMesh\";\r\nimport { FlowGraphEventBlock } from \"../../flowGraphEventBlock\";\r\nimport { PointerEventTypes } from \"../../../Events/pointerEvents\";\r\nimport type { FlowGraphContext } from \"../../flowGraphContext\";\r\nimport type { IFlowGraphBlockConfiguration } from \"../../flowGraphBlock\";\r\nimport { RegisterClass } from \"../../../Misc/typeStore\";\r\nimport type { FlowGraphPath } from \"../../flowGraphPath\";\r\nimport { Tools } from \"../../../Misc/tools\";\r\n/**\r\n * @experimental\r\n */\r\nexport interface IFlowGraphMeshPickEventBlockConfiguration extends IFlowGraphBlockConfiguration {\r\n path: FlowGraphPath;\r\n}\r\n/**\r\n * @experimental\r\n * A block that activates when a mesh is picked.\r\n */\r\nexport class FlowGraphMeshPickEventBlock extends FlowGraphEventBlock {\r\n public constructor(public config: IFlowGraphMeshPickEventBlockConfiguration) {\r\n if (config.path.hasTemplateStrings) {\r\n Tools.Warn(\"Template strings are not supported in the path of mesh pick event blocks.\");\r\n }\r\n super(config);\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _preparePendingTasks(context: FlowGraphContext): void {\r\n let pickObserver = context._getExecutionVariable(this, \"meshPickObserver\");\r\n if (!pickObserver) {\r\n const mesh = this.config.path.getProperty(context);\r\n if (!mesh || !(mesh instanceof AbstractMesh)) {\r\n throw new Error(\"Mesh pick event block requires a valid mesh\");\r\n }\r\n context._setExecutionVariable(this, \"mesh\", mesh);\r\n pickObserver = mesh.getScene().onPointerObservable.add((pointerInfo) => {\r\n if (pointerInfo.type === PointerEventTypes.POINTERPICK && pointerInfo.pickInfo?.pickedMesh === mesh) {\r\n this._execute(context);\r\n }\r\n });\r\n const disposeObserver = mesh.onDisposeObservable.add(() => this._onDispose);\r\n context._setExecutionVariable(this, \"meshPickObserver\", pickObserver);\r\n context._setExecutionVariable(this, \"meshDisposeObserver\", disposeObserver);\r\n }\r\n }\r\n\r\n public _onDispose(context: FlowGraphContext) {\r\n this._cancelPendingTasks(context);\r\n context._removePendingBlock(this);\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _cancelPendingTasks(context: FlowGraphContext): void {\r\n const mesh = context._getExecutionVariable(this, \"mesh\");\r\n const pickObserver = context._getExecutionVariable(this, \"meshPickObserver\");\r\n const disposeObserver = context._getExecutionVariable(this, \"meshDisposeObserver\");\r\n\r\n mesh.getScene().onPointerObservable.remove(pickObserver);\r\n mesh.onDisposeObservable.remove(disposeObserver);\r\n\r\n context._deleteExecutionVariable(this, \"mesh\");\r\n context._deleteExecutionVariable(this, \"meshPickObserver\");\r\n context._deleteExecutionVariable(this, \"meshDisposeObserver\");\r\n }\r\n\r\n public getClassName(): string {\r\n return \"FGMeshPickEventBlock\";\r\n }\r\n\r\n public serialize(serializationObject?: any): void {\r\n super.serialize(serializationObject);\r\n serializationObject.config.path = this.config.path.serialize();\r\n }\r\n}\r\nRegisterClass(\"FGMeshPickEventBlock\", FlowGraphMeshPickEventBlock);\r\n"]}
@@ -24,4 +24,5 @@ export declare class FlowGraphReceiveCustomEventBlock extends FlowGraphEventBloc
24
24
  _preparePendingTasks(context: FlowGraphContext): void;
25
25
  _cancelPendingTasks(context: FlowGraphContext): void;
26
26
  getClassName(): string;
27
+ serialize(serializationObject?: any): void;
27
28
  }
@@ -10,7 +10,7 @@ export class FlowGraphReceiveCustomEventBlock extends FlowGraphEventBlock {
10
10
  constructor(config) {
11
11
  super(config);
12
12
  this.config = config;
13
- this.eventData = this._registerDataOutput("eventData", RichTypeAny);
13
+ this.eventData = this.registerDataOutput("eventData", RichTypeAny);
14
14
  }
15
15
  _preparePendingTasks(context) {
16
16
  const observable = context.configuration.coordinator.getCustomEventObservable(this.config.eventId);
@@ -31,6 +31,10 @@ export class FlowGraphReceiveCustomEventBlock extends FlowGraphEventBlock {
31
31
  getClassName() {
32
32
  return "FGReceiveCustomEventBlock";
33
33
  }
34
+ serialize(serializationObject) {
35
+ super.serialize(serializationObject);
36
+ serializationObject.eventId = this.config.eventId;
37
+ }
34
38
  }
35
39
  RegisterClass("FGReceiveCustomEventBlock", FlowGraphReceiveCustomEventBlock);
36
40
  //# sourceMappingURL=flowGraphReceiveCustomEventBlock.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"flowGraphReceiveCustomEventBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FlowGraph/Blocks/Event/flowGraphReceiveCustomEventBlock.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAEhE,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAE5C,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAEvD,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AASxD;;;GAGG;AACH,MAAM,OAAO,gCAAiC,SAAQ,mBAAmB;IAQrE,YAAmB,MAAsD;QACrE,KAAK,CAAC,MAAM,CAAC,CAAC;QADC,WAAM,GAAN,MAAM,CAAgD;QAErE,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,mBAAmB,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;IACxE,CAAC;IACM,oBAAoB,CAAC,OAAyB;QACjD,MAAM,UAAU,GAAG,OAAO,CAAC,aAAa,CAAC,WAAW,CAAC,wBAAwB,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QACnG,IAAI,CAAC,cAAc,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE;YAC/C,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;YAC5C,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QAC3B,CAAC,CAAC,CAAC;IACP,CAAC;IACM,mBAAmB,CAAC,OAAyB;QAChD,MAAM,UAAU,GAAG,OAAO,CAAC,aAAa,CAAC,WAAW,CAAC,wBAAwB,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QACnG,IAAI,UAAU,EAAE;YACZ,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;SAC1C;aAAM;YACH,KAAK,CAAC,IAAI,CAAC,kEAAkE,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC,CAAC;SACvG;IACL,CAAC;IAEM,YAAY;QACf,OAAO,2BAA2B,CAAC;IACvC,CAAC;CACJ;AACD,aAAa,CAAC,2BAA2B,EAAE,gCAAgC,CAAC,CAAC","sourcesContent":["import type { Observer } from \"../../../Misc/observable\";\r\nimport type { FlowGraphContext } from \"../../flowGraphContext\";\r\nimport { FlowGraphEventBlock } from \"../../flowGraphEventBlock\";\r\nimport type { Nullable } from \"../../../types\";\r\nimport { Tools } from \"../../../Misc/tools\";\r\nimport type { FlowGraphDataConnection } from \"../../flowGraphDataConnection\";\r\nimport { RichTypeAny } from \"../../flowGraphRichTypes\";\r\nimport type { IFlowGraphBlockConfiguration } from \"../../flowGraphBlock\";\r\nimport { RegisterClass } from \"../../../Misc/typeStore\";\r\n/**\r\n * @experimental\r\n * Parameters used to create a FlowGraphReceiveCustomEventBlock.\r\n */\r\nexport interface IFlowGraphReceiveCustomEventBlockConfiguration extends IFlowGraphBlockConfiguration {\r\n eventId: string;\r\n}\r\n\r\n/**\r\n * @experimental\r\n * A block that receives a custom event. It saves the data sent in the eventData output.\r\n */\r\nexport class FlowGraphReceiveCustomEventBlock extends FlowGraphEventBlock {\r\n private _eventObserver: Nullable<Observer<any>>;\r\n\r\n /**\r\n * Output connection: The data sent with the event.\r\n */\r\n public eventData: FlowGraphDataConnection<any>;\r\n\r\n constructor(public config: IFlowGraphReceiveCustomEventBlockConfiguration) {\r\n super(config);\r\n this.eventData = this._registerDataOutput(\"eventData\", RichTypeAny);\r\n }\r\n public _preparePendingTasks(context: FlowGraphContext): void {\r\n const observable = context.configuration.coordinator.getCustomEventObservable(this.config.eventId);\r\n this._eventObserver = observable.add((eventData) => {\r\n this.eventData.setValue(eventData, context);\r\n this._execute(context);\r\n });\r\n }\r\n public _cancelPendingTasks(context: FlowGraphContext): void {\r\n const observable = context.configuration.coordinator.getCustomEventObservable(this.config.eventId);\r\n if (observable) {\r\n observable.remove(this._eventObserver);\r\n } else {\r\n Tools.Warn(`FlowGraphReceiveCustomEventBlock: Missing observable for event ${this.config.eventId}`);\r\n }\r\n }\r\n\r\n public getClassName(): string {\r\n return \"FGReceiveCustomEventBlock\";\r\n }\r\n}\r\nRegisterClass(\"FGReceiveCustomEventBlock\", FlowGraphReceiveCustomEventBlock);\r\n"]}
1
+ {"version":3,"file":"flowGraphReceiveCustomEventBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FlowGraph/Blocks/Event/flowGraphReceiveCustomEventBlock.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAEhE,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAE5C,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAEvD,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AASxD;;;GAGG;AACH,MAAM,OAAO,gCAAiC,SAAQ,mBAAmB;IAQrE,YAAmB,MAAsD;QACrE,KAAK,CAAC,MAAM,CAAC,CAAC;QADC,WAAM,GAAN,MAAM,CAAgD;QAErE,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,kBAAkB,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;IACvE,CAAC;IACM,oBAAoB,CAAC,OAAyB;QACjD,MAAM,UAAU,GAAG,OAAO,CAAC,aAAa,CAAC,WAAW,CAAC,wBAAwB,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QACnG,IAAI,CAAC,cAAc,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE;YAC/C,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;YAC5C,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QAC3B,CAAC,CAAC,CAAC;IACP,CAAC;IACM,mBAAmB,CAAC,OAAyB;QAChD,MAAM,UAAU,GAAG,OAAO,CAAC,aAAa,CAAC,WAAW,CAAC,wBAAwB,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QACnG,IAAI,UAAU,EAAE;YACZ,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;SAC1C;aAAM;YACH,KAAK,CAAC,IAAI,CAAC,kEAAkE,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC,CAAC;SACvG;IACL,CAAC;IAEM,YAAY;QACf,OAAO,2BAA2B,CAAC;IACvC,CAAC;IAEM,SAAS,CAAC,mBAAyB;QACtC,KAAK,CAAC,SAAS,CAAC,mBAAmB,CAAC,CAAC;QACrC,mBAAmB,CAAC,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC;IACtD,CAAC;CACJ;AACD,aAAa,CAAC,2BAA2B,EAAE,gCAAgC,CAAC,CAAC","sourcesContent":["import type { Observer } from \"../../../Misc/observable\";\r\nimport type { FlowGraphContext } from \"../../flowGraphContext\";\r\nimport { FlowGraphEventBlock } from \"../../flowGraphEventBlock\";\r\nimport type { Nullable } from \"../../../types\";\r\nimport { Tools } from \"../../../Misc/tools\";\r\nimport type { FlowGraphDataConnection } from \"../../flowGraphDataConnection\";\r\nimport { RichTypeAny } from \"../../flowGraphRichTypes\";\r\nimport type { IFlowGraphBlockConfiguration } from \"../../flowGraphBlock\";\r\nimport { RegisterClass } from \"../../../Misc/typeStore\";\r\n/**\r\n * @experimental\r\n * Parameters used to create a FlowGraphReceiveCustomEventBlock.\r\n */\r\nexport interface IFlowGraphReceiveCustomEventBlockConfiguration extends IFlowGraphBlockConfiguration {\r\n eventId: string;\r\n}\r\n\r\n/**\r\n * @experimental\r\n * A block that receives a custom event. It saves the data sent in the eventData output.\r\n */\r\nexport class FlowGraphReceiveCustomEventBlock extends FlowGraphEventBlock {\r\n private _eventObserver: Nullable<Observer<any>>;\r\n\r\n /**\r\n * Output connection: The data sent with the event.\r\n */\r\n public eventData: FlowGraphDataConnection<any>;\r\n\r\n constructor(public config: IFlowGraphReceiveCustomEventBlockConfiguration) {\r\n super(config);\r\n this.eventData = this.registerDataOutput(\"eventData\", RichTypeAny);\r\n }\r\n public _preparePendingTasks(context: FlowGraphContext): void {\r\n const observable = context.configuration.coordinator.getCustomEventObservable(this.config.eventId);\r\n this._eventObserver = observable.add((eventData) => {\r\n this.eventData.setValue(eventData, context);\r\n this._execute(context);\r\n });\r\n }\r\n public _cancelPendingTasks(context: FlowGraphContext): void {\r\n const observable = context.configuration.coordinator.getCustomEventObservable(this.config.eventId);\r\n if (observable) {\r\n observable.remove(this._eventObserver);\r\n } else {\r\n Tools.Warn(`FlowGraphReceiveCustomEventBlock: Missing observable for event ${this.config.eventId}`);\r\n }\r\n }\r\n\r\n public getClassName(): string {\r\n return \"FGReceiveCustomEventBlock\";\r\n }\r\n\r\n public serialize(serializationObject?: any): void {\r\n super.serialize(serializationObject);\r\n serializationObject.eventId = this.config.eventId;\r\n }\r\n}\r\nRegisterClass(\"FGReceiveCustomEventBlock\", FlowGraphReceiveCustomEventBlock);\r\n"]}
@@ -8,7 +8,7 @@ import { RegisterClass } from "../../../../Misc/typeStore.js";
8
8
  export class FlowGraphPauseAnimationBlock extends FlowGraphWithOnDoneExecutionBlock {
9
9
  constructor(config) {
10
10
  super(config);
11
- this.animationToPause = this._registerDataInput("animationToPause", RichTypeAny);
11
+ this.animationToPause = this.registerDataInput("animationToPause", RichTypeAny);
12
12
  }
13
13
  _execute(context) {
14
14
  const animationToPauseValue = this.animationToPause.getValue(context);
@@ -1 +1 @@
1
- {"version":3,"file":"flowGraphPauseAnimationBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FlowGraph/Blocks/Execution/Animation/flowGraphPauseAnimationBlock.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iCAAiC,EAAE,MAAM,4CAA4C,CAAC;AAE/F,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAE1D,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D;;;GAGG;AACH,MAAM,OAAO,4BAA6B,SAAQ,iCAAiC;IAM/E,YAAY,MAAqC;QAC7C,KAAK,CAAC,MAAM,CAAC,CAAC;QACd,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC,kBAAkB,CAAC,kBAAkB,EAAE,WAAW,CAAC,CAAC;IACrF,CAAC;IAEM,QAAQ,CAAC,OAAyB;QACrC,MAAM,qBAAqB,GAAG,IAAI,CAAC,gBAAgB,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QACtE,qBAAqB,CAAC,KAAK,EAAE,CAAC;QAC9B,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;IACzC,CAAC;IAEM,YAAY;QACf,OAAO,uBAAuB,CAAC;IACnC,CAAC;CACJ;AACD,aAAa,CAAC,uBAAuB,EAAE,4BAA4B,CAAC,CAAC","sourcesContent":["import type { FlowGraphContext } from \"../../../flowGraphContext\";\r\nimport type { FlowGraphDataConnection } from \"../../../flowGraphDataConnection\";\r\nimport { FlowGraphWithOnDoneExecutionBlock } from \"../../../flowGraphWithOnDoneExecutionBlock\";\r\nimport type { Animatable } from \"../../../../Animations\";\r\nimport { RichTypeAny } from \"../../../flowGraphRichTypes\";\r\nimport type { IFlowGraphBlockConfiguration } from \"../../../flowGraphBlock\";\r\nimport { RegisterClass } from \"../../../../Misc/typeStore\";\r\n/**\r\n * @experimental\r\n * Block that stops a running animation\r\n */\r\nexport class FlowGraphPauseAnimationBlock extends FlowGraphWithOnDoneExecutionBlock {\r\n /**\r\n *\r\n */\r\n public readonly animationToPause: FlowGraphDataConnection<Animatable>;\r\n\r\n constructor(config?: IFlowGraphBlockConfiguration) {\r\n super(config);\r\n this.animationToPause = this._registerDataInput(\"animationToPause\", RichTypeAny);\r\n }\r\n\r\n public _execute(context: FlowGraphContext): void {\r\n const animationToPauseValue = this.animationToPause.getValue(context);\r\n animationToPauseValue.pause();\r\n this.onDone._activateSignal(context);\r\n }\r\n\r\n public getClassName(): string {\r\n return \"FGPauseAnimationBlock\";\r\n }\r\n}\r\nRegisterClass(\"FGPauseAnimationBlock\", FlowGraphPauseAnimationBlock);\r\n"]}
1
+ {"version":3,"file":"flowGraphPauseAnimationBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FlowGraph/Blocks/Execution/Animation/flowGraphPauseAnimationBlock.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iCAAiC,EAAE,MAAM,4CAA4C,CAAC;AAE/F,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAE1D,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D;;;GAGG;AACH,MAAM,OAAO,4BAA6B,SAAQ,iCAAiC;IAM/E,YAAY,MAAqC;QAC7C,KAAK,CAAC,MAAM,CAAC,CAAC;QACd,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC,iBAAiB,CAAC,kBAAkB,EAAE,WAAW,CAAC,CAAC;IACpF,CAAC;IAEM,QAAQ,CAAC,OAAyB;QACrC,MAAM,qBAAqB,GAAG,IAAI,CAAC,gBAAgB,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QACtE,qBAAqB,CAAC,KAAK,EAAE,CAAC;QAC9B,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;IACzC,CAAC;IAEM,YAAY;QACf,OAAO,uBAAuB,CAAC;IACnC,CAAC;CACJ;AACD,aAAa,CAAC,uBAAuB,EAAE,4BAA4B,CAAC,CAAC","sourcesContent":["import type { FlowGraphContext } from \"../../../flowGraphContext\";\r\nimport type { FlowGraphDataConnection } from \"../../../flowGraphDataConnection\";\r\nimport { FlowGraphWithOnDoneExecutionBlock } from \"../../../flowGraphWithOnDoneExecutionBlock\";\r\nimport type { Animatable } from \"../../../../Animations\";\r\nimport { RichTypeAny } from \"../../../flowGraphRichTypes\";\r\nimport type { IFlowGraphBlockConfiguration } from \"../../../flowGraphBlock\";\r\nimport { RegisterClass } from \"../../../../Misc/typeStore\";\r\n/**\r\n * @experimental\r\n * Block that stops a running animation\r\n */\r\nexport class FlowGraphPauseAnimationBlock extends FlowGraphWithOnDoneExecutionBlock {\r\n /**\r\n *\r\n */\r\n public readonly animationToPause: FlowGraphDataConnection<Animatable>;\r\n\r\n constructor(config?: IFlowGraphBlockConfiguration) {\r\n super(config);\r\n this.animationToPause = this.registerDataInput(\"animationToPause\", RichTypeAny);\r\n }\r\n\r\n public _execute(context: FlowGraphContext): void {\r\n const animationToPauseValue = this.animationToPause.getValue(context);\r\n animationToPauseValue.pause();\r\n this.onDone._activateSignal(context);\r\n }\r\n\r\n public getClassName(): string {\r\n return \"FGPauseAnimationBlock\";\r\n }\r\n}\r\nRegisterClass(\"FGPauseAnimationBlock\", FlowGraphPauseAnimationBlock);\r\n"]}
@@ -1,22 +1,32 @@
1
1
  import type { FlowGraphContext } from "../../../flowGraphContext";
2
- import type { Animatable, Animation, IAnimatable } from "../../../../Animations";
2
+ import type { Animatable } from "../../../../Animations";
3
3
  import type { FlowGraphDataConnection } from "../../../flowGraphDataConnection";
4
4
  import type { FlowGraphSignalConnection } from "../../../flowGraphSignalConnection";
5
5
  import { FlowGraphAsyncExecutionBlock } from "../../../flowGraphAsyncExecutionBlock";
6
6
  import type { IFlowGraphBlockConfiguration } from "../../../flowGraphBlock";
7
+ import type { FlowGraphPath } from "../../../flowGraphPath";
8
+ import { FlowGraphPathComponent } from "../../../flowGraphPathComponent";
9
+ /**
10
+ * @experimental
11
+ */
12
+ export interface IFlowGraphPlayAnimationBlockConfiguration extends IFlowGraphBlockConfiguration {
13
+ targetPath: FlowGraphPath;
14
+ animationPath: FlowGraphPath;
15
+ }
7
16
  /**
8
17
  * @experimental
9
18
  * A block that plays an animation on an animatable object.
10
19
  */
11
20
  export declare class FlowGraphPlayAnimationBlock extends FlowGraphAsyncExecutionBlock {
21
+ config: IFlowGraphPlayAnimationBlockConfiguration;
12
22
  /**
13
- * Input connection: The target to play the animation on.
23
+ * The substitution inputs for template strings in the target
14
24
  */
15
- readonly target: FlowGraphDataConnection<IAnimatable>;
25
+ readonly templateTargetComponent: FlowGraphPathComponent;
16
26
  /**
17
- * Input connection: The animation to play.
27
+ * The substitution inputs for template strings in the animation
18
28
  */
19
- readonly animation: FlowGraphDataConnection<Animation>;
29
+ readonly templateAnimationComponent: FlowGraphPathComponent;
20
30
  /**
21
31
  * Input connection: The speed of the animation.
22
32
  */
@@ -41,7 +51,7 @@ export declare class FlowGraphPlayAnimationBlock extends FlowGraphAsyncExecution
41
51
  * Output connection: The animatable that is currently running.
42
52
  */
43
53
  readonly runningAnimatable: FlowGraphDataConnection<Animatable>;
44
- constructor(config?: IFlowGraphBlockConfiguration);
54
+ constructor(config: IFlowGraphPlayAnimationBlockConfiguration);
45
55
  /**
46
56
  * @internal
47
57
  * @param context
@@ -55,4 +65,5 @@ export declare class FlowGraphPlayAnimationBlock extends FlowGraphAsyncExecution
55
65
  */
56
66
  _cancelPendingTasks(context: FlowGraphContext): void;
57
67
  getClassName(): string;
68
+ serialize(serializationObject?: any): void;
58
69
  }
@@ -1,6 +1,7 @@
1
1
  import { FlowGraphAsyncExecutionBlock } from "../../../flowGraphAsyncExecutionBlock.js";
2
2
  import { RichTypeAny, RichTypeNumber, RichTypeBoolean } from "../../../flowGraphRichTypes.js";
3
3
  import { RegisterClass } from "../../../../Misc/typeStore.js";
4
+ import { FlowGraphPathComponent } from "../../../flowGraphPathComponent.js";
4
5
  /**
5
6
  * @experimental
6
7
  * A block that plays an animation on an animatable object.
@@ -8,14 +9,15 @@ import { RegisterClass } from "../../../../Misc/typeStore.js";
8
9
  export class FlowGraphPlayAnimationBlock extends FlowGraphAsyncExecutionBlock {
9
10
  constructor(config) {
10
11
  super(config);
11
- this.target = this._registerDataInput("target", RichTypeAny);
12
- this.animation = this._registerDataInput("animation", RichTypeAny);
13
- this.speed = this._registerDataInput("speed", RichTypeNumber);
14
- this.loop = this._registerDataInput("loop", RichTypeBoolean);
15
- this.from = this._registerDataInput("from", RichTypeNumber);
16
- this.to = this._registerDataInput("to", RichTypeNumber);
12
+ this.config = config;
13
+ this.templateTargetComponent = new FlowGraphPathComponent(config.targetPath, this);
14
+ this.templateAnimationComponent = new FlowGraphPathComponent(config.animationPath, this);
15
+ this.speed = this.registerDataInput("speed", RichTypeNumber);
16
+ this.loop = this.registerDataInput("loop", RichTypeBoolean);
17
+ this.from = this.registerDataInput("from", RichTypeNumber);
18
+ this.to = this.registerDataInput("to", RichTypeNumber);
17
19
  this.onAnimationEnd = this._registerSignalOutput("onAnimationEnd");
18
- this.runningAnimatable = this._registerDataOutput("runningAnimatable", RichTypeAny);
20
+ this.runningAnimatable = this.registerDataOutput("runningAnimatable", RichTypeAny);
19
21
  }
20
22
  /**
21
23
  * @internal
@@ -23,8 +25,8 @@ export class FlowGraphPlayAnimationBlock extends FlowGraphAsyncExecutionBlock {
23
25
  */
24
26
  _preparePendingTasks(context) {
25
27
  var _a;
26
- const targetValue = this.target.getValue(context);
27
- const animationValue = this.animation.getValue(context);
28
+ const targetValue = this.templateTargetComponent.getProperty(context);
29
+ const animationValue = this.templateAnimationComponent.getProperty(context);
28
30
  if (!targetValue || !animationValue) {
29
31
  throw new Error("Cannot play animation without target or animation");
30
32
  }
@@ -71,6 +73,11 @@ export class FlowGraphPlayAnimationBlock extends FlowGraphAsyncExecutionBlock {
71
73
  getClassName() {
72
74
  return "FGPlayAnimationBlock";
73
75
  }
76
+ serialize(serializationObject = {}) {
77
+ super.serialize(serializationObject);
78
+ serializationObject.config.targetPath = this.config.targetPath.serialize();
79
+ serializationObject.config.animationPath = this.config.animationPath.serialize();
80
+ }
74
81
  }
75
82
  RegisterClass("FGPlayAnimationBlock", FlowGraphPlayAnimationBlock);
76
83
  //# sourceMappingURL=flowGraphPlayAnimationBlock.js.map