@onerjs/core 8.32.0 → 8.32.1

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 (312) hide show
  1. package/Audio/Interfaces/ISoundOptions.d.ts +1 -1
  2. package/Audio/Interfaces/ISoundOptions.js.map +1 -1
  3. package/Audio/audioEngine.d.ts +3 -4
  4. package/Audio/audioEngine.js +9 -6
  5. package/Audio/audioEngine.js.map +1 -1
  6. package/Audio/sound.d.ts +33 -54
  7. package/Audio/sound.js +450 -718
  8. package/Audio/sound.js.map +1 -1
  9. package/AudioV2/abstractAudio/abstractAudioOutNode.d.ts +1 -1
  10. package/AudioV2/abstractAudio/abstractAudioOutNode.js +1 -1
  11. package/AudioV2/abstractAudio/abstractAudioOutNode.js.map +1 -1
  12. package/AudioV2/abstractAudio/abstractSound.d.ts +1 -1
  13. package/AudioV2/abstractAudio/abstractSound.js +2 -2
  14. package/AudioV2/abstractAudio/abstractSound.js.map +1 -1
  15. package/AudioV2/abstractAudio/abstractSoundSource.d.ts +11 -3
  16. package/AudioV2/abstractAudio/abstractSoundSource.js +37 -1
  17. package/AudioV2/abstractAudio/abstractSoundSource.js.map +1 -1
  18. package/AudioV2/abstractAudio/audioBus.d.ts +8 -3
  19. package/AudioV2/abstractAudio/audioBus.js +24 -1
  20. package/AudioV2/abstractAudio/audioBus.js.map +1 -1
  21. package/AudioV2/abstractAudio/staticSound.d.ts +1 -1
  22. package/AudioV2/abstractAudio/staticSound.js +2 -2
  23. package/AudioV2/abstractAudio/staticSound.js.map +1 -1
  24. package/AudioV2/abstractAudio/streamingSound.d.ts +1 -1
  25. package/AudioV2/abstractAudio/streamingSound.js +2 -2
  26. package/AudioV2/abstractAudio/streamingSound.js.map +1 -1
  27. package/AudioV2/abstractAudio/subNodes/abstractAudioSubGraph.d.ts +1 -1
  28. package/AudioV2/abstractAudio/subNodes/abstractAudioSubGraph.js +3 -0
  29. package/AudioV2/abstractAudio/subNodes/abstractAudioSubGraph.js.map +1 -1
  30. package/AudioV2/abstractAudio/subNodes/spatialAudioSubNode.d.ts +1 -0
  31. package/AudioV2/abstractAudio/subNodes/spatialAudioSubNode.js +1 -0
  32. package/AudioV2/abstractAudio/subNodes/spatialAudioSubNode.js.map +1 -1
  33. package/AudioV2/abstractAudio/subProperties/abstractSpatialAudio.d.ts +12 -2
  34. package/AudioV2/abstractAudio/subProperties/abstractSpatialAudio.js +2 -0
  35. package/AudioV2/abstractAudio/subProperties/abstractSpatialAudio.js.map +1 -1
  36. package/AudioV2/abstractAudio/subProperties/spatialAudio.d.ts +6 -0
  37. package/AudioV2/abstractAudio/subProperties/spatialAudio.js +25 -0
  38. package/AudioV2/abstractAudio/subProperties/spatialAudio.js.map +1 -1
  39. package/AudioV2/webAudio/components/webAudioParameterComponent.js +2 -2
  40. package/AudioV2/webAudio/components/webAudioParameterComponent.js.map +1 -1
  41. package/AudioV2/webAudio/subNodes/spatialWebAudioSubNode.d.ts +3 -0
  42. package/AudioV2/webAudio/subNodes/spatialWebAudioSubNode.js +14 -17
  43. package/AudioV2/webAudio/subNodes/spatialWebAudioSubNode.js.map +1 -1
  44. package/AudioV2/webAudio/subNodes/webAudioBusAndSoundSubGraph.js +1 -0
  45. package/AudioV2/webAudio/subNodes/webAudioBusAndSoundSubGraph.js.map +1 -1
  46. package/AudioV2/webAudio/subProperties/spatialWebAudio.js +1 -0
  47. package/AudioV2/webAudio/subProperties/spatialWebAudio.js.map +1 -1
  48. package/AudioV2/webAudio/webAudioBus.d.ts +2 -7
  49. package/AudioV2/webAudio/webAudioBus.js +4 -24
  50. package/AudioV2/webAudio/webAudioBus.js.map +1 -1
  51. package/AudioV2/webAudio/webAudioEngine.js +1 -0
  52. package/AudioV2/webAudio/webAudioEngine.js.map +1 -1
  53. package/AudioV2/webAudio/webAudioSoundSource.d.ts +2 -7
  54. package/AudioV2/webAudio/webAudioSoundSource.js +3 -24
  55. package/AudioV2/webAudio/webAudioSoundSource.js.map +1 -1
  56. package/AudioV2/webAudio/webAudioStaticSound.d.ts +3 -7
  57. package/AudioV2/webAudio/webAudioStaticSound.js +13 -26
  58. package/AudioV2/webAudio/webAudioStaticSound.js.map +1 -1
  59. package/AudioV2/webAudio/webAudioStreamingSound.d.ts +3 -7
  60. package/AudioV2/webAudio/webAudioStreamingSound.js +6 -23
  61. package/AudioV2/webAudio/webAudioStreamingSound.js.map +1 -1
  62. package/Cameras/arcRotateCamera.js +4 -5
  63. package/Cameras/arcRotateCamera.js.map +1 -1
  64. package/Compute/computeEffect.js +5 -1
  65. package/Compute/computeEffect.js.map +1 -1
  66. package/Compute/computeShader.d.ts +4 -0
  67. package/Compute/computeShader.js +9 -3
  68. package/Compute/computeShader.js.map +1 -1
  69. package/Debug/debugLayer.d.ts +1 -1
  70. package/Debug/debugLayer.js.map +1 -1
  71. package/Engines/abstractEngine.d.ts +2 -2
  72. package/Engines/abstractEngine.js +2 -2
  73. package/Engines/abstractEngine.js.map +1 -1
  74. package/Engines/thinEngine.js +1 -1
  75. package/Engines/thinEngine.js.map +1 -1
  76. package/Engines/webgpuEngine.js +8 -9
  77. package/Engines/webgpuEngine.js.map +1 -1
  78. package/FrameGraph/Node/Blocks/PostProcesses/volumetricLightingBlock.d.ts +74 -0
  79. package/FrameGraph/Node/Blocks/PostProcesses/volumetricLightingBlock.js +179 -0
  80. package/FrameGraph/Node/Blocks/PostProcesses/volumetricLightingBlock.js.map +1 -0
  81. package/FrameGraph/Node/Blocks/index.d.ts +2 -0
  82. package/FrameGraph/Node/Blocks/index.js +2 -0
  83. package/FrameGraph/Node/Blocks/index.js.map +1 -1
  84. package/FrameGraph/Node/Blocks/lightingVolumeBlock.d.ts +43 -0
  85. package/FrameGraph/Node/Blocks/lightingVolumeBlock.js +93 -0
  86. package/FrameGraph/Node/Blocks/lightingVolumeBlock.js.map +1 -0
  87. package/FrameGraph/Passes/renderPass.js +2 -2
  88. package/FrameGraph/Passes/renderPass.js.map +1 -1
  89. package/FrameGraph/Tasks/Layers/baseLayerTask.d.ts +2 -0
  90. package/FrameGraph/Tasks/Layers/baseLayerTask.js +6 -0
  91. package/FrameGraph/Tasks/Layers/baseLayerTask.js.map +1 -1
  92. package/FrameGraph/Tasks/Layers/glowLayerTask.d.ts +1 -0
  93. package/FrameGraph/Tasks/Layers/glowLayerTask.js +3 -0
  94. package/FrameGraph/Tasks/Layers/glowLayerTask.js.map +1 -1
  95. package/FrameGraph/Tasks/Layers/highlightLayerTask.d.ts +1 -0
  96. package/FrameGraph/Tasks/Layers/highlightLayerTask.js +3 -0
  97. package/FrameGraph/Tasks/Layers/highlightLayerTask.js.map +1 -1
  98. package/FrameGraph/Tasks/Misc/computeShaderTask.d.ts +1 -0
  99. package/FrameGraph/Tasks/Misc/computeShaderTask.js +3 -0
  100. package/FrameGraph/Tasks/Misc/computeShaderTask.js.map +1 -1
  101. package/FrameGraph/Tasks/Misc/cullObjectsTask.d.ts +1 -0
  102. package/FrameGraph/Tasks/Misc/cullObjectsTask.js +3 -0
  103. package/FrameGraph/Tasks/Misc/cullObjectsTask.js.map +1 -1
  104. package/FrameGraph/Tasks/Misc/executeTask.d.ts +1 -0
  105. package/FrameGraph/Tasks/Misc/executeTask.js +3 -0
  106. package/FrameGraph/Tasks/Misc/executeTask.js.map +1 -1
  107. package/FrameGraph/Tasks/Misc/lightingVolumeTask.d.ts +32 -0
  108. package/FrameGraph/Tasks/Misc/lightingVolumeTask.js +63 -0
  109. package/FrameGraph/Tasks/Misc/lightingVolumeTask.js.map +1 -0
  110. package/FrameGraph/Tasks/PostProcesses/anaglyphTask.d.ts +1 -0
  111. package/FrameGraph/Tasks/PostProcesses/anaglyphTask.js +3 -0
  112. package/FrameGraph/Tasks/PostProcesses/anaglyphTask.js.map +1 -1
  113. package/FrameGraph/Tasks/PostProcesses/blackAndWhiteTask.d.ts +1 -0
  114. package/FrameGraph/Tasks/PostProcesses/blackAndWhiteTask.js +3 -0
  115. package/FrameGraph/Tasks/PostProcesses/blackAndWhiteTask.js.map +1 -1
  116. package/FrameGraph/Tasks/PostProcesses/bloomMergeTask.d.ts +1 -0
  117. package/FrameGraph/Tasks/PostProcesses/bloomMergeTask.js +3 -0
  118. package/FrameGraph/Tasks/PostProcesses/bloomMergeTask.js.map +1 -1
  119. package/FrameGraph/Tasks/PostProcesses/bloomTask.d.ts +1 -0
  120. package/FrameGraph/Tasks/PostProcesses/bloomTask.js +3 -0
  121. package/FrameGraph/Tasks/PostProcesses/bloomTask.js.map +1 -1
  122. package/FrameGraph/Tasks/PostProcesses/blurTask.d.ts +1 -0
  123. package/FrameGraph/Tasks/PostProcesses/blurTask.js +3 -0
  124. package/FrameGraph/Tasks/PostProcesses/blurTask.js.map +1 -1
  125. package/FrameGraph/Tasks/PostProcesses/chromaticAberrationTask.d.ts +1 -0
  126. package/FrameGraph/Tasks/PostProcesses/chromaticAberrationTask.js +3 -0
  127. package/FrameGraph/Tasks/PostProcesses/chromaticAberrationTask.js.map +1 -1
  128. package/FrameGraph/Tasks/PostProcesses/circleOfConfusionTask.d.ts +1 -0
  129. package/FrameGraph/Tasks/PostProcesses/circleOfConfusionTask.js +3 -0
  130. package/FrameGraph/Tasks/PostProcesses/circleOfConfusionTask.js.map +1 -1
  131. package/FrameGraph/Tasks/PostProcesses/colorCorrectionTask.d.ts +1 -0
  132. package/FrameGraph/Tasks/PostProcesses/colorCorrectionTask.js +3 -0
  133. package/FrameGraph/Tasks/PostProcesses/colorCorrectionTask.js.map +1 -1
  134. package/FrameGraph/Tasks/PostProcesses/convolutionTask.d.ts +1 -0
  135. package/FrameGraph/Tasks/PostProcesses/convolutionTask.js +3 -0
  136. package/FrameGraph/Tasks/PostProcesses/convolutionTask.js.map +1 -1
  137. package/FrameGraph/Tasks/PostProcesses/customPostProcessTask.d.ts +1 -0
  138. package/FrameGraph/Tasks/PostProcesses/customPostProcessTask.js +3 -0
  139. package/FrameGraph/Tasks/PostProcesses/customPostProcessTask.js.map +1 -1
  140. package/FrameGraph/Tasks/PostProcesses/depthOfFieldBlurTask.d.ts +1 -0
  141. package/FrameGraph/Tasks/PostProcesses/depthOfFieldBlurTask.js +3 -0
  142. package/FrameGraph/Tasks/PostProcesses/depthOfFieldBlurTask.js.map +1 -1
  143. package/FrameGraph/Tasks/PostProcesses/depthOfFieldMergeTask.d.ts +1 -0
  144. package/FrameGraph/Tasks/PostProcesses/depthOfFieldMergeTask.js +3 -0
  145. package/FrameGraph/Tasks/PostProcesses/depthOfFieldMergeTask.js.map +1 -1
  146. package/FrameGraph/Tasks/PostProcesses/depthOfFieldTask.d.ts +1 -0
  147. package/FrameGraph/Tasks/PostProcesses/depthOfFieldTask.js +3 -0
  148. package/FrameGraph/Tasks/PostProcesses/depthOfFieldTask.js.map +1 -1
  149. package/FrameGraph/Tasks/PostProcesses/extractHighlightsTask.d.ts +1 -0
  150. package/FrameGraph/Tasks/PostProcesses/extractHighlightsTask.js +3 -0
  151. package/FrameGraph/Tasks/PostProcesses/extractHighlightsTask.js.map +1 -1
  152. package/FrameGraph/Tasks/PostProcesses/filterTask.d.ts +1 -0
  153. package/FrameGraph/Tasks/PostProcesses/filterTask.js +3 -0
  154. package/FrameGraph/Tasks/PostProcesses/filterTask.js.map +1 -1
  155. package/FrameGraph/Tasks/PostProcesses/fxaaTask.d.ts +1 -0
  156. package/FrameGraph/Tasks/PostProcesses/fxaaTask.js +3 -0
  157. package/FrameGraph/Tasks/PostProcesses/fxaaTask.js.map +1 -1
  158. package/FrameGraph/Tasks/PostProcesses/grainTask.d.ts +1 -0
  159. package/FrameGraph/Tasks/PostProcesses/grainTask.js +3 -0
  160. package/FrameGraph/Tasks/PostProcesses/grainTask.js.map +1 -1
  161. package/FrameGraph/Tasks/PostProcesses/imageProcessingTask.d.ts +1 -0
  162. package/FrameGraph/Tasks/PostProcesses/imageProcessingTask.js +3 -0
  163. package/FrameGraph/Tasks/PostProcesses/imageProcessingTask.js.map +1 -1
  164. package/FrameGraph/Tasks/PostProcesses/motionBlurTask.d.ts +1 -0
  165. package/FrameGraph/Tasks/PostProcesses/motionBlurTask.js +3 -0
  166. package/FrameGraph/Tasks/PostProcesses/motionBlurTask.js.map +1 -1
  167. package/FrameGraph/Tasks/PostProcesses/passTask.d.ts +2 -0
  168. package/FrameGraph/Tasks/PostProcesses/passTask.js +6 -0
  169. package/FrameGraph/Tasks/PostProcesses/passTask.js.map +1 -1
  170. package/FrameGraph/Tasks/PostProcesses/postProcessTask.d.ts +3 -2
  171. package/FrameGraph/Tasks/PostProcesses/postProcessTask.js +3 -0
  172. package/FrameGraph/Tasks/PostProcesses/postProcessTask.js.map +1 -1
  173. package/FrameGraph/Tasks/PostProcesses/screenSpaceCurvatureTask.d.ts +1 -0
  174. package/FrameGraph/Tasks/PostProcesses/screenSpaceCurvatureTask.js +3 -0
  175. package/FrameGraph/Tasks/PostProcesses/screenSpaceCurvatureTask.js.map +1 -1
  176. package/FrameGraph/Tasks/PostProcesses/sharpenTask.d.ts +1 -0
  177. package/FrameGraph/Tasks/PostProcesses/sharpenTask.js +3 -0
  178. package/FrameGraph/Tasks/PostProcesses/sharpenTask.js.map +1 -1
  179. package/FrameGraph/Tasks/PostProcesses/ssao2BlurTask.d.ts +1 -0
  180. package/FrameGraph/Tasks/PostProcesses/ssao2BlurTask.js +3 -0
  181. package/FrameGraph/Tasks/PostProcesses/ssao2BlurTask.js.map +1 -1
  182. package/FrameGraph/Tasks/PostProcesses/ssao2RenderingPipelineTask.d.ts +1 -0
  183. package/FrameGraph/Tasks/PostProcesses/ssao2RenderingPipelineTask.js +3 -0
  184. package/FrameGraph/Tasks/PostProcesses/ssao2RenderingPipelineTask.js.map +1 -1
  185. package/FrameGraph/Tasks/PostProcesses/ssao2Task.d.ts +1 -0
  186. package/FrameGraph/Tasks/PostProcesses/ssao2Task.js +3 -0
  187. package/FrameGraph/Tasks/PostProcesses/ssao2Task.js.map +1 -1
  188. package/FrameGraph/Tasks/PostProcesses/ssrBlurTask.d.ts +1 -0
  189. package/FrameGraph/Tasks/PostProcesses/ssrBlurTask.js +3 -0
  190. package/FrameGraph/Tasks/PostProcesses/ssrBlurTask.js.map +1 -1
  191. package/FrameGraph/Tasks/PostProcesses/ssrRenderingPipelineTask.d.ts +1 -0
  192. package/FrameGraph/Tasks/PostProcesses/ssrRenderingPipelineTask.js +3 -0
  193. package/FrameGraph/Tasks/PostProcesses/ssrRenderingPipelineTask.js.map +1 -1
  194. package/FrameGraph/Tasks/PostProcesses/ssrTask.d.ts +1 -0
  195. package/FrameGraph/Tasks/PostProcesses/ssrTask.js +3 -0
  196. package/FrameGraph/Tasks/PostProcesses/ssrTask.js.map +1 -1
  197. package/FrameGraph/Tasks/PostProcesses/taaTask.d.ts +1 -0
  198. package/FrameGraph/Tasks/PostProcesses/taaTask.js +3 -0
  199. package/FrameGraph/Tasks/PostProcesses/taaTask.js.map +1 -1
  200. package/FrameGraph/Tasks/PostProcesses/tonemapTask.d.ts +1 -0
  201. package/FrameGraph/Tasks/PostProcesses/tonemapTask.js +3 -0
  202. package/FrameGraph/Tasks/PostProcesses/tonemapTask.js.map +1 -1
  203. package/FrameGraph/Tasks/PostProcesses/volumetricLightingBlendVolumeTask.d.ts +31 -0
  204. package/FrameGraph/Tasks/PostProcesses/volumetricLightingBlendVolumeTask.js +60 -0
  205. package/FrameGraph/Tasks/PostProcesses/volumetricLightingBlendVolumeTask.js.map +1 -0
  206. package/FrameGraph/Tasks/PostProcesses/volumetricLightingTask.d.ts +93 -0
  207. package/FrameGraph/Tasks/PostProcesses/volumetricLightingTask.js +183 -0
  208. package/FrameGraph/Tasks/PostProcesses/volumetricLightingTask.js.map +1 -0
  209. package/FrameGraph/Tasks/Rendering/csmShadowGeneratorTask.d.ts +1 -0
  210. package/FrameGraph/Tasks/Rendering/csmShadowGeneratorTask.js +3 -0
  211. package/FrameGraph/Tasks/Rendering/csmShadowGeneratorTask.js.map +1 -1
  212. package/FrameGraph/Tasks/Rendering/geometryRendererTask.d.ts +1 -0
  213. package/FrameGraph/Tasks/Rendering/geometryRendererTask.js +3 -0
  214. package/FrameGraph/Tasks/Rendering/geometryRendererTask.js.map +1 -1
  215. package/FrameGraph/Tasks/Rendering/objectRendererTask.d.ts +1 -0
  216. package/FrameGraph/Tasks/Rendering/objectRendererTask.js +4 -1
  217. package/FrameGraph/Tasks/Rendering/objectRendererTask.js.map +1 -1
  218. package/FrameGraph/Tasks/Rendering/shadowGeneratorTask.d.ts +1 -0
  219. package/FrameGraph/Tasks/Rendering/shadowGeneratorTask.js +3 -0
  220. package/FrameGraph/Tasks/Rendering/shadowGeneratorTask.js.map +1 -1
  221. package/FrameGraph/Tasks/Rendering/utilityLayerRendererTask.d.ts +1 -0
  222. package/FrameGraph/Tasks/Rendering/utilityLayerRendererTask.js +3 -0
  223. package/FrameGraph/Tasks/Rendering/utilityLayerRendererTask.js.map +1 -1
  224. package/FrameGraph/Tasks/Texture/clearTextureTask.d.ts +1 -0
  225. package/FrameGraph/Tasks/Texture/clearTextureTask.js +4 -1
  226. package/FrameGraph/Tasks/Texture/clearTextureTask.js.map +1 -1
  227. package/FrameGraph/Tasks/Texture/copyToBackbufferColorTask.d.ts +1 -0
  228. package/FrameGraph/Tasks/Texture/copyToBackbufferColorTask.js +3 -0
  229. package/FrameGraph/Tasks/Texture/copyToBackbufferColorTask.js.map +1 -1
  230. package/FrameGraph/Tasks/Texture/copyToTextureTask.d.ts +1 -0
  231. package/FrameGraph/Tasks/Texture/copyToTextureTask.js +21 -4
  232. package/FrameGraph/Tasks/Texture/copyToTextureTask.js.map +1 -1
  233. package/FrameGraph/Tasks/Texture/generateMipMapsTask.d.ts +1 -0
  234. package/FrameGraph/Tasks/Texture/generateMipMapsTask.js +3 -0
  235. package/FrameGraph/Tasks/Texture/generateMipMapsTask.js.map +1 -1
  236. package/FrameGraph/frameGraphRenderContext.d.ts +3 -2
  237. package/FrameGraph/frameGraphRenderContext.js +14 -5
  238. package/FrameGraph/frameGraphRenderContext.js.map +1 -1
  239. package/FrameGraph/frameGraphTask.d.ts +5 -0
  240. package/FrameGraph/frameGraphTask.js +11 -2
  241. package/FrameGraph/frameGraphTask.js.map +1 -1
  242. package/FrameGraph/index.d.ts +2 -0
  243. package/FrameGraph/index.js +2 -0
  244. package/FrameGraph/index.js.map +1 -1
  245. package/Lights/lightingVolume.d.ts +12 -6
  246. package/Lights/lightingVolume.js +218 -108
  247. package/Lights/lightingVolume.js.map +1 -1
  248. package/Loading/Plugins/babylonFileLoader.js.map +1 -1
  249. package/Materials/GaussianSplatting/gaussianSplattingMaterial.js +2 -0
  250. package/Materials/GaussianSplatting/gaussianSplattingMaterial.js.map +1 -1
  251. package/Meshes/GaussianSplatting/gaussianSplattingMesh.js +2 -2
  252. package/Meshes/GaussianSplatting/gaussianSplattingMesh.js.map +1 -1
  253. package/Meshes/geometry.d.ts +2 -1
  254. package/Meshes/geometry.js +6 -2
  255. package/Meshes/geometry.js.map +1 -1
  256. package/Meshes/mesh.d.ts +2 -1
  257. package/Meshes/mesh.js +4 -3
  258. package/Meshes/mesh.js.map +1 -1
  259. package/Particles/Node/Blocks/Update/updateFlowMapBlock.d.ts +9 -1
  260. package/Particles/Node/Blocks/Update/updateFlowMapBlock.js +8 -0
  261. package/Particles/Node/Blocks/Update/updateFlowMapBlock.js.map +1 -1
  262. package/Particles/Node/Blocks/Update/updateNoiseBlock.d.ts +39 -0
  263. package/Particles/Node/Blocks/Update/updateNoiseBlock.js +102 -0
  264. package/Particles/Node/Blocks/Update/updateNoiseBlock.js.map +1 -0
  265. package/Particles/Node/Blocks/index.d.ts +1 -0
  266. package/Particles/Node/Blocks/index.js +1 -0
  267. package/Particles/Node/Blocks/index.js.map +1 -1
  268. package/Particles/Node/Blocks/particleSourceTextureBlock.d.ts +9 -5
  269. package/Particles/Node/Blocks/particleSourceTextureBlock.js +31 -13
  270. package/Particles/Node/Blocks/particleSourceTextureBlock.js.map +1 -1
  271. package/Particles/Node/nodeParticleSystemSet.helper.js +39 -21
  272. package/Particles/Node/nodeParticleSystemSet.helper.js.map +1 -1
  273. package/Particles/particle.d.ts +2 -2
  274. package/Particles/particle.js +4 -2
  275. package/Particles/particle.js.map +1 -1
  276. package/Particles/thinParticleSystem.d.ts +1 -1
  277. package/Particles/thinParticleSystem.function.js +2 -2
  278. package/Particles/thinParticleSystem.function.js.map +1 -1
  279. package/Particles/thinParticleSystem.js.map +1 -1
  280. package/Physics/v2/characterController.d.ts +42 -2
  281. package/Physics/v2/characterController.js +140 -46
  282. package/Physics/v2/characterController.js.map +1 -1
  283. package/Shaders/gaussianSplatting.vertex.js +2 -2
  284. package/Shaders/gaussianSplatting.vertex.js.map +1 -1
  285. package/Shaders/volumetricLightingBlendVolume.fragment.d.ts +5 -0
  286. package/Shaders/volumetricLightingBlendVolume.fragment.js +21 -0
  287. package/Shaders/volumetricLightingBlendVolume.fragment.js.map +1 -0
  288. package/Shaders/volumetricLightingRenderVolume.fragment.d.ts +7 -0
  289. package/Shaders/volumetricLightingRenderVolume.fragment.js +25 -0
  290. package/Shaders/volumetricLightingRenderVolume.fragment.js.map +1 -0
  291. package/Shaders/volumetricLightingRenderVolume.vertex.d.ts +9 -0
  292. package/Shaders/volumetricLightingRenderVolume.vertex.js +18 -0
  293. package/Shaders/volumetricLightingRenderVolume.vertex.js.map +1 -0
  294. package/ShadersWGSL/gaussianSplatting.vertex.js +3 -3
  295. package/ShadersWGSL/gaussianSplatting.vertex.js.map +1 -1
  296. package/ShadersWGSL/lightingVolume.compute.js +10 -4
  297. package/ShadersWGSL/lightingVolume.compute.js.map +1 -1
  298. package/ShadersWGSL/volumetricLightingBlendVolume.fragment.d.ts +5 -0
  299. package/ShadersWGSL/volumetricLightingBlendVolume.fragment.js +22 -0
  300. package/ShadersWGSL/volumetricLightingBlendVolume.fragment.js.map +1 -0
  301. package/ShadersWGSL/volumetricLightingRenderVolume.fragment.d.ts +7 -0
  302. package/ShadersWGSL/volumetricLightingRenderVolume.fragment.js +27 -0
  303. package/ShadersWGSL/volumetricLightingRenderVolume.fragment.js.map +1 -0
  304. package/ShadersWGSL/volumetricLightingRenderVolume.vertex.d.ts +7 -0
  305. package/ShadersWGSL/volumetricLightingRenderVolume.vertex.js +17 -0
  306. package/ShadersWGSL/volumetricLightingRenderVolume.vertex.js.map +1 -0
  307. package/States/IStencilState.d.ts +48 -2
  308. package/States/IStencilState.js.map +1 -1
  309. package/States/alphaCullingState.d.ts +1 -0
  310. package/States/alphaCullingState.js +3 -0
  311. package/States/alphaCullingState.js.map +1 -1
  312. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"nodeParticleSystemSet.helper.js","sourceRoot":"","sources":["../../../../../dev/core/src/Particles/Node/nodeParticleSystemSet.helper.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,mCAA+B;AAC1D,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,6BAA6B,EAAE,MAAM,uCAAuC,CAAC;AACtF,OAAO,EAAE,yBAAyB,EAAE,MAAM,mCAAmC,CAAC;AAC9E,OAAO,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AACzE,OAAO,EAAE,uBAAuB,EAAE,iCAAiC,EAAE,MAAM,kCAAkC,CAAC;AAC9G,OAAO,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AACvE,OAAO,EAAE,0BAA0B,EAAE,MAAM,qCAAqC,CAAC;AACjF,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,EAAE,iBAAiB,EAAE,2BAA2B,EAAE,MAAM,4BAA4B,CAAC;AAC5F,OAAO,EAAE,mBAAmB,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AAC7F,OAAO,EAAE,0BAA0B,EAAE,MAAM,qCAAqC,CAAC;AACjF,OAAO,EAAE,yBAAyB,EAAE,MAAM,oCAAoC,CAAC;AAC/E,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,sBAAsB,EAAE,2BAA2B,EAAE,MAAM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AM,GAAI,YAAoB,CAAC,OAAO,IAAK,YAAoB,CAAC,MAAM,CAAC;IAE7E,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;QACvB,4CAA4C;QAC5C,MAAM,WAAW,GAAG,IAAI,mBAAmB,CAAC,eAAe,GAAG,KAAK,CAAC,CAAC;QACrE,WAAW,CAAC,QAAQ,GAAG,cAAc,CAAC;QACtC,sBAAsB,CAAC,SAAS,EAAE,MAAM,EAAE,WAAW,CAAC,GAAG,CAAC,CAAC;QAC3D,sBAAsB,CAAC,SAAS,EAAE,MAAM,EAAE,WAAW,CAAC,GAAG,CAAC,CAAC;QAC3D,WAAW,CAAC,MAAM,CAAC,SAAS,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC;IAC3D,CAAC;SAAM,CAAC;QACJ,eAAe;QACf,sBAAsB,CAAC,OAAO,EAAE,MAAM,EAAE,kBAAkB,CAAC,KAAK,CAAC,CAAC;IACtE,CAAC;IAED,OAAO,kBAAkB,CAAC,MAAM,CAAC;AACrC,CAAC","sourcesContent":["import type { Nullable } from \"core/types\";\r\nimport type { Color4 } from \"core/Maths/math.color\";\r\nimport type { Texture } from \"core/Materials/Textures/texture\";\r\nimport type { Mesh } from \"core/Meshes/mesh\";\r\nimport type { ColorGradient, FactorGradient } from \"core/Misc\";\r\nimport type { ParticleSystem } from \"core/Particles/particleSystem\";\r\nimport type { IParticleSystem } from \"core/Particles/IParticleSystem\";\r\nimport type { BoxParticleEmitter } from \"core/Particles/EmitterTypes/boxParticleEmitter\";\r\nimport type { ConeDirectedParticleEmitter, ConeParticleEmitter } from \"core/Particles/EmitterTypes/coneParticleEmitter\";\r\nimport type { CustomParticleEmitter } from \"core/Particles/EmitterTypes/customParticleEmitter\";\r\nimport type { CylinderDirectedParticleEmitter, CylinderParticleEmitter } from \"core/Particles/EmitterTypes/cylinderParticleEmitter\";\r\nimport type { HemisphericParticleEmitter } from \"core/Particles/EmitterTypes/hemisphericParticleEmitter\";\r\nimport type { MeshParticleEmitter } from \"core/Particles/EmitterTypes/meshParticleEmitter\";\r\nimport type { PointParticleEmitter } from \"core/Particles/EmitterTypes/pointParticleEmitter\";\r\nimport type { SphereDirectedParticleEmitter, SphereParticleEmitter } from \"core/Particles/EmitterTypes/sphereParticleEmitter\";\r\nimport type { NodeParticleConnectionPoint } from \"core/Particles/Node/nodeParticleBlockConnectionPoint\";\r\nimport type { IShapeBlock } from \"core/Particles/Node/Blocks/Emitters/IShapeBlock\";\r\nimport type { NodeParticleBlockConnectionPointTypes } from \"core/Particles/Node/Enums/nodeParticleBlockConnectionPointTypes\";\r\n\r\nimport { Vector2, Vector3 } from \"core/Maths/math.vector\";\r\nimport { NodeParticleSystemSet } from \"./nodeParticleSystemSet\";\r\nimport { NodeParticleContextualSources } from \"./Enums/nodeParticleContextualSources\";\r\nimport { NodeParticleSystemSources } from \"./Enums/nodeParticleSystemSources\";\r\nimport { ParticleConverterBlock } from \"./Blocks/particleConverterBlock\";\r\nimport { ParticleFloatToIntBlock, ParticleFloatToIntBlockOperations } from \"./Blocks/particleFloatToIntBlock\";\r\nimport { ParticleGradientBlock } from \"./Blocks/particleGradientBlock\";\r\nimport { ParticleGradientValueBlock } from \"./Blocks/particleGradientValueBlock\";\r\nimport { ParticleInputBlock } from \"./Blocks/particleInputBlock\";\r\nimport { ParticleMathBlock, ParticleMathBlockOperations } from \"./Blocks/particleMathBlock\";\r\nimport { ParticleRandomBlock, ParticleRandomBlockLocks } from \"./Blocks/particleRandomBlock\";\r\nimport { ParticleTextureSourceBlock } from \"./Blocks/particleSourceTextureBlock\";\r\nimport { ParticleVectorLengthBlock } from \"./Blocks/particleVectorLengthBlock\";\r\nimport { SystemBlock } from \"./Blocks/systemBlock\";\r\nimport { ParticleConditionBlock, ParticleConditionBlockTests } from \"./Blocks/Conditions/particleConditionBlock\";\r\nimport { CreateParticleBlock } from \"./Blocks/Emitters/createParticleBlock\";\r\nimport { BoxShapeBlock } from \"./Blocks/Emitters/boxShapeBlock\";\r\nimport { ConeShapeBlock } from \"./Blocks/Emitters/coneShapeBlock\";\r\nimport { CylinderShapeBlock } from \"./Blocks/Emitters/cylinderShapeBlock\";\r\nimport { CustomShapeBlock } from \"./Blocks/Emitters/customShapeBlock\";\r\nimport { MeshShapeBlock } from \"./Blocks/Emitters/meshShapeBlock\";\r\nimport { PointShapeBlock } from \"./Blocks/Emitters/pointShapeBlock\";\r\nimport { SphereShapeBlock } from \"./Blocks/Emitters/sphereShapeBlock\";\r\nimport { UpdateAngleBlock } from \"./Blocks/Update/updateAngleBlock\";\r\nimport { UpdateColorBlock } from \"./Blocks/Update/updateColorBlock\";\r\nimport { UpdateDirectionBlock } from \"./Blocks/Update/updateDirectionBlock\";\r\nimport { UpdatePositionBlock } from \"./Blocks/Update/updatePositionBlock\";\r\nimport { UpdateSizeBlock } from \"./Blocks/Update/updateSizeBlock\";\r\n\r\n/** Represents blocks or groups of blocks that can be used in multiple places in the graph, so they are stored in this context to be reused */\r\ntype ConversionContext = {\r\n targetStopDurationBlockOutput: NodeParticleConnectionPoint;\r\n // Connections that represent calculated ratios values\r\n timeToStopTimeRatioBlockGroupOutput: NodeParticleConnectionPoint;\r\n ageToLifeTimeRatioBlockGroupOutput: NodeParticleConnectionPoint;\r\n // Connections for the start value of a gradient. These are stored so they can be reused for the Creation phase and the Update phase of the particle\r\n sizeGradientValue0Output: NodeParticleConnectionPoint;\r\n colorGradientValue0Output: NodeParticleConnectionPoint;\r\n // Updated scaled direction direction based on velocity and drag\r\n scaledDirection: NodeParticleConnectionPoint;\r\n};\r\n\r\ntype RuntimeConversionContext = Partial<ConversionContext>;\r\n\r\n/**\r\n * Converts a ParticleSystem to a NodeParticleSystemSet.\r\n * @param name The name of the node particle system set.\r\n * @param particleSystemsList The particle systems to convert.\r\n * @returns The converted node particle system set or null if conversion failed.\r\n */\r\nexport async function ConvertToNodeParticleSystemSetAsync(name: string, particleSystemsList: ParticleSystem[]): Promise<Nullable<NodeParticleSystemSet>> {\r\n if (!particleSystemsList || !particleSystemsList.length) {\r\n return null;\r\n }\r\n\r\n const nodeParticleSystemSet = new NodeParticleSystemSet(name);\r\n const promises: Promise<void>[] = [];\r\n\r\n for (const particleSystem of particleSystemsList) {\r\n promises.push(_ExtractDatafromParticleSystemAsync(nodeParticleSystemSet, particleSystem, {}));\r\n }\r\n\r\n await Promise.all(promises);\r\n return nodeParticleSystemSet;\r\n}\r\n\r\nasync function _ExtractDatafromParticleSystemAsync(newSet: NodeParticleSystemSet, oldSystem: ParticleSystem, context: RuntimeConversionContext): Promise<void> {\r\n // CreateParticle block group\r\n const createParticleOutput = _CreateParticleBlockGroup(oldSystem, context);\r\n\r\n // Emitter Shape block\r\n const shapeOutput = _EmitterShapeBlock(oldSystem);\r\n createParticleOutput.particle.connectTo(shapeOutput.particle);\r\n\r\n // UpdateParticle block group\r\n const updateParticleOutput = _UpdateParticleBlockGroup(shapeOutput.output, oldSystem, context);\r\n\r\n // System block\r\n const newSystem = _SystemBlockGroup(oldSystem, context);\r\n updateParticleOutput.connectTo(newSystem.particle);\r\n\r\n // Register\r\n newSet.systemBlocks.push(newSystem);\r\n}\r\n\r\n// ------------- CREATE PARTICLE FUNCTIONS -------------\r\n\r\n// The creation of the different properties follows the order they are added to the CreationQueue in ThinParticleSystem:\r\n// Lifetime, Emit Power, Size, Scale/StartSize, Angle, Color, Noise, ColorDead, Ramp, Sheet\r\nfunction _CreateParticleBlockGroup(oldSystem: ParticleSystem, context: RuntimeConversionContext): CreateParticleBlock {\r\n // Create particle block\r\n const createParticleBlock = new CreateParticleBlock(\"Create Particle\");\r\n\r\n _CreateParticleLifetimeBlockGroup(oldSystem, context).connectTo(createParticleBlock.lifeTime);\r\n _CreateParticleEmitPowerBlockGroup(oldSystem).connectTo(createParticleBlock.emitPower);\r\n _CreateParticleSizeBlockGroup(oldSystem, context).connectTo(createParticleBlock.size);\r\n _CreateParticleScaleBlockGroup(oldSystem, context).connectTo(createParticleBlock.scale);\r\n _CreateParticleAngleBlockGroup(oldSystem).connectTo(createParticleBlock.angle);\r\n _CreateParticleColorBlockGroup(oldSystem, context).connectTo(createParticleBlock.color);\r\n\r\n // Dead color\r\n _CreateAndConnectInput(\"Dead Color\", oldSystem.colorDead, createParticleBlock.colorDead);\r\n\r\n return createParticleBlock;\r\n}\r\n\r\n/**\r\n * Creates the group of blocks that represent the particle lifetime\r\n * @param oldSystem The old particle system to convert\r\n * @param context The context of the current conversion\r\n * @returns The output of the group of blocks that represent the particle lifetime\r\n */\r\nfunction _CreateParticleLifetimeBlockGroup(oldSystem: ParticleSystem, context: RuntimeConversionContext): NodeParticleConnectionPoint {\r\n if (oldSystem.targetStopDuration && oldSystem._lifeTimeGradients && oldSystem._lifeTimeGradients.length > 0) {\r\n context.timeToStopTimeRatioBlockGroupOutput = _CreateTimeToStopTimeRatioBlockGroup(oldSystem, context);\r\n const gradientBlockGroupOutput = _CreateGradientBlockGroup(\r\n context.timeToStopTimeRatioBlockGroupOutput,\r\n oldSystem._lifeTimeGradients,\r\n ParticleRandomBlockLocks.PerParticle,\r\n \"Lifetime\"\r\n );\r\n return gradientBlockGroupOutput;\r\n } else {\r\n const randomLifetimeBlock = new ParticleRandomBlock(\"Random Lifetime\");\r\n _CreateAndConnectInput(\"Min Lifetime\", oldSystem.minLifeTime, randomLifetimeBlock.min);\r\n _CreateAndConnectInput(\"Max Lifetime\", oldSystem.maxLifeTime, randomLifetimeBlock.max);\r\n return randomLifetimeBlock.output;\r\n }\r\n}\r\n\r\n/**\r\n * Creates the group of blocks that represent the particle emit power\r\n * @param oldSystem The old particle system to convert\r\n * @returns The output of the group of blocks that represent the particle emit power\r\n */\r\nfunction _CreateParticleEmitPowerBlockGroup(oldSystem: ParticleSystem): NodeParticleConnectionPoint {\r\n const randomEmitPowerBlock = new ParticleRandomBlock(\"Random Emit Power\");\r\n _CreateAndConnectInput(\"Min Emit Power\", oldSystem.minEmitPower, randomEmitPowerBlock.min);\r\n _CreateAndConnectInput(\"Max Emit Power\", oldSystem.maxEmitPower, randomEmitPowerBlock.max);\r\n return randomEmitPowerBlock.output;\r\n}\r\n\r\n/**\r\n * Creates the group of blocks that represent the particle size\r\n * @param oldSystem The old particle system to convert\r\n * @param context The context of the current conversion\r\n * @returns The output of the group of blocks that represent the particle size\r\n */\r\nfunction _CreateParticleSizeBlockGroup(oldSystem: ParticleSystem, context: RuntimeConversionContext): NodeParticleConnectionPoint {\r\n if (oldSystem._sizeGradients && oldSystem._sizeGradients.length > 0) {\r\n context.sizeGradientValue0Output = _CreateParticleInitialValueFromGradient(oldSystem._sizeGradients);\r\n return context.sizeGradientValue0Output;\r\n } else {\r\n const randomSizeBlock = new ParticleRandomBlock(\"Random size\");\r\n _CreateAndConnectInput(\"Min size\", oldSystem.minSize, randomSizeBlock.min);\r\n _CreateAndConnectInput(\"Max size\", oldSystem.maxSize, randomSizeBlock.max);\r\n return randomSizeBlock.output;\r\n }\r\n}\r\n\r\n/**\r\n * Creates the group of blocks that represent the particle scale\r\n * @param oldSystem The old particle system to convert\r\n * @param context The context of the current conversion\r\n * @returns The output of the group of blocks that represent the particle scale\r\n */\r\nfunction _CreateParticleScaleBlockGroup(oldSystem: ParticleSystem, context: RuntimeConversionContext): NodeParticleConnectionPoint {\r\n // Create the random scale\r\n const randomScaleBlock = new ParticleRandomBlock(\"Random Scale\");\r\n _CreateAndConnectInput(\"Min Scale\", new Vector2(oldSystem.minScaleX, oldSystem.minScaleY), randomScaleBlock.min);\r\n _CreateAndConnectInput(\"Max Scale\", new Vector2(oldSystem.maxScaleX, oldSystem.maxScaleY), randomScaleBlock.max);\r\n\r\n if (oldSystem.targetStopDuration && oldSystem._startSizeGradients && oldSystem._startSizeGradients.length > 0) {\r\n // Create the start size gradient\r\n context.timeToStopTimeRatioBlockGroupOutput = _CreateTimeToStopTimeRatioBlockGroup(oldSystem, context);\r\n const gradientBlockGroupOutput = _CreateGradientBlockGroup(\r\n context.timeToStopTimeRatioBlockGroupOutput,\r\n oldSystem._startSizeGradients,\r\n ParticleRandomBlockLocks.PerParticle,\r\n \"Start Size\"\r\n );\r\n\r\n // Multiply the initial random scale by the start size gradient\r\n const multiplyScaleBlock = new ParticleMathBlock(\"Multiply Scale by Start Size Gradient\");\r\n multiplyScaleBlock.operation = ParticleMathBlockOperations.Multiply;\r\n randomScaleBlock.output.connectTo(multiplyScaleBlock.left);\r\n gradientBlockGroupOutput.connectTo(multiplyScaleBlock.right);\r\n\r\n return multiplyScaleBlock.output;\r\n } else {\r\n return randomScaleBlock.output;\r\n }\r\n}\r\n\r\n/**\r\n * Creates the group of blocks that represent the particle angle (rotation)\r\n * @param oldSystem The old particle system to convert\r\n * @returns The output of the group of blocks that represent the particle angle (rotation)\r\n */\r\nfunction _CreateParticleAngleBlockGroup(oldSystem: ParticleSystem): NodeParticleConnectionPoint {\r\n const randomRotationBlock = new ParticleRandomBlock(\"Random Rotation\");\r\n _CreateAndConnectInput(\"Min Rotation\", oldSystem.minInitialRotation, randomRotationBlock.min);\r\n _CreateAndConnectInput(\"Max Rotation\", oldSystem.maxInitialRotation, randomRotationBlock.max);\r\n return randomRotationBlock.output;\r\n}\r\n\r\n/**\r\n * Creates the group of blocks that represent the particle color\r\n * @param oldSystem The old particle system to convert\r\n * @param context The context of the current conversion\r\n * @returns The output of the group of blocks that represent the particle color\r\n */\r\nfunction _CreateParticleColorBlockGroup(oldSystem: ParticleSystem, context: RuntimeConversionContext): NodeParticleConnectionPoint {\r\n if (oldSystem._colorGradients && oldSystem._colorGradients.length > 0) {\r\n context.colorGradientValue0Output = _CreateParticleInitialValueFromGradient(oldSystem._colorGradients);\r\n return context.colorGradientValue0Output;\r\n } else {\r\n const randomColorBlock = new ParticleRandomBlock(\"Random color\");\r\n _CreateAndConnectInput(\"Color 1\", oldSystem.color1, randomColorBlock.min);\r\n _CreateAndConnectInput(\"Color 2\", oldSystem.color2, randomColorBlock.max);\r\n return randomColorBlock.output;\r\n }\r\n}\r\n\r\nfunction _CreateParticleInitialValueFromGradient(gradients: Array<FactorGradient> | Array<ColorGradient>): NodeParticleConnectionPoint {\r\n if (gradients.length === 0) {\r\n throw new Error(\"No gradients provided.\");\r\n }\r\n\r\n const gradientStep = gradients[0];\r\n const value1 = (gradientStep as any).factor1 ?? (gradientStep as any).color1;\r\n const value2 = (gradientStep as any).factor2 ?? (gradientStep as any).color2;\r\n\r\n if (value2 !== undefined) {\r\n // Create a random between value1 and value2\r\n const randomBlock = new ParticleRandomBlock(\"Random Value 0\");\r\n randomBlock.lockMode = ParticleRandomBlockLocks.OncePerParticle;\r\n _CreateAndConnectInput(\"Value 1\", value1, randomBlock.min);\r\n _CreateAndConnectInput(\"Value 2\", value2, randomBlock.max);\r\n return randomBlock.output;\r\n } else {\r\n // Single value\r\n const sizeBlock = new ParticleInputBlock(\"Value\");\r\n sizeBlock.value = value1;\r\n return sizeBlock.output;\r\n }\r\n}\r\n\r\n// ------------- EMITTER SHAPE FUNCTIONS -------------\r\n\r\nfunction _EmitterShapeBlock(oldSystem: IParticleSystem): IShapeBlock {\r\n const emitter = oldSystem.particleEmitterType;\r\n if (!emitter) {\r\n throw new Error(\"Particle system has no emitter type.\");\r\n }\r\n\r\n let shapeBlock: Nullable<IShapeBlock> = null;\r\n switch (emitter.getClassName()) {\r\n case \"BoxParticleEmitter\": {\r\n const source = emitter as BoxParticleEmitter;\r\n shapeBlock = new BoxShapeBlock(\"Box Shape\");\r\n\r\n const target = shapeBlock as BoxShapeBlock;\r\n _CreateAndConnectInput(\"Direction 1\", source.direction1, target.direction1);\r\n _CreateAndConnectInput(\"Direction 2\", source.direction2, target.direction2);\r\n _CreateAndConnectInput(\"Min Emit Box\", source.minEmitBox, target.minEmitBox);\r\n _CreateAndConnectInput(\"Max Emit Box\", source.maxEmitBox, target.maxEmitBox);\r\n break;\r\n }\r\n case \"ConeParticleEmitter\": {\r\n const source = emitter as ConeParticleEmitter;\r\n shapeBlock = new ConeShapeBlock(\"Cone Shape\");\r\n\r\n const target = shapeBlock as ConeShapeBlock;\r\n target.emitFromSpawnPointOnly = source.emitFromSpawnPointOnly;\r\n _CreateAndConnectInput(\"Radius\", source.radius, target.radius);\r\n _CreateAndConnectInput(\"Angle\", source.angle, target.angle);\r\n _CreateAndConnectInput(\"Radius Range\", source.radiusRange, target.radiusRange);\r\n _CreateAndConnectInput(\"Height Range\", source.heightRange, target.heightRange);\r\n _CreateAndConnectInput(\"Direction Randomizer\", source.directionRandomizer, target.directionRandomizer);\r\n break;\r\n }\r\n case \"ConeDirectedParticleEmitter\": {\r\n const source = emitter as ConeDirectedParticleEmitter;\r\n shapeBlock = new ConeShapeBlock(\"Cone Shape\");\r\n\r\n const target = shapeBlock as ConeShapeBlock;\r\n target.emitFromSpawnPointOnly = source.emitFromSpawnPointOnly;\r\n _CreateAndConnectInput(\"Radius\", source.radius, target.radius);\r\n _CreateAndConnectInput(\"Angle\", source.angle, target.angle);\r\n _CreateAndConnectInput(\"Radius Range\", source.radiusRange, target.radiusRange);\r\n _CreateAndConnectInput(\"Height Range\", source.heightRange, target.heightRange);\r\n _CreateAndConnectInput(\"Direction 1\", source.direction1, target.direction1);\r\n _CreateAndConnectInput(\"Direction 2\", source.direction2, target.direction2);\r\n break;\r\n }\r\n case \"CustomParticleEmitter\": {\r\n const source = emitter as CustomParticleEmitter;\r\n shapeBlock = new CustomShapeBlock(\"Custom Shape\");\r\n\r\n const target = shapeBlock as CustomShapeBlock;\r\n target.particlePositionGenerator = source.particlePositionGenerator;\r\n target.particleDestinationGenerator = source.particleDestinationGenerator;\r\n target.particleDirectionGenerator = source.particleDirectionGenerator;\r\n break;\r\n }\r\n case \"CylinderParticleEmitter\": {\r\n const source = emitter as CylinderParticleEmitter;\r\n shapeBlock = new CylinderShapeBlock(\"Cylinder Shape\");\r\n\r\n const target = shapeBlock as CylinderShapeBlock;\r\n _CreateAndConnectInput(\"Height\", source.height, target.height);\r\n _CreateAndConnectInput(\"Radius\", source.radius, target.radius);\r\n _CreateAndConnectInput(\"Radius Range\", source.radiusRange, target.radiusRange);\r\n _CreateAndConnectInput(\"Direction Randomizer\", source.directionRandomizer, target.directionRandomizer);\r\n break;\r\n }\r\n case \"CylinderDirectedParticleEmitter\": {\r\n const source = emitter as CylinderDirectedParticleEmitter;\r\n shapeBlock = new CylinderShapeBlock(\"Cylinder Shape\");\r\n\r\n const target = shapeBlock as CylinderShapeBlock;\r\n _CreateAndConnectInput(\"Height\", source.height, target.height);\r\n _CreateAndConnectInput(\"Radius\", source.radius, target.radius);\r\n _CreateAndConnectInput(\"Radius Range\", source.radiusRange, target.radiusRange);\r\n _CreateAndConnectInput(\"Direction 1\", source.direction1, target.direction1);\r\n _CreateAndConnectInput(\"Direction 2\", source.direction2, target.direction2);\r\n break;\r\n }\r\n case \"HemisphericParticleEmitter\": {\r\n const source = emitter as HemisphericParticleEmitter;\r\n shapeBlock = new SphereShapeBlock(\"Sphere Shape\");\r\n\r\n const target = shapeBlock as SphereShapeBlock;\r\n target.isHemispheric = true;\r\n _CreateAndConnectInput(\"Radius\", source.radius, target.radius);\r\n _CreateAndConnectInput(\"Radius Range\", source.radiusRange, target.radiusRange);\r\n _CreateAndConnectInput(\"Direction Randomizer\", source.directionRandomizer, target.directionRandomizer);\r\n break;\r\n }\r\n case \"MeshParticleEmitter\": {\r\n const source = emitter as MeshParticleEmitter;\r\n shapeBlock = new MeshShapeBlock(\"Mesh Shape\");\r\n\r\n const target = shapeBlock as MeshShapeBlock;\r\n target.useMeshNormalsForDirection = source.useMeshNormalsForDirection;\r\n _CreateAndConnectInput(\"Direction 1\", source.direction1, target.direction1);\r\n _CreateAndConnectInput(\"Direction 2\", source.direction2, target.direction2);\r\n\r\n target.mesh = source.mesh as Mesh;\r\n break;\r\n }\r\n case \"PointParticleEmitter\": {\r\n const source = emitter as PointParticleEmitter;\r\n shapeBlock = new PointShapeBlock(\"Point Shape\");\r\n\r\n const target = shapeBlock as PointShapeBlock;\r\n _CreateAndConnectInput(\"Direction 1\", source.direction1, target.direction1);\r\n _CreateAndConnectInput(\"Direction 2\", source.direction2, target.direction2);\r\n break;\r\n }\r\n case \"SphereParticleEmitter\": {\r\n const source = emitter as SphereParticleEmitter;\r\n shapeBlock = new SphereShapeBlock(\"Sphere Shape\");\r\n\r\n const target = shapeBlock as SphereShapeBlock;\r\n _CreateAndConnectInput(\"Radius\", source.radius, target.radius);\r\n _CreateAndConnectInput(\"Radius Range\", source.radiusRange, target.radiusRange);\r\n _CreateAndConnectInput(\"Direction Randomizer\", source.directionRandomizer, target.directionRandomizer);\r\n break;\r\n }\r\n case \"SphereDirectedParticleEmitter\": {\r\n const source = emitter as SphereDirectedParticleEmitter;\r\n shapeBlock = new SphereShapeBlock(\"Sphere Shape\");\r\n\r\n const target = shapeBlock as SphereShapeBlock;\r\n _CreateAndConnectInput(\"Radius\", source.radius, target.radius);\r\n _CreateAndConnectInput(\"Radius Range\", source.radiusRange, target.radiusRange);\r\n _CreateAndConnectInput(\"Direction1\", source.direction1, target.direction1);\r\n _CreateAndConnectInput(\"Direction2\", source.direction2, target.direction2);\r\n break;\r\n }\r\n }\r\n\r\n if (!shapeBlock) {\r\n throw new Error(`Unsupported particle emitter type: ${emitter.getClassName()}`);\r\n }\r\n\r\n return shapeBlock;\r\n}\r\n\r\n// ------------- UPDATE PARTICLE FUNCTIONS -------------\r\n\r\n/**\r\n * Creates the group of blocks that represent the particle system update\r\n * The creation of the different properties follows the order they are added to the ProcessQueue in ThinParticleSystem:\r\n * Color, AngularSpeedGradients, AngularSpeed, VelocityGradients, Direction, LimitVelocityGradients, DragGradients, Position, Noise, SizeGradients, Gravity, RemapGradients\r\n * @param inputParticle The particle input connection point\r\n * @param oldSystem The old particle system to convert\r\n * @param context The runtime conversion context\r\n * @returns The output connection point after all updates have been applied\r\n */\r\nfunction _UpdateParticleBlockGroup(inputParticle: NodeParticleConnectionPoint, oldSystem: ParticleSystem, context: RuntimeConversionContext): NodeParticleConnectionPoint {\r\n let updateBlockGroupOutput: NodeParticleConnectionPoint = inputParticle;\r\n\r\n updateBlockGroupOutput = _UpdateParticleColorBlockGroup(updateBlockGroupOutput, oldSystem._colorGradients, context);\r\n updateBlockGroupOutput = _UpdateParticleAngleBlockGroup(updateBlockGroupOutput, oldSystem, context);\r\n\r\n if (oldSystem._velocityGradients && oldSystem._velocityGradients.length > 0) {\r\n context.scaledDirection = _UpdateParticleVelocityGradientBlockGroup(oldSystem._velocityGradients, context);\r\n }\r\n\r\n if (oldSystem._dragGradients && oldSystem._dragGradients.length > 0) {\r\n context.scaledDirection = _UpdateParticleDragGradientBlockGroup(oldSystem._dragGradients, context);\r\n }\r\n\r\n updateBlockGroupOutput = _UpdateParticlePositionBlockGroup(updateBlockGroupOutput, oldSystem.isLocal, context);\r\n\r\n if (oldSystem._limitVelocityGradients && oldSystem._limitVelocityGradients.length > 0 && oldSystem.limitVelocityDamping !== 0) {\r\n updateBlockGroupOutput = _UpdateParticleVelocityLimitGradientBlockGroup(updateBlockGroupOutput, oldSystem._limitVelocityGradients, oldSystem.limitVelocityDamping, context);\r\n }\r\n\r\n if (oldSystem._sizeGradients && oldSystem._sizeGradients.length > 0) {\r\n updateBlockGroupOutput = _UpdateParticleSizeGradientBlockGroup(updateBlockGroupOutput, oldSystem._sizeGradients, context);\r\n }\r\n\r\n if (oldSystem.gravity.equalsToFloats(0, 0, 0) === false) {\r\n updateBlockGroupOutput = _UpdateParticleGravityBlockGroup(updateBlockGroupOutput, oldSystem.gravity);\r\n }\r\n\r\n return updateBlockGroupOutput;\r\n}\r\n\r\n/**\r\n * Creates the group of blocks that represent the particle color update\r\n * @param inputParticle The input particle to update\r\n * @param colorGradients The color gradients (if any)\r\n * @param context The context of the current conversion\r\n * @returns The output of the group of blocks that represent the particle color update\r\n */\r\nfunction _UpdateParticleColorBlockGroup(\r\n inputParticle: NodeParticleConnectionPoint,\r\n colorGradients: Nullable<Array<ColorGradient>>,\r\n context: RuntimeConversionContext\r\n): NodeParticleConnectionPoint {\r\n let colorCalculation: NodeParticleConnectionPoint | undefined = undefined;\r\n if (colorGradients && colorGradients.length > 0) {\r\n if (context.colorGradientValue0Output === undefined) {\r\n throw new Error(\"Initial color gradient values not found in context.\");\r\n }\r\n\r\n context.ageToLifeTimeRatioBlockGroupOutput = _CreateAgeToLifeTimeRatioBlockGroup(context);\r\n colorCalculation = _CreateGradientBlockGroup(context.ageToLifeTimeRatioBlockGroupOutput, colorGradients, ParticleRandomBlockLocks.OncePerParticle, \"Color\", [\r\n context.colorGradientValue0Output,\r\n ]);\r\n } else {\r\n colorCalculation = _BasicColorUpdateBlockGroup();\r\n }\r\n\r\n // Create the color update block clamping alpha >= 0\r\n const colorUpdateBlock = new UpdateColorBlock(\"Color update\");\r\n inputParticle.connectTo(colorUpdateBlock.particle);\r\n _ClampUpdateColorAlpha(colorCalculation).connectTo(colorUpdateBlock.color);\r\n\r\n return colorUpdateBlock.output;\r\n}\r\n\r\n/**\r\n * Creates the group of blocks that represent the particle angle update\r\n * @param inputParticle The input particle to update\r\n * @param oldSystem The old particle system to convert\r\n * @param context The context of the current conversion\r\n * @returns The output of the group of blocks that represent the particle color update\r\n */\r\nfunction _UpdateParticleAngleBlockGroup(inputParticle: NodeParticleConnectionPoint, oldSystem: ParticleSystem, context: RuntimeConversionContext): NodeParticleConnectionPoint {\r\n // We will try to use gradients if they exist\r\n // If not, we will try to use min/max angular speed\r\n let angularSpeedCalculation = null;\r\n if (oldSystem._angularSpeedGradients && oldSystem._angularSpeedGradients.length > 0) {\r\n angularSpeedCalculation = _UpdateParticleAngularSpeedGradientBlockGroup(oldSystem._angularSpeedGradients, context);\r\n } else if (oldSystem.minAngularSpeed !== 0 || oldSystem.maxAngularSpeed !== 0) {\r\n angularSpeedCalculation = _UpdateParticleAngularSpeedBlockGroup(oldSystem.minAngularSpeed, oldSystem.maxAngularSpeed);\r\n }\r\n\r\n // If we have an angular speed calculation, then update the angle\r\n if (angularSpeedCalculation) {\r\n // Create the angular speed delta\r\n const angleSpeedDeltaOutput = _CreateDeltaModifiedInput(\"Angular Speed\", angularSpeedCalculation);\r\n\r\n // Add it to the angle\r\n const addAngle = new ParticleMathBlock(\"Add Angular Speed to Angle\");\r\n addAngle.operation = ParticleMathBlockOperations.Add;\r\n _CreateAndConnectContextualSource(\"Angle\", NodeParticleContextualSources.Angle, addAngle.left);\r\n angleSpeedDeltaOutput.connectTo(addAngle.right);\r\n\r\n // Update the particle angle\r\n const updateAngle = new UpdateAngleBlock(\"Angle Update with Angular Speed\");\r\n inputParticle.connectTo(updateAngle.particle);\r\n addAngle.output.connectTo(updateAngle.angle);\r\n\r\n return updateAngle.output;\r\n } else {\r\n return inputParticle;\r\n }\r\n}\r\n\r\n/**\r\n * Creates the group of blocks that represent the particle velocity update\r\n * @param velocityGradients The velocity gradients\r\n * @param context The context of the current conversion\r\n * @returns The output of the group of blocks that represent the particle velocity update\r\n */\r\nfunction _UpdateParticleVelocityGradientBlockGroup(velocityGradients: Array<FactorGradient>, context: RuntimeConversionContext): NodeParticleConnectionPoint {\r\n context.ageToLifeTimeRatioBlockGroupOutput = _CreateAgeToLifeTimeRatioBlockGroup(context);\r\n\r\n // Generate the gradient\r\n const velocityValueOutput = _CreateGradientBlockGroup(context.ageToLifeTimeRatioBlockGroupOutput, velocityGradients, ParticleRandomBlockLocks.OncePerParticle, \"Velocity\");\r\n\r\n // Update the direction scale based on the velocity\r\n const multiplyScaleByVelocity = new ParticleMathBlock(\"Multiply Direction Scale by Velocity\");\r\n multiplyScaleByVelocity.operation = ParticleMathBlockOperations.Multiply;\r\n velocityValueOutput.connectTo(multiplyScaleByVelocity.left);\r\n _CreateAndConnectContextualSource(\"Direction Scale\", NodeParticleContextualSources.DirectionScale, multiplyScaleByVelocity.right);\r\n\r\n // Update the particle direction scale\r\n const multiplyDirection = new ParticleMathBlock(\"Scaled Direction\");\r\n multiplyDirection.operation = ParticleMathBlockOperations.Multiply;\r\n multiplyScaleByVelocity.output.connectTo(multiplyDirection.left);\r\n _CreateAndConnectContextualSource(\"Direction\", NodeParticleContextualSources.Direction, multiplyDirection.right);\r\n\r\n // Store the new calculation of the scaled direction in the context\r\n context.scaledDirection = multiplyDirection.output;\r\n return multiplyDirection.output;\r\n}\r\n\r\n/**\r\n * Creates the group of blocks that represent the particle velocity limit update\r\n * @param inputParticle The input particle to update\r\n * @param velocityLimitGradients The velocity limit gradients\r\n * @param limitVelocityDamping The limit velocity damping factor\r\n * @param context The context of the current conversion\r\n * @returns The output of the group of blocks that represent the particle velocity limit update\r\n */\r\nfunction _UpdateParticleVelocityLimitGradientBlockGroup(\r\n inputParticle: NodeParticleConnectionPoint,\r\n velocityLimitGradients: Array<FactorGradient>,\r\n limitVelocityDamping: number,\r\n context: RuntimeConversionContext\r\n): NodeParticleConnectionPoint {\r\n context.ageToLifeTimeRatioBlockGroupOutput = _CreateAgeToLifeTimeRatioBlockGroup(context);\r\n\r\n // Calculate the current speed\r\n const currentSpeedBlock = new ParticleVectorLengthBlock(\"Current Speed\");\r\n _CreateAndConnectContextualSource(\"Direction\", NodeParticleContextualSources.Direction, currentSpeedBlock.input);\r\n\r\n // Calculate the velocity limit from the gradient\r\n const velocityLimitValueOutput = _CreateGradientBlockGroup(\r\n context.ageToLifeTimeRatioBlockGroupOutput,\r\n velocityLimitGradients,\r\n ParticleRandomBlockLocks.OncePerParticle,\r\n \"Velocity Limit\"\r\n );\r\n\r\n // Blocks that will calculate the new velocity if over the limit\r\n const damped = new ParticleMathBlock(\"Damped Speed\");\r\n damped.operation = ParticleMathBlockOperations.Multiply;\r\n _CreateAndConnectContextualSource(\"Direction\", NodeParticleContextualSources.Direction, damped.left);\r\n _CreateAndConnectInput(\"Limit Velocity Damping\", limitVelocityDamping, damped.right);\r\n\r\n // Compare current speed and limit\r\n const compareSpeed = new ParticleConditionBlock(\"Compare Speed to Limit\");\r\n compareSpeed.test = ParticleConditionBlockTests.GreaterThan;\r\n currentSpeedBlock.output.connectTo(compareSpeed.left);\r\n velocityLimitValueOutput.connectTo(compareSpeed.right);\r\n damped.output.connectTo(compareSpeed.ifTrue);\r\n _CreateAndConnectContextualSource(\"Direction\", NodeParticleContextualSources.Direction, compareSpeed.ifFalse);\r\n\r\n // Update the direction based on the calculted value\r\n const updateDirection = new UpdateDirectionBlock(\"Direction Update\");\r\n inputParticle.connectTo(updateDirection.particle);\r\n compareSpeed.output.connectTo(updateDirection.direction);\r\n\r\n return updateDirection.output;\r\n}\r\n\r\n/**\r\n * Creates the group of blocks that represent the particle drag update\r\n * @param dragGradients The drag gradients\r\n * @param context The context of the current conversion\r\n * @returns The output of the group of blocks that represent the particle drag update\r\n */\r\nfunction _UpdateParticleDragGradientBlockGroup(dragGradients: Array<FactorGradient>, context: RuntimeConversionContext): NodeParticleConnectionPoint {\r\n context.ageToLifeTimeRatioBlockGroupOutput = _CreateAgeToLifeTimeRatioBlockGroup(context);\r\n\r\n // Generate the gradient\r\n const dragValueOutput = _CreateGradientBlockGroup(context.ageToLifeTimeRatioBlockGroupOutput, dragGradients, ParticleRandomBlockLocks.OncePerParticle, \"Drag\");\r\n\r\n // Calculate drag factor\r\n const oneMinusDragBlock = new ParticleMathBlock(\"1 - Drag\");\r\n oneMinusDragBlock.operation = ParticleMathBlockOperations.Subtract;\r\n _CreateAndConnectInput(\"One\", 1, oneMinusDragBlock.left);\r\n dragValueOutput.connectTo(oneMinusDragBlock.right);\r\n\r\n // Multiply the scaled direction by drag factor\r\n const multiplyDirection = new ParticleMathBlock(\"Scaled Direction with Drag\");\r\n multiplyDirection.operation = ParticleMathBlockOperations.Multiply;\r\n oneMinusDragBlock.output.connectTo(multiplyDirection.left);\r\n if (context.scaledDirection === undefined) {\r\n _CreateAndConnectContextualSource(\"Scaled Direction\", NodeParticleContextualSources.ScaledDirection, multiplyDirection.right);\r\n } else {\r\n context.scaledDirection.connectTo(multiplyDirection.right);\r\n }\r\n\r\n // Store the new calculation of the scaled direction in the context\r\n context.scaledDirection = multiplyDirection.output;\r\n return multiplyDirection.output;\r\n}\r\n\r\n/**\r\n * Creates the group of blocks that represent the particle position update\r\n * @param inputParticle The input particle to update\r\n * @param isLocal Whether the particle coordinate system is local or not\r\n * @param context The context of the current conversion\r\n * @returns The output of the group of blocks that represent the particle position update\r\n */\r\nfunction _UpdateParticlePositionBlockGroup(inputParticle: NodeParticleConnectionPoint, isLocal: boolean, context: RuntimeConversionContext): NodeParticleConnectionPoint {\r\n // Update the particle position\r\n const updatePosition = new UpdatePositionBlock(\"Position Update\");\r\n inputParticle.connectTo(updatePosition.particle);\r\n\r\n if (isLocal) {\r\n _CreateAndConnectContextualSource(\"Local Position Updated\", NodeParticleContextualSources.LocalPositionUpdated, updatePosition.position);\r\n } else {\r\n // Calculate the new position\r\n const addPositionBlock = new ParticleMathBlock(\"Add Position\");\r\n addPositionBlock.operation = ParticleMathBlockOperations.Add;\r\n _CreateAndConnectContextualSource(\"Position\", NodeParticleContextualSources.Position, addPositionBlock.left);\r\n if (context.scaledDirection === undefined) {\r\n _CreateAndConnectContextualSource(\"Scaled Direction\", NodeParticleContextualSources.ScaledDirection, addPositionBlock.right);\r\n } else {\r\n context.scaledDirection.connectTo(addPositionBlock.right);\r\n }\r\n\r\n addPositionBlock.output.connectTo(updatePosition.position);\r\n }\r\n\r\n return updatePosition.output;\r\n}\r\n\r\n/**\r\n * Creates the group of blocks that represent the particle size update\r\n * @param inputParticle The input particle to update\r\n * @param sizeGradients The size gradients (if any)\r\n * @param context The context of the current conversion\r\n * @returns The output of the group of blocks that represent the particle size update\r\n */\r\nfunction _UpdateParticleSizeGradientBlockGroup(\r\n inputParticle: NodeParticleConnectionPoint,\r\n sizeGradients: Array<FactorGradient>,\r\n context: RuntimeConversionContext\r\n): NodeParticleConnectionPoint {\r\n if (context.sizeGradientValue0Output === undefined) {\r\n throw new Error(\"Initial size gradient values not found in context.\");\r\n }\r\n\r\n context.ageToLifeTimeRatioBlockGroupOutput = _CreateAgeToLifeTimeRatioBlockGroup(context);\r\n\r\n // Generate the gradient\r\n const sizeValueOutput = _CreateGradientBlockGroup(context.ageToLifeTimeRatioBlockGroupOutput, sizeGradients, ParticleRandomBlockLocks.OncePerParticle, \"Size\", [\r\n context.sizeGradientValue0Output,\r\n ]);\r\n\r\n // Create the update size\r\n const updateSizeBlock = new UpdateSizeBlock(\"Size Update\");\r\n inputParticle.connectTo(updateSizeBlock.particle);\r\n sizeValueOutput.connectTo(updateSizeBlock.size);\r\n\r\n return updateSizeBlock.output;\r\n}\r\n\r\n/**\r\n * Creates the group of blocks that represent the particle gravity update\r\n * @param inputParticle The input particle to update\r\n * @param gravity The gravity vector to apply\r\n * @returns The output of the group of blocks that represent the particle gravity update\r\n */\r\nfunction _UpdateParticleGravityBlockGroup(inputParticle: NodeParticleConnectionPoint, gravity: Vector3): NodeParticleConnectionPoint {\r\n // Create the gravity delta\r\n const gravityDeltaOutput = _CreateDeltaModifiedInput(\"Gravity\", gravity);\r\n\r\n // Add it to the direction\r\n const addDirectionBlock = new ParticleMathBlock(\"Add Gravity to Direction\");\r\n addDirectionBlock.operation = ParticleMathBlockOperations.Add;\r\n _CreateAndConnectContextualSource(\"Direction\", NodeParticleContextualSources.Direction, addDirectionBlock.left);\r\n gravityDeltaOutput.connectTo(addDirectionBlock.right);\r\n\r\n // Update the particle direction\r\n const updateDirection = new UpdateDirectionBlock(\"Direction Update with Gravity\");\r\n inputParticle.connectTo(updateDirection.particle);\r\n addDirectionBlock.output.connectTo(updateDirection.direction);\r\n\r\n return updateDirection.output;\r\n}\r\n\r\nfunction _UpdateParticleAngularSpeedGradientBlockGroup(angularSpeedGradients: Array<FactorGradient>, context: RuntimeConversionContext): NodeParticleConnectionPoint {\r\n context.ageToLifeTimeRatioBlockGroupOutput = _CreateAgeToLifeTimeRatioBlockGroup(context);\r\n\r\n // Generate the gradient\r\n const angularSpeedValueOutput = _CreateGradientBlockGroup(\r\n context.ageToLifeTimeRatioBlockGroupOutput,\r\n angularSpeedGradients,\r\n ParticleRandomBlockLocks.OncePerParticle,\r\n \"Angular Speed\"\r\n );\r\n return angularSpeedValueOutput;\r\n}\r\n\r\nfunction _UpdateParticleAngularSpeedBlockGroup(minAngularSpeed: number, maxAngularSpeed: number): NodeParticleConnectionPoint {\r\n // Random value between for the angular speed of the particle\r\n const randomAngularSpeedBlock = new ParticleRandomBlock(\"Random Angular Speed\");\r\n randomAngularSpeedBlock.lockMode = ParticleRandomBlockLocks.OncePerParticle;\r\n _CreateAndConnectInput(\"Min Angular Speed\", minAngularSpeed, randomAngularSpeedBlock.min);\r\n _CreateAndConnectInput(\"Max Angular Speed\", maxAngularSpeed, randomAngularSpeedBlock.max);\r\n return randomAngularSpeedBlock.output;\r\n}\r\n\r\nfunction _BasicColorUpdateBlockGroup(): NodeParticleConnectionPoint {\r\n const addColorBlock = new ParticleMathBlock(\"Add Color\");\r\n addColorBlock.operation = ParticleMathBlockOperations.Add;\r\n _CreateAndConnectContextualSource(\"Color\", NodeParticleContextualSources.Color, addColorBlock.left);\r\n _CreateAndConnectContextualSource(\"Scaled Color Step\", NodeParticleContextualSources.ScaledColorStep, addColorBlock.right);\r\n return addColorBlock.output;\r\n}\r\n\r\nfunction _ClampUpdateColorAlpha(colorCalculationOutput: NodeParticleConnectionPoint): NodeParticleConnectionPoint {\r\n // Decompose color to clamp alpha\r\n const decomposeColorBlock = new ParticleConverterBlock(\"Decompose Color\");\r\n colorCalculationOutput.connectTo(decomposeColorBlock.colorIn);\r\n\r\n // Clamp alpha to be >= 0\r\n const maxAlphaBlock = new ParticleMathBlock(\"Alpha >= 0\");\r\n maxAlphaBlock.operation = ParticleMathBlockOperations.Max;\r\n decomposeColorBlock.wOut.connectTo(maxAlphaBlock.left);\r\n _CreateAndConnectInput(\"Zero\", 0, maxAlphaBlock.right);\r\n\r\n // Recompose color\r\n const composeColorBlock = new ParticleConverterBlock(\"Compose Color\");\r\n decomposeColorBlock.xyzOut.connectTo(composeColorBlock.xyzIn);\r\n maxAlphaBlock.output.connectTo(composeColorBlock.wIn);\r\n\r\n return composeColorBlock.colorOut;\r\n}\r\n\r\n// ------------- SYSTEM FUNCTIONS -------------\r\n\r\nfunction _SystemBlockGroup(oldSystem: ParticleSystem, context: RuntimeConversionContext): SystemBlock {\r\n const newSystem = new SystemBlock(oldSystem.name);\r\n\r\n newSystem.translationPivot.value = oldSystem.translationPivot;\r\n newSystem.textureMask.value = oldSystem.textureMask;\r\n newSystem.manualEmitCount = oldSystem.manualEmitCount;\r\n newSystem.blendMode = oldSystem.blendMode;\r\n newSystem.capacity = oldSystem.getCapacity();\r\n newSystem.startDelay = oldSystem.startDelay;\r\n newSystem.updateSpeed = oldSystem.updateSpeed;\r\n newSystem.preWarmCycles = oldSystem.preWarmCycles;\r\n newSystem.preWarmStepOffset = oldSystem.preWarmStepOffset;\r\n newSystem.isBillboardBased = oldSystem.isBillboardBased;\r\n newSystem.isLocal = oldSystem.isLocal;\r\n newSystem.disposeOnStop = oldSystem.disposeOnStop;\r\n\r\n _SystemEmitRateValue(oldSystem, newSystem, context);\r\n _SystemTextureBlock(oldSystem).connectTo(newSystem.texture);\r\n _SystemTargetStopDuration(oldSystem, newSystem, context);\r\n\r\n return newSystem;\r\n}\r\n\r\nfunction _SystemEmitRateValue(oldSystem: ParticleSystem, newSystem: SystemBlock, context: RuntimeConversionContext): void {\r\n const emitGradients = oldSystem.getEmitRateGradients();\r\n if (emitGradients && emitGradients.length > 0 && oldSystem.targetStopDuration > 0) {\r\n // Create the emit gradients\r\n context.timeToStopTimeRatioBlockGroupOutput = _CreateTimeToStopTimeRatioBlockGroup(oldSystem, context);\r\n const gradientValue = _CreateGradientBlockGroup(context.timeToStopTimeRatioBlockGroupOutput, emitGradients, ParticleRandomBlockLocks.PerSystem, \"Emit Rate\");\r\n\r\n // Round the value to an int\r\n const roundBlock = new ParticleFloatToIntBlock(\"Round to Int\");\r\n roundBlock.operation = ParticleFloatToIntBlockOperations.Round;\r\n gradientValue.connectTo(roundBlock.input);\r\n roundBlock.output.connectTo(newSystem.emitRate);\r\n } else {\r\n newSystem.emitRate.value = oldSystem.emitRate;\r\n }\r\n}\r\n\r\nfunction _SystemTextureBlock(oldSystem: ParticleSystem): NodeParticleConnectionPoint {\r\n // Texture\r\n const textureBlock = new ParticleTextureSourceBlock(\"Texture\");\r\n const url = (oldSystem.particleTexture as Texture).url || \"\";\r\n if (url) {\r\n textureBlock.url = url;\r\n } else {\r\n textureBlock.sourceTexture = oldSystem.particleTexture;\r\n }\r\n\r\n return textureBlock.texture;\r\n}\r\n\r\nfunction _SystemTargetStopDuration(oldSystem: ParticleSystem, newSystem: SystemBlock, context: RuntimeConversionContext): void {\r\n // If something else uses the target stop duration (like a gradient),\r\n // then the block is already created and stored in the context\r\n if (context.targetStopDurationBlockOutput) {\r\n context.targetStopDurationBlockOutput.connectTo(newSystem.targetStopDuration);\r\n } else {\r\n // If no one used it, do not create a block just set the value\r\n newSystem.targetStopDuration.value = oldSystem.targetStopDuration;\r\n }\r\n}\r\n\r\n// ------------- UTILITY FUNCTIONS -------------\r\n\r\nfunction _CreateDeltaModifiedInput(name: string, value: Vector3 | NodeParticleConnectionPoint): NodeParticleConnectionPoint {\r\n const multiplyBlock = new ParticleMathBlock(\"Multiply by Delta\");\r\n multiplyBlock.operation = ParticleMathBlockOperations.Multiply;\r\n if (value instanceof Vector3) {\r\n _CreateAndConnectInput(name, value, multiplyBlock.left);\r\n } else {\r\n value.connectTo(multiplyBlock.left);\r\n }\r\n _CreateAndConnectSystemSource(\"Delta\", NodeParticleSystemSources.Delta, multiplyBlock.right);\r\n\r\n return multiplyBlock.output;\r\n}\r\n\r\nfunction _CreateAndConnectInput(\r\n inputBlockName: string,\r\n value: number | Vector2 | Vector3 | Color4,\r\n targetToConnectTo: NodeParticleConnectionPoint,\r\n inputType?: NodeParticleBlockConnectionPointTypes\r\n): void {\r\n const input = new ParticleInputBlock(inputBlockName, inputType);\r\n input.value = value;\r\n input.output.connectTo(targetToConnectTo);\r\n}\r\n\r\nfunction _CreateAndConnectContextualSource(contextualBlockName: string, contextSource: NodeParticleContextualSources, targetToConnectTo: NodeParticleConnectionPoint): void {\r\n const input = new ParticleInputBlock(contextualBlockName);\r\n input.contextualValue = contextSource;\r\n input.output.connectTo(targetToConnectTo);\r\n}\r\n\r\nfunction _CreateAndConnectSystemSource(systemBlockName: string, systemSource: NodeParticleSystemSources, targetToConnectTo: NodeParticleConnectionPoint): void {\r\n const input = new ParticleInputBlock(systemBlockName);\r\n input.systemSource = systemSource;\r\n input.output.connectTo(targetToConnectTo);\r\n}\r\n\r\n/**\r\n * Creates the target stop duration input block, as it can be shared in multiple places\r\n * This block is stored in the context so the same block is shared in the graph\r\n * @param oldSystem The old particle system to convert\r\n * @param context The context of the current conversion\r\n * @returns\r\n */\r\nfunction _CreateTargetStopDurationInputBlock(oldSystem: ParticleSystem, context: RuntimeConversionContext): NodeParticleConnectionPoint {\r\n // If we have already created the target stop duration input block, return it\r\n if (context.targetStopDurationBlockOutput) {\r\n return context.targetStopDurationBlockOutput;\r\n }\r\n\r\n // Create the target stop duration input block if not already created\r\n const targetStopDurationInputBlock = new ParticleInputBlock(\"Target Stop Duration\");\r\n targetStopDurationInputBlock.value = oldSystem.targetStopDuration;\r\n\r\n // Save the output in our context to avoid regenerating it again\r\n context.targetStopDurationBlockOutput = targetStopDurationInputBlock.output;\r\n return context.targetStopDurationBlockOutput;\r\n}\r\n\r\n/**\r\n * Create a group of blocks that calculates the ratio between the actual frame and the target stop duration, clamped between 0 and 1.\r\n * This is used to simulate the behavior of the old particle system where several particle gradient values are affected by the target stop duration.\r\n * This block group is stored in the context so the same group is shared in the graph\r\n * @param oldSystem The old particle system to convert\r\n * @param context The context of the current conversion\r\n * @returns The ratio block output connection point\r\n */\r\nfunction _CreateTimeToStopTimeRatioBlockGroup(oldSystem: ParticleSystem, context: RuntimeConversionContext): NodeParticleConnectionPoint {\r\n // If we have already generated this group, return it\r\n if (context.timeToStopTimeRatioBlockGroupOutput) {\r\n return context.timeToStopTimeRatioBlockGroupOutput;\r\n }\r\n\r\n context.targetStopDurationBlockOutput = _CreateTargetStopDurationInputBlock(oldSystem, context);\r\n\r\n // Find the ratio between the actual frame and the target stop duration\r\n const ratio = new ParticleMathBlock(\"Frame/Stop Ratio\");\r\n ratio.operation = ParticleMathBlockOperations.Divide;\r\n _CreateAndConnectSystemSource(\"Actual Frame\", NodeParticleSystemSources.Time, ratio.left);\r\n context.targetStopDurationBlockOutput.connectTo(ratio.right);\r\n\r\n // Make sure values is >=0\r\n const clampMin = new ParticleMathBlock(\"Clamp Min 0\");\r\n clampMin.operation = ParticleMathBlockOperations.Max;\r\n _CreateAndConnectInput(\"Zero\", 0, clampMin.left);\r\n ratio.output.connectTo(clampMin.right);\r\n\r\n // Make sure values is <=1\r\n const clampMax = new ParticleMathBlock(\"Clamp Max 1\");\r\n clampMax.operation = ParticleMathBlockOperations.Min;\r\n _CreateAndConnectInput(\"One\", 1, clampMax.left);\r\n clampMin.output.connectTo(clampMax.right);\r\n\r\n // Save the group output in our context to avoid regenerating it again\r\n context.timeToStopTimeRatioBlockGroupOutput = clampMax.output;\r\n return context.timeToStopTimeRatioBlockGroupOutput;\r\n}\r\n\r\nfunction _CreateAgeToLifeTimeRatioBlockGroup(context: RuntimeConversionContext): NodeParticleConnectionPoint {\r\n // If we have already generated this group, return it\r\n if (context.ageToLifeTimeRatioBlockGroupOutput) {\r\n return context.ageToLifeTimeRatioBlockGroupOutput;\r\n }\r\n\r\n // Find the ratio between the age and the lifetime\r\n const ratio = new ParticleMathBlock(\"Age/LifeTime Ratio\");\r\n ratio.operation = ParticleMathBlockOperations.Divide;\r\n _CreateAndConnectContextualSource(\"Age\", NodeParticleContextualSources.Age, ratio.left);\r\n _CreateAndConnectContextualSource(\"LifeTime\", NodeParticleContextualSources.Lifetime, ratio.right);\r\n\r\n // Save the group output in our context to avoid regenerating it again\r\n context.ageToLifeTimeRatioBlockGroupOutput = ratio.output;\r\n return ratio.output;\r\n}\r\n\r\n/**\r\n * Creates the blocks that represent a gradient\r\n * @param gradientSelector The value that determines which gradient to use\r\n * @param gradientValues The list of gradient values\r\n * @param randomLockMode The type of random to use for the gradient values\r\n * @param prefix The prefix to use for naming the blocks\r\n * @param initialValues Optional initial values to connect to the gradient inputs that were calculated during other steps of the conversion\r\n * @returns The output connection point of the gradient block\r\n */\r\nfunction _CreateGradientBlockGroup(\r\n gradientSelector: NodeParticleConnectionPoint,\r\n gradientValues: Array<FactorGradient> | Array<ColorGradient>,\r\n randomLockMode: ParticleRandomBlockLocks,\r\n prefix: string,\r\n initialValues: NodeParticleConnectionPoint[] = []\r\n): NodeParticleConnectionPoint {\r\n // Create the gradient block and connect the value that controls the gradient selection\r\n const gradientBlock = new ParticleGradientBlock(prefix + \" Gradient Block\");\r\n gradientSelector.connectTo(gradientBlock.gradient);\r\n\r\n // If initial values are provided, we use them instead of the values in the gradientValues array\r\n // These means this values were already transformed into blocks on a previous step of the conversion and we must reuse them\r\n for (let i = 0; i < initialValues.length; i++) {\r\n const reference = i < gradientValues.length ? gradientValues[i].gradient : 1;\r\n const gradientValueBlock = new ParticleGradientValueBlock(prefix + \" Gradient Value \" + i);\r\n gradientValueBlock.reference = reference;\r\n initialValues[i].connectTo(gradientValueBlock.value);\r\n gradientValueBlock.output.connectTo(gradientBlock.inputs[i + 1]);\r\n }\r\n\r\n // Create the gradient values\r\n for (let i = 0 + initialValues.length; i < gradientValues.length; i++) {\r\n const gradientValueBlockGroupOutput = _CreateGradientValueBlockGroup(gradientValues[i], randomLockMode, prefix, i);\r\n gradientValueBlockGroupOutput.connectTo(gradientBlock.inputs[i + 1]);\r\n }\r\n\r\n return gradientBlock.output;\r\n}\r\n\r\n/**\r\n * Creates the blocks that represent a gradient value\r\n * This can be either a single value or a random between two values\r\n * @param gradientStep The gradient step data\r\n * @param randomLockMode The lock mode to use for random values\r\n * @param prefix The prefix to use for naming the blocks\r\n * @param index The index of the gradient step\r\n * @returns The output connection point of the gradient value block\r\n */\r\nfunction _CreateGradientValueBlockGroup(\r\n gradientStep: FactorGradient | ColorGradient,\r\n randomLockMode: ParticleRandomBlockLocks,\r\n prefix: string,\r\n index: number\r\n): NodeParticleConnectionPoint {\r\n const gradientValueBlock = new ParticleGradientValueBlock(prefix + \" Gradient Value \" + index);\r\n gradientValueBlock.reference = gradientStep.gradient;\r\n\r\n const value1 = (gradientStep as any).factor1 ?? (gradientStep as any).color1;\r\n const value2 = (gradientStep as any).factor2 ?? (gradientStep as any).color2;\r\n\r\n if (value2 !== undefined) {\r\n // Create a random between value1 and value2\r\n const randomBlock = new ParticleRandomBlock(\"Random Value \" + index);\r\n randomBlock.lockMode = randomLockMode;\r\n _CreateAndConnectInput(\"Value 1\", value1, randomBlock.min);\r\n _CreateAndConnectInput(\"Value 2\", value2, randomBlock.max);\r\n randomBlock.output.connectTo(gradientValueBlock.value);\r\n } else {\r\n // Single value\r\n _CreateAndConnectInput(\"Value\", value1, gradientValueBlock.value);\r\n }\r\n\r\n return gradientValueBlock.output;\r\n}\r\n"]}
1
+ {"version":3,"file":"nodeParticleSystemSet.helper.js","sourceRoot":"","sources":["../../../../../dev/core/src/Particles/Node/nodeParticleSystemSet.helper.ts"],"names":[],"mappings":"AAqBA,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,mCAA+B;AAC1D,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,6BAA6B,EAAE,MAAM,uCAAuC,CAAC;AACtF,OAAO,EAAE,yBAAyB,EAAE,MAAM,mCAAmC,CAAC;AAC9E,OAAO,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AACzE,OAAO,EAAE,uBAAuB,EAAE,iCAAiC,EAAE,MAAM,kCAAkC,CAAC;AAC9G,OAAO,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AACvE,OAAO,EAAE,0BAA0B,EAAE,MAAM,qCAAqC,CAAC;AACjF,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,EAAE,iBAAiB,EAAE,2BAA2B,EAAE,MAAM,4BAA4B,CAAC;AAC5F,OAAO,EAAE,mBAAmB,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AAC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E,CAAC;IAC3C,IAAI,GAAG,EAAE,CAAC;QACN,YAAY,CAAC,GAAG,GAAG,GAAG,CAAC;IAC3B,CAAC;SAAM,CAAC;QACJ,YAAY,CAAC,aAAa,GAAG,OAAO,CAAC;IACzC,CAAC;IAED,OAAO,YAAY,CAAC,OAAO,CAAC;AAChC,CAAC","sourcesContent":["import type { Nullable } from \"core/types\";\r\nimport type { Color4 } from \"core/Maths/math.color\";\r\nimport type { BaseTexture } from \"core/Materials/Textures/baseTexture\";\r\nimport type { Texture } from \"core/Materials/Textures/texture\";\r\nimport type { ProceduralTexture } from \"core/Materials/Textures/Procedurals/proceduralTexture\";\r\nimport type { Mesh } from \"core/Meshes/mesh\";\r\nimport type { ColorGradient, FactorGradient } from \"core/Misc\";\r\nimport type { ParticleSystem } from \"core/Particles/particleSystem\";\r\nimport type { IParticleSystem } from \"core/Particles/IParticleSystem\";\r\nimport type { BoxParticleEmitter } from \"core/Particles/EmitterTypes/boxParticleEmitter\";\r\nimport type { ConeDirectedParticleEmitter, ConeParticleEmitter } from \"core/Particles/EmitterTypes/coneParticleEmitter\";\r\nimport type { CustomParticleEmitter } from \"core/Particles/EmitterTypes/customParticleEmitter\";\r\nimport type { CylinderDirectedParticleEmitter, CylinderParticleEmitter } from \"core/Particles/EmitterTypes/cylinderParticleEmitter\";\r\nimport type { HemisphericParticleEmitter } from \"core/Particles/EmitterTypes/hemisphericParticleEmitter\";\r\nimport type { MeshParticleEmitter } from \"core/Particles/EmitterTypes/meshParticleEmitter\";\r\nimport type { PointParticleEmitter } from \"core/Particles/EmitterTypes/pointParticleEmitter\";\r\nimport type { SphereDirectedParticleEmitter, SphereParticleEmitter } from \"core/Particles/EmitterTypes/sphereParticleEmitter\";\r\nimport type { NodeParticleConnectionPoint } from \"core/Particles/Node/nodeParticleBlockConnectionPoint\";\r\nimport type { IShapeBlock } from \"core/Particles/Node/Blocks/Emitters/IShapeBlock\";\r\nimport type { NodeParticleBlockConnectionPointTypes } from \"core/Particles/Node/Enums/nodeParticleBlockConnectionPointTypes\";\r\n\r\nimport { Vector2, Vector3 } from \"core/Maths/math.vector\";\r\nimport { NodeParticleSystemSet } from \"./nodeParticleSystemSet\";\r\nimport { NodeParticleContextualSources } from \"./Enums/nodeParticleContextualSources\";\r\nimport { NodeParticleSystemSources } from \"./Enums/nodeParticleSystemSources\";\r\nimport { ParticleConverterBlock } from \"./Blocks/particleConverterBlock\";\r\nimport { ParticleFloatToIntBlock, ParticleFloatToIntBlockOperations } from \"./Blocks/particleFloatToIntBlock\";\r\nimport { ParticleGradientBlock } from \"./Blocks/particleGradientBlock\";\r\nimport { ParticleGradientValueBlock } from \"./Blocks/particleGradientValueBlock\";\r\nimport { ParticleInputBlock } from \"./Blocks/particleInputBlock\";\r\nimport { ParticleMathBlock, ParticleMathBlockOperations } from \"./Blocks/particleMathBlock\";\r\nimport { ParticleRandomBlock, ParticleRandomBlockLocks } from \"./Blocks/particleRandomBlock\";\r\nimport { ParticleTextureSourceBlock } from \"./Blocks/particleSourceTextureBlock\";\r\nimport { ParticleVectorLengthBlock } from \"./Blocks/particleVectorLengthBlock\";\r\nimport { SystemBlock } from \"./Blocks/systemBlock\";\r\nimport { ParticleConditionBlock, ParticleConditionBlockTests } from \"./Blocks/Conditions/particleConditionBlock\";\r\nimport { CreateParticleBlock } from \"./Blocks/Emitters/createParticleBlock\";\r\nimport { BoxShapeBlock } from \"./Blocks/Emitters/boxShapeBlock\";\r\nimport { ConeShapeBlock } from \"./Blocks/Emitters/coneShapeBlock\";\r\nimport { CylinderShapeBlock } from \"./Blocks/Emitters/cylinderShapeBlock\";\r\nimport { CustomShapeBlock } from \"./Blocks/Emitters/customShapeBlock\";\r\nimport { MeshShapeBlock } from \"./Blocks/Emitters/meshShapeBlock\";\r\nimport { PointShapeBlock } from \"./Blocks/Emitters/pointShapeBlock\";\r\nimport { SphereShapeBlock } from \"./Blocks/Emitters/sphereShapeBlock\";\r\nimport { UpdateAngleBlock } from \"./Blocks/Update/updateAngleBlock\";\r\nimport { UpdateColorBlock } from \"./Blocks/Update/updateColorBlock\";\r\nimport { UpdateDirectionBlock } from \"./Blocks/Update/updateDirectionBlock\";\r\nimport { UpdateNoiseBlock } from \"./Blocks/Update/updateNoiseBlock\";\r\nimport { UpdatePositionBlock } from \"./Blocks/Update/updatePositionBlock\";\r\nimport { UpdateSizeBlock } from \"./Blocks/Update/updateSizeBlock\";\r\n\r\n/** Represents blocks or groups of blocks that can be used in multiple places in the graph, so they are stored in this context to be reused */\r\ntype ConversionContext = {\r\n targetStopDurationBlockOutput: NodeParticleConnectionPoint;\r\n // Connections that represent calculated ratios values\r\n timeToStopTimeRatioBlockGroupOutput: NodeParticleConnectionPoint;\r\n ageToLifeTimeRatioBlockGroupOutput: NodeParticleConnectionPoint;\r\n // Connections for the start value of a gradient. These are stored so they can be reused for the Creation phase and the Update phase of the particle\r\n sizeGradientValue0Output: NodeParticleConnectionPoint;\r\n colorGradientValue0Output: NodeParticleConnectionPoint;\r\n // Updated scaled direction direction based on velocity and drag\r\n scaledDirection: NodeParticleConnectionPoint;\r\n};\r\n\r\ntype RuntimeConversionContext = Partial<ConversionContext>;\r\n\r\n/**\r\n * Converts a ParticleSystem to a NodeParticleSystemSet.\r\n * @param name The name of the node particle system set.\r\n * @param particleSystemsList The particle systems to convert.\r\n * @returns The converted node particle system set or null if conversion failed.\r\n */\r\nexport async function ConvertToNodeParticleSystemSetAsync(name: string, particleSystemsList: ParticleSystem[]): Promise<Nullable<NodeParticleSystemSet>> {\r\n if (!particleSystemsList || !particleSystemsList.length) {\r\n return null;\r\n }\r\n\r\n const nodeParticleSystemSet = new NodeParticleSystemSet(name);\r\n const promises: Promise<void>[] = [];\r\n\r\n for (const particleSystem of particleSystemsList) {\r\n promises.push(_ExtractDatafromParticleSystemAsync(nodeParticleSystemSet, particleSystem, {}));\r\n }\r\n\r\n await Promise.all(promises);\r\n return nodeParticleSystemSet;\r\n}\r\n\r\nasync function _ExtractDatafromParticleSystemAsync(newSet: NodeParticleSystemSet, oldSystem: ParticleSystem, context: RuntimeConversionContext): Promise<void> {\r\n // CreateParticle block group\r\n const createParticleOutput = _CreateParticleBlockGroup(oldSystem, context);\r\n\r\n // Emitter Shape block\r\n const shapeOutput = _EmitterShapeBlock(oldSystem);\r\n createParticleOutput.particle.connectTo(shapeOutput.particle);\r\n\r\n // UpdateParticle block group\r\n const updateParticleOutput = _UpdateParticleBlockGroup(shapeOutput.output, oldSystem, context);\r\n\r\n // System block\r\n const newSystem = _SystemBlockGroup(oldSystem, context);\r\n updateParticleOutput.connectTo(newSystem.particle);\r\n\r\n // Register\r\n newSet.systemBlocks.push(newSystem);\r\n}\r\n\r\n// ------------- CREATE PARTICLE FUNCTIONS -------------\r\n\r\n// The creation of the different properties follows the order they are added to the CreationQueue in ThinParticleSystem:\r\n// Lifetime, Emit Power, Size, Scale/StartSize, Angle, Color, Noise, ColorDead, Ramp, Sheet\r\nfunction _CreateParticleBlockGroup(oldSystem: ParticleSystem, context: RuntimeConversionContext): CreateParticleBlock {\r\n // Create particle block\r\n const createParticleBlock = new CreateParticleBlock(\"Create Particle\");\r\n\r\n _CreateParticleLifetimeBlockGroup(oldSystem, context).connectTo(createParticleBlock.lifeTime);\r\n _CreateParticleEmitPowerBlockGroup(oldSystem).connectTo(createParticleBlock.emitPower);\r\n _CreateParticleSizeBlockGroup(oldSystem, context).connectTo(createParticleBlock.size);\r\n _CreateParticleScaleBlockGroup(oldSystem, context).connectTo(createParticleBlock.scale);\r\n _CreateParticleAngleBlockGroup(oldSystem).connectTo(createParticleBlock.angle);\r\n _CreateParticleColorBlockGroup(oldSystem, context).connectTo(createParticleBlock.color);\r\n\r\n // Dead color\r\n _CreateAndConnectInput(\"Dead Color\", oldSystem.colorDead, createParticleBlock.colorDead);\r\n\r\n return createParticleBlock;\r\n}\r\n\r\n/**\r\n * Creates the group of blocks that represent the particle lifetime\r\n * @param oldSystem The old particle system to convert\r\n * @param context The context of the current conversion\r\n * @returns The output of the group of blocks that represent the particle lifetime\r\n */\r\nfunction _CreateParticleLifetimeBlockGroup(oldSystem: ParticleSystem, context: RuntimeConversionContext): NodeParticleConnectionPoint {\r\n if (oldSystem.targetStopDuration && oldSystem._lifeTimeGradients && oldSystem._lifeTimeGradients.length > 0) {\r\n context.timeToStopTimeRatioBlockGroupOutput = _CreateTimeToStopTimeRatioBlockGroup(oldSystem, context);\r\n const gradientBlockGroupOutput = _CreateGradientBlockGroup(\r\n context.timeToStopTimeRatioBlockGroupOutput,\r\n oldSystem._lifeTimeGradients,\r\n ParticleRandomBlockLocks.PerParticle,\r\n \"Lifetime\"\r\n );\r\n return gradientBlockGroupOutput;\r\n } else {\r\n const randomLifetimeBlock = new ParticleRandomBlock(\"Random Lifetime\");\r\n _CreateAndConnectInput(\"Min Lifetime\", oldSystem.minLifeTime, randomLifetimeBlock.min);\r\n _CreateAndConnectInput(\"Max Lifetime\", oldSystem.maxLifeTime, randomLifetimeBlock.max);\r\n return randomLifetimeBlock.output;\r\n }\r\n}\r\n\r\n/**\r\n * Creates the group of blocks that represent the particle emit power\r\n * @param oldSystem The old particle system to convert\r\n * @returns The output of the group of blocks that represent the particle emit power\r\n */\r\nfunction _CreateParticleEmitPowerBlockGroup(oldSystem: ParticleSystem): NodeParticleConnectionPoint {\r\n const randomEmitPowerBlock = new ParticleRandomBlock(\"Random Emit Power\");\r\n _CreateAndConnectInput(\"Min Emit Power\", oldSystem.minEmitPower, randomEmitPowerBlock.min);\r\n _CreateAndConnectInput(\"Max Emit Power\", oldSystem.maxEmitPower, randomEmitPowerBlock.max);\r\n return randomEmitPowerBlock.output;\r\n}\r\n\r\n/**\r\n * Creates the group of blocks that represent the particle size\r\n * @param oldSystem The old particle system to convert\r\n * @param context The context of the current conversion\r\n * @returns The output of the group of blocks that represent the particle size\r\n */\r\nfunction _CreateParticleSizeBlockGroup(oldSystem: ParticleSystem, context: RuntimeConversionContext): NodeParticleConnectionPoint {\r\n if (oldSystem._sizeGradients && oldSystem._sizeGradients.length > 0) {\r\n context.sizeGradientValue0Output = _CreateParticleInitialValueFromGradient(oldSystem._sizeGradients);\r\n return context.sizeGradientValue0Output;\r\n } else {\r\n const randomSizeBlock = new ParticleRandomBlock(\"Random size\");\r\n _CreateAndConnectInput(\"Min size\", oldSystem.minSize, randomSizeBlock.min);\r\n _CreateAndConnectInput(\"Max size\", oldSystem.maxSize, randomSizeBlock.max);\r\n return randomSizeBlock.output;\r\n }\r\n}\r\n\r\n/**\r\n * Creates the group of blocks that represent the particle scale\r\n * @param oldSystem The old particle system to convert\r\n * @param context The context of the current conversion\r\n * @returns The output of the group of blocks that represent the particle scale\r\n */\r\nfunction _CreateParticleScaleBlockGroup(oldSystem: ParticleSystem, context: RuntimeConversionContext): NodeParticleConnectionPoint {\r\n // Create the random scale\r\n const randomScaleBlock = new ParticleRandomBlock(\"Random Scale\");\r\n _CreateAndConnectInput(\"Min Scale\", new Vector2(oldSystem.minScaleX, oldSystem.minScaleY), randomScaleBlock.min);\r\n _CreateAndConnectInput(\"Max Scale\", new Vector2(oldSystem.maxScaleX, oldSystem.maxScaleY), randomScaleBlock.max);\r\n\r\n if (oldSystem.targetStopDuration && oldSystem._startSizeGradients && oldSystem._startSizeGradients.length > 0) {\r\n // Create the start size gradient\r\n context.timeToStopTimeRatioBlockGroupOutput = _CreateTimeToStopTimeRatioBlockGroup(oldSystem, context);\r\n const gradientBlockGroupOutput = _CreateGradientBlockGroup(\r\n context.timeToStopTimeRatioBlockGroupOutput,\r\n oldSystem._startSizeGradients,\r\n ParticleRandomBlockLocks.PerParticle,\r\n \"Start Size\"\r\n );\r\n\r\n // Multiply the initial random scale by the start size gradient\r\n const multiplyScaleBlock = new ParticleMathBlock(\"Multiply Scale by Start Size Gradient\");\r\n multiplyScaleBlock.operation = ParticleMathBlockOperations.Multiply;\r\n randomScaleBlock.output.connectTo(multiplyScaleBlock.left);\r\n gradientBlockGroupOutput.connectTo(multiplyScaleBlock.right);\r\n\r\n return multiplyScaleBlock.output;\r\n } else {\r\n return randomScaleBlock.output;\r\n }\r\n}\r\n\r\n/**\r\n * Creates the group of blocks that represent the particle angle (rotation)\r\n * @param oldSystem The old particle system to convert\r\n * @returns The output of the group of blocks that represent the particle angle (rotation)\r\n */\r\nfunction _CreateParticleAngleBlockGroup(oldSystem: ParticleSystem): NodeParticleConnectionPoint {\r\n const randomRotationBlock = new ParticleRandomBlock(\"Random Rotation\");\r\n _CreateAndConnectInput(\"Min Rotation\", oldSystem.minInitialRotation, randomRotationBlock.min);\r\n _CreateAndConnectInput(\"Max Rotation\", oldSystem.maxInitialRotation, randomRotationBlock.max);\r\n return randomRotationBlock.output;\r\n}\r\n\r\n/**\r\n * Creates the group of blocks that represent the particle color\r\n * @param oldSystem The old particle system to convert\r\n * @param context The context of the current conversion\r\n * @returns The output of the group of blocks that represent the particle color\r\n */\r\nfunction _CreateParticleColorBlockGroup(oldSystem: ParticleSystem, context: RuntimeConversionContext): NodeParticleConnectionPoint {\r\n if (oldSystem._colorGradients && oldSystem._colorGradients.length > 0) {\r\n context.colorGradientValue0Output = _CreateParticleInitialValueFromGradient(oldSystem._colorGradients);\r\n return context.colorGradientValue0Output;\r\n } else {\r\n const randomColorBlock = new ParticleRandomBlock(\"Random color\");\r\n _CreateAndConnectInput(\"Color 1\", oldSystem.color1, randomColorBlock.min);\r\n _CreateAndConnectInput(\"Color 2\", oldSystem.color2, randomColorBlock.max);\r\n return randomColorBlock.output;\r\n }\r\n}\r\n\r\nfunction _CreateParticleInitialValueFromGradient(gradients: Array<FactorGradient> | Array<ColorGradient>): NodeParticleConnectionPoint {\r\n if (gradients.length === 0) {\r\n throw new Error(\"No gradients provided.\");\r\n }\r\n\r\n const gradientStep = gradients[0];\r\n const value1 = (gradientStep as any).factor1 ?? (gradientStep as any).color1;\r\n const value2 = (gradientStep as any).factor2 ?? (gradientStep as any).color2;\r\n\r\n if (value2 !== undefined) {\r\n // Create a random between value1 and value2\r\n const randomBlock = new ParticleRandomBlock(\"Random Value 0\");\r\n randomBlock.lockMode = ParticleRandomBlockLocks.OncePerParticle;\r\n _CreateAndConnectInput(\"Value 1\", value1, randomBlock.min);\r\n _CreateAndConnectInput(\"Value 2\", value2, randomBlock.max);\r\n return randomBlock.output;\r\n } else {\r\n // Single value\r\n const sizeBlock = new ParticleInputBlock(\"Value\");\r\n sizeBlock.value = value1;\r\n return sizeBlock.output;\r\n }\r\n}\r\n\r\n// ------------- EMITTER SHAPE FUNCTIONS -------------\r\n\r\nfunction _EmitterShapeBlock(oldSystem: IParticleSystem): IShapeBlock {\r\n const emitter = oldSystem.particleEmitterType;\r\n if (!emitter) {\r\n throw new Error(\"Particle system has no emitter type.\");\r\n }\r\n\r\n let shapeBlock: Nullable<IShapeBlock> = null;\r\n switch (emitter.getClassName()) {\r\n case \"BoxParticleEmitter\": {\r\n const source = emitter as BoxParticleEmitter;\r\n shapeBlock = new BoxShapeBlock(\"Box Shape\");\r\n\r\n const target = shapeBlock as BoxShapeBlock;\r\n _CreateAndConnectInput(\"Direction 1\", source.direction1, target.direction1);\r\n _CreateAndConnectInput(\"Direction 2\", source.direction2, target.direction2);\r\n _CreateAndConnectInput(\"Min Emit Box\", source.minEmitBox, target.minEmitBox);\r\n _CreateAndConnectInput(\"Max Emit Box\", source.maxEmitBox, target.maxEmitBox);\r\n break;\r\n }\r\n case \"ConeParticleEmitter\": {\r\n const source = emitter as ConeParticleEmitter;\r\n shapeBlock = new ConeShapeBlock(\"Cone Shape\");\r\n\r\n const target = shapeBlock as ConeShapeBlock;\r\n target.emitFromSpawnPointOnly = source.emitFromSpawnPointOnly;\r\n _CreateAndConnectInput(\"Radius\", source.radius, target.radius);\r\n _CreateAndConnectInput(\"Angle\", source.angle, target.angle);\r\n _CreateAndConnectInput(\"Radius Range\", source.radiusRange, target.radiusRange);\r\n _CreateAndConnectInput(\"Height Range\", source.heightRange, target.heightRange);\r\n _CreateAndConnectInput(\"Direction Randomizer\", source.directionRandomizer, target.directionRandomizer);\r\n break;\r\n }\r\n case \"ConeDirectedParticleEmitter\": {\r\n const source = emitter as ConeDirectedParticleEmitter;\r\n shapeBlock = new ConeShapeBlock(\"Cone Shape\");\r\n\r\n const target = shapeBlock as ConeShapeBlock;\r\n target.emitFromSpawnPointOnly = source.emitFromSpawnPointOnly;\r\n _CreateAndConnectInput(\"Radius\", source.radius, target.radius);\r\n _CreateAndConnectInput(\"Angle\", source.angle, target.angle);\r\n _CreateAndConnectInput(\"Radius Range\", source.radiusRange, target.radiusRange);\r\n _CreateAndConnectInput(\"Height Range\", source.heightRange, target.heightRange);\r\n _CreateAndConnectInput(\"Direction 1\", source.direction1, target.direction1);\r\n _CreateAndConnectInput(\"Direction 2\", source.direction2, target.direction2);\r\n break;\r\n }\r\n case \"CustomParticleEmitter\": {\r\n const source = emitter as CustomParticleEmitter;\r\n shapeBlock = new CustomShapeBlock(\"Custom Shape\");\r\n\r\n const target = shapeBlock as CustomShapeBlock;\r\n target.particlePositionGenerator = source.particlePositionGenerator;\r\n target.particleDestinationGenerator = source.particleDestinationGenerator;\r\n target.particleDirectionGenerator = source.particleDirectionGenerator;\r\n break;\r\n }\r\n case \"CylinderParticleEmitter\": {\r\n const source = emitter as CylinderParticleEmitter;\r\n shapeBlock = new CylinderShapeBlock(\"Cylinder Shape\");\r\n\r\n const target = shapeBlock as CylinderShapeBlock;\r\n _CreateAndConnectInput(\"Height\", source.height, target.height);\r\n _CreateAndConnectInput(\"Radius\", source.radius, target.radius);\r\n _CreateAndConnectInput(\"Radius Range\", source.radiusRange, target.radiusRange);\r\n _CreateAndConnectInput(\"Direction Randomizer\", source.directionRandomizer, target.directionRandomizer);\r\n break;\r\n }\r\n case \"CylinderDirectedParticleEmitter\": {\r\n const source = emitter as CylinderDirectedParticleEmitter;\r\n shapeBlock = new CylinderShapeBlock(\"Cylinder Shape\");\r\n\r\n const target = shapeBlock as CylinderShapeBlock;\r\n _CreateAndConnectInput(\"Height\", source.height, target.height);\r\n _CreateAndConnectInput(\"Radius\", source.radius, target.radius);\r\n _CreateAndConnectInput(\"Radius Range\", source.radiusRange, target.radiusRange);\r\n _CreateAndConnectInput(\"Direction 1\", source.direction1, target.direction1);\r\n _CreateAndConnectInput(\"Direction 2\", source.direction2, target.direction2);\r\n break;\r\n }\r\n case \"HemisphericParticleEmitter\": {\r\n const source = emitter as HemisphericParticleEmitter;\r\n shapeBlock = new SphereShapeBlock(\"Sphere Shape\");\r\n\r\n const target = shapeBlock as SphereShapeBlock;\r\n target.isHemispheric = true;\r\n _CreateAndConnectInput(\"Radius\", source.radius, target.radius);\r\n _CreateAndConnectInput(\"Radius Range\", source.radiusRange, target.radiusRange);\r\n _CreateAndConnectInput(\"Direction Randomizer\", source.directionRandomizer, target.directionRandomizer);\r\n break;\r\n }\r\n case \"MeshParticleEmitter\": {\r\n const source = emitter as MeshParticleEmitter;\r\n shapeBlock = new MeshShapeBlock(\"Mesh Shape\");\r\n\r\n const target = shapeBlock as MeshShapeBlock;\r\n target.useMeshNormalsForDirection = source.useMeshNormalsForDirection;\r\n _CreateAndConnectInput(\"Direction 1\", source.direction1, target.direction1);\r\n _CreateAndConnectInput(\"Direction 2\", source.direction2, target.direction2);\r\n\r\n target.mesh = source.mesh as Mesh;\r\n break;\r\n }\r\n case \"PointParticleEmitter\": {\r\n const source = emitter as PointParticleEmitter;\r\n shapeBlock = new PointShapeBlock(\"Point Shape\");\r\n\r\n const target = shapeBlock as PointShapeBlock;\r\n _CreateAndConnectInput(\"Direction 1\", source.direction1, target.direction1);\r\n _CreateAndConnectInput(\"Direction 2\", source.direction2, target.direction2);\r\n break;\r\n }\r\n case \"SphereParticleEmitter\": {\r\n const source = emitter as SphereParticleEmitter;\r\n shapeBlock = new SphereShapeBlock(\"Sphere Shape\");\r\n\r\n const target = shapeBlock as SphereShapeBlock;\r\n _CreateAndConnectInput(\"Radius\", source.radius, target.radius);\r\n _CreateAndConnectInput(\"Radius Range\", source.radiusRange, target.radiusRange);\r\n _CreateAndConnectInput(\"Direction Randomizer\", source.directionRandomizer, target.directionRandomizer);\r\n break;\r\n }\r\n case \"SphereDirectedParticleEmitter\": {\r\n const source = emitter as SphereDirectedParticleEmitter;\r\n shapeBlock = new SphereShapeBlock(\"Sphere Shape\");\r\n\r\n const target = shapeBlock as SphereShapeBlock;\r\n _CreateAndConnectInput(\"Radius\", source.radius, target.radius);\r\n _CreateAndConnectInput(\"Radius Range\", source.radiusRange, target.radiusRange);\r\n _CreateAndConnectInput(\"Direction1\", source.direction1, target.direction1);\r\n _CreateAndConnectInput(\"Direction2\", source.direction2, target.direction2);\r\n break;\r\n }\r\n }\r\n\r\n if (!shapeBlock) {\r\n throw new Error(`Unsupported particle emitter type: ${emitter.getClassName()}`);\r\n }\r\n\r\n return shapeBlock;\r\n}\r\n\r\n// ------------- UPDATE PARTICLE FUNCTIONS -------------\r\n\r\n/**\r\n * Creates the group of blocks that represent the particle system update\r\n * The creation of the different properties follows the order they are added to the ProcessQueue in ThinParticleSystem:\r\n * Color, AngularSpeedGradients, AngularSpeed, VelocityGradients, Direction, LimitVelocityGradients, DragGradients, Position, Noise, SizeGradients, Gravity, RemapGradients\r\n * @param inputParticle The particle input connection point\r\n * @param oldSystem The old particle system to convert\r\n * @param context The runtime conversion context\r\n * @returns The output connection point after all updates have been applied\r\n */\r\nfunction _UpdateParticleBlockGroup(inputParticle: NodeParticleConnectionPoint, oldSystem: ParticleSystem, context: RuntimeConversionContext): NodeParticleConnectionPoint {\r\n let updatedParticle: NodeParticleConnectionPoint = inputParticle;\r\n\r\n updatedParticle = _UpdateParticleColorBlockGroup(updatedParticle, oldSystem._colorGradients, context);\r\n updatedParticle = _UpdateParticleAngleBlockGroup(updatedParticle, oldSystem, context);\r\n\r\n if (oldSystem._velocityGradients && oldSystem._velocityGradients.length > 0) {\r\n context.scaledDirection = _UpdateParticleVelocityGradientBlockGroup(oldSystem._velocityGradients, context);\r\n }\r\n\r\n if (oldSystem._dragGradients && oldSystem._dragGradients.length > 0) {\r\n context.scaledDirection = _UpdateParticleDragGradientBlockGroup(oldSystem._dragGradients, context);\r\n }\r\n\r\n updatedParticle = _UpdateParticlePositionBlockGroup(updatedParticle, oldSystem.isLocal, context);\r\n\r\n if (oldSystem._limitVelocityGradients && oldSystem._limitVelocityGradients.length > 0 && oldSystem.limitVelocityDamping !== 0) {\r\n updatedParticle = _UpdateParticleVelocityLimitGradientBlockGroup(updatedParticle, oldSystem._limitVelocityGradients, oldSystem.limitVelocityDamping, context);\r\n }\r\n\r\n if (oldSystem.noiseTexture && oldSystem.noiseStrength) {\r\n updatedParticle = _UpdateParticleNoiseBlockGroup(updatedParticle, oldSystem.noiseTexture, oldSystem.noiseStrength);\r\n }\r\n\r\n if (oldSystem._sizeGradients && oldSystem._sizeGradients.length > 0) {\r\n updatedParticle = _UpdateParticleSizeGradientBlockGroup(updatedParticle, oldSystem._sizeGradients, context);\r\n }\r\n\r\n if (oldSystem.gravity.equalsToFloats(0, 0, 0) === false) {\r\n updatedParticle = _UpdateParticleGravityBlockGroup(updatedParticle, oldSystem.gravity);\r\n }\r\n\r\n return updatedParticle;\r\n}\r\n\r\n/**\r\n * Creates the group of blocks that represent the particle color update\r\n * @param inputParticle The input particle to update\r\n * @param colorGradients The color gradients (if any)\r\n * @param context The context of the current conversion\r\n * @returns The output of the group of blocks that represent the particle color update\r\n */\r\nfunction _UpdateParticleColorBlockGroup(\r\n inputParticle: NodeParticleConnectionPoint,\r\n colorGradients: Nullable<Array<ColorGradient>>,\r\n context: RuntimeConversionContext\r\n): NodeParticleConnectionPoint {\r\n let colorCalculation: NodeParticleConnectionPoint | undefined = undefined;\r\n if (colorGradients && colorGradients.length > 0) {\r\n if (context.colorGradientValue0Output === undefined) {\r\n throw new Error(\"Initial color gradient values not found in context.\");\r\n }\r\n\r\n context.ageToLifeTimeRatioBlockGroupOutput = _CreateAgeToLifeTimeRatioBlockGroup(context);\r\n colorCalculation = _CreateGradientBlockGroup(context.ageToLifeTimeRatioBlockGroupOutput, colorGradients, ParticleRandomBlockLocks.OncePerParticle, \"Color\", [\r\n context.colorGradientValue0Output,\r\n ]);\r\n } else {\r\n colorCalculation = _BasicColorUpdateBlockGroup();\r\n }\r\n\r\n // Create the color update block clamping alpha >= 0\r\n const colorUpdateBlock = new UpdateColorBlock(\"Color update\");\r\n inputParticle.connectTo(colorUpdateBlock.particle);\r\n _ClampUpdateColorAlpha(colorCalculation).connectTo(colorUpdateBlock.color);\r\n\r\n return colorUpdateBlock.output;\r\n}\r\n\r\n/**\r\n * Creates the group of blocks that represent the particle angle update\r\n * @param inputParticle The input particle to update\r\n * @param oldSystem The old particle system to convert\r\n * @param context The context of the current conversion\r\n * @returns The output of the group of blocks that represent the particle color update\r\n */\r\nfunction _UpdateParticleAngleBlockGroup(inputParticle: NodeParticleConnectionPoint, oldSystem: ParticleSystem, context: RuntimeConversionContext): NodeParticleConnectionPoint {\r\n // We will try to use gradients if they exist\r\n // If not, we will try to use min/max angular speed\r\n let angularSpeedCalculation = null;\r\n if (oldSystem._angularSpeedGradients && oldSystem._angularSpeedGradients.length > 0) {\r\n angularSpeedCalculation = _UpdateParticleAngularSpeedGradientBlockGroup(oldSystem._angularSpeedGradients, context);\r\n } else if (oldSystem.minAngularSpeed !== 0 || oldSystem.maxAngularSpeed !== 0) {\r\n angularSpeedCalculation = _UpdateParticleAngularSpeedBlockGroup(oldSystem.minAngularSpeed, oldSystem.maxAngularSpeed);\r\n }\r\n\r\n // If we have an angular speed calculation, then update the angle\r\n if (angularSpeedCalculation) {\r\n // Create the angular speed delta\r\n const angleSpeedDeltaOutput = _CreateDeltaModifiedInput(\"Angular Speed\", angularSpeedCalculation);\r\n\r\n // Add it to the angle\r\n const addAngle = new ParticleMathBlock(\"Add Angular Speed to Angle\");\r\n addAngle.operation = ParticleMathBlockOperations.Add;\r\n _CreateAndConnectContextualSource(\"Angle\", NodeParticleContextualSources.Angle, addAngle.left);\r\n angleSpeedDeltaOutput.connectTo(addAngle.right);\r\n\r\n // Update the particle angle\r\n const updateAngle = new UpdateAngleBlock(\"Angle Update with Angular Speed\");\r\n inputParticle.connectTo(updateAngle.particle);\r\n addAngle.output.connectTo(updateAngle.angle);\r\n\r\n return updateAngle.output;\r\n } else {\r\n return inputParticle;\r\n }\r\n}\r\n\r\n/**\r\n * Creates the group of blocks that represent the particle velocity update\r\n * @param velocityGradients The velocity gradients\r\n * @param context The context of the current conversion\r\n * @returns The output of the group of blocks that represent the particle velocity update\r\n */\r\nfunction _UpdateParticleVelocityGradientBlockGroup(velocityGradients: Array<FactorGradient>, context: RuntimeConversionContext): NodeParticleConnectionPoint {\r\n context.ageToLifeTimeRatioBlockGroupOutput = _CreateAgeToLifeTimeRatioBlockGroup(context);\r\n\r\n // Generate the gradient\r\n const velocityValueOutput = _CreateGradientBlockGroup(context.ageToLifeTimeRatioBlockGroupOutput, velocityGradients, ParticleRandomBlockLocks.OncePerParticle, \"Velocity\");\r\n\r\n // Update the direction scale based on the velocity\r\n const multiplyScaleByVelocity = new ParticleMathBlock(\"Multiply Direction Scale by Velocity\");\r\n multiplyScaleByVelocity.operation = ParticleMathBlockOperations.Multiply;\r\n velocityValueOutput.connectTo(multiplyScaleByVelocity.left);\r\n _CreateAndConnectContextualSource(\"Direction Scale\", NodeParticleContextualSources.DirectionScale, multiplyScaleByVelocity.right);\r\n\r\n // Update the particle direction scale\r\n const multiplyDirection = new ParticleMathBlock(\"Scaled Direction\");\r\n multiplyDirection.operation = ParticleMathBlockOperations.Multiply;\r\n multiplyScaleByVelocity.output.connectTo(multiplyDirection.left);\r\n _CreateAndConnectContextualSource(\"Direction\", NodeParticleContextualSources.Direction, multiplyDirection.right);\r\n\r\n // Store the new calculation of the scaled direction in the context\r\n context.scaledDirection = multiplyDirection.output;\r\n return multiplyDirection.output;\r\n}\r\n\r\n/**\r\n * Creates the group of blocks that represent the particle velocity limit update\r\n * @param inputParticle The input particle to update\r\n * @param velocityLimitGradients The velocity limit gradients\r\n * @param limitVelocityDamping The limit velocity damping factor\r\n * @param context The context of the current conversion\r\n * @returns The output of the group of blocks that represent the particle velocity limit update\r\n */\r\nfunction _UpdateParticleVelocityLimitGradientBlockGroup(\r\n inputParticle: NodeParticleConnectionPoint,\r\n velocityLimitGradients: Array<FactorGradient>,\r\n limitVelocityDamping: number,\r\n context: RuntimeConversionContext\r\n): NodeParticleConnectionPoint {\r\n context.ageToLifeTimeRatioBlockGroupOutput = _CreateAgeToLifeTimeRatioBlockGroup(context);\r\n\r\n // Calculate the current speed\r\n const currentSpeedBlock = new ParticleVectorLengthBlock(\"Current Speed\");\r\n _CreateAndConnectContextualSource(\"Direction\", NodeParticleContextualSources.Direction, currentSpeedBlock.input);\r\n\r\n // Calculate the velocity limit from the gradient\r\n const velocityLimitValueOutput = _CreateGradientBlockGroup(\r\n context.ageToLifeTimeRatioBlockGroupOutput,\r\n velocityLimitGradients,\r\n ParticleRandomBlockLocks.OncePerParticle,\r\n \"Velocity Limit\"\r\n );\r\n\r\n // Blocks that will calculate the new velocity if over the limit\r\n const damped = new ParticleMathBlock(\"Damped Speed\");\r\n damped.operation = ParticleMathBlockOperations.Multiply;\r\n _CreateAndConnectContextualSource(\"Direction\", NodeParticleContextualSources.Direction, damped.left);\r\n _CreateAndConnectInput(\"Limit Velocity Damping\", limitVelocityDamping, damped.right);\r\n\r\n // Compare current speed and limit\r\n const compareSpeed = new ParticleConditionBlock(\"Compare Speed to Limit\");\r\n compareSpeed.test = ParticleConditionBlockTests.GreaterThan;\r\n currentSpeedBlock.output.connectTo(compareSpeed.left);\r\n velocityLimitValueOutput.connectTo(compareSpeed.right);\r\n damped.output.connectTo(compareSpeed.ifTrue);\r\n _CreateAndConnectContextualSource(\"Direction\", NodeParticleContextualSources.Direction, compareSpeed.ifFalse);\r\n\r\n // Update the direction based on the calculted value\r\n const updateDirection = new UpdateDirectionBlock(\"Direction Update\");\r\n inputParticle.connectTo(updateDirection.particle);\r\n compareSpeed.output.connectTo(updateDirection.direction);\r\n\r\n return updateDirection.output;\r\n}\r\n\r\n/**\r\n * Creates the group of blocks that represent the particle noise update\r\n * @param inputParticle The particle to update\r\n * @param noiseTexture The noise texture\r\n * @param noiseStrength The strength of the noise\r\n * @returns The output of the group of blocks that represent the particle noise update\r\n */\r\nfunction _UpdateParticleNoiseBlockGroup(inputParticle: NodeParticleConnectionPoint, noiseTexture: ProceduralTexture, noiseStrength: Vector3): NodeParticleConnectionPoint {\r\n const noiseUpdate = new UpdateNoiseBlock(\"Noise Update\");\r\n inputParticle.connectTo(noiseUpdate.particle);\r\n _CreateTextureBlock(noiseTexture).connectTo(noiseUpdate.noiseTexture);\r\n _CreateAndConnectInput(\"Noise Strength\", noiseStrength, noiseUpdate.strength);\r\n return noiseUpdate.output;\r\n}\r\n\r\n/**\r\n * Creates the group of blocks that represent the particle drag update\r\n * @param dragGradients The drag gradients\r\n * @param context The context of the current conversion\r\n * @returns The output of the group of blocks that represent the particle drag update\r\n */\r\nfunction _UpdateParticleDragGradientBlockGroup(dragGradients: Array<FactorGradient>, context: RuntimeConversionContext): NodeParticleConnectionPoint {\r\n context.ageToLifeTimeRatioBlockGroupOutput = _CreateAgeToLifeTimeRatioBlockGroup(context);\r\n\r\n // Generate the gradient\r\n const dragValueOutput = _CreateGradientBlockGroup(context.ageToLifeTimeRatioBlockGroupOutput, dragGradients, ParticleRandomBlockLocks.OncePerParticle, \"Drag\");\r\n\r\n // Calculate drag factor\r\n const oneMinusDragBlock = new ParticleMathBlock(\"1 - Drag\");\r\n oneMinusDragBlock.operation = ParticleMathBlockOperations.Subtract;\r\n _CreateAndConnectInput(\"One\", 1, oneMinusDragBlock.left);\r\n dragValueOutput.connectTo(oneMinusDragBlock.right);\r\n\r\n // Multiply the scaled direction by drag factor\r\n const multiplyDirection = new ParticleMathBlock(\"Scaled Direction with Drag\");\r\n multiplyDirection.operation = ParticleMathBlockOperations.Multiply;\r\n oneMinusDragBlock.output.connectTo(multiplyDirection.left);\r\n if (context.scaledDirection === undefined) {\r\n _CreateAndConnectContextualSource(\"Scaled Direction\", NodeParticleContextualSources.ScaledDirection, multiplyDirection.right);\r\n } else {\r\n context.scaledDirection.connectTo(multiplyDirection.right);\r\n }\r\n\r\n // Store the new calculation of the scaled direction in the context\r\n context.scaledDirection = multiplyDirection.output;\r\n return multiplyDirection.output;\r\n}\r\n\r\n/**\r\n * Creates the group of blocks that represent the particle position update\r\n * @param inputParticle The input particle to update\r\n * @param isLocal Whether the particle coordinate system is local or not\r\n * @param context The context of the current conversion\r\n * @returns The output of the group of blocks that represent the particle position update\r\n */\r\nfunction _UpdateParticlePositionBlockGroup(inputParticle: NodeParticleConnectionPoint, isLocal: boolean, context: RuntimeConversionContext): NodeParticleConnectionPoint {\r\n // Update the particle position\r\n const updatePosition = new UpdatePositionBlock(\"Position Update\");\r\n inputParticle.connectTo(updatePosition.particle);\r\n\r\n if (isLocal) {\r\n _CreateAndConnectContextualSource(\"Local Position Updated\", NodeParticleContextualSources.LocalPositionUpdated, updatePosition.position);\r\n } else {\r\n // Calculate the new position\r\n const addPositionBlock = new ParticleMathBlock(\"Add Position\");\r\n addPositionBlock.operation = ParticleMathBlockOperations.Add;\r\n _CreateAndConnectContextualSource(\"Position\", NodeParticleContextualSources.Position, addPositionBlock.left);\r\n if (context.scaledDirection === undefined) {\r\n _CreateAndConnectContextualSource(\"Scaled Direction\", NodeParticleContextualSources.ScaledDirection, addPositionBlock.right);\r\n } else {\r\n context.scaledDirection.connectTo(addPositionBlock.right);\r\n }\r\n\r\n addPositionBlock.output.connectTo(updatePosition.position);\r\n }\r\n\r\n return updatePosition.output;\r\n}\r\n\r\n/**\r\n * Creates the group of blocks that represent the particle size update\r\n * @param inputParticle The input particle to update\r\n * @param sizeGradients The size gradients (if any)\r\n * @param context The context of the current conversion\r\n * @returns The output of the group of blocks that represent the particle size update\r\n */\r\nfunction _UpdateParticleSizeGradientBlockGroup(\r\n inputParticle: NodeParticleConnectionPoint,\r\n sizeGradients: Array<FactorGradient>,\r\n context: RuntimeConversionContext\r\n): NodeParticleConnectionPoint {\r\n if (context.sizeGradientValue0Output === undefined) {\r\n throw new Error(\"Initial size gradient values not found in context.\");\r\n }\r\n\r\n context.ageToLifeTimeRatioBlockGroupOutput = _CreateAgeToLifeTimeRatioBlockGroup(context);\r\n\r\n // Generate the gradient\r\n const sizeValueOutput = _CreateGradientBlockGroup(context.ageToLifeTimeRatioBlockGroupOutput, sizeGradients, ParticleRandomBlockLocks.OncePerParticle, \"Size\", [\r\n context.sizeGradientValue0Output,\r\n ]);\r\n\r\n // Create the update size\r\n const updateSizeBlock = new UpdateSizeBlock(\"Size Update\");\r\n inputParticle.connectTo(updateSizeBlock.particle);\r\n sizeValueOutput.connectTo(updateSizeBlock.size);\r\n\r\n return updateSizeBlock.output;\r\n}\r\n\r\n/**\r\n * Creates the group of blocks that represent the particle gravity update\r\n * @param inputParticle The input particle to update\r\n * @param gravity The gravity vector to apply\r\n * @returns The output of the group of blocks that represent the particle gravity update\r\n */\r\nfunction _UpdateParticleGravityBlockGroup(inputParticle: NodeParticleConnectionPoint, gravity: Vector3): NodeParticleConnectionPoint {\r\n // Create the gravity delta\r\n const gravityDeltaOutput = _CreateDeltaModifiedInput(\"Gravity\", gravity);\r\n\r\n // Add it to the direction\r\n const addDirectionBlock = new ParticleMathBlock(\"Add Gravity to Direction\");\r\n addDirectionBlock.operation = ParticleMathBlockOperations.Add;\r\n _CreateAndConnectContextualSource(\"Direction\", NodeParticleContextualSources.Direction, addDirectionBlock.left);\r\n gravityDeltaOutput.connectTo(addDirectionBlock.right);\r\n\r\n // Update the particle direction\r\n const updateDirection = new UpdateDirectionBlock(\"Direction Update with Gravity\");\r\n inputParticle.connectTo(updateDirection.particle);\r\n addDirectionBlock.output.connectTo(updateDirection.direction);\r\n\r\n return updateDirection.output;\r\n}\r\n\r\nfunction _UpdateParticleAngularSpeedGradientBlockGroup(angularSpeedGradients: Array<FactorGradient>, context: RuntimeConversionContext): NodeParticleConnectionPoint {\r\n context.ageToLifeTimeRatioBlockGroupOutput = _CreateAgeToLifeTimeRatioBlockGroup(context);\r\n\r\n // Generate the gradient\r\n const angularSpeedValueOutput = _CreateGradientBlockGroup(\r\n context.ageToLifeTimeRatioBlockGroupOutput,\r\n angularSpeedGradients,\r\n ParticleRandomBlockLocks.OncePerParticle,\r\n \"Angular Speed\"\r\n );\r\n return angularSpeedValueOutput;\r\n}\r\n\r\nfunction _UpdateParticleAngularSpeedBlockGroup(minAngularSpeed: number, maxAngularSpeed: number): NodeParticleConnectionPoint {\r\n // Random value between for the angular speed of the particle\r\n const randomAngularSpeedBlock = new ParticleRandomBlock(\"Random Angular Speed\");\r\n randomAngularSpeedBlock.lockMode = ParticleRandomBlockLocks.OncePerParticle;\r\n _CreateAndConnectInput(\"Min Angular Speed\", minAngularSpeed, randomAngularSpeedBlock.min);\r\n _CreateAndConnectInput(\"Max Angular Speed\", maxAngularSpeed, randomAngularSpeedBlock.max);\r\n return randomAngularSpeedBlock.output;\r\n}\r\n\r\nfunction _BasicColorUpdateBlockGroup(): NodeParticleConnectionPoint {\r\n const addColorBlock = new ParticleMathBlock(\"Add Color\");\r\n addColorBlock.operation = ParticleMathBlockOperations.Add;\r\n _CreateAndConnectContextualSource(\"Color\", NodeParticleContextualSources.Color, addColorBlock.left);\r\n _CreateAndConnectContextualSource(\"Scaled Color Step\", NodeParticleContextualSources.ScaledColorStep, addColorBlock.right);\r\n return addColorBlock.output;\r\n}\r\n\r\nfunction _ClampUpdateColorAlpha(colorCalculationOutput: NodeParticleConnectionPoint): NodeParticleConnectionPoint {\r\n // Decompose color to clamp alpha\r\n const decomposeColorBlock = new ParticleConverterBlock(\"Decompose Color\");\r\n colorCalculationOutput.connectTo(decomposeColorBlock.colorIn);\r\n\r\n // Clamp alpha to be >= 0\r\n const maxAlphaBlock = new ParticleMathBlock(\"Alpha >= 0\");\r\n maxAlphaBlock.operation = ParticleMathBlockOperations.Max;\r\n decomposeColorBlock.wOut.connectTo(maxAlphaBlock.left);\r\n _CreateAndConnectInput(\"Zero\", 0, maxAlphaBlock.right);\r\n\r\n // Recompose color\r\n const composeColorBlock = new ParticleConverterBlock(\"Compose Color\");\r\n decomposeColorBlock.xyzOut.connectTo(composeColorBlock.xyzIn);\r\n maxAlphaBlock.output.connectTo(composeColorBlock.wIn);\r\n\r\n return composeColorBlock.colorOut;\r\n}\r\n\r\n// ------------- SYSTEM FUNCTIONS -------------\r\n\r\nfunction _SystemBlockGroup(oldSystem: ParticleSystem, context: RuntimeConversionContext): SystemBlock {\r\n const newSystem = new SystemBlock(oldSystem.name);\r\n\r\n newSystem.translationPivot.value = oldSystem.translationPivot;\r\n newSystem.textureMask.value = oldSystem.textureMask;\r\n newSystem.manualEmitCount = oldSystem.manualEmitCount;\r\n newSystem.blendMode = oldSystem.blendMode;\r\n newSystem.capacity = oldSystem.getCapacity();\r\n newSystem.startDelay = oldSystem.startDelay;\r\n newSystem.updateSpeed = oldSystem.updateSpeed;\r\n newSystem.preWarmCycles = oldSystem.preWarmCycles;\r\n newSystem.preWarmStepOffset = oldSystem.preWarmStepOffset;\r\n newSystem.isBillboardBased = oldSystem.isBillboardBased;\r\n newSystem.isLocal = oldSystem.isLocal;\r\n newSystem.disposeOnStop = oldSystem.disposeOnStop;\r\n\r\n _SystemEmitRateValue(oldSystem, newSystem, context);\r\n _CreateTextureBlock(oldSystem.particleTexture).connectTo(newSystem.texture);\r\n _SystemTargetStopDuration(oldSystem, newSystem, context);\r\n\r\n return newSystem;\r\n}\r\n\r\nfunction _SystemEmitRateValue(oldSystem: ParticleSystem, newSystem: SystemBlock, context: RuntimeConversionContext): void {\r\n const emitGradients = oldSystem.getEmitRateGradients();\r\n if (emitGradients && emitGradients.length > 0 && oldSystem.targetStopDuration > 0) {\r\n // Create the emit gradients\r\n context.timeToStopTimeRatioBlockGroupOutput = _CreateTimeToStopTimeRatioBlockGroup(oldSystem, context);\r\n const gradientValue = _CreateGradientBlockGroup(context.timeToStopTimeRatioBlockGroupOutput, emitGradients, ParticleRandomBlockLocks.PerSystem, \"Emit Rate\");\r\n\r\n // Round the value to an int\r\n const roundBlock = new ParticleFloatToIntBlock(\"Round to Int\");\r\n roundBlock.operation = ParticleFloatToIntBlockOperations.Round;\r\n gradientValue.connectTo(roundBlock.input);\r\n roundBlock.output.connectTo(newSystem.emitRate);\r\n } else {\r\n newSystem.emitRate.value = oldSystem.emitRate;\r\n }\r\n}\r\n\r\nfunction _SystemTargetStopDuration(oldSystem: ParticleSystem, newSystem: SystemBlock, context: RuntimeConversionContext): void {\r\n // If something else uses the target stop duration (like a gradient),\r\n // then the block is already created and stored in the context\r\n if (context.targetStopDurationBlockOutput) {\r\n context.targetStopDurationBlockOutput.connectTo(newSystem.targetStopDuration);\r\n } else {\r\n // If no one used it, do not create a block just set the value\r\n newSystem.targetStopDuration.value = oldSystem.targetStopDuration;\r\n }\r\n}\r\n\r\n// ------------- UTILITY FUNCTIONS -------------\r\n\r\nfunction _CreateDeltaModifiedInput(name: string, value: Vector3 | NodeParticleConnectionPoint): NodeParticleConnectionPoint {\r\n const multiplyBlock = new ParticleMathBlock(\"Multiply by Delta\");\r\n multiplyBlock.operation = ParticleMathBlockOperations.Multiply;\r\n if (value instanceof Vector3) {\r\n _CreateAndConnectInput(name, value, multiplyBlock.left);\r\n } else {\r\n value.connectTo(multiplyBlock.left);\r\n }\r\n _CreateAndConnectSystemSource(\"Delta\", NodeParticleSystemSources.Delta, multiplyBlock.right);\r\n\r\n return multiplyBlock.output;\r\n}\r\n\r\nfunction _CreateAndConnectInput(\r\n inputBlockName: string,\r\n value: number | Vector2 | Vector3 | Color4,\r\n targetToConnectTo: NodeParticleConnectionPoint,\r\n inputType?: NodeParticleBlockConnectionPointTypes\r\n): void {\r\n const input = new ParticleInputBlock(inputBlockName, inputType);\r\n input.value = value;\r\n input.output.connectTo(targetToConnectTo);\r\n}\r\n\r\nfunction _CreateAndConnectContextualSource(contextualBlockName: string, contextSource: NodeParticleContextualSources, targetToConnectTo: NodeParticleConnectionPoint): void {\r\n const input = new ParticleInputBlock(contextualBlockName);\r\n input.contextualValue = contextSource;\r\n input.output.connectTo(targetToConnectTo);\r\n}\r\n\r\nfunction _CreateAndConnectSystemSource(systemBlockName: string, systemSource: NodeParticleSystemSources, targetToConnectTo: NodeParticleConnectionPoint): void {\r\n const input = new ParticleInputBlock(systemBlockName);\r\n input.systemSource = systemSource;\r\n input.output.connectTo(targetToConnectTo);\r\n}\r\n\r\n/**\r\n * Creates the target stop duration input block, as it can be shared in multiple places\r\n * This block is stored in the context so the same block is shared in the graph\r\n * @param oldSystem The old particle system to convert\r\n * @param context The context of the current conversion\r\n * @returns\r\n */\r\nfunction _CreateTargetStopDurationInputBlock(oldSystem: ParticleSystem, context: RuntimeConversionContext): NodeParticleConnectionPoint {\r\n // If we have already created the target stop duration input block, return it\r\n if (context.targetStopDurationBlockOutput) {\r\n return context.targetStopDurationBlockOutput;\r\n }\r\n\r\n // Create the target stop duration input block if not already created\r\n const targetStopDurationInputBlock = new ParticleInputBlock(\"Target Stop Duration\");\r\n targetStopDurationInputBlock.value = oldSystem.targetStopDuration;\r\n\r\n // Save the output in our context to avoid regenerating it again\r\n context.targetStopDurationBlockOutput = targetStopDurationInputBlock.output;\r\n return context.targetStopDurationBlockOutput;\r\n}\r\n\r\n/**\r\n * Create a group of blocks that calculates the ratio between the actual frame and the target stop duration, clamped between 0 and 1.\r\n * This is used to simulate the behavior of the old particle system where several particle gradient values are affected by the target stop duration.\r\n * This block group is stored in the context so the same group is shared in the graph\r\n * @param oldSystem The old particle system to convert\r\n * @param context The context of the current conversion\r\n * @returns The ratio block output connection point\r\n */\r\nfunction _CreateTimeToStopTimeRatioBlockGroup(oldSystem: ParticleSystem, context: RuntimeConversionContext): NodeParticleConnectionPoint {\r\n // If we have already generated this group, return it\r\n if (context.timeToStopTimeRatioBlockGroupOutput) {\r\n return context.timeToStopTimeRatioBlockGroupOutput;\r\n }\r\n\r\n context.targetStopDurationBlockOutput = _CreateTargetStopDurationInputBlock(oldSystem, context);\r\n\r\n // Find the ratio between the actual frame and the target stop duration\r\n const ratio = new ParticleMathBlock(\"Frame/Stop Ratio\");\r\n ratio.operation = ParticleMathBlockOperations.Divide;\r\n _CreateAndConnectSystemSource(\"Actual Frame\", NodeParticleSystemSources.Time, ratio.left);\r\n context.targetStopDurationBlockOutput.connectTo(ratio.right);\r\n\r\n // Make sure values is >=0\r\n const clampMin = new ParticleMathBlock(\"Clamp Min 0\");\r\n clampMin.operation = ParticleMathBlockOperations.Max;\r\n _CreateAndConnectInput(\"Zero\", 0, clampMin.left);\r\n ratio.output.connectTo(clampMin.right);\r\n\r\n // Make sure values is <=1\r\n const clampMax = new ParticleMathBlock(\"Clamp Max 1\");\r\n clampMax.operation = ParticleMathBlockOperations.Min;\r\n _CreateAndConnectInput(\"One\", 1, clampMax.left);\r\n clampMin.output.connectTo(clampMax.right);\r\n\r\n // Save the group output in our context to avoid regenerating it again\r\n context.timeToStopTimeRatioBlockGroupOutput = clampMax.output;\r\n return context.timeToStopTimeRatioBlockGroupOutput;\r\n}\r\n\r\nfunction _CreateAgeToLifeTimeRatioBlockGroup(context: RuntimeConversionContext): NodeParticleConnectionPoint {\r\n // If we have already generated this group, return it\r\n if (context.ageToLifeTimeRatioBlockGroupOutput) {\r\n return context.ageToLifeTimeRatioBlockGroupOutput;\r\n }\r\n\r\n // Find the ratio between the age and the lifetime\r\n const ratio = new ParticleMathBlock(\"Age/LifeTime Ratio\");\r\n ratio.operation = ParticleMathBlockOperations.Divide;\r\n _CreateAndConnectContextualSource(\"Age\", NodeParticleContextualSources.Age, ratio.left);\r\n _CreateAndConnectContextualSource(\"LifeTime\", NodeParticleContextualSources.Lifetime, ratio.right);\r\n\r\n // Save the group output in our context to avoid regenerating it again\r\n context.ageToLifeTimeRatioBlockGroupOutput = ratio.output;\r\n return ratio.output;\r\n}\r\n\r\n/**\r\n * Creates the blocks that represent a gradient\r\n * @param gradientSelector The value that determines which gradient to use\r\n * @param gradientValues The list of gradient values\r\n * @param randomLockMode The type of random to use for the gradient values\r\n * @param prefix The prefix to use for naming the blocks\r\n * @param initialValues Optional initial values to connect to the gradient inputs that were calculated during other steps of the conversion\r\n * @returns The output connection point of the gradient block\r\n */\r\nfunction _CreateGradientBlockGroup(\r\n gradientSelector: NodeParticleConnectionPoint,\r\n gradientValues: Array<FactorGradient> | Array<ColorGradient>,\r\n randomLockMode: ParticleRandomBlockLocks,\r\n prefix: string,\r\n initialValues: NodeParticleConnectionPoint[] = []\r\n): NodeParticleConnectionPoint {\r\n // Create the gradient block and connect the value that controls the gradient selection\r\n const gradientBlock = new ParticleGradientBlock(prefix + \" Gradient Block\");\r\n gradientSelector.connectTo(gradientBlock.gradient);\r\n\r\n // If initial values are provided, we use them instead of the values in the gradientValues array\r\n // These means this values were already transformed into blocks on a previous step of the conversion and we must reuse them\r\n for (let i = 0; i < initialValues.length; i++) {\r\n const reference = i < gradientValues.length ? gradientValues[i].gradient : 1;\r\n const gradientValueBlock = new ParticleGradientValueBlock(prefix + \" Gradient Value \" + i);\r\n gradientValueBlock.reference = reference;\r\n initialValues[i].connectTo(gradientValueBlock.value);\r\n gradientValueBlock.output.connectTo(gradientBlock.inputs[i + 1]);\r\n }\r\n\r\n // Create the gradient values\r\n for (let i = 0 + initialValues.length; i < gradientValues.length; i++) {\r\n const gradientValueBlockGroupOutput = _CreateGradientValueBlockGroup(gradientValues[i], randomLockMode, prefix, i);\r\n gradientValueBlockGroupOutput.connectTo(gradientBlock.inputs[i + 1]);\r\n }\r\n\r\n return gradientBlock.output;\r\n}\r\n\r\n/**\r\n * Creates the blocks that represent a gradient value\r\n * This can be either a single value or a random between two values\r\n * @param gradientStep The gradient step data\r\n * @param randomLockMode The lock mode to use for random values\r\n * @param prefix The prefix to use for naming the blocks\r\n * @param index The index of the gradient step\r\n * @returns The output connection point of the gradient value block\r\n */\r\nfunction _CreateGradientValueBlockGroup(\r\n gradientStep: FactorGradient | ColorGradient,\r\n randomLockMode: ParticleRandomBlockLocks,\r\n prefix: string,\r\n index: number\r\n): NodeParticleConnectionPoint {\r\n const gradientValueBlock = new ParticleGradientValueBlock(prefix + \" Gradient Value \" + index);\r\n gradientValueBlock.reference = gradientStep.gradient;\r\n\r\n const value1 = (gradientStep as any).factor1 ?? (gradientStep as any).color1;\r\n const value2 = (gradientStep as any).factor2 ?? (gradientStep as any).color2;\r\n\r\n if (value2 !== undefined) {\r\n // Create a random between value1 and value2\r\n const randomBlock = new ParticleRandomBlock(\"Random Value \" + index);\r\n randomBlock.lockMode = randomLockMode;\r\n _CreateAndConnectInput(\"Value 1\", value1, randomBlock.min);\r\n _CreateAndConnectInput(\"Value 2\", value2, randomBlock.max);\r\n randomBlock.output.connectTo(gradientValueBlock.value);\r\n } else {\r\n // Single value\r\n _CreateAndConnectInput(\"Value\", value1, gradientValueBlock.value);\r\n }\r\n\r\n return gradientValueBlock.output;\r\n}\r\n\r\nfunction _CreateTextureBlock(texture: Nullable<BaseTexture>): NodeParticleConnectionPoint {\r\n // Texture\r\n const textureBlock = new ParticleTextureSourceBlock(\"Texture\");\r\n const url = (texture as Texture).url || \"\";\r\n if (url) {\r\n textureBlock.url = url;\r\n } else {\r\n textureBlock.sourceTexture = texture;\r\n }\r\n\r\n return textureBlock.texture;\r\n}\r\n"]}
@@ -127,9 +127,9 @@ export declare class Particle {
127
127
  /** @internal */
128
128
  _currentDrag2: number;
129
129
  /** @internal */
130
- _randomNoiseCoordinates1: Vector3;
130
+ _randomNoiseCoordinates1: Nullable<Vector3>;
131
131
  /** @internal */
132
- _randomNoiseCoordinates2: Vector3;
132
+ _randomNoiseCoordinates2: Nullable<Vector3>;
133
133
  /** @internal */
134
134
  _localPosition?: Vector3;
135
135
  /**
@@ -175,6 +175,8 @@ export class Particle {
175
175
  this._currentDragGradient = null;
176
176
  this.cellIndex = this.particleSystem.startSpriteCellID;
177
177
  this._randomCellOffset = undefined;
178
+ this._randomNoiseCoordinates1 = null;
179
+ this._randomNoiseCoordinates2 = null;
178
180
  }
179
181
  /**
180
182
  * Copy the properties of particle to another one.
@@ -260,8 +262,8 @@ export class Particle {
260
262
  other.remapData = new Vector4(0, 0, 0, 0);
261
263
  }
262
264
  }
263
- if (this._randomNoiseCoordinates1) {
264
- if (other._randomNoiseCoordinates1) {
265
+ if (this._randomNoiseCoordinates1 && this._randomNoiseCoordinates2) {
266
+ if (other._randomNoiseCoordinates1 && other._randomNoiseCoordinates2) {
265
267
  other._randomNoiseCoordinates1.copyFrom(this._randomNoiseCoordinates1);
266
268
  other._randomNoiseCoordinates2.copyFrom(this._randomNoiseCoordinates2);
267
269
  }
@@ -1 +1 @@
1
- {"version":3,"file":"particle.js","sourceRoot":"","sources":["../../../../dev/core/src/Particles/particle.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC7E,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAM7C,OAAO,EAAE,KAAK,EAAE,MAAM,gCAAgC,CAAC;AAEvD;;;GAGG;AACH,MAAM,OAAO,QAAQ;IAoJjB;;;OAGG;IACH;IACI;;OAEG;IACI,cAAkC;QAAlC,mBAAc,GAAd,cAAc,CAAoB;QAtJ7C;;WAEG;QACI,aAAQ,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC;QAEjC;;WAEG;QACI,cAAS,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC;QAElC;;WAEG;QACI,UAAK,GAAG,IAAI,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;QAEtC;;WAEG;QACI,cAAS,GAAG,IAAI,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;QAE1C;;WAEG;QACI,iBAAY,GAAG,IAAI,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;QAE7C;;WAEG;QACI,cAAS,GAAG,IAAI,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;QAE1C;;WAEG;QACI,aAAQ,GAAG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\"../Maths/math.color\";\r\nimport type { SubEmitter } from \"./subEmitter\";\r\nimport type { ColorGradient, FactorGradient } from \"../Misc/gradients\";\r\n\r\nimport type { AbstractMesh } from \"../Meshes/abstractMesh\";\r\nimport type { ThinParticleSystem } from \"./thinParticleSystem\";\r\nimport { Clamp } from \"../Maths/math.scalar.functions\";\r\n\r\n/**\r\n * A particle represents one of the element emitted by a particle system.\r\n * This is mainly define by its coordinates, direction, velocity and age.\r\n */\r\nexport class Particle {\r\n private static _Count = 0;\r\n /**\r\n * Unique ID of the particle\r\n */\r\n public id: number;\r\n /**\r\n * The world position of the particle in the scene.\r\n */\r\n public position = Vector3.Zero();\r\n\r\n /**\r\n * The world direction of the particle in the scene.\r\n */\r\n public direction = Vector3.Zero();\r\n\r\n /**\r\n * The color of the particle.\r\n */\r\n public color = new Color4(0, 0, 0, 0);\r\n\r\n /**\r\n * The color change of the particle per step.\r\n */\r\n public colorStep = new Color4(0, 0, 0, 0);\r\n\r\n /**\r\n * The creation color of the particle.\r\n */\r\n public initialColor = new Color4(0, 0, 0, 0);\r\n\r\n /**\r\n * The color used when the end of life of the particle.\r\n */\r\n public colorDead = new Color4(0, 0, 0, 0);\r\n\r\n /**\r\n * Defines how long will the life of the particle be.\r\n */\r\n public lifeTime = 1.0;\r\n\r\n /**\r\n * The current age of the particle.\r\n */\r\n public age = 0;\r\n\r\n /**\r\n * The current size of the particle.\r\n */\r\n public size = 0;\r\n\r\n /**\r\n * The current scale of the particle.\r\n */\r\n public scale = new Vector2(1, 1);\r\n\r\n /**\r\n * The current angle of the particle.\r\n */\r\n public angle = 0;\r\n\r\n /**\r\n * Defines how fast is the angle changing.\r\n */\r\n public angularSpeed = 0;\r\n\r\n /**\r\n * Defines the cell index used by the particle to be rendered from a sprite.\r\n */\r\n public cellIndex: number = 0;\r\n\r\n /**\r\n * The information required to support color remapping\r\n */\r\n public remapData: Vector4;\r\n\r\n /** @internal */\r\n public _randomCellOffset?: number;\r\n\r\n /** @internal */\r\n public _initialDirection: Nullable<Vector3>;\r\n\r\n /** @internal */\r\n public _attachedSubEmitters: Nullable<Array<SubEmitter>> = null;\r\n\r\n /** @internal */\r\n public _initialStartSpriteCellId: number;\r\n /** @internal */\r\n public _initialEndSpriteCellId: number;\r\n /** @internal */\r\n public _initialSpriteCellLoop: boolean;\r\n\r\n /** @internal */\r\n public _currentColorGradient: Nullable<ColorGradient>;\r\n /** @internal */\r\n public _currentColor1 = new Color4(0, 0, 0, 0);\r\n /** @internal */\r\n public _currentColor2 = new Color4(0, 0, 0, 0);\r\n\r\n /** @internal */\r\n public _currentSizeGradient: Nullable<FactorGradient>;\r\n /** @internal */\r\n public _currentSize1 = 0;\r\n /** @internal */\r\n public _currentSize2 = 0;\r\n\r\n /** @internal */\r\n public _currentAngularSpeedGradient: Nullable<FactorGradient>;\r\n /** @internal */\r\n public _currentAngularSpeed1 = 0;\r\n /** @internal */\r\n public _currentAngularSpeed2 = 0;\r\n\r\n /** @internal */\r\n public _currentVelocityGradient: Nullable<FactorGradient>;\r\n /** @internal */\r\n public _currentVelocity1 = 0;\r\n /** @internal */\r\n public _currentVelocity2 = 0;\r\n\r\n /** @internal */\r\n public _directionScale: number;\r\n\r\n /** @internal */\r\n public _scaledDirection = Vector3.Zero();\r\n\r\n /** @internal */\r\n public _currentLimitVelocityGradient: Nullable<FactorGradient>;\r\n /** @internal */\r\n public _currentLimitVelocity1 = 0;\r\n /** @internal */\r\n public _currentLimitVelocity2 = 0;\r\n\r\n /** @internal */\r\n public _currentDragGradient: Nullable<FactorGradient>;\r\n /** @internal */\r\n public _currentDrag1 = 0;\r\n /** @internal */\r\n public _currentDrag2 = 0;\r\n\r\n /** @internal */\r\n public _randomNoiseCoordinates1: Vector3;\r\n /** @internal */\r\n public _randomNoiseCoordinates2: Vector3;\r\n\r\n /** @internal */\r\n public _localPosition?: Vector3;\r\n\r\n /**\r\n * Creates a new instance Particle\r\n * @param particleSystem the particle system the particle belongs to\r\n */\r\n constructor(\r\n /**\r\n * The particle system the particle belongs to.\r\n */\r\n public particleSystem: ThinParticleSystem\r\n ) {\r\n this.id = Particle._Count++;\r\n if (!this.particleSystem.isAnimationSheetEnabled) {\r\n return;\r\n }\r\n\r\n this._updateCellInfoFromSystem();\r\n }\r\n\r\n private _updateCellInfoFromSystem(): void {\r\n this.cellIndex = this.particleSystem.startSpriteCellID;\r\n }\r\n\r\n /**\r\n * Defines how the sprite cell index is updated for the particle\r\n */\r\n public updateCellIndex(): void {\r\n let offsetAge = this.age;\r\n let changeSpeed = this.particleSystem.spriteCellChangeSpeed;\r\n\r\n if (this.particleSystem.spriteRandomStartCell) {\r\n if (this._randomCellOffset === undefined) {\r\n this._randomCellOffset = Math.random() * this.lifeTime;\r\n }\r\n\r\n if (changeSpeed === 0) {\r\n // Special case when speed = 0 meaning we want to stay on initial cell\r\n changeSpeed = 1;\r\n offsetAge = this._randomCellOffset;\r\n } else {\r\n offsetAge += this._randomCellOffset;\r\n }\r\n }\r\n\r\n const dist = this._initialEndSpriteCellId - this._initialStartSpriteCellId + 1;\r\n let ratio: number;\r\n if (this._initialSpriteCellLoop) {\r\n ratio = Clamp(((offsetAge * changeSpeed) % this.lifeTime) / this.lifeTime);\r\n } else {\r\n ratio = Clamp((offsetAge * changeSpeed) / this.lifeTime);\r\n }\r\n this.cellIndex = (this._initialStartSpriteCellId + ratio * dist) | 0;\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _inheritParticleInfoToSubEmitter(subEmitter: SubEmitter) {\r\n if ((<AbstractMesh>subEmitter.particleSystem.emitter).position) {\r\n const emitterMesh = <AbstractMesh>subEmitter.particleSystem.emitter;\r\n emitterMesh.position.copyFrom(this.position);\r\n if (subEmitter.inheritDirection) {\r\n const temp = TmpVectors.Vector3[0];\r\n this.direction.normalizeToRef(temp);\r\n emitterMesh.setDirection(temp, 0, Math.PI / 2);\r\n }\r\n } else {\r\n const emitterPosition = <Vector3>subEmitter.particleSystem.emitter;\r\n emitterPosition.copyFrom(this.position);\r\n }\r\n // Set inheritedVelocityOffset to be used when new particles are created\r\n this.direction.scaleToRef(subEmitter.inheritedVelocityAmount / 2, TmpVectors.Vector3[0]);\r\n subEmitter.particleSystem._inheritedVelocityOffset.copyFrom(TmpVectors.Vector3[0]);\r\n }\r\n\r\n /** @internal */\r\n public _inheritParticleInfoToSubEmitters() {\r\n if (this._attachedSubEmitters && this._attachedSubEmitters.length > 0) {\r\n for (const subEmitter of this._attachedSubEmitters) {\r\n this._inheritParticleInfoToSubEmitter(subEmitter);\r\n }\r\n }\r\n }\r\n\r\n /** @internal */\r\n public _reset() {\r\n this.age = 0;\r\n this.id = Particle._Count++;\r\n this._currentColorGradient = null;\r\n this._currentSizeGradient = null;\r\n this._currentAngularSpeedGradient = null;\r\n this._currentVelocityGradient = null;\r\n this._currentLimitVelocityGradient = null;\r\n this._currentDragGradient = null;\r\n this.cellIndex = this.particleSystem.startSpriteCellID;\r\n this._randomCellOffset = undefined;\r\n }\r\n\r\n /**\r\n * Copy the properties of particle to another one.\r\n * @param other the particle to copy the information to.\r\n */\r\n public copyTo(other: Particle) {\r\n other.position.copyFrom(this.position);\r\n if (this._initialDirection) {\r\n if (other._initialDirection) {\r\n other._initialDirection.copyFrom(this._initialDirection);\r\n } else {\r\n other._initialDirection = this._initialDirection.clone();\r\n }\r\n } else {\r\n other._initialDirection = null;\r\n }\r\n other.direction.copyFrom(this.direction);\r\n if (this._localPosition) {\r\n if (other._localPosition) {\r\n other._localPosition.copyFrom(this._localPosition);\r\n } else {\r\n other._localPosition = this._localPosition.clone();\r\n }\r\n }\r\n other.color.copyFrom(this.color);\r\n other.colorStep.copyFrom(this.colorStep);\r\n other.initialColor.copyFrom(this.initialColor);\r\n other.colorDead.copyFrom(this.colorDead);\r\n other.lifeTime = this.lifeTime;\r\n other.age = this.age;\r\n other._randomCellOffset = this._randomCellOffset;\r\n other.size = this.size;\r\n other.scale.copyFrom(this.scale);\r\n other.angle = this.angle;\r\n other.angularSpeed = this.angularSpeed;\r\n other.particleSystem = this.particleSystem;\r\n other.cellIndex = this.cellIndex;\r\n other.id = this.id;\r\n other._attachedSubEmitters = this._attachedSubEmitters;\r\n if (this._currentColorGradient) {\r\n other._currentColorGradient = this._currentColorGradient;\r\n other._currentColor1.copyFrom(this._currentColor1);\r\n other._currentColor2.copyFrom(this._currentColor2);\r\n }\r\n if (this._currentSizeGradient) {\r\n other._currentSizeGradient = this._currentSizeGradient;\r\n other._currentSize1 = this._currentSize1;\r\n other._currentSize2 = this._currentSize2;\r\n }\r\n if (this._currentAngularSpeedGradient) {\r\n other._currentAngularSpeedGradient = this._currentAngularSpeedGradient;\r\n other._currentAngularSpeed1 = this._currentAngularSpeed1;\r\n other._currentAngularSpeed2 = this._currentAngularSpeed2;\r\n }\r\n if (this._currentVelocityGradient) {\r\n other._currentVelocityGradient = this._currentVelocityGradient;\r\n other._currentVelocity1 = this._currentVelocity1;\r\n other._currentVelocity2 = this._currentVelocity2;\r\n }\r\n if (this._currentLimitVelocityGradient) {\r\n other._currentLimitVelocityGradient = this._currentLimitVelocityGradient;\r\n other._currentLimitVelocity1 = this._currentLimitVelocity1;\r\n other._currentLimitVelocity2 = this._currentLimitVelocity2;\r\n }\r\n if (this._currentDragGradient) {\r\n other._currentDragGradient = this._currentDragGradient;\r\n other._currentDrag1 = this._currentDrag1;\r\n other._currentDrag2 = this._currentDrag2;\r\n }\r\n if (this.particleSystem.isAnimationSheetEnabled) {\r\n other._initialStartSpriteCellId = this._initialStartSpriteCellId;\r\n other._initialEndSpriteCellId = this._initialEndSpriteCellId;\r\n other._initialSpriteCellLoop = this._initialSpriteCellLoop;\r\n }\r\n if (this.particleSystem.useRampGradients) {\r\n if (other.remapData && this.remapData) {\r\n other.remapData.copyFrom(this.remapData);\r\n } else {\r\n other.remapData = new Vector4(0, 0, 0, 0);\r\n }\r\n }\r\n if (this._randomNoiseCoordinates1) {\r\n if (other._randomNoiseCoordinates1) {\r\n other._randomNoiseCoordinates1.copyFrom(this._randomNoiseCoordinates1);\r\n other._randomNoiseCoordinates2.copyFrom(this._randomNoiseCoordinates2);\r\n } else {\r\n other._randomNoiseCoordinates1 = this._randomNoiseCoordinates1.clone();\r\n other._randomNoiseCoordinates2 = this._randomNoiseCoordinates2.clone();\r\n }\r\n }\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"particle.js","sourceRoot":"","sources":["../../../../dev/core/src/Particles/particle.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC7E,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAM7C,OAAO,EAAE,KAAK,EAAE,MAAM,gCAAgC,CAAC;AAEvD;;;GAGG;AACH,MAAM,OAAO,QAAQ;IAoJjB;;;OAGG;IACH;IACI;;OAEG;IACI,cAAkC;QAAlC,mBAAc,GAAd,cAAc,CAAoB;QAtJ7C;;WAEG;QACI,aAAQ,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC;QAEjC;;WAEG;QACI,cAAS,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC;QAElC;;WAEG;QACI,UAAK,GAAG,IAAI,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;QAEtC;;WAEG;QACI,cAAS,GAAG,IAAI,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;QAE1C;;WAEG;QACI,iBAAY,GAAG,IAAI,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;QAE7C;;WAEG;QACI,cAAS,GAAG,IAAI,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;QAE1C;;WAEG;QACI,aAAQ,GAAG,GAAG,CAAC;QAEtB;;WAEG;QACI,QAAG,GAAG,CAAC,CAAC;QAEf;;WAEG;QACI,SAAI,GAAG,CAAC,CAAC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Vectors, Vector4 } from \"../Maths/math.vector\";\r\nimport { Color4 } from \"../Maths/math.color\";\r\nimport type { SubEmitter } from \"./subEmitter\";\r\nimport type { ColorGradient, FactorGradient } from \"../Misc/gradients\";\r\n\r\nimport type { AbstractMesh } from \"../Meshes/abstractMesh\";\r\nimport type { ThinParticleSystem } from \"./thinParticleSystem\";\r\nimport { Clamp } from \"../Maths/math.scalar.functions\";\r\n\r\n/**\r\n * A particle represents one of the element emitted by a particle system.\r\n * This is mainly define by its coordinates, direction, velocity and age.\r\n */\r\nexport class Particle {\r\n private static _Count = 0;\r\n /**\r\n * Unique ID of the particle\r\n */\r\n public id: number;\r\n /**\r\n * The world position of the particle in the scene.\r\n */\r\n public position = Vector3.Zero();\r\n\r\n /**\r\n * The world direction of the particle in the scene.\r\n */\r\n public direction = Vector3.Zero();\r\n\r\n /**\r\n * The color of the particle.\r\n */\r\n public color = new Color4(0, 0, 0, 0);\r\n\r\n /**\r\n * The color change of the particle per step.\r\n */\r\n public colorStep = new Color4(0, 0, 0, 0);\r\n\r\n /**\r\n * The creation color of the particle.\r\n */\r\n public initialColor = new Color4(0, 0, 0, 0);\r\n\r\n /**\r\n * The color used when the end of life of the particle.\r\n */\r\n public colorDead = new Color4(0, 0, 0, 0);\r\n\r\n /**\r\n * Defines how long will the life of the particle be.\r\n */\r\n public lifeTime = 1.0;\r\n\r\n /**\r\n * The current age of the particle.\r\n */\r\n public age = 0;\r\n\r\n /**\r\n * The current size of the particle.\r\n */\r\n public size = 0;\r\n\r\n /**\r\n * The current scale of the particle.\r\n */\r\n public scale = new Vector2(1, 1);\r\n\r\n /**\r\n * The current angle of the particle.\r\n */\r\n public angle = 0;\r\n\r\n /**\r\n * Defines how fast is the angle changing.\r\n */\r\n public angularSpeed = 0;\r\n\r\n /**\r\n * Defines the cell index used by the particle to be rendered from a sprite.\r\n */\r\n public cellIndex: number = 0;\r\n\r\n /**\r\n * The information required to support color remapping\r\n */\r\n public remapData: Vector4;\r\n\r\n /** @internal */\r\n public _randomCellOffset?: number;\r\n\r\n /** @internal */\r\n public _initialDirection: Nullable<Vector3>;\r\n\r\n /** @internal */\r\n public _attachedSubEmitters: Nullable<Array<SubEmitter>> = null;\r\n\r\n /** @internal */\r\n public _initialStartSpriteCellId: number;\r\n /** @internal */\r\n public _initialEndSpriteCellId: number;\r\n /** @internal */\r\n public _initialSpriteCellLoop: boolean;\r\n\r\n /** @internal */\r\n public _currentColorGradient: Nullable<ColorGradient>;\r\n /** @internal */\r\n public _currentColor1 = new Color4(0, 0, 0, 0);\r\n /** @internal */\r\n public _currentColor2 = new Color4(0, 0, 0, 0);\r\n\r\n /** @internal */\r\n public _currentSizeGradient: Nullable<FactorGradient>;\r\n /** @internal */\r\n public _currentSize1 = 0;\r\n /** @internal */\r\n public _currentSize2 = 0;\r\n\r\n /** @internal */\r\n public _currentAngularSpeedGradient: Nullable<FactorGradient>;\r\n /** @internal */\r\n public _currentAngularSpeed1 = 0;\r\n /** @internal */\r\n public _currentAngularSpeed2 = 0;\r\n\r\n /** @internal */\r\n public _currentVelocityGradient: Nullable<FactorGradient>;\r\n /** @internal */\r\n public _currentVelocity1 = 0;\r\n /** @internal */\r\n public _currentVelocity2 = 0;\r\n\r\n /** @internal */\r\n public _directionScale: number;\r\n\r\n /** @internal */\r\n public _scaledDirection = Vector3.Zero();\r\n\r\n /** @internal */\r\n public _currentLimitVelocityGradient: Nullable<FactorGradient>;\r\n /** @internal */\r\n public _currentLimitVelocity1 = 0;\r\n /** @internal */\r\n public _currentLimitVelocity2 = 0;\r\n\r\n /** @internal */\r\n public _currentDragGradient: Nullable<FactorGradient>;\r\n /** @internal */\r\n public _currentDrag1 = 0;\r\n /** @internal */\r\n public _currentDrag2 = 0;\r\n\r\n /** @internal */\r\n public _randomNoiseCoordinates1: Nullable<Vector3>;\r\n /** @internal */\r\n public _randomNoiseCoordinates2: Nullable<Vector3>;\r\n\r\n /** @internal */\r\n public _localPosition?: Vector3;\r\n\r\n /**\r\n * Creates a new instance Particle\r\n * @param particleSystem the particle system the particle belongs to\r\n */\r\n constructor(\r\n /**\r\n * The particle system the particle belongs to.\r\n */\r\n public particleSystem: ThinParticleSystem\r\n ) {\r\n this.id = Particle._Count++;\r\n if (!this.particleSystem.isAnimationSheetEnabled) {\r\n return;\r\n }\r\n\r\n this._updateCellInfoFromSystem();\r\n }\r\n\r\n private _updateCellInfoFromSystem(): void {\r\n this.cellIndex = this.particleSystem.startSpriteCellID;\r\n }\r\n\r\n /**\r\n * Defines how the sprite cell index is updated for the particle\r\n */\r\n public updateCellIndex(): void {\r\n let offsetAge = this.age;\r\n let changeSpeed = this.particleSystem.spriteCellChangeSpeed;\r\n\r\n if (this.particleSystem.spriteRandomStartCell) {\r\n if (this._randomCellOffset === undefined) {\r\n this._randomCellOffset = Math.random() * this.lifeTime;\r\n }\r\n\r\n if (changeSpeed === 0) {\r\n // Special case when speed = 0 meaning we want to stay on initial cell\r\n changeSpeed = 1;\r\n offsetAge = this._randomCellOffset;\r\n } else {\r\n offsetAge += this._randomCellOffset;\r\n }\r\n }\r\n\r\n const dist = this._initialEndSpriteCellId - this._initialStartSpriteCellId + 1;\r\n let ratio: number;\r\n if (this._initialSpriteCellLoop) {\r\n ratio = Clamp(((offsetAge * changeSpeed) % this.lifeTime) / this.lifeTime);\r\n } else {\r\n ratio = Clamp((offsetAge * changeSpeed) / this.lifeTime);\r\n }\r\n this.cellIndex = (this._initialStartSpriteCellId + ratio * dist) | 0;\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _inheritParticleInfoToSubEmitter(subEmitter: SubEmitter) {\r\n if ((<AbstractMesh>subEmitter.particleSystem.emitter).position) {\r\n const emitterMesh = <AbstractMesh>subEmitter.particleSystem.emitter;\r\n emitterMesh.position.copyFrom(this.position);\r\n if (subEmitter.inheritDirection) {\r\n const temp = TmpVectors.Vector3[0];\r\n this.direction.normalizeToRef(temp);\r\n emitterMesh.setDirection(temp, 0, Math.PI / 2);\r\n }\r\n } else {\r\n const emitterPosition = <Vector3>subEmitter.particleSystem.emitter;\r\n emitterPosition.copyFrom(this.position);\r\n }\r\n // Set inheritedVelocityOffset to be used when new particles are created\r\n this.direction.scaleToRef(subEmitter.inheritedVelocityAmount / 2, TmpVectors.Vector3[0]);\r\n subEmitter.particleSystem._inheritedVelocityOffset.copyFrom(TmpVectors.Vector3[0]);\r\n }\r\n\r\n /** @internal */\r\n public _inheritParticleInfoToSubEmitters() {\r\n if (this._attachedSubEmitters && this._attachedSubEmitters.length > 0) {\r\n for (const subEmitter of this._attachedSubEmitters) {\r\n this._inheritParticleInfoToSubEmitter(subEmitter);\r\n }\r\n }\r\n }\r\n\r\n /** @internal */\r\n public _reset() {\r\n this.age = 0;\r\n this.id = Particle._Count++;\r\n this._currentColorGradient = null;\r\n this._currentSizeGradient = null;\r\n this._currentAngularSpeedGradient = null;\r\n this._currentVelocityGradient = null;\r\n this._currentLimitVelocityGradient = null;\r\n this._currentDragGradient = null;\r\n this.cellIndex = this.particleSystem.startSpriteCellID;\r\n this._randomCellOffset = undefined;\r\n this._randomNoiseCoordinates1 = null;\r\n this._randomNoiseCoordinates2 = null;\r\n }\r\n\r\n /**\r\n * Copy the properties of particle to another one.\r\n * @param other the particle to copy the information to.\r\n */\r\n public copyTo(other: Particle) {\r\n other.position.copyFrom(this.position);\r\n if (this._initialDirection) {\r\n if (other._initialDirection) {\r\n other._initialDirection.copyFrom(this._initialDirection);\r\n } else {\r\n other._initialDirection = this._initialDirection.clone();\r\n }\r\n } else {\r\n other._initialDirection = null;\r\n }\r\n other.direction.copyFrom(this.direction);\r\n if (this._localPosition) {\r\n if (other._localPosition) {\r\n other._localPosition.copyFrom(this._localPosition);\r\n } else {\r\n other._localPosition = this._localPosition.clone();\r\n }\r\n }\r\n other.color.copyFrom(this.color);\r\n other.colorStep.copyFrom(this.colorStep);\r\n other.initialColor.copyFrom(this.initialColor);\r\n other.colorDead.copyFrom(this.colorDead);\r\n other.lifeTime = this.lifeTime;\r\n other.age = this.age;\r\n other._randomCellOffset = this._randomCellOffset;\r\n other.size = this.size;\r\n other.scale.copyFrom(this.scale);\r\n other.angle = this.angle;\r\n other.angularSpeed = this.angularSpeed;\r\n other.particleSystem = this.particleSystem;\r\n other.cellIndex = this.cellIndex;\r\n other.id = this.id;\r\n other._attachedSubEmitters = this._attachedSubEmitters;\r\n if (this._currentColorGradient) {\r\n other._currentColorGradient = this._currentColorGradient;\r\n other._currentColor1.copyFrom(this._currentColor1);\r\n other._currentColor2.copyFrom(this._currentColor2);\r\n }\r\n if (this._currentSizeGradient) {\r\n other._currentSizeGradient = this._currentSizeGradient;\r\n other._currentSize1 = this._currentSize1;\r\n other._currentSize2 = this._currentSize2;\r\n }\r\n if (this._currentAngularSpeedGradient) {\r\n other._currentAngularSpeedGradient = this._currentAngularSpeedGradient;\r\n other._currentAngularSpeed1 = this._currentAngularSpeed1;\r\n other._currentAngularSpeed2 = this._currentAngularSpeed2;\r\n }\r\n if (this._currentVelocityGradient) {\r\n other._currentVelocityGradient = this._currentVelocityGradient;\r\n other._currentVelocity1 = this._currentVelocity1;\r\n other._currentVelocity2 = this._currentVelocity2;\r\n }\r\n if (this._currentLimitVelocityGradient) {\r\n other._currentLimitVelocityGradient = this._currentLimitVelocityGradient;\r\n other._currentLimitVelocity1 = this._currentLimitVelocity1;\r\n other._currentLimitVelocity2 = this._currentLimitVelocity2;\r\n }\r\n if (this._currentDragGradient) {\r\n other._currentDragGradient = this._currentDragGradient;\r\n other._currentDrag1 = this._currentDrag1;\r\n other._currentDrag2 = this._currentDrag2;\r\n }\r\n if (this.particleSystem.isAnimationSheetEnabled) {\r\n other._initialStartSpriteCellId = this._initialStartSpriteCellId;\r\n other._initialEndSpriteCellId = this._initialEndSpriteCellId;\r\n other._initialSpriteCellLoop = this._initialSpriteCellLoop;\r\n }\r\n if (this.particleSystem.useRampGradients) {\r\n if (other.remapData && this.remapData) {\r\n other.remapData.copyFrom(this.remapData);\r\n } else {\r\n other.remapData = new Vector4(0, 0, 0, 0);\r\n }\r\n }\r\n if (this._randomNoiseCoordinates1 && this._randomNoiseCoordinates2) {\r\n if (other._randomNoiseCoordinates1 && other._randomNoiseCoordinates2) {\r\n other._randomNoiseCoordinates1.copyFrom(this._randomNoiseCoordinates1);\r\n other._randomNoiseCoordinates2.copyFrom(this._randomNoiseCoordinates2);\r\n } else {\r\n other._randomNoiseCoordinates1 = this._randomNoiseCoordinates1.clone();\r\n other._randomNoiseCoordinates2 = this._randomNoiseCoordinates2.clone();\r\n }\r\n }\r\n }\r\n}\r\n"]}
@@ -488,7 +488,7 @@ export declare class ThinParticleSystem extends BaseParticleSystem implements ID
488
488
  */
489
489
  resetDrawCache(): void;
490
490
  /** @internal */
491
- _fetchR(u: number, v: number, width: number, height: number, pixels: Uint8Array): number;
491
+ _fetchR(u: number, v: number, width: number, height: number, pixels: Uint8Array | Uint8ClampedArray): number;
492
492
  protected _reset(): void;
493
493
  private _resetEffect;
494
494
  private _createVertexBuffers;
@@ -181,7 +181,7 @@ export function _ProcessDragGradients(particle, system) {
181
181
  /** Noise */
182
182
  /** @internal */
183
183
  export function _CreateNoiseData(particle, _system) {
184
- if (particle._randomNoiseCoordinates1) {
184
+ if (particle._randomNoiseCoordinates1 && particle._randomNoiseCoordinates2) {
185
185
  particle._randomNoiseCoordinates1.copyFromFloats(Math.random(), Math.random(), Math.random());
186
186
  particle._randomNoiseCoordinates2.copyFromFloats(Math.random(), Math.random(), Math.random());
187
187
  }
@@ -194,7 +194,7 @@ export function _CreateNoiseData(particle, _system) {
194
194
  export function _ProcessNoise(particle, system) {
195
195
  const noiseTextureData = system._noiseTextureData;
196
196
  const noiseTextureSize = system._noiseTextureSize;
197
- if (noiseTextureData && noiseTextureSize && particle._randomNoiseCoordinates1) {
197
+ if (noiseTextureData && noiseTextureSize && particle._randomNoiseCoordinates1 && particle._randomNoiseCoordinates2) {
198
198
  const fetchedColorR = system._fetchR(particle._randomNoiseCoordinates1.x, particle._randomNoiseCoordinates1.y, noiseTextureSize.width, noiseTextureSize.height, noiseTextureData);
199
199
  const fetchedColorG = system._fetchR(particle._randomNoiseCoordinates1.z, particle._randomNoiseCoordinates2.x, noiseTextureSize.width, noiseTextureSize.height, noiseTextureData);
200
200
  const fetchedColorB = system._fetchR(particle._randomNoiseCoordinates2.y, particle._randomNoiseCoordinates2.z, noiseTextureSize.width, noiseTextureSize.height, noiseTextureData);