@babylonjs/core 8.11.0 → 8.12.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 (391) hide show
  1. package/Cameras/arcRotateCamera.js +8 -0
  2. package/Cameras/arcRotateCamera.js.map +1 -1
  3. package/Cameras/targetCamera.js +2 -0
  4. package/Cameras/targetCamera.js.map +1 -1
  5. package/Collisions/gpuPicker.d.ts +4 -0
  6. package/Collisions/gpuPicker.js +6 -0
  7. package/Collisions/gpuPicker.js.map +1 -1
  8. package/Engines/abstractEngine.js +2 -2
  9. package/Engines/abstractEngine.js.map +1 -1
  10. package/Engines/constants.d.ts +4 -0
  11. package/Engines/constants.js +4 -0
  12. package/Engines/constants.js.map +1 -1
  13. package/FrameGraph/Node/Blocks/Rendering/baseShadowGeneratorBlock.d.ts +1 -0
  14. package/FrameGraph/Node/Blocks/Rendering/baseShadowGeneratorBlock.js +2 -0
  15. package/FrameGraph/Node/Blocks/Rendering/baseShadowGeneratorBlock.js.map +1 -1
  16. package/FrameGraph/Node/Blocks/Rendering/csmShadowGeneratorBlock.d.ts +6 -1
  17. package/FrameGraph/Node/Blocks/Rendering/csmShadowGeneratorBlock.js +29 -0
  18. package/FrameGraph/Node/Blocks/Rendering/csmShadowGeneratorBlock.js.map +1 -1
  19. package/FrameGraph/Node/Blocks/Rendering/geometryRendererBlock.d.ts +6 -0
  20. package/FrameGraph/Node/Blocks/Rendering/geometryRendererBlock.js +36 -9
  21. package/FrameGraph/Node/Blocks/Rendering/geometryRendererBlock.js.map +1 -1
  22. package/FrameGraph/Node/Blocks/Rendering/shadowGeneratorBlock.js +1 -0
  23. package/FrameGraph/Node/Blocks/Rendering/shadowGeneratorBlock.js.map +1 -1
  24. package/FrameGraph/Node/Blocks/inputBlock.js +1 -0
  25. package/FrameGraph/Node/Blocks/inputBlock.js.map +1 -1
  26. package/FrameGraph/Node/Types/nodeRenderGraphTypes.d.ts +2 -0
  27. package/FrameGraph/Node/Types/nodeRenderGraphTypes.js +2 -0
  28. package/FrameGraph/Node/Types/nodeRenderGraphTypes.js.map +1 -1
  29. package/FrameGraph/Tasks/Rendering/csmShadowGeneratorTask.d.ts +23 -0
  30. package/FrameGraph/Tasks/Rendering/csmShadowGeneratorTask.js +126 -21
  31. package/FrameGraph/Tasks/Rendering/csmShadowGeneratorTask.js.map +1 -1
  32. package/FrameGraph/Tasks/Rendering/geometryRendererTask.d.ts +5 -0
  33. package/FrameGraph/Tasks/Rendering/geometryRendererTask.js +4 -0
  34. package/FrameGraph/Tasks/Rendering/geometryRendererTask.js.map +1 -1
  35. package/FrameGraph/Tasks/Rendering/shadowGeneratorTask.d.ts +2 -4
  36. package/FrameGraph/Tasks/Rendering/shadowGeneratorTask.js +4 -17
  37. package/FrameGraph/Tasks/Rendering/shadowGeneratorTask.js.map +1 -1
  38. package/FrameGraph/frameGraph.js +1 -1
  39. package/FrameGraph/frameGraph.js.map +1 -1
  40. package/FrameGraph/frameGraphContext.d.ts +30 -0
  41. package/FrameGraph/frameGraphContext.js +47 -0
  42. package/FrameGraph/frameGraphContext.js.map +1 -1
  43. package/FrameGraph/frameGraphRenderContext.d.ts +1 -4
  44. package/FrameGraph/frameGraphRenderContext.js +2 -5
  45. package/FrameGraph/frameGraphRenderContext.js.map +1 -1
  46. package/Lights/Shadows/cascadedShadowGenerator.d.ts +0 -1
  47. package/Lights/Shadows/cascadedShadowGenerator.js +0 -12
  48. package/Lights/Shadows/cascadedShadowGenerator.js.map +1 -1
  49. package/Materials/Node/Blocks/Dual/clipPlanesBlock.d.ts +1 -1
  50. package/Materials/Node/Blocks/Dual/clipPlanesBlock.js +4 -1
  51. package/Materials/Node/Blocks/Dual/clipPlanesBlock.js.map +1 -1
  52. package/Materials/Node/Blocks/Dual/currentScreenBlock.d.ts +2 -3
  53. package/Materials/Node/Blocks/Dual/currentScreenBlock.js +1 -1
  54. package/Materials/Node/Blocks/Dual/currentScreenBlock.js.map +1 -1
  55. package/Materials/Node/Blocks/Dual/fogBlock.d.ts +1 -1
  56. package/Materials/Node/Blocks/Dual/fogBlock.js +4 -1
  57. package/Materials/Node/Blocks/Dual/fogBlock.js.map +1 -1
  58. package/Materials/Node/Blocks/Dual/lightBlock.d.ts +1 -1
  59. package/Materials/Node/Blocks/Dual/lightBlock.js +2 -2
  60. package/Materials/Node/Blocks/Dual/lightBlock.js.map +1 -1
  61. package/Materials/Node/Blocks/Dual/reflectionTextureBaseBlock.d.ts +1 -2
  62. package/Materials/Node/Blocks/Dual/reflectionTextureBaseBlock.js +1 -1
  63. package/Materials/Node/Blocks/Dual/reflectionTextureBaseBlock.js.map +1 -1
  64. package/Materials/Node/Blocks/Dual/smartFilterTextureBlock.js +3 -4
  65. package/Materials/Node/Blocks/Dual/smartFilterTextureBlock.js.map +1 -1
  66. package/Materials/Node/Blocks/Dual/textureBlock.d.ts +2 -3
  67. package/Materials/Node/Blocks/Dual/textureBlock.js +2 -2
  68. package/Materials/Node/Blocks/Dual/textureBlock.js.map +1 -1
  69. package/Materials/Node/Blocks/Fragment/TBNBlock.d.ts +1 -1
  70. package/Materials/Node/Blocks/Fragment/TBNBlock.js +4 -1
  71. package/Materials/Node/Blocks/Fragment/TBNBlock.js.map +1 -1
  72. package/Materials/Node/Blocks/Fragment/fragCoordBlock.js +2 -2
  73. package/Materials/Node/Blocks/Fragment/fragCoordBlock.js.map +1 -1
  74. package/Materials/Node/Blocks/Fragment/fragmentOutputBlock.d.ts +1 -2
  75. package/Materials/Node/Blocks/Fragment/fragmentOutputBlock.js +1 -1
  76. package/Materials/Node/Blocks/Fragment/fragmentOutputBlock.js.map +1 -1
  77. package/Materials/Node/Blocks/Fragment/frontFacingBlock.js +2 -2
  78. package/Materials/Node/Blocks/Fragment/frontFacingBlock.js.map +1 -1
  79. package/Materials/Node/Blocks/Fragment/heightToNormalBlock.js +1 -2
  80. package/Materials/Node/Blocks/Fragment/heightToNormalBlock.js.map +1 -1
  81. package/Materials/Node/Blocks/Fragment/imageProcessingBlock.d.ts +1 -1
  82. package/Materials/Node/Blocks/Fragment/imageProcessingBlock.js +1 -1
  83. package/Materials/Node/Blocks/Fragment/imageProcessingBlock.js.map +1 -1
  84. package/Materials/Node/Blocks/Fragment/perturbNormalBlock.d.ts +1 -2
  85. package/Materials/Node/Blocks/Fragment/perturbNormalBlock.js +1 -1
  86. package/Materials/Node/Blocks/Fragment/perturbNormalBlock.js.map +1 -1
  87. package/Materials/Node/Blocks/Fragment/screenSizeBlock.js +2 -2
  88. package/Materials/Node/Blocks/Fragment/screenSizeBlock.js.map +1 -1
  89. package/Materials/Node/Blocks/GaussianSplatting/gaussianSplattingBlock.d.ts +3 -3
  90. package/Materials/Node/Blocks/GaussianSplatting/gaussianSplattingBlock.js +6 -3
  91. package/Materials/Node/Blocks/GaussianSplatting/gaussianSplattingBlock.js.map +1 -1
  92. package/Materials/Node/Blocks/PBR/anisotropyBlock.d.ts +1 -2
  93. package/Materials/Node/Blocks/PBR/anisotropyBlock.js +2 -4
  94. package/Materials/Node/Blocks/PBR/anisotropyBlock.js.map +1 -1
  95. package/Materials/Node/Blocks/PBR/clearCoatBlock.d.ts +1 -2
  96. package/Materials/Node/Blocks/PBR/clearCoatBlock.js +1 -2
  97. package/Materials/Node/Blocks/PBR/clearCoatBlock.js.map +1 -1
  98. package/Materials/Node/Blocks/PBR/iridescenceBlock.d.ts +2 -3
  99. package/Materials/Node/Blocks/PBR/iridescenceBlock.js +1 -2
  100. package/Materials/Node/Blocks/PBR/iridescenceBlock.js.map +1 -1
  101. package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.d.ts +1 -1
  102. package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.js +5 -2
  103. package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.js.map +1 -1
  104. package/Materials/Node/Blocks/PBR/reflectionBlock.d.ts +1 -2
  105. package/Materials/Node/Blocks/PBR/reflectionBlock.js +2 -2
  106. package/Materials/Node/Blocks/PBR/reflectionBlock.js.map +1 -1
  107. package/Materials/Node/Blocks/PBR/refractionBlock.d.ts +1 -2
  108. package/Materials/Node/Blocks/PBR/refractionBlock.js +1 -2
  109. package/Materials/Node/Blocks/PBR/refractionBlock.js.map +1 -1
  110. package/Materials/Node/Blocks/PBR/sheenBlock.d.ts +2 -3
  111. package/Materials/Node/Blocks/PBR/sheenBlock.js +1 -2
  112. package/Materials/Node/Blocks/PBR/sheenBlock.js.map +1 -1
  113. package/Materials/Node/Blocks/PBR/subSurfaceBlock.d.ts +2 -3
  114. package/Materials/Node/Blocks/PBR/subSurfaceBlock.js +1 -2
  115. package/Materials/Node/Blocks/PBR/subSurfaceBlock.js.map +1 -1
  116. package/Materials/Node/Blocks/Particle/particleTextureBlock.d.ts +1 -2
  117. package/Materials/Node/Blocks/Particle/particleTextureBlock.js +1 -1
  118. package/Materials/Node/Blocks/Particle/particleTextureBlock.js.map +1 -1
  119. package/Materials/Node/Blocks/Vertex/bonesBlock.d.ts +2 -2
  120. package/Materials/Node/Blocks/Vertex/bonesBlock.js +3 -3
  121. package/Materials/Node/Blocks/Vertex/bonesBlock.js.map +1 -1
  122. package/Materials/Node/Blocks/Vertex/instancesBlock.d.ts +1 -1
  123. package/Materials/Node/Blocks/Vertex/instancesBlock.js +1 -1
  124. package/Materials/Node/Blocks/Vertex/instancesBlock.js.map +1 -1
  125. package/Materials/Node/Blocks/Vertex/lightInformationBlock.d.ts +1 -2
  126. package/Materials/Node/Blocks/Vertex/lightInformationBlock.js +1 -1
  127. package/Materials/Node/Blocks/Vertex/lightInformationBlock.js.map +1 -1
  128. package/Materials/Node/Blocks/Vertex/morphTargetsBlock.d.ts +2 -2
  129. package/Materials/Node/Blocks/Vertex/morphTargetsBlock.js +8 -2
  130. package/Materials/Node/Blocks/Vertex/morphTargetsBlock.js.map +1 -1
  131. package/Materials/Node/Blocks/transformBlock.d.ts +3 -3
  132. package/Materials/Node/Blocks/transformBlock.js +4 -5
  133. package/Materials/Node/Blocks/transformBlock.js.map +1 -1
  134. package/Materials/Node/Blocks/triPlanarBlock.d.ts +1 -3
  135. package/Materials/Node/Blocks/triPlanarBlock.js +1 -1
  136. package/Materials/Node/Blocks/triPlanarBlock.js.map +1 -1
  137. package/Materials/Node/nodeMaterial.d.ts +1 -1
  138. package/Materials/Node/nodeMaterial.js +28 -42
  139. package/Materials/Node/nodeMaterial.js.map +1 -1
  140. package/Materials/Node/nodeMaterialBlock.d.ts +8 -12
  141. package/Materials/Node/nodeMaterialBlock.js +10 -12
  142. package/Materials/Node/nodeMaterialBlock.js.map +1 -1
  143. package/Materials/Node/nodeMaterialBuildState.js +3 -1
  144. package/Materials/Node/nodeMaterialBuildState.js.map +1 -1
  145. package/Materials/Node/nodeMaterialBuildStateSharedData.d.ts +7 -3
  146. package/Materials/Node/nodeMaterialBuildStateSharedData.js +17 -6
  147. package/Materials/Node/nodeMaterialBuildStateSharedData.js.map +1 -1
  148. package/Materials/PBR/pbrBaseMaterial.d.ts +2 -0
  149. package/Materials/PBR/pbrBaseMaterial.js +11 -0
  150. package/Materials/PBR/pbrBaseMaterial.js.map +1 -1
  151. package/Materials/Textures/Loaders/exrTextureLoader.d.ts +10 -0
  152. package/Materials/Textures/Loaders/exrTextureLoader.js +28 -1
  153. package/Materials/Textures/Loaders/exrTextureLoader.js.map +1 -1
  154. package/Materials/materialHelper.functions.js +1 -1
  155. package/Materials/materialHelper.functions.js.map +1 -1
  156. package/Materials/materialHelper.geometryrendering.js +7 -0
  157. package/Materials/materialHelper.geometryrendering.js.map +1 -1
  158. package/Materials/standardMaterial.d.ts +2 -0
  159. package/Materials/standardMaterial.js +11 -0
  160. package/Materials/standardMaterial.js.map +1 -1
  161. package/Meshes/Node/Blocks/Textures/geometryTextureBlock.d.ts +7 -0
  162. package/Meshes/Node/Blocks/Textures/geometryTextureBlock.js +11 -5
  163. package/Meshes/Node/Blocks/Textures/geometryTextureBlock.js.map +1 -1
  164. package/Meshes/Node/Blocks/Textures/geometryTextureFetchBlock.d.ts +6 -0
  165. package/Meshes/Node/Blocks/Textures/geometryTextureFetchBlock.js +42 -4
  166. package/Meshes/Node/Blocks/Textures/geometryTextureFetchBlock.js.map +1 -1
  167. package/Meshes/Node/Blocks/geometryOptimizeBlock.js +8 -0
  168. package/Meshes/Node/Blocks/geometryOptimizeBlock.js.map +1 -1
  169. package/Misc/environmentTextureTools.js +1 -1
  170. package/Misc/environmentTextureTools.js.map +1 -1
  171. package/Misc/minMaxReducer.d.ts +8 -6
  172. package/Misc/minMaxReducer.js +57 -90
  173. package/Misc/minMaxReducer.js.map +1 -1
  174. package/Misc/observable.d.ts +1 -1
  175. package/Misc/observable.js.map +1 -1
  176. package/Misc/thinMinMaxReducer.d.ts +47 -0
  177. package/Misc/thinMinMaxReducer.js +148 -0
  178. package/Misc/thinMinMaxReducer.js.map +1 -0
  179. package/Particles/EmitterTypes/customParticleEmitter.d.ts +5 -0
  180. package/Particles/EmitterTypes/customParticleEmitter.js +9 -1
  181. package/Particles/EmitterTypes/customParticleEmitter.js.map +1 -1
  182. package/Particles/IParticleSystem.d.ts +8 -0
  183. package/Particles/IParticleSystem.js.map +1 -1
  184. package/Particles/Node/Blocks/Conditions/particleConditionBlock.d.ts +75 -0
  185. package/Particles/Node/Blocks/Conditions/particleConditionBlock.js +179 -0
  186. package/Particles/Node/Blocks/Conditions/particleConditionBlock.js.map +1 -0
  187. package/Particles/Node/Blocks/Emitters/boxShapeBlock.d.ts +47 -0
  188. package/Particles/Node/Blocks/Emitters/boxShapeBlock.js +107 -0
  189. package/Particles/Node/Blocks/Emitters/boxShapeBlock.js.map +1 -0
  190. package/Particles/Node/Blocks/Emitters/createParticleBlock.d.ts +46 -0
  191. package/Particles/Node/Blocks/Emitters/createParticleBlock.js +97 -0
  192. package/Particles/Node/Blocks/Emitters/createParticleBlock.js.map +1 -0
  193. package/Particles/Node/Blocks/Emitters/customShapeBlock.d.ts +39 -0
  194. package/Particles/Node/Blocks/Emitters/customShapeBlock.js +84 -0
  195. package/Particles/Node/Blocks/Emitters/customShapeBlock.js.map +1 -0
  196. package/Particles/Node/Blocks/Emitters/cylinderShapeBlock.d.ts +48 -0
  197. package/Particles/Node/Blocks/Emitters/cylinderShapeBlock.js +120 -0
  198. package/Particles/Node/Blocks/Emitters/cylinderShapeBlock.js.map +1 -0
  199. package/Particles/Node/Blocks/Emitters/index.d.ts +7 -0
  200. package/Particles/Node/Blocks/Emitters/index.js +8 -0
  201. package/Particles/Node/Blocks/Emitters/index.js.map +1 -0
  202. package/Particles/Node/Blocks/Emitters/pointShapeBlock.d.ts +39 -0
  203. package/Particles/Node/Blocks/Emitters/pointShapeBlock.js +86 -0
  204. package/Particles/Node/Blocks/Emitters/pointShapeBlock.js.map +1 -0
  205. package/Particles/Node/Blocks/Emitters/setupSpriteSheetBlock.d.ts +53 -0
  206. package/Particles/Node/Blocks/Emitters/setupSpriteSheetBlock.js +111 -0
  207. package/Particles/Node/Blocks/Emitters/setupSpriteSheetBlock.js.map +1 -0
  208. package/Particles/Node/Blocks/Emitters/sphereShapeBlock.d.ts +43 -0
  209. package/Particles/Node/Blocks/Emitters/sphereShapeBlock.js +108 -0
  210. package/Particles/Node/Blocks/Emitters/sphereShapeBlock.js.map +1 -0
  211. package/Particles/Node/Blocks/Teleport/particleTeleportInBlock.d.ts +48 -0
  212. package/Particles/Node/Blocks/Teleport/particleTeleportInBlock.js +100 -0
  213. package/Particles/Node/Blocks/Teleport/particleTeleportInBlock.js.map +1 -0
  214. package/Particles/Node/Blocks/Teleport/particleTeleportOutBlock.d.ts +47 -0
  215. package/Particles/Node/Blocks/Teleport/particleTeleportOutBlock.js +82 -0
  216. package/Particles/Node/Blocks/Teleport/particleTeleportOutBlock.js.map +1 -0
  217. package/Particles/Node/Blocks/Triggers/particleTriggerBlock.d.ts +48 -0
  218. package/Particles/Node/Blocks/Triggers/particleTriggerBlock.js +133 -0
  219. package/Particles/Node/Blocks/Triggers/particleTriggerBlock.js.map +1 -0
  220. package/Particles/Node/Blocks/Triggers/triggerTools.d.ts +9 -0
  221. package/Particles/Node/Blocks/Triggers/triggerTools.js +16 -0
  222. package/Particles/Node/Blocks/Triggers/triggerTools.js.map +1 -0
  223. package/Particles/Node/Blocks/Update/basicPositionUpdateBlock.d.ts +31 -0
  224. package/Particles/Node/Blocks/Update/basicPositionUpdateBlock.js +64 -0
  225. package/Particles/Node/Blocks/Update/basicPositionUpdateBlock.js.map +1 -0
  226. package/Particles/Node/Blocks/Update/basicSpriteUpdateBlock.d.ts +31 -0
  227. package/Particles/Node/Blocks/Update/basicSpriteUpdateBlock.js +63 -0
  228. package/Particles/Node/Blocks/Update/basicSpriteUpdateBlock.js.map +1 -0
  229. package/Particles/Node/Blocks/Update/updateAngleBlock.d.ts +35 -0
  230. package/Particles/Node/Blocks/Update/updateAngleBlock.js +73 -0
  231. package/Particles/Node/Blocks/Update/updateAngleBlock.js.map +1 -0
  232. package/Particles/Node/Blocks/Update/updateColorBlock.d.ts +35 -0
  233. package/Particles/Node/Blocks/Update/updateColorBlock.js +73 -0
  234. package/Particles/Node/Blocks/Update/updateColorBlock.js.map +1 -0
  235. package/Particles/Node/Blocks/Update/updateDirectionBlock.d.ts +35 -0
  236. package/Particles/Node/Blocks/Update/updateDirectionBlock.js +73 -0
  237. package/Particles/Node/Blocks/Update/updateDirectionBlock.js.map +1 -0
  238. package/Particles/Node/Blocks/Update/updateFlowMapBlock.d.ts +41 -0
  239. package/Particles/Node/Blocks/Update/updateFlowMapBlock.js +102 -0
  240. package/Particles/Node/Blocks/Update/updateFlowMapBlock.js.map +1 -0
  241. package/Particles/Node/Blocks/Update/updatePositionBlock.d.ts +35 -0
  242. package/Particles/Node/Blocks/Update/updatePositionBlock.js +73 -0
  243. package/Particles/Node/Blocks/Update/updatePositionBlock.js.map +1 -0
  244. package/Particles/Node/Blocks/Update/updateScaleBlock.d.ts +35 -0
  245. package/Particles/Node/Blocks/Update/updateScaleBlock.js +73 -0
  246. package/Particles/Node/Blocks/Update/updateScaleBlock.js.map +1 -0
  247. package/Particles/Node/Blocks/Update/updateSpriteCellIndexBlock.d.ts +35 -0
  248. package/Particles/Node/Blocks/Update/updateSpriteCellIndexBlock.js +74 -0
  249. package/Particles/Node/Blocks/Update/updateSpriteCellIndexBlock.js.map +1 -0
  250. package/Particles/Node/Blocks/index.d.ts +27 -0
  251. package/Particles/Node/Blocks/index.js +29 -0
  252. package/Particles/Node/Blocks/index.js.map +1 -0
  253. package/Particles/Node/Blocks/particleConverterBlock.d.ts +85 -0
  254. package/Particles/Node/Blocks/particleConverterBlock.js +267 -0
  255. package/Particles/Node/Blocks/particleConverterBlock.js.map +1 -0
  256. package/Particles/Node/Blocks/particleDebugBlock.d.ts +37 -0
  257. package/Particles/Node/Blocks/particleDebugBlock.js +109 -0
  258. package/Particles/Node/Blocks/particleDebugBlock.js.map +1 -0
  259. package/Particles/Node/Blocks/particleElbowBlock.d.ts +27 -0
  260. package/Particles/Node/Blocks/particleElbowBlock.js +47 -0
  261. package/Particles/Node/Blocks/particleElbowBlock.js.map +1 -0
  262. package/Particles/Node/Blocks/particleGradientBlock.d.ts +28 -0
  263. package/Particles/Node/Blocks/particleGradientBlock.js +118 -0
  264. package/Particles/Node/Blocks/particleGradientBlock.js.map +1 -0
  265. package/Particles/Node/Blocks/particleGradientValueBlock.d.ts +32 -0
  266. package/Particles/Node/Blocks/particleGradientValueBlock.js +79 -0
  267. package/Particles/Node/Blocks/particleGradientValueBlock.js.map +1 -0
  268. package/Particles/Node/Blocks/particleInputBlock.d.ts +87 -0
  269. package/Particles/Node/Blocks/particleInputBlock.js +279 -0
  270. package/Particles/Node/Blocks/particleInputBlock.js.map +1 -0
  271. package/Particles/Node/Blocks/particleLerpBlock.d.ts +34 -0
  272. package/Particles/Node/Blocks/particleLerpBlock.js +92 -0
  273. package/Particles/Node/Blocks/particleLerpBlock.js.map +1 -0
  274. package/Particles/Node/Blocks/particleMathBlock.d.ts +64 -0
  275. package/Particles/Node/Blocks/particleMathBlock.js +321 -0
  276. package/Particles/Node/Blocks/particleMathBlock.js.map +1 -0
  277. package/Particles/Node/Blocks/particleRandomBlock.d.ts +52 -0
  278. package/Particles/Node/Blocks/particleRandomBlock.js +161 -0
  279. package/Particles/Node/Blocks/particleRandomBlock.js.map +1 -0
  280. package/Particles/Node/Blocks/particleSourceTextureBlock.d.ts +65 -0
  281. package/Particles/Node/Blocks/particleSourceTextureBlock.js +173 -0
  282. package/Particles/Node/Blocks/particleSourceTextureBlock.js.map +1 -0
  283. package/Particles/Node/Blocks/particleTrigonometryBlock.d.ts +80 -0
  284. package/Particles/Node/Blocks/particleTrigonometryBlock.js +272 -0
  285. package/Particles/Node/Blocks/particleTrigonometryBlock.js.map +1 -0
  286. package/Particles/Node/Blocks/randomRangeBlock.d.ts +45 -0
  287. package/Particles/Node/Blocks/randomRangeBlock.js +151 -0
  288. package/Particles/Node/Blocks/randomRangeBlock.js.map +1 -0
  289. package/Particles/Node/Blocks/systemBlock.d.ts +71 -0
  290. package/Particles/Node/Blocks/systemBlock.js +193 -0
  291. package/Particles/Node/Blocks/systemBlock.js.map +1 -0
  292. package/Particles/Node/Enums/nodeParticleBlockConnectionPointTypes.d.ts +39 -0
  293. package/Particles/Node/Enums/nodeParticleBlockConnectionPointTypes.js +41 -0
  294. package/Particles/Node/Enums/nodeParticleBlockConnectionPointTypes.js.map +1 -0
  295. package/Particles/Node/Enums/nodeParticleContextualSources.d.ts +31 -0
  296. package/Particles/Node/Enums/nodeParticleContextualSources.js +34 -0
  297. package/Particles/Node/Enums/nodeParticleContextualSources.js.map +1 -0
  298. package/Particles/Node/Enums/nodeParticleSystemSources.d.ts +13 -0
  299. package/Particles/Node/Enums/nodeParticleSystemSources.js +15 -0
  300. package/Particles/Node/Enums/nodeParticleSystemSources.js.map +1 -0
  301. package/Particles/Node/index.d.ts +8 -0
  302. package/Particles/Node/index.js +10 -0
  303. package/Particles/Node/index.js.map +1 -0
  304. package/Particles/Node/nodeParticleBlock.d.ts +154 -0
  305. package/Particles/Node/nodeParticleBlock.js +355 -0
  306. package/Particles/Node/nodeParticleBlock.js.map +1 -0
  307. package/Particles/Node/nodeParticleBlockConnectionPoint.d.ts +188 -0
  308. package/Particles/Node/nodeParticleBlockConnectionPoint.js +337 -0
  309. package/Particles/Node/nodeParticleBlockConnectionPoint.js.map +1 -0
  310. package/Particles/Node/nodeParticleBuildState.d.ts +89 -0
  311. package/Particles/Node/nodeParticleBuildState.js +170 -0
  312. package/Particles/Node/nodeParticleBuildState.js.map +1 -0
  313. package/Particles/Node/nodeParticleSystemSet.d.ts +121 -0
  314. package/Particles/Node/nodeParticleSystemSet.js +383 -0
  315. package/Particles/Node/nodeParticleSystemSet.js.map +1 -0
  316. package/Particles/Queue/executionQueue.d.ts +2 -0
  317. package/Particles/Queue/executionQueue.js +10 -0
  318. package/Particles/Queue/executionQueue.js.map +1 -1
  319. package/Particles/baseParticleSystem.d.ts +6 -1
  320. package/Particles/baseParticleSystem.js +7 -0
  321. package/Particles/baseParticleSystem.js.map +1 -1
  322. package/Particles/flowMap.d.ts +7 -0
  323. package/Particles/flowMap.js +32 -0
  324. package/Particles/flowMap.js.map +1 -1
  325. package/Particles/gpuParticleSystem.d.ts +4 -0
  326. package/Particles/gpuParticleSystem.js +4 -0
  327. package/Particles/gpuParticleSystem.js.map +1 -1
  328. package/Particles/index.d.ts +1 -0
  329. package/Particles/index.js +1 -0
  330. package/Particles/index.js.map +1 -1
  331. package/Particles/particleSystem.d.ts +12 -0
  332. package/Particles/particleSystem.js +22 -1
  333. package/Particles/particleSystem.js.map +1 -1
  334. package/Particles/thinParticleSystem.d.ts +32 -11
  335. package/Particles/thinParticleSystem.js +62 -36
  336. package/Particles/thinParticleSystem.js.map +1 -1
  337. package/PostProcesses/postProcessManager.d.ts +2 -1
  338. package/PostProcesses/postProcessManager.js +3 -2
  339. package/PostProcesses/postProcessManager.js.map +1 -1
  340. package/Shaders/ShadersInclude/defaultUboDeclaration.js +1 -1
  341. package/Shaders/ShadersInclude/defaultUboDeclaration.js.map +1 -1
  342. package/Shaders/ShadersInclude/defaultVertexDeclaration.js +1 -0
  343. package/Shaders/ShadersInclude/defaultVertexDeclaration.js.map +1 -1
  344. package/Shaders/ShadersInclude/lightFragment.js +5 -2
  345. package/Shaders/ShadersInclude/lightFragment.js.map +1 -1
  346. package/Shaders/ShadersInclude/morphTargetsVertexDeclaration.js +3 -0
  347. package/Shaders/ShadersInclude/morphTargetsVertexDeclaration.js.map +1 -1
  348. package/Shaders/ShadersInclude/pbrBlockPrePass.js +3 -0
  349. package/Shaders/ShadersInclude/pbrBlockPrePass.js.map +1 -1
  350. package/Shaders/ShadersInclude/pbrDirectLightingFunctions.js +1 -1
  351. package/Shaders/ShadersInclude/pbrDirectLightingFunctions.js.map +1 -1
  352. package/Shaders/ShadersInclude/pbrUboDeclaration.js +1 -1
  353. package/Shaders/ShadersInclude/pbrUboDeclaration.js.map +1 -1
  354. package/Shaders/ShadersInclude/pbrVertexDeclaration.js +1 -0
  355. package/Shaders/ShadersInclude/pbrVertexDeclaration.js.map +1 -1
  356. package/Shaders/ShadersInclude/prePassDeclaration.js +3 -0
  357. package/Shaders/ShadersInclude/prePassDeclaration.js.map +1 -1
  358. package/Shaders/ShadersInclude/prePassVertex.js +3 -0
  359. package/Shaders/ShadersInclude/prePassVertex.js.map +1 -1
  360. package/Shaders/ShadersInclude/prePassVertexDeclaration.js +3 -0
  361. package/Shaders/ShadersInclude/prePassVertexDeclaration.js.map +1 -1
  362. package/Shaders/default.fragment.js +3 -0
  363. package/Shaders/default.fragment.js.map +1 -1
  364. package/Shaders/minmaxRedux.fragment.js +13 -5
  365. package/Shaders/minmaxRedux.fragment.js.map +1 -1
  366. package/ShadersWGSL/ShadersInclude/defaultUboDeclaration.js +1 -1
  367. package/ShadersWGSL/ShadersInclude/defaultUboDeclaration.js.map +1 -1
  368. package/ShadersWGSL/ShadersInclude/lightFragment.js +5 -2
  369. package/ShadersWGSL/ShadersInclude/lightFragment.js.map +1 -1
  370. package/ShadersWGSL/ShadersInclude/morphTargetsVertexDeclaration.js +3 -0
  371. package/ShadersWGSL/ShadersInclude/morphTargetsVertexDeclaration.js.map +1 -1
  372. package/ShadersWGSL/ShadersInclude/pbrBlockPrePass.js +3 -0
  373. package/ShadersWGSL/ShadersInclude/pbrBlockPrePass.js.map +1 -1
  374. package/ShadersWGSL/ShadersInclude/pbrDirectLightingFunctions.js +1 -1
  375. package/ShadersWGSL/ShadersInclude/pbrDirectLightingFunctions.js.map +1 -1
  376. package/ShadersWGSL/ShadersInclude/pbrUboDeclaration.js +1 -1
  377. package/ShadersWGSL/ShadersInclude/pbrUboDeclaration.js.map +1 -1
  378. package/ShadersWGSL/ShadersInclude/prePassDeclaration.js +3 -0
  379. package/ShadersWGSL/ShadersInclude/prePassDeclaration.js.map +1 -1
  380. package/ShadersWGSL/ShadersInclude/prePassVertex.js +3 -0
  381. package/ShadersWGSL/ShadersInclude/prePassVertex.js.map +1 -1
  382. package/ShadersWGSL/ShadersInclude/prePassVertexDeclaration.js +3 -0
  383. package/ShadersWGSL/ShadersInclude/prePassVertexDeclaration.js.map +1 -1
  384. package/ShadersWGSL/default.fragment.js +3 -0
  385. package/ShadersWGSL/default.fragment.js.map +1 -1
  386. package/ShadersWGSL/minmaxRedux.fragment.js +14 -6
  387. package/ShadersWGSL/minmaxRedux.fragment.js.map +1 -1
  388. package/package.json +1 -1
  389. package/scene.d.ts +5 -0
  390. package/scene.js +8 -0
  391. package/scene.js.map +1 -1
@@ -0,0 +1,170 @@
1
+ import { NodeParticleContextualSources } from "./Enums/nodeParticleContextualSources.js";
2
+ import { NodeParticleBlockConnectionPointTypes } from "./Enums/nodeParticleBlockConnectionPointTypes.js";
3
+ import { Vector2, Vector3 } from "../../Maths/math.vector.js";
4
+ import { Color4 } from "../../Maths/math.color.js";
5
+ import { NodeParticleSystemSources } from "./Enums/nodeParticleSystemSources.js";
6
+ /**
7
+ * Class used to store node based geometry build state
8
+ */
9
+ export class NodeParticleBuildState {
10
+ constructor() {
11
+ /** Gets or sets the list of non connected mandatory inputs */
12
+ this.notConnectedNonOptionalInputs = [];
13
+ /**
14
+ * Gets or sets the particle context for contextual data
15
+ */
16
+ this.particleContext = null;
17
+ /**
18
+ * Gets or sets the system context for contextual data
19
+ */
20
+ this.systemContext = null;
21
+ /**
22
+ * Gets or sets the index of the gradient to use
23
+ */
24
+ this.gradientIndex = 0;
25
+ /**
26
+ * Gets or sets next gradient in line
27
+ */
28
+ this.nextGradientIndex = 0;
29
+ }
30
+ /**
31
+ * Emits errors if any
32
+ */
33
+ emitErrors() {
34
+ let errorMessage = "";
35
+ for (const notConnectedInput of this.notConnectedNonOptionalInputs) {
36
+ errorMessage += `input ${notConnectedInput.name} from block ${notConnectedInput.ownerBlock.name}[${notConnectedInput.ownerBlock.getClassName()}] is not connected and is not optional.\n`;
37
+ }
38
+ if (errorMessage) {
39
+ // eslint-disable-next-line no-throw-literal
40
+ throw "Build of Node Particle System Set failed:\n" + errorMessage;
41
+ }
42
+ }
43
+ /**
44
+ * Adapt a value to a target type
45
+ * @param source defines the value to adapt
46
+ * @param targetType defines the target type
47
+ * @returns the adapted value
48
+ */
49
+ adapt(source, targetType) {
50
+ const value = source.getConnectedValue(this) || 0;
51
+ if (source.type === targetType) {
52
+ return value;
53
+ }
54
+ switch (targetType) {
55
+ case NodeParticleBlockConnectionPointTypes.Vector2:
56
+ return new Vector2(value, value);
57
+ case NodeParticleBlockConnectionPointTypes.Vector3:
58
+ return new Vector3(value, value, value);
59
+ case NodeParticleBlockConnectionPointTypes.Color4:
60
+ return new Color4(value, value, value, value);
61
+ }
62
+ return null;
63
+ }
64
+ /**
65
+ * Gets the value associated with a contextual source
66
+ * @param source Source of the contextual value
67
+ * @returns the value associated with the source
68
+ */
69
+ getContextualValue(source) {
70
+ if (!this.particleContext || !this.systemContext) {
71
+ return null;
72
+ }
73
+ switch (source) {
74
+ case NodeParticleContextualSources.Position:
75
+ return this.particleContext.position;
76
+ case NodeParticleContextualSources.Direction:
77
+ return this.particleContext.direction;
78
+ case NodeParticleContextualSources.ScaledDirection:
79
+ this.particleContext.direction.scaleToRef(this.systemContext._directionScale, this.systemContext._scaledDirection);
80
+ return this.systemContext._scaledDirection;
81
+ case NodeParticleContextualSources.Color:
82
+ return this.particleContext.color;
83
+ case NodeParticleContextualSources.Age:
84
+ return this.particleContext.age;
85
+ case NodeParticleContextualSources.Lifetime:
86
+ return this.particleContext.lifeTime;
87
+ case NodeParticleContextualSources.Angle:
88
+ return this.particleContext.angle;
89
+ case NodeParticleContextualSources.Scale:
90
+ return this.particleContext.scale;
91
+ case NodeParticleContextualSources.AgeGradient:
92
+ return this.particleContext.age / this.particleContext.lifeTime;
93
+ case NodeParticleContextualSources.SpriteCellEnd:
94
+ return this.systemContext.endSpriteCellID;
95
+ case NodeParticleContextualSources.SpriteCellIndex:
96
+ return this.particleContext.cellIndex;
97
+ case NodeParticleContextualSources.SpriteCellStart:
98
+ return this.systemContext.startSpriteCellID;
99
+ }
100
+ return null;
101
+ }
102
+ /**
103
+ * Gets a boolean indicating if the emitter is a transform node (or a simple vector3)
104
+ */
105
+ get isEmitterTransformNode() {
106
+ if (!this.systemContext) {
107
+ return false;
108
+ }
109
+ if (this.systemContext.emitter.position) {
110
+ return true;
111
+ }
112
+ return false;
113
+ }
114
+ /**
115
+ * Gets the emitter world matrix
116
+ */
117
+ get emitterWorldMatrix() {
118
+ if (!this.systemContext) {
119
+ return null;
120
+ }
121
+ return this.systemContext._emitterWorldMatrix;
122
+ }
123
+ /**
124
+ * Gets the emitter inverse world matrix
125
+ */
126
+ get emitterInverseWorldMatrix() {
127
+ if (!this.systemContext) {
128
+ return null;
129
+ }
130
+ return this.systemContext._emitterInverseWorldMatrix;
131
+ }
132
+ /**
133
+ * Gets the emitter position
134
+ */
135
+ get emitterPosition() {
136
+ if (!this.systemContext) {
137
+ return null;
138
+ }
139
+ if (this.isEmitterTransformNode) {
140
+ return this.systemContext.emitter.absolutePosition;
141
+ }
142
+ return this.systemContext.emitter;
143
+ }
144
+ /**
145
+ * Gets the value associated with a system source
146
+ * @param source Source of the system value
147
+ * @returns the value associated with the source
148
+ */
149
+ getSystemValue(source) {
150
+ if (!this.particleContext || !this.systemContext) {
151
+ return null;
152
+ }
153
+ switch (source) {
154
+ case NodeParticleSystemSources.Time:
155
+ return this.systemContext._actualFrame;
156
+ case NodeParticleSystemSources.Delta:
157
+ return this.systemContext._scaledUpdateSpeed;
158
+ case NodeParticleSystemSources.Emitter:
159
+ if (this.isEmitterTransformNode) {
160
+ const emitterMesh = this.systemContext.emitter;
161
+ return emitterMesh.absolutePosition;
162
+ }
163
+ else {
164
+ return this.systemContext.emitter;
165
+ }
166
+ }
167
+ return null;
168
+ }
169
+ }
170
+ //# sourceMappingURL=nodeParticleBuildState.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nodeParticleBuildState.js","sourceRoot":"","sources":["../../../../../dev/core/src/Particles/Node/nodeParticleBuildState.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,6BAA6B,EAAE,MAAM,uCAAuC,CAAC;AAGtF,OAAO,EAAE,qCAAqC,EAAE,MAAM,+CAA+C,CAAC;AACtG,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,mCAA+B;AAE1D,OAAO,EAAE,MAAM,EAAE,kCAA8B;AAC/C,OAAO,EAAE,yBAAyB,EAAE,MAAM,mCAAmC,CAAC;AAG9E;;GAEG;AACH,MAAM,OAAO,sBAAsB;IAAnC;QAcI,8DAA8D;QACvD,kCAA6B,GAAkC,EAAE,CAAC;QAKzE;;WAEG;QACI,oBAAe,GAAuB,IAAI,CAAC;QAElD;;WAEG;QACI,kBAAa,GAAiC,IAAI,CAAC;QAE1D;;WAEG;QACI,kBAAa,GAAW,CAAC,CAAC;QACjC;;WAEG;QACI,sBAAiB,GAAW,CAAC,CAAC;IAsKzC,CAAC;IAhKG;;OAEG;IACI,UAAU;QACb,IAAI,YAAY,GAAG,EAAE,CAAC;QAEtB,KAAK,MAAM,iBAAiB,IAAI,IAAI,CAAC,6BAA6B,EAAE,CAAC;Y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7D,OAAO,WAAW,CAAC,gBAAgB,CAAC;gBACxC,CAAC;qBAAM,CAAC;oBACJ,OAAO,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC;gBACtC,CAAC;QACT,CAAC;QAED,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ","sourcesContent":["import type { Scene } from \"core/scene\";\r\nimport type { NodeParticleConnectionPoint } from \"./nodeParticleBlockConnectionPoint\";\r\nimport { NodeParticleContextualSources } from \"./Enums/nodeParticleContextualSources\";\r\nimport type { Particle } from \"../particle\";\r\nimport type { Nullable } from \"core/types\";\r\nimport { NodeParticleBlockConnectionPointTypes } from \"./Enums/nodeParticleBlockConnectionPointTypes\";\r\nimport { Vector2, Vector3 } from \"core/Maths/math.vector\";\r\nimport type { ThinParticleSystem } from \"../thinParticleSystem\";\r\nimport { Color4 } from \"core/Maths/math.color\";\r\nimport { NodeParticleSystemSources } from \"./Enums/nodeParticleSystemSources\";\r\nimport type { AbstractMesh } from \"core/Meshes/abstractMesh\";\r\n\r\n/**\r\n * Class used to store node based geometry build state\r\n */\r\nexport class NodeParticleBuildState {\r\n /**\r\n * Gets the capactity of the particle system to build\r\n */\r\n public capacity: number;\r\n\r\n /**\r\n * Gets the scene where the particle system is built\r\n */\r\n public scene: Scene;\r\n\r\n /** Gets or sets the build identifier */\r\n public buildId: number;\r\n\r\n /** Gets or sets the list of non connected mandatory inputs */\r\n public notConnectedNonOptionalInputs: NodeParticleConnectionPoint[] = [];\r\n\r\n /** Gets or sets a boolean indicating that verbose mode is on */\r\n public verbose: boolean;\r\n\r\n /**\r\n * Gets or sets the particle context for contextual data\r\n */\r\n public particleContext: Nullable<Particle> = null;\r\n\r\n /**\r\n * Gets or sets the system context for contextual data\r\n */\r\n public systemContext: Nullable<ThinParticleSystem> = null;\r\n\r\n /**\r\n * Gets or sets the index of the gradient to use\r\n */\r\n public gradientIndex: number = 0;\r\n /**\r\n * Gets or sets next gradient in line\r\n */\r\n public nextGradientIndex: number = 0;\r\n /**\r\n * Gets or sets the next gradient value\r\n */\r\n public nextGradientValue: any;\r\n\r\n /**\r\n * Emits errors if any\r\n */\r\n public emitErrors() {\r\n let errorMessage = \"\";\r\n\r\n for (const notConnectedInput of this.notConnectedNonOptionalInputs) {\r\n errorMessage += `input ${notConnectedInput.name} from block ${\r\n notConnectedInput.ownerBlock.name\r\n }[${notConnectedInput.ownerBlock.getClassName()}] is not connected and is not optional.\\n`;\r\n }\r\n\r\n if (errorMessage) {\r\n // eslint-disable-next-line no-throw-literal\r\n throw \"Build of Node Particle System Set failed:\\n\" + errorMessage;\r\n }\r\n }\r\n\r\n /**\r\n * Adapt a value to a target type\r\n * @param source defines the value to adapt\r\n * @param targetType defines the target type\r\n * @returns the adapted value\r\n */\r\n adapt(source: NodeParticleConnectionPoint, targetType: NodeParticleBlockConnectionPointTypes) {\r\n const value = source.getConnectedValue(this) || 0;\r\n\r\n if (source.type === targetType) {\r\n return value;\r\n }\r\n\r\n switch (targetType) {\r\n case NodeParticleBlockConnectionPointTypes.Vector2:\r\n return new Vector2(value, value);\r\n case NodeParticleBlockConnectionPointTypes.Vector3:\r\n return new Vector3(value, value, value);\r\n case NodeParticleBlockConnectionPointTypes.Color4:\r\n return new Color4(value, value, value, value);\r\n }\r\n\r\n return null;\r\n }\r\n\r\n /**\r\n * Gets the value associated with a contextual source\r\n * @param source Source of the contextual value\r\n * @returns the value associated with the source\r\n */\r\n public getContextualValue(source: NodeParticleContextualSources) {\r\n if (!this.particleContext || !this.systemContext) {\r\n return null;\r\n }\r\n\r\n switch (source) {\r\n case NodeParticleContextualSources.Position:\r\n return this.particleContext.position;\r\n case NodeParticleContextualSources.Direction:\r\n return this.particleContext.direction;\r\n case NodeParticleContextualSources.ScaledDirection:\r\n this.particleContext.direction.scaleToRef(this.systemContext._directionScale, this.systemContext._scaledDirection);\r\n return this.systemContext._scaledDirection;\r\n case NodeParticleContextualSources.Color:\r\n return this.particleContext.color;\r\n case NodeParticleContextualSources.Age:\r\n return this.particleContext.age;\r\n case NodeParticleContextualSources.Lifetime:\r\n return this.particleContext.lifeTime;\r\n case NodeParticleContextualSources.Angle:\r\n return this.particleContext.angle;\r\n case NodeParticleContextualSources.Scale:\r\n return this.particleContext.scale;\r\n case NodeParticleContextualSources.AgeGradient:\r\n return this.particleContext.age / this.particleContext.lifeTime;\r\n case NodeParticleContextualSources.SpriteCellEnd:\r\n return this.systemContext.endSpriteCellID;\r\n case NodeParticleContextualSources.SpriteCellIndex:\r\n return this.particleContext.cellIndex;\r\n case NodeParticleContextualSources.SpriteCellStart:\r\n return this.systemContext.startSpriteCellID;\r\n }\r\n\r\n return null;\r\n }\r\n\r\n /**\r\n * Gets a boolean indicating if the emitter is a transform node (or a simple vector3)\r\n */\r\n public get isEmitterTransformNode() {\r\n if (!this.systemContext) {\r\n return false;\r\n }\r\n\r\n if ((<AbstractMesh>this.systemContext.emitter).position) {\r\n return true;\r\n }\r\n\r\n return false;\r\n }\r\n\r\n /**\r\n * Gets the emitter world matrix\r\n */\r\n public get emitterWorldMatrix() {\r\n if (!this.systemContext) {\r\n return null;\r\n }\r\n return this.systemContext._emitterWorldMatrix;\r\n }\r\n\r\n /**\r\n * Gets the emitter inverse world matrix\r\n */\r\n public get emitterInverseWorldMatrix() {\r\n if (!this.systemContext) {\r\n return null;\r\n }\r\n return this.systemContext._emitterInverseWorldMatrix;\r\n }\r\n\r\n /**\r\n * Gets the emitter position\r\n */\r\n public get emitterPosition() {\r\n if (!this.systemContext) {\r\n return null;\r\n }\r\n\r\n if (this.isEmitterTransformNode) {\r\n return (<AbstractMesh>this.systemContext.emitter).absolutePosition;\r\n }\r\n\r\n return this.systemContext.emitter as Vector3;\r\n }\r\n\r\n /**\r\n * Gets the value associated with a system source\r\n * @param source Source of the system value\r\n * @returns the value associated with the source\r\n */\r\n public getSystemValue(source: NodeParticleSystemSources) {\r\n if (!this.particleContext || !this.systemContext) {\r\n return null;\r\n }\r\n\r\n switch (source) {\r\n case NodeParticleSystemSources.Time:\r\n return this.systemContext._actualFrame;\r\n case NodeParticleSystemSources.Delta:\r\n return this.systemContext._scaledUpdateSpeed;\r\n case NodeParticleSystemSources.Emitter:\r\n if (this.isEmitterTransformNode) {\r\n const emitterMesh = <AbstractMesh>this.systemContext.emitter;\r\n return emitterMesh.absolutePosition;\r\n } else {\r\n return this.systemContext.emitter;\r\n }\r\n }\r\n\r\n return null;\r\n }\r\n}\r\n"]}
@@ -0,0 +1,121 @@
1
+ import { ParticleSystemSet } from "../particleSystemSet.js";
2
+ import { SystemBlock } from "./Blocks/systemBlock.js";
3
+ import type { Scene } from "../../scene.js";
4
+ import type { NodeParticleBlock } from "./nodeParticleBlock.js";
5
+ import { Observable } from "../../Misc/observable.js";
6
+ import { ParticleInputBlock } from "./Blocks/particleInputBlock.js";
7
+ /**
8
+ * Defines a set of particle systems defined as a node graph.
9
+ * @experimental This API is experimental and may change in future releases.
10
+ * NPE: #K6F1ZB
11
+ * PG: #ZT509U
12
+ */
13
+ export declare class NodeParticleSystemSet {
14
+ private _systemBlocks;
15
+ private _buildId;
16
+ /** Define the Url to load node editor script */
17
+ static EditorURL: string;
18
+ /** Define the Url to load snippets */
19
+ static SnippetUrl: string;
20
+ /**
21
+ * Snippet ID if the material was created from the snippet server
22
+ */
23
+ snippetId: string;
24
+ /**
25
+ * Gets an array of blocks that needs to be serialized even if they are not yet connected
26
+ */
27
+ attachedBlocks: NodeParticleBlock[];
28
+ /**
29
+ * Gets or sets data used by visual editor
30
+ * @see https://npe.babylonjs.com
31
+ */
32
+ editorData: any;
33
+ /**
34
+ * Observable raised when the particle set is built
35
+ */
36
+ onBuildObservable: Observable<NodeParticleSystemSet>;
37
+ /**
38
+ * The name of the set
39
+ */
40
+ name: string;
41
+ /**
42
+ * A free comment about the set
43
+ */
44
+ comment: string;
45
+ /**
46
+ * Gets the system blocks
47
+ */
48
+ get systemBlocks(): SystemBlock[];
49
+ /**
50
+ * Gets the list of input blocks attached to this material
51
+ * @returns an array of InputBlocks
52
+ */
53
+ get inputBlocks(): ParticleInputBlock[];
54
+ /**
55
+ * Creates a new set
56
+ * @param name defines the name of the set
57
+ */
58
+ constructor(name: string);
59
+ /**
60
+ * Gets the current class name of the geometry e.g. "NodeParticleSystemSet"
61
+ * @returns the class name
62
+ */
63
+ getClassName(): string;
64
+ private _initializeBlock;
65
+ /**
66
+ * Builds the particle system set from the defined blocks.
67
+ * @param scene defines the hosting scene
68
+ * @param verbose defines whether to log detailed information during the build process (false by default)
69
+ * @returns a promise that resolves to the built particle system set
70
+ */
71
+ buildAsync(scene: Scene, verbose?: boolean): Promise<ParticleSystemSet>;
72
+ /**
73
+ * Clear the current geometry
74
+ */
75
+ clear(): void;
76
+ /**
77
+ * Clear the current set and restore it to a default state
78
+ */
79
+ setToDefault(): void;
80
+ /**
81
+ * Remove a block from the current system set
82
+ * @param block defines the block to remove
83
+ */
84
+ removeBlock(block: NodeParticleBlock): void;
85
+ /**
86
+ * Clear the current graph and load a new one from a serialization object
87
+ * @param source defines the JSON representation of the particle set
88
+ * @param merge defines whether or not the source must be merged or replace the current content
89
+ */
90
+ parseSerializedObject(source: any, merge?: boolean): void;
91
+ private _restoreConnections;
92
+ /**
93
+ * Serializes this geometry in a JSON representation
94
+ * @param selectedBlocks defines the list of blocks to save (if null the whole geometry will be saved)
95
+ * @returns the serialized geometry object
96
+ */
97
+ serialize(selectedBlocks?: NodeParticleBlock[]): any;
98
+ /**
99
+ * Disposes the resources
100
+ */
101
+ dispose(): void;
102
+ /**
103
+ * Creates a new node particle set set to default basic configuration
104
+ * @param name defines the name of the particle set
105
+ * @returns a new NodeParticleSystemSet
106
+ */
107
+ static CreateDefault(name: string): NodeParticleSystemSet;
108
+ /**
109
+ * Creates a node particle set from parsed data
110
+ * @param source defines the JSON representation of the particle set
111
+ * @returns a new node particle set
112
+ */
113
+ static Parse(source: any): NodeParticleSystemSet;
114
+ /**
115
+ * Creates a node particle set from a snippet saved by the node geometry editor
116
+ * @param snippetId defines the snippet to load
117
+ * @param nodeParticleSet defines a node particle set to update (instead of creating a new one)
118
+ * @returns a promise that will resolve to the new node geometry
119
+ */
120
+ static ParseFromSnippetAsync(snippetId: string, nodeParticleSet?: NodeParticleSystemSet): Promise<NodeParticleSystemSet>;
121
+ }