@babylonjs/core 8.11.0 → 8.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (389) 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/thinMinMaxReducer.d.ts +47 -0
  175. package/Misc/thinMinMaxReducer.js +148 -0
  176. package/Misc/thinMinMaxReducer.js.map +1 -0
  177. package/Particles/EmitterTypes/customParticleEmitter.d.ts +5 -0
  178. package/Particles/EmitterTypes/customParticleEmitter.js +9 -1
  179. package/Particles/EmitterTypes/customParticleEmitter.js.map +1 -1
  180. package/Particles/IParticleSystem.d.ts +4 -0
  181. package/Particles/IParticleSystem.js.map +1 -1
  182. package/Particles/Node/Blocks/Conditions/particleConditionBlock.d.ts +75 -0
  183. package/Particles/Node/Blocks/Conditions/particleConditionBlock.js +179 -0
  184. package/Particles/Node/Blocks/Conditions/particleConditionBlock.js.map +1 -0
  185. package/Particles/Node/Blocks/Emitters/boxShapeBlock.d.ts +47 -0
  186. package/Particles/Node/Blocks/Emitters/boxShapeBlock.js +107 -0
  187. package/Particles/Node/Blocks/Emitters/boxShapeBlock.js.map +1 -0
  188. package/Particles/Node/Blocks/Emitters/createParticleBlock.d.ts +46 -0
  189. package/Particles/Node/Blocks/Emitters/createParticleBlock.js +97 -0
  190. package/Particles/Node/Blocks/Emitters/createParticleBlock.js.map +1 -0
  191. package/Particles/Node/Blocks/Emitters/customShapeBlock.d.ts +39 -0
  192. package/Particles/Node/Blocks/Emitters/customShapeBlock.js +84 -0
  193. package/Particles/Node/Blocks/Emitters/customShapeBlock.js.map +1 -0
  194. package/Particles/Node/Blocks/Emitters/cylinderShapeBlock.d.ts +48 -0
  195. package/Particles/Node/Blocks/Emitters/cylinderShapeBlock.js +120 -0
  196. package/Particles/Node/Blocks/Emitters/cylinderShapeBlock.js.map +1 -0
  197. package/Particles/Node/Blocks/Emitters/index.d.ts +7 -0
  198. package/Particles/Node/Blocks/Emitters/index.js +8 -0
  199. package/Particles/Node/Blocks/Emitters/index.js.map +1 -0
  200. package/Particles/Node/Blocks/Emitters/pointShapeBlock.d.ts +39 -0
  201. package/Particles/Node/Blocks/Emitters/pointShapeBlock.js +86 -0
  202. package/Particles/Node/Blocks/Emitters/pointShapeBlock.js.map +1 -0
  203. package/Particles/Node/Blocks/Emitters/setupSpriteSheetBlock.d.ts +53 -0
  204. package/Particles/Node/Blocks/Emitters/setupSpriteSheetBlock.js +111 -0
  205. package/Particles/Node/Blocks/Emitters/setupSpriteSheetBlock.js.map +1 -0
  206. package/Particles/Node/Blocks/Emitters/sphereShapeBlock.d.ts +43 -0
  207. package/Particles/Node/Blocks/Emitters/sphereShapeBlock.js +108 -0
  208. package/Particles/Node/Blocks/Emitters/sphereShapeBlock.js.map +1 -0
  209. package/Particles/Node/Blocks/Teleport/particleTeleportInBlock.d.ts +48 -0
  210. package/Particles/Node/Blocks/Teleport/particleTeleportInBlock.js +100 -0
  211. package/Particles/Node/Blocks/Teleport/particleTeleportInBlock.js.map +1 -0
  212. package/Particles/Node/Blocks/Teleport/particleTeleportOutBlock.d.ts +47 -0
  213. package/Particles/Node/Blocks/Teleport/particleTeleportOutBlock.js +82 -0
  214. package/Particles/Node/Blocks/Teleport/particleTeleportOutBlock.js.map +1 -0
  215. package/Particles/Node/Blocks/Triggers/particleTriggerBlock.d.ts +48 -0
  216. package/Particles/Node/Blocks/Triggers/particleTriggerBlock.js +133 -0
  217. package/Particles/Node/Blocks/Triggers/particleTriggerBlock.js.map +1 -0
  218. package/Particles/Node/Blocks/Triggers/triggerTools.d.ts +9 -0
  219. package/Particles/Node/Blocks/Triggers/triggerTools.js +16 -0
  220. package/Particles/Node/Blocks/Triggers/triggerTools.js.map +1 -0
  221. package/Particles/Node/Blocks/Update/basicPositionUpdateBlock.d.ts +31 -0
  222. package/Particles/Node/Blocks/Update/basicPositionUpdateBlock.js +64 -0
  223. package/Particles/Node/Blocks/Update/basicPositionUpdateBlock.js.map +1 -0
  224. package/Particles/Node/Blocks/Update/basicSpriteUpdateBlock.d.ts +31 -0
  225. package/Particles/Node/Blocks/Update/basicSpriteUpdateBlock.js +63 -0
  226. package/Particles/Node/Blocks/Update/basicSpriteUpdateBlock.js.map +1 -0
  227. package/Particles/Node/Blocks/Update/updateAngleBlock.d.ts +35 -0
  228. package/Particles/Node/Blocks/Update/updateAngleBlock.js +73 -0
  229. package/Particles/Node/Blocks/Update/updateAngleBlock.js.map +1 -0
  230. package/Particles/Node/Blocks/Update/updateColorBlock.d.ts +35 -0
  231. package/Particles/Node/Blocks/Update/updateColorBlock.js +73 -0
  232. package/Particles/Node/Blocks/Update/updateColorBlock.js.map +1 -0
  233. package/Particles/Node/Blocks/Update/updateDirectionBlock.d.ts +35 -0
  234. package/Particles/Node/Blocks/Update/updateDirectionBlock.js +73 -0
  235. package/Particles/Node/Blocks/Update/updateDirectionBlock.js.map +1 -0
  236. package/Particles/Node/Blocks/Update/updateFlowMapBlock.d.ts +41 -0
  237. package/Particles/Node/Blocks/Update/updateFlowMapBlock.js +102 -0
  238. package/Particles/Node/Blocks/Update/updateFlowMapBlock.js.map +1 -0
  239. package/Particles/Node/Blocks/Update/updatePositionBlock.d.ts +35 -0
  240. package/Particles/Node/Blocks/Update/updatePositionBlock.js +73 -0
  241. package/Particles/Node/Blocks/Update/updatePositionBlock.js.map +1 -0
  242. package/Particles/Node/Blocks/Update/updateScaleBlock.d.ts +35 -0
  243. package/Particles/Node/Blocks/Update/updateScaleBlock.js +73 -0
  244. package/Particles/Node/Blocks/Update/updateScaleBlock.js.map +1 -0
  245. package/Particles/Node/Blocks/Update/updateSpriteCellIndexBlock.d.ts +35 -0
  246. package/Particles/Node/Blocks/Update/updateSpriteCellIndexBlock.js +74 -0
  247. package/Particles/Node/Blocks/Update/updateSpriteCellIndexBlock.js.map +1 -0
  248. package/Particles/Node/Blocks/index.d.ts +27 -0
  249. package/Particles/Node/Blocks/index.js +29 -0
  250. package/Particles/Node/Blocks/index.js.map +1 -0
  251. package/Particles/Node/Blocks/particleConverterBlock.d.ts +85 -0
  252. package/Particles/Node/Blocks/particleConverterBlock.js +267 -0
  253. package/Particles/Node/Blocks/particleConverterBlock.js.map +1 -0
  254. package/Particles/Node/Blocks/particleDebugBlock.d.ts +37 -0
  255. package/Particles/Node/Blocks/particleDebugBlock.js +109 -0
  256. package/Particles/Node/Blocks/particleDebugBlock.js.map +1 -0
  257. package/Particles/Node/Blocks/particleElbowBlock.d.ts +27 -0
  258. package/Particles/Node/Blocks/particleElbowBlock.js +47 -0
  259. package/Particles/Node/Blocks/particleElbowBlock.js.map +1 -0
  260. package/Particles/Node/Blocks/particleGradientBlock.d.ts +28 -0
  261. package/Particles/Node/Blocks/particleGradientBlock.js +118 -0
  262. package/Particles/Node/Blocks/particleGradientBlock.js.map +1 -0
  263. package/Particles/Node/Blocks/particleGradientValueBlock.d.ts +32 -0
  264. package/Particles/Node/Blocks/particleGradientValueBlock.js +79 -0
  265. package/Particles/Node/Blocks/particleGradientValueBlock.js.map +1 -0
  266. package/Particles/Node/Blocks/particleInputBlock.d.ts +87 -0
  267. package/Particles/Node/Blocks/particleInputBlock.js +279 -0
  268. package/Particles/Node/Blocks/particleInputBlock.js.map +1 -0
  269. package/Particles/Node/Blocks/particleLerpBlock.d.ts +34 -0
  270. package/Particles/Node/Blocks/particleLerpBlock.js +92 -0
  271. package/Particles/Node/Blocks/particleLerpBlock.js.map +1 -0
  272. package/Particles/Node/Blocks/particleMathBlock.d.ts +64 -0
  273. package/Particles/Node/Blocks/particleMathBlock.js +321 -0
  274. package/Particles/Node/Blocks/particleMathBlock.js.map +1 -0
  275. package/Particles/Node/Blocks/particleRandomBlock.d.ts +52 -0
  276. package/Particles/Node/Blocks/particleRandomBlock.js +161 -0
  277. package/Particles/Node/Blocks/particleRandomBlock.js.map +1 -0
  278. package/Particles/Node/Blocks/particleSourceTextureBlock.d.ts +65 -0
  279. package/Particles/Node/Blocks/particleSourceTextureBlock.js +173 -0
  280. package/Particles/Node/Blocks/particleSourceTextureBlock.js.map +1 -0
  281. package/Particles/Node/Blocks/particleTrigonometryBlock.d.ts +80 -0
  282. package/Particles/Node/Blocks/particleTrigonometryBlock.js +272 -0
  283. package/Particles/Node/Blocks/particleTrigonometryBlock.js.map +1 -0
  284. package/Particles/Node/Blocks/randomRangeBlock.d.ts +45 -0
  285. package/Particles/Node/Blocks/randomRangeBlock.js +151 -0
  286. package/Particles/Node/Blocks/randomRangeBlock.js.map +1 -0
  287. package/Particles/Node/Blocks/systemBlock.d.ts +71 -0
  288. package/Particles/Node/Blocks/systemBlock.js +193 -0
  289. package/Particles/Node/Blocks/systemBlock.js.map +1 -0
  290. package/Particles/Node/Enums/nodeParticleBlockConnectionPointTypes.d.ts +39 -0
  291. package/Particles/Node/Enums/nodeParticleBlockConnectionPointTypes.js +41 -0
  292. package/Particles/Node/Enums/nodeParticleBlockConnectionPointTypes.js.map +1 -0
  293. package/Particles/Node/Enums/nodeParticleContextualSources.d.ts +31 -0
  294. package/Particles/Node/Enums/nodeParticleContextualSources.js +34 -0
  295. package/Particles/Node/Enums/nodeParticleContextualSources.js.map +1 -0
  296. package/Particles/Node/Enums/nodeParticleSystemSources.d.ts +13 -0
  297. package/Particles/Node/Enums/nodeParticleSystemSources.js +15 -0
  298. package/Particles/Node/Enums/nodeParticleSystemSources.js.map +1 -0
  299. package/Particles/Node/index.d.ts +8 -0
  300. package/Particles/Node/index.js +10 -0
  301. package/Particles/Node/index.js.map +1 -0
  302. package/Particles/Node/nodeParticleBlock.d.ts +154 -0
  303. package/Particles/Node/nodeParticleBlock.js +355 -0
  304. package/Particles/Node/nodeParticleBlock.js.map +1 -0
  305. package/Particles/Node/nodeParticleBlockConnectionPoint.d.ts +188 -0
  306. package/Particles/Node/nodeParticleBlockConnectionPoint.js +337 -0
  307. package/Particles/Node/nodeParticleBlockConnectionPoint.js.map +1 -0
  308. package/Particles/Node/nodeParticleBuildState.d.ts +89 -0
  309. package/Particles/Node/nodeParticleBuildState.js +170 -0
  310. package/Particles/Node/nodeParticleBuildState.js.map +1 -0
  311. package/Particles/Node/nodeParticleSystemSet.d.ts +120 -0
  312. package/Particles/Node/nodeParticleSystemSet.js +382 -0
  313. package/Particles/Node/nodeParticleSystemSet.js.map +1 -0
  314. package/Particles/Queue/executionQueue.d.ts +2 -0
  315. package/Particles/Queue/executionQueue.js +10 -0
  316. package/Particles/Queue/executionQueue.js.map +1 -1
  317. package/Particles/baseParticleSystem.d.ts +2 -1
  318. package/Particles/baseParticleSystem.js +1 -0
  319. package/Particles/baseParticleSystem.js.map +1 -1
  320. package/Particles/flowMap.d.ts +7 -0
  321. package/Particles/flowMap.js +32 -0
  322. package/Particles/flowMap.js.map +1 -1
  323. package/Particles/gpuParticleSystem.d.ts +4 -0
  324. package/Particles/gpuParticleSystem.js +4 -0
  325. package/Particles/gpuParticleSystem.js.map +1 -1
  326. package/Particles/index.d.ts +1 -0
  327. package/Particles/index.js +1 -0
  328. package/Particles/index.js.map +1 -1
  329. package/Particles/particleSystem.d.ts +12 -0
  330. package/Particles/particleSystem.js +22 -1
  331. package/Particles/particleSystem.js.map +1 -1
  332. package/Particles/thinParticleSystem.d.ts +32 -11
  333. package/Particles/thinParticleSystem.js +62 -36
  334. package/Particles/thinParticleSystem.js.map +1 -1
  335. package/PostProcesses/postProcessManager.d.ts +2 -1
  336. package/PostProcesses/postProcessManager.js +3 -2
  337. package/PostProcesses/postProcessManager.js.map +1 -1
  338. package/Shaders/ShadersInclude/defaultUboDeclaration.js +1 -1
  339. package/Shaders/ShadersInclude/defaultUboDeclaration.js.map +1 -1
  340. package/Shaders/ShadersInclude/defaultVertexDeclaration.js +1 -0
  341. package/Shaders/ShadersInclude/defaultVertexDeclaration.js.map +1 -1
  342. package/Shaders/ShadersInclude/lightFragment.js +5 -2
  343. package/Shaders/ShadersInclude/lightFragment.js.map +1 -1
  344. package/Shaders/ShadersInclude/morphTargetsVertexDeclaration.js +3 -0
  345. package/Shaders/ShadersInclude/morphTargetsVertexDeclaration.js.map +1 -1
  346. package/Shaders/ShadersInclude/pbrBlockPrePass.js +3 -0
  347. package/Shaders/ShadersInclude/pbrBlockPrePass.js.map +1 -1
  348. package/Shaders/ShadersInclude/pbrDirectLightingFunctions.js +1 -1
  349. package/Shaders/ShadersInclude/pbrDirectLightingFunctions.js.map +1 -1
  350. package/Shaders/ShadersInclude/pbrUboDeclaration.js +1 -1
  351. package/Shaders/ShadersInclude/pbrUboDeclaration.js.map +1 -1
  352. package/Shaders/ShadersInclude/pbrVertexDeclaration.js +1 -0
  353. package/Shaders/ShadersInclude/pbrVertexDeclaration.js.map +1 -1
  354. package/Shaders/ShadersInclude/prePassDeclaration.js +3 -0
  355. package/Shaders/ShadersInclude/prePassDeclaration.js.map +1 -1
  356. package/Shaders/ShadersInclude/prePassVertex.js +3 -0
  357. package/Shaders/ShadersInclude/prePassVertex.js.map +1 -1
  358. package/Shaders/ShadersInclude/prePassVertexDeclaration.js +3 -0
  359. package/Shaders/ShadersInclude/prePassVertexDeclaration.js.map +1 -1
  360. package/Shaders/default.fragment.js +3 -0
  361. package/Shaders/default.fragment.js.map +1 -1
  362. package/Shaders/minmaxRedux.fragment.js +13 -5
  363. package/Shaders/minmaxRedux.fragment.js.map +1 -1
  364. package/ShadersWGSL/ShadersInclude/defaultUboDeclaration.js +1 -1
  365. package/ShadersWGSL/ShadersInclude/defaultUboDeclaration.js.map +1 -1
  366. package/ShadersWGSL/ShadersInclude/lightFragment.js +5 -2
  367. package/ShadersWGSL/ShadersInclude/lightFragment.js.map +1 -1
  368. package/ShadersWGSL/ShadersInclude/morphTargetsVertexDeclaration.js +3 -0
  369. package/ShadersWGSL/ShadersInclude/morphTargetsVertexDeclaration.js.map +1 -1
  370. package/ShadersWGSL/ShadersInclude/pbrBlockPrePass.js +3 -0
  371. package/ShadersWGSL/ShadersInclude/pbrBlockPrePass.js.map +1 -1
  372. package/ShadersWGSL/ShadersInclude/pbrDirectLightingFunctions.js +1 -1
  373. package/ShadersWGSL/ShadersInclude/pbrDirectLightingFunctions.js.map +1 -1
  374. package/ShadersWGSL/ShadersInclude/pbrUboDeclaration.js +1 -1
  375. package/ShadersWGSL/ShadersInclude/pbrUboDeclaration.js.map +1 -1
  376. package/ShadersWGSL/ShadersInclude/prePassDeclaration.js +3 -0
  377. package/ShadersWGSL/ShadersInclude/prePassDeclaration.js.map +1 -1
  378. package/ShadersWGSL/ShadersInclude/prePassVertex.js +3 -0
  379. package/ShadersWGSL/ShadersInclude/prePassVertex.js.map +1 -1
  380. package/ShadersWGSL/ShadersInclude/prePassVertexDeclaration.js +3 -0
  381. package/ShadersWGSL/ShadersInclude/prePassVertexDeclaration.js.map +1 -1
  382. package/ShadersWGSL/default.fragment.js +3 -0
  383. package/ShadersWGSL/default.fragment.js.map +1 -1
  384. package/ShadersWGSL/minmaxRedux.fragment.js +14 -6
  385. package/ShadersWGSL/minmaxRedux.fragment.js.map +1 -1
  386. package/package.json +1 -1
  387. package/scene.d.ts +5 -0
  388. package/scene.js +8 -0
  389. package/scene.js.map +1 -1
@@ -0,0 +1,75 @@
1
+ import { NodeParticleBlock } from "../../nodeParticleBlock.js";
2
+ import type { NodeParticleConnectionPoint } from "../../nodeParticleBlockConnectionPoint.js";
3
+ /**
4
+ * Conditions supported by the condition block
5
+ */
6
+ export declare enum ParticleConditionBlockTests {
7
+ /** Equal */
8
+ Equal = 0,
9
+ /** NotEqual */
10
+ NotEqual = 1,
11
+ /** LessThan */
12
+ LessThan = 2,
13
+ /** GreaterThan */
14
+ GreaterThan = 3,
15
+ /** LessOrEqual */
16
+ LessOrEqual = 4,
17
+ /** GreaterOrEqual */
18
+ GreaterOrEqual = 5,
19
+ /** Logical Exclusive OR */
20
+ Xor = 6,
21
+ /** Logical Or */
22
+ Or = 7,
23
+ /** Logical And */
24
+ And = 8
25
+ }
26
+ /**
27
+ * Block used to evaluate a condition and return a true or false value as a float (1 or 0).
28
+ */
29
+ export declare class ParticleConditionBlock extends NodeParticleBlock {
30
+ /**
31
+ * Gets or sets the test used by the block
32
+ */
33
+ test: ParticleConditionBlockTests;
34
+ /**
35
+ * Gets or sets the epsilon value used for comparison
36
+ */
37
+ epsilon: number;
38
+ /**
39
+ * Create a new ParticleConditionBlock
40
+ * @param name defines the block name
41
+ */
42
+ constructor(name: string);
43
+ /**
44
+ * Gets the current class name
45
+ * @returns the class name
46
+ */
47
+ getClassName(): string;
48
+ /**
49
+ * Gets the left input component
50
+ */
51
+ get left(): NodeParticleConnectionPoint;
52
+ /**
53
+ * Gets the right input component
54
+ */
55
+ get right(): NodeParticleConnectionPoint;
56
+ /**
57
+ * Gets the ifTrue input component
58
+ */
59
+ get ifTrue(): NodeParticleConnectionPoint;
60
+ /**
61
+ * Gets the ifFalse input component
62
+ */
63
+ get ifFalse(): NodeParticleConnectionPoint;
64
+ /**
65
+ * Gets the output component
66
+ */
67
+ get output(): NodeParticleConnectionPoint;
68
+ _build(): void;
69
+ /**
70
+ * Serializes this block in a JSON representation
71
+ * @returns the serialized block object
72
+ */
73
+ serialize(): any;
74
+ _deserialize(serializationObject: any): void;
75
+ }
@@ -0,0 +1,179 @@
1
+ import { __decorate } from "../../../../tslib.es6.js";
2
+ import { RegisterClass } from "../../../../Misc/typeStore.js";
3
+ import { WithinEpsilon } from "../../../../Maths/math.scalar.functions.js";
4
+ import { NodeParticleBlockConnectionPointTypes } from "../../Enums/nodeParticleBlockConnectionPointTypes.js";
5
+ import { NodeParticleBlock } from "../../nodeParticleBlock.js";
6
+ import { editableInPropertyPage } from "../../../../Decorators/nodeDecorator.js";
7
+ /**
8
+ * Conditions supported by the condition block
9
+ */
10
+ export var ParticleConditionBlockTests;
11
+ (function (ParticleConditionBlockTests) {
12
+ /** Equal */
13
+ ParticleConditionBlockTests[ParticleConditionBlockTests["Equal"] = 0] = "Equal";
14
+ /** NotEqual */
15
+ ParticleConditionBlockTests[ParticleConditionBlockTests["NotEqual"] = 1] = "NotEqual";
16
+ /** LessThan */
17
+ ParticleConditionBlockTests[ParticleConditionBlockTests["LessThan"] = 2] = "LessThan";
18
+ /** GreaterThan */
19
+ ParticleConditionBlockTests[ParticleConditionBlockTests["GreaterThan"] = 3] = "GreaterThan";
20
+ /** LessOrEqual */
21
+ ParticleConditionBlockTests[ParticleConditionBlockTests["LessOrEqual"] = 4] = "LessOrEqual";
22
+ /** GreaterOrEqual */
23
+ ParticleConditionBlockTests[ParticleConditionBlockTests["GreaterOrEqual"] = 5] = "GreaterOrEqual";
24
+ /** Logical Exclusive OR */
25
+ ParticleConditionBlockTests[ParticleConditionBlockTests["Xor"] = 6] = "Xor";
26
+ /** Logical Or */
27
+ ParticleConditionBlockTests[ParticleConditionBlockTests["Or"] = 7] = "Or";
28
+ /** Logical And */
29
+ ParticleConditionBlockTests[ParticleConditionBlockTests["And"] = 8] = "And";
30
+ })(ParticleConditionBlockTests || (ParticleConditionBlockTests = {}));
31
+ /**
32
+ * Block used to evaluate a condition and return a true or false value as a float (1 or 0).
33
+ */
34
+ export class ParticleConditionBlock extends NodeParticleBlock {
35
+ /**
36
+ * Create a new ParticleConditionBlock
37
+ * @param name defines the block name
38
+ */
39
+ constructor(name) {
40
+ super(name);
41
+ /**
42
+ * Gets or sets the test used by the block
43
+ */
44
+ this.test = ParticleConditionBlockTests.Equal;
45
+ /**
46
+ * Gets or sets the epsilon value used for comparison
47
+ */
48
+ this.epsilon = 0;
49
+ this.registerInput("left", NodeParticleBlockConnectionPointTypes.Float);
50
+ this.registerInput("right", NodeParticleBlockConnectionPointTypes.Float, true, 0);
51
+ this.registerInput("ifTrue", NodeParticleBlockConnectionPointTypes.AutoDetect, true, 1);
52
+ this.registerInput("ifFalse", NodeParticleBlockConnectionPointTypes.AutoDetect, true, 0);
53
+ this.registerOutput("output", NodeParticleBlockConnectionPointTypes.BasedOnInput);
54
+ this.output._typeConnectionSource = this._inputs[2];
55
+ this.output._defaultConnectionPointType = NodeParticleBlockConnectionPointTypes.Float;
56
+ this._inputs[0].acceptedConnectionPointTypes.push(NodeParticleBlockConnectionPointTypes.Int);
57
+ this._inputs[1].acceptedConnectionPointTypes.push(NodeParticleBlockConnectionPointTypes.Int);
58
+ this._linkConnectionTypes(2, 3);
59
+ }
60
+ /**
61
+ * Gets the current class name
62
+ * @returns the class name
63
+ */
64
+ getClassName() {
65
+ return "ParticleConditionBlock";
66
+ }
67
+ /**
68
+ * Gets the left input component
69
+ */
70
+ get left() {
71
+ return this._inputs[0];
72
+ }
73
+ /**
74
+ * Gets the right input component
75
+ */
76
+ get right() {
77
+ return this._inputs[1];
78
+ }
79
+ /**
80
+ * Gets the ifTrue input component
81
+ */
82
+ get ifTrue() {
83
+ return this._inputs[2];
84
+ }
85
+ /**
86
+ * Gets the ifFalse input component
87
+ */
88
+ get ifFalse() {
89
+ return this._inputs[3];
90
+ }
91
+ /**
92
+ * Gets the output component
93
+ */
94
+ get output() {
95
+ return this._outputs[0];
96
+ }
97
+ _build() {
98
+ const func = (state) => {
99
+ const left = this.left.getConnectedValue(state);
100
+ const right = this.right.getConnectedValue(state);
101
+ let condition = false;
102
+ switch (this.test) {
103
+ case ParticleConditionBlockTests.Equal:
104
+ condition = WithinEpsilon(left, right, this.epsilon);
105
+ break;
106
+ case ParticleConditionBlockTests.NotEqual:
107
+ condition = !WithinEpsilon(left, right, this.epsilon);
108
+ break;
109
+ case ParticleConditionBlockTests.LessThan:
110
+ condition = left < right + this.epsilon;
111
+ break;
112
+ case ParticleConditionBlockTests.GreaterThan:
113
+ condition = left > right - this.epsilon;
114
+ break;
115
+ case ParticleConditionBlockTests.LessOrEqual:
116
+ condition = left <= right + this.epsilon;
117
+ break;
118
+ case ParticleConditionBlockTests.GreaterOrEqual:
119
+ condition = left >= right - this.epsilon;
120
+ break;
121
+ case ParticleConditionBlockTests.Xor:
122
+ condition = (!!left && !right) || (!left && !!right);
123
+ break;
124
+ case ParticleConditionBlockTests.Or:
125
+ condition = !!left || !!right;
126
+ break;
127
+ case ParticleConditionBlockTests.And:
128
+ condition = !!left && !!right;
129
+ break;
130
+ }
131
+ return condition;
132
+ };
133
+ this.output._storedFunction = (state) => {
134
+ if (func(state)) {
135
+ return this.ifTrue.getConnectedValue(state);
136
+ }
137
+ return this.ifFalse.getConnectedValue(state);
138
+ };
139
+ }
140
+ /**
141
+ * Serializes this block in a JSON representation
142
+ * @returns the serialized block object
143
+ */
144
+ serialize() {
145
+ const serializationObject = super.serialize();
146
+ serializationObject.test = this.test;
147
+ serializationObject.epsilon = this.epsilon;
148
+ return serializationObject;
149
+ }
150
+ _deserialize(serializationObject) {
151
+ super._deserialize(serializationObject);
152
+ this.test = serializationObject.test;
153
+ if (serializationObject.epsilon !== undefined) {
154
+ this.epsilon = serializationObject.epsilon;
155
+ }
156
+ }
157
+ }
158
+ __decorate([
159
+ editableInPropertyPage("Test", 4 /* PropertyTypeForEdition.List */, "ADVANCED", {
160
+ notifiers: { rebuild: true },
161
+ embedded: true,
162
+ options: [
163
+ { label: "Equal", value: ParticleConditionBlockTests.Equal },
164
+ { label: "NotEqual", value: ParticleConditionBlockTests.NotEqual },
165
+ { label: "LessThan", value: ParticleConditionBlockTests.LessThan },
166
+ { label: "GreaterThan", value: ParticleConditionBlockTests.GreaterThan },
167
+ { label: "LessOrEqual", value: ParticleConditionBlockTests.LessOrEqual },
168
+ { label: "GreaterOrEqual", value: ParticleConditionBlockTests.GreaterOrEqual },
169
+ { label: "Xor", value: ParticleConditionBlockTests.Xor },
170
+ { label: "Or", value: ParticleConditionBlockTests.Or },
171
+ { label: "And", value: ParticleConditionBlockTests.And },
172
+ ],
173
+ })
174
+ ], ParticleConditionBlock.prototype, "test", void 0);
175
+ __decorate([
176
+ editableInPropertyPage("Epsilon", 1 /* PropertyTypeForEdition.Float */, "ADVANCED", { embedded: true, notifiers: { rebuild: true } })
177
+ ], ParticleConditionBlock.prototype, "epsilon", void 0);
178
+ RegisterClass("BABYLON.ParticleConditionBlock", ParticleConditionBlock);
179
+ //# sourceMappingURL=particleConditionBlock.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"particleConditionBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/Particles/Node/Blocks/Conditions/particleConditionBlock.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,yCAAyC,CAAC;AAExE,OAAO,EAAE,qCAAqC,EAAE,MAAM,mDAAmD,CAAC;AAC1G,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,sBAAsB,EAA0B,gDAAsC;AAG/F;;GAEG;AACH,MAAM,CAAN,IAAY,2BAmBX;AAnBD,WAAY,2BAA2B;IACnC,YAAY;IACZ,+EAAK,CAAA;IACL,eAAe;IACf,qFAAQ,CAAA;IACR,eAAe;IACf,qFAAQ,CAAA;IACR,kBAAkB;IAClB,2FAAW,CAAA;IACX,kBAAkB;IAClB,2FAAW,CAAA;IACX,qBAAqB;IACrB,iGAAc,CAAA;IACd,2BAA2B;IAC3B,2EAAG,CAAA;IACH,iBAAiB;IACjB,yEAAE,CAAA;IACF,kBAAkB;IAClB,2EAAG,CAAA;AACP,CAAC,EAnBW,2BAA2B,KAA3B,2BAA2B,QAmBtC;AAED;;GAEG;AACH,MAAM,OAAO,sBAAuB,SAAQ,iBAAiB;IA2BzD;;;OAGG;IACH,YAAmB,IAAY;QAC3B,KAAK,CAAC,IAAI,CAAC,CAAC;QA/BhB;;WAEG;QAgBI,SAAI,GAAG,2BAA2B,CAAC,KAAK,CAAC;QAEhD;;WAEG;QAEI,YAAO,GAAG,CAAC,CAAC;QASf,IAAI,CAAC,aAAa,CAAC,MAAM,EAAE,qCAAqC,CAAC,KAAK,CAAC,CAAC;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UAAU,EAAE;QACrE,SAAS,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE;QAC5B,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE;YACL,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,2BAA2B,CAAC,KAAK,EAAE;YAC5D,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,2BAA2B,CAAC,QAAQ,EAAE;YAClE,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,2BAA2B,CAAC,QAAQ,EAAE;YAClE,EAAE,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE,2BAA2B,CAAC,WAAW,EAAE;YACxE,EAAE,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE,2BAA2B,CAAC,WAAW,EAAE;YACxE,EAAE,KAAK,EAAE,gBAAgB,EAAE,KAAK,EAAE,2BAA2B,CAAC,cAAc,EAAE;YAC9E,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,2BAA2B,CAAC,GAAG,EAAE;YACxD,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,2BAA2B,CAAC,EAAE,EAAE;YACtD,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,2BAA2B,CAAC,GAAG,EAAE;SAC3D;KACJ,CAAC;oDAC8C;AAMzC;IADN,sBAAsB,CAAC,SAAS,wCAAgC,UAAU,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,CAAC;uDAC3G;AAuIvB,aAAa,CAAC,gCAAgC,EAAE,sBAAsB,CAAC,CAAC","sourcesContent":["import { RegisterClass } from \"../../../../Misc/typeStore\";\r\nimport { WithinEpsilon } from \"../../../../Maths/math.scalar.functions\";\r\nimport type { NodeParticleBuildState } from \"../../nodeParticleBuildState\";\r\nimport { NodeParticleBlockConnectionPointTypes } from \"../../Enums/nodeParticleBlockConnectionPointTypes\";\r\nimport { NodeParticleBlock } from \"../../nodeParticleBlock\";\r\nimport { editableInPropertyPage, PropertyTypeForEdition } from \"core/Decorators/nodeDecorator\";\r\nimport type { NodeParticleConnectionPoint } from \"../../nodeParticleBlockConnectionPoint\";\r\n\r\n/**\r\n * Conditions supported by the condition block\r\n */\r\nexport enum ParticleConditionBlockTests {\r\n /** Equal */\r\n Equal,\r\n /** NotEqual */\r\n NotEqual,\r\n /** LessThan */\r\n LessThan,\r\n /** GreaterThan */\r\n GreaterThan,\r\n /** LessOrEqual */\r\n LessOrEqual,\r\n /** GreaterOrEqual */\r\n GreaterOrEqual,\r\n /** Logical Exclusive OR */\r\n Xor,\r\n /** Logical Or */\r\n Or,\r\n /** Logical And */\r\n And,\r\n}\r\n\r\n/**\r\n * Block used to evaluate a condition and return a true or false value as a float (1 or 0).\r\n */\r\nexport class ParticleConditionBlock extends NodeParticleBlock {\r\n /**\r\n * Gets or sets the test used by the block\r\n */\r\n @editableInPropertyPage(\"Test\", PropertyTypeForEdition.List, \"ADVANCED\", {\r\n notifiers: { rebuild: true },\r\n embedded: true,\r\n options: [\r\n { label: \"Equal\", value: ParticleConditionBlockTests.Equal },\r\n { label: \"NotEqual\", value: ParticleConditionBlockTests.NotEqual },\r\n { label: \"LessThan\", value: ParticleConditionBlockTests.LessThan },\r\n { label: \"GreaterThan\", value: ParticleConditionBlockTests.GreaterThan },\r\n { label: \"LessOrEqual\", value: ParticleConditionBlockTests.LessOrEqual },\r\n { label: \"GreaterOrEqual\", value: ParticleConditionBlockTests.GreaterOrEqual },\r\n { label: \"Xor\", value: ParticleConditionBlockTests.Xor },\r\n { label: \"Or\", value: ParticleConditionBlockTests.Or },\r\n { label: \"And\", value: ParticleConditionBlockTests.And },\r\n ],\r\n })\r\n public test = ParticleConditionBlockTests.Equal;\r\n\r\n /**\r\n * Gets or sets the epsilon value used for comparison\r\n */\r\n @editableInPropertyPage(\"Epsilon\", PropertyTypeForEdition.Float, \"ADVANCED\", { embedded: true, notifiers: { rebuild: true } })\r\n public epsilon = 0;\r\n\r\n /**\r\n * Create a new ParticleConditionBlock\r\n * @param name defines the block name\r\n */\r\n public constructor(name: string) {\r\n super(name);\r\n\r\n this.registerInput(\"left\", NodeParticleBlockConnectionPointTypes.Float);\r\n this.registerInput(\"right\", NodeParticleBlockConnectionPointTypes.Float, true, 0);\r\n this.registerInput(\"ifTrue\", NodeParticleBlockConnectionPointTypes.AutoDetect, true, 1);\r\n this.registerInput(\"ifFalse\", NodeParticleBlockConnectionPointTypes.AutoDetect, true, 0);\r\n this.registerOutput(\"output\", NodeParticleBlockConnectionPointTypes.BasedOnInput);\r\n\r\n this.output._typeConnectionSource = this._inputs[2];\r\n this.output._defaultConnectionPointType = NodeParticleBlockConnectionPointTypes.Float;\r\n this._inputs[0].acceptedConnectionPointTypes.push(NodeParticleBlockConnectionPointTypes.Int);\r\n this._inputs[1].acceptedConnectionPointTypes.push(NodeParticleBlockConnectionPointTypes.Int);\r\n this._linkConnectionTypes(2, 3);\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public override getClassName() {\r\n return \"ParticleConditionBlock\";\r\n }\r\n\r\n /**\r\n * Gets the left input component\r\n */\r\n public get left(): NodeParticleConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the right input component\r\n */\r\n public get right(): NodeParticleConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the ifTrue input component\r\n */\r\n public get ifTrue(): NodeParticleConnectionPoint {\r\n return this._inputs[2];\r\n }\r\n\r\n /**\r\n * Gets the ifFalse input component\r\n */\r\n public get ifFalse(): NodeParticleConnectionPoint {\r\n return this._inputs[3];\r\n }\r\n\r\n /**\r\n * Gets the output component\r\n */\r\n public get output(): NodeParticleConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n public override _build() {\r\n const func = (state: NodeParticleBuildState) => {\r\n const left = this.left.getConnectedValue(state) as number;\r\n const right = this.right.getConnectedValue(state) as number;\r\n let condition = false;\r\n\r\n switch (this.test) {\r\n case ParticleConditionBlockTests.Equal:\r\n condition = WithinEpsilon(left, right, this.epsilon);\r\n break;\r\n case ParticleConditionBlockTests.NotEqual:\r\n condition = !WithinEpsilon(left, right, this.epsilon);\r\n break;\r\n case ParticleConditionBlockTests.LessThan:\r\n condition = left < right + this.epsilon;\r\n break;\r\n case ParticleConditionBlockTests.GreaterThan:\r\n condition = left > right - this.epsilon;\r\n break;\r\n case ParticleConditionBlockTests.LessOrEqual:\r\n condition = left <= right + this.epsilon;\r\n break;\r\n case ParticleConditionBlockTests.GreaterOrEqual:\r\n condition = left >= right - this.epsilon;\r\n break;\r\n case ParticleConditionBlockTests.Xor:\r\n condition = (!!left && !right) || (!left && !!right);\r\n break;\r\n case ParticleConditionBlockTests.Or:\r\n condition = !!left || !!right;\r\n break;\r\n case ParticleConditionBlockTests.And:\r\n condition = !!left && !!right;\r\n break;\r\n }\r\n return condition;\r\n };\r\n\r\n this.output._storedFunction = (state) => {\r\n if (func(state)) {\r\n return this.ifTrue.getConnectedValue(state);\r\n }\r\n\r\n return this.ifFalse.getConnectedValue(state);\r\n };\r\n }\r\n\r\n /**\r\n * Serializes this block in a JSON representation\r\n * @returns the serialized block object\r\n */\r\n public override serialize(): any {\r\n const serializationObject = super.serialize();\r\n\r\n serializationObject.test = this.test;\r\n serializationObject.epsilon = this.epsilon;\r\n\r\n return serializationObject;\r\n }\r\n\r\n public override _deserialize(serializationObject: any) {\r\n super._deserialize(serializationObject);\r\n\r\n this.test = serializationObject.test;\r\n if (serializationObject.epsilon !== undefined) {\r\n this.epsilon = serializationObject.epsilon;\r\n }\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.ParticleConditionBlock\", ParticleConditionBlock);\r\n"]}
@@ -0,0 +1,47 @@
1
+ import type { NodeParticleConnectionPoint } from "../../nodeParticleBlockConnectionPoint.js";
2
+ import type { NodeParticleBuildState } from "../../nodeParticleBuildState.js";
3
+ import { NodeParticleBlock } from "../../nodeParticleBlock.js";
4
+ /**
5
+ * Block used to provide a flow of particles emitted from a box shape.
6
+ */
7
+ export declare class BoxShapeBlock extends NodeParticleBlock {
8
+ /**
9
+ * Create a new BoxShapeBlock
10
+ * @param name defines the block name
11
+ */
12
+ constructor(name: string);
13
+ /**
14
+ * Gets the current class name
15
+ * @returns the class name
16
+ */
17
+ getClassName(): string;
18
+ /**
19
+ * Gets the particle input component
20
+ */
21
+ get particle(): NodeParticleConnectionPoint;
22
+ /**
23
+ * Gets the direction1 input component
24
+ */
25
+ get direction1(): NodeParticleConnectionPoint;
26
+ /**
27
+ * Gets the direction2 input component
28
+ */
29
+ get direction2(): NodeParticleConnectionPoint;
30
+ /**
31
+ * Gets the minEmitBox input component
32
+ */
33
+ get minEmitBox(): NodeParticleConnectionPoint;
34
+ /**
35
+ * Gets the maxEmitBox input component
36
+ */
37
+ get maxEmitBox(): NodeParticleConnectionPoint;
38
+ /**
39
+ * Gets the output component
40
+ */
41
+ get output(): NodeParticleConnectionPoint;
42
+ /**
43
+ * Builds the block
44
+ * @param state defines the build state
45
+ */
46
+ _build(state: NodeParticleBuildState): void;
47
+ }
@@ -0,0 +1,107 @@
1
+ import { RegisterClass } from "../../../../Misc/typeStore.js";
2
+ import { NodeParticleBlockConnectionPointTypes } from "../../Enums/nodeParticleBlockConnectionPointTypes.js";
3
+ import { Vector3 } from "../../../../Maths/math.vector.js";
4
+ import { NodeParticleBlock } from "../../nodeParticleBlock.js";
5
+ import { RandomRange } from "../../../../Maths/math.scalar.functions.js";
6
+ /**
7
+ * Block used to provide a flow of particles emitted from a box shape.
8
+ */
9
+ export class BoxShapeBlock extends NodeParticleBlock {
10
+ /**
11
+ * Create a new BoxShapeBlock
12
+ * @param name defines the block name
13
+ */
14
+ constructor(name) {
15
+ super(name);
16
+ this.registerInput("particle", NodeParticleBlockConnectionPointTypes.Particle);
17
+ this.registerInput("direction1", NodeParticleBlockConnectionPointTypes.Vector3, true, new Vector3(0, 1.0, 0));
18
+ this.registerInput("direction2", NodeParticleBlockConnectionPointTypes.Vector3, true, new Vector3(0, 1.0, 0));
19
+ this.registerInput("minEmitBox", NodeParticleBlockConnectionPointTypes.Vector3, true, new Vector3(-0.5, -0.5, -0.5));
20
+ this.registerInput("maxEmitBox", NodeParticleBlockConnectionPointTypes.Vector3, true, new Vector3(0.5, 0.5, 0.5));
21
+ this.registerOutput("output", NodeParticleBlockConnectionPointTypes.Particle);
22
+ }
23
+ /**
24
+ * Gets the current class name
25
+ * @returns the class name
26
+ */
27
+ getClassName() {
28
+ return "BoxShapeBlock";
29
+ }
30
+ /**
31
+ * Gets the particle input component
32
+ */
33
+ get particle() {
34
+ return this._inputs[0];
35
+ }
36
+ /**
37
+ * Gets the direction1 input component
38
+ */
39
+ get direction1() {
40
+ return this._inputs[1];
41
+ }
42
+ /**
43
+ * Gets the direction2 input component
44
+ */
45
+ get direction2() {
46
+ return this._inputs[2];
47
+ }
48
+ /**
49
+ * Gets the minEmitBox input component
50
+ */
51
+ get minEmitBox() {
52
+ return this._inputs[3];
53
+ }
54
+ /**
55
+ * Gets the maxEmitBox input component
56
+ */
57
+ get maxEmitBox() {
58
+ return this._inputs[4];
59
+ }
60
+ /**
61
+ * Gets the output component
62
+ */
63
+ get output() {
64
+ return this._outputs[0];
65
+ }
66
+ /**
67
+ * Builds the block
68
+ * @param state defines the build state
69
+ */
70
+ _build(state) {
71
+ const system = this.particle.getConnectedValue(state);
72
+ system._directionCreation.process = (particle) => {
73
+ state.particleContext = particle;
74
+ state.systemContext = system;
75
+ const direction1 = this.direction1.getConnectedValue(state);
76
+ const direction2 = this.direction2.getConnectedValue(state);
77
+ const randX = RandomRange(direction1.x, direction2.x);
78
+ const randY = RandomRange(direction1.y, direction2.y);
79
+ const randZ = RandomRange(direction1.z, direction2.z);
80
+ if (state.isEmitterTransformNode) {
81
+ Vector3.TransformNormalFromFloatsToRef(randX, randY, randZ, state.emitterWorldMatrix, particle.direction);
82
+ }
83
+ else {
84
+ particle.direction.copyFromFloats(randX, randY, randZ);
85
+ }
86
+ };
87
+ system._positionCreation.process = (particle) => {
88
+ state.particleContext = particle;
89
+ state.systemContext = system;
90
+ const minEmitBox = this.minEmitBox.getConnectedValue(state);
91
+ const maxEmitBox = this.maxEmitBox.getConnectedValue(state);
92
+ const randX = RandomRange(minEmitBox.x, maxEmitBox.x);
93
+ const randY = RandomRange(minEmitBox.y, maxEmitBox.y);
94
+ const randZ = RandomRange(minEmitBox.z, maxEmitBox.z);
95
+ if (state.isEmitterTransformNode) {
96
+ Vector3.TransformCoordinatesFromFloatsToRef(randX, randY, randZ, state.emitterWorldMatrix, particle.position);
97
+ }
98
+ else {
99
+ particle.position.copyFromFloats(randX, randY, randZ);
100
+ particle.position.addInPlace(state.emitterPosition);
101
+ }
102
+ };
103
+ this.output._storedValue = system;
104
+ }
105
+ }
106
+ RegisterClass("BABYLON.BoxShapeBlock", BoxShapeBlock);
107
+ //# sourceMappingURL=boxShapeBlock.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"boxShapeBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/Particles/Node/Blocks/Emitters/boxShapeBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,qCAAqC,EAAE,MAAM,mDAAmD,CAAC;AAE1G,OAAO,EAAE,OAAO,EAAE,yCAA+B;AAEjD,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAE5D,OAAO,EAAE,WAAW,EAAE,mDAAyC;AAE/D;;GAEG;AACH,MAAM,OAAO,aAAc,SAAQ,iBAAiB;IAChD;;;OAGG;IACH,YAAmB,IAAY;QAC3B,KAAK,CAAC,IAAI,CAAC,CAAC;QAEZ,IAAI,CAAC,aAAa,CAAC,UAAU,EAAE,qCAAqC,CAAC,QAAQ,CAAC,CAAC;QAC/E,IAAI,CAAC,aAAa,CAAC,YAAY,EAAE,qCAAqC,CAAC,OAAO,EAAE,IAAI,EAAE,IAA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,CAAC,UAAU,CAAC,iBAAiB,CAAC,KAAK,CAAY,CAAC;YACvE,MAAM,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC,iBAAiB,CAAC,KAAK,CAAY,CAAC;YAEvE,MAAM,KAAK,GAAG,WAAW,CAAC,UAAU,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC;YACtD,MAAM,KAAK,GAAG,WAAW,CAAC,UAAU,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC;YACtD,MAAM,KAAK,GAAG,WAAW,CAAC,UAAU,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC;YAEtD,IAAI,KAAK,CAAC,sBAAsB,EAAE,CAAC;gBAC/B,OAAO,CAAC,mCAAmC,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,kBAAmB,EAAE,QAAQ,CAAC,QAAQ,CAAC,CAAC;YACnH,CAAC;iBAAM,CAAC;gBACJ,QAAQ,CAAC,QAAQ,CAAC,cAAc,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;gBACtD,QAAQ,CAAC,QAAQ,CAAC,UAAU,CAAC,KAAK,CAAC,eAAgB,CAAC,CAAC;YACzD,CAAC;QACL,CAAC,CAAC;QAEF,IAAI,CAAC,MAAM,CAAC,YAAY,GAAG,MAAM,CAAC;IACtC,CAAC;CACJ;AAED,aAAa,CAAC,uBAAuB,EAAE,aAAa,CAAC,CAAC","sourcesContent":["import { RegisterClass } from \"../../../../Misc/typeStore\";\r\nimport { NodeParticleBlockConnectionPointTypes } from \"../../Enums/nodeParticleBlockConnectionPointTypes\";\r\nimport type { NodeParticleConnectionPoint } from \"../../nodeParticleBlockConnectionPoint\";\r\nimport { Vector3 } from \"core/Maths/math.vector\";\r\nimport type { NodeParticleBuildState } from \"../../nodeParticleBuildState\";\r\nimport { NodeParticleBlock } from \"../../nodeParticleBlock\";\r\nimport type { Particle } from \"core/Particles/particle\";\r\nimport { RandomRange } from \"core/Maths/math.scalar.functions\";\r\n\r\n/**\r\n * Block used to provide a flow of particles emitted from a box shape.\r\n */\r\nexport class BoxShapeBlock extends NodeParticleBlock {\r\n /**\r\n * Create a new BoxShapeBlock\r\n * @param name defines the block name\r\n */\r\n public constructor(name: string) {\r\n super(name);\r\n\r\n this.registerInput(\"particle\", NodeParticleBlockConnectionPointTypes.Particle);\r\n this.registerInput(\"direction1\", NodeParticleBlockConnectionPointTypes.Vector3, true, new Vector3(0, 1.0, 0));\r\n this.registerInput(\"direction2\", NodeParticleBlockConnectionPointTypes.Vector3, true, new Vector3(0, 1.0, 0));\r\n this.registerInput(\"minEmitBox\", NodeParticleBlockConnectionPointTypes.Vector3, true, new Vector3(-0.5, -0.5, -0.5));\r\n this.registerInput(\"maxEmitBox\", NodeParticleBlockConnectionPointTypes.Vector3, true, new Vector3(0.5, 0.5, 0.5));\r\n this.registerOutput(\"output\", NodeParticleBlockConnectionPointTypes.Particle);\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public override getClassName() {\r\n return \"BoxShapeBlock\";\r\n }\r\n\r\n /**\r\n * Gets the particle input component\r\n */\r\n public get particle(): NodeParticleConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the direction1 input component\r\n */\r\n public get direction1(): NodeParticleConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the direction2 input component\r\n */\r\n public get direction2(): NodeParticleConnectionPoint {\r\n return this._inputs[2];\r\n }\r\n\r\n /**\r\n * Gets the minEmitBox input component\r\n */\r\n public get minEmitBox(): NodeParticleConnectionPoint {\r\n return this._inputs[3];\r\n }\r\n\r\n /**\r\n * Gets the maxEmitBox input component\r\n */\r\n public get maxEmitBox(): NodeParticleConnectionPoint {\r\n return this._inputs[4];\r\n }\r\n\r\n /**\r\n * Gets the output component\r\n */\r\n public get output(): NodeParticleConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n /**\r\n * Builds the block\r\n * @param state defines the build state\r\n */\r\n public override _build(state: NodeParticleBuildState) {\r\n const system = this.particle.getConnectedValue(state);\r\n\r\n system._directionCreation.process = (particle: Particle) => {\r\n state.particleContext = particle;\r\n state.systemContext = system;\r\n\r\n const direction1 = this.direction1.getConnectedValue(state) as Vector3;\r\n const direction2 = this.direction2.getConnectedValue(state) as Vector3;\r\n\r\n const randX = RandomRange(direction1.x, direction2.x);\r\n const randY = RandomRange(direction1.y, direction2.y);\r\n const randZ = RandomRange(direction1.z, direction2.z);\r\n\r\n if (state.isEmitterTransformNode) {\r\n Vector3.TransformNormalFromFloatsToRef(randX, randY, randZ, state.emitterWorldMatrix!, particle.direction);\r\n } else {\r\n particle.direction.copyFromFloats(randX, randY, randZ);\r\n }\r\n };\r\n\r\n system._positionCreation.process = (particle: Particle) => {\r\n state.particleContext = particle;\r\n state.systemContext = system;\r\n const minEmitBox = this.minEmitBox.getConnectedValue(state) as Vector3;\r\n const maxEmitBox = this.maxEmitBox.getConnectedValue(state) as Vector3;\r\n\r\n const randX = RandomRange(minEmitBox.x, maxEmitBox.x);\r\n const randY = RandomRange(minEmitBox.y, maxEmitBox.y);\r\n const randZ = RandomRange(minEmitBox.z, maxEmitBox.z);\r\n\r\n if (state.isEmitterTransformNode) {\r\n Vector3.TransformCoordinatesFromFloatsToRef(randX, randY, randZ, state.emitterWorldMatrix!, particle.position);\r\n } else {\r\n particle.position.copyFromFloats(randX, randY, randZ);\r\n particle.position.addInPlace(state.emitterPosition!);\r\n }\r\n };\r\n\r\n this.output._storedValue = system;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.BoxShapeBlock\", BoxShapeBlock);\r\n"]}
@@ -0,0 +1,46 @@
1
+ import { NodeParticleBlock } from "../../nodeParticleBlock.js";
2
+ import type { NodeParticleConnectionPoint } from "../../nodeParticleBlockConnectionPoint.js";
3
+ import type { NodeParticleBuildState } from "../../nodeParticleBuildState.js";
4
+ /**
5
+ * @internal
6
+ */
7
+ export declare class CreateParticleBlock extends NodeParticleBlock {
8
+ /**
9
+ * Create a new CreateParticleBlock
10
+ * @param name defines the block name
11
+ */
12
+ constructor(name: string);
13
+ /**
14
+ * Gets the current class name
15
+ * @returns the class name
16
+ */
17
+ getClassName(): string;
18
+ /**
19
+ * Gets the emitPower input component
20
+ */
21
+ get emitPower(): NodeParticleConnectionPoint;
22
+ /**
23
+ * Gets the lifeTime input component
24
+ */
25
+ get lifeTime(): NodeParticleConnectionPoint;
26
+ /**
27
+ * Gets the color input component
28
+ */
29
+ get color(): NodeParticleConnectionPoint;
30
+ /**
31
+ * Gets the scale input component
32
+ */
33
+ get scale(): NodeParticleConnectionPoint;
34
+ /**
35
+ * Gets the angle input component
36
+ */
37
+ get angle(): NodeParticleConnectionPoint;
38
+ /**
39
+ * Gets the particle output component
40
+ */
41
+ get particle(): NodeParticleConnectionPoint;
42
+ /**
43
+ * @internal
44
+ */
45
+ _build(state: NodeParticleBuildState): void;
46
+ }
@@ -0,0 +1,97 @@
1
+ import { NodeParticleBlockConnectionPointTypes } from "../../Enums/nodeParticleBlockConnectionPointTypes.js";
2
+ import { NodeParticleBlock } from "../../nodeParticleBlock.js";
3
+ import { ParticleSystem } from "../../../particleSystem.js";
4
+ import { Color4 } from "../../../../Maths/math.color.js";
5
+ import { Vector2 } from "../../../../Maths/math.vector.js";
6
+ import { RegisterClass } from "../../../../Misc/typeStore.js";
7
+ import { PointParticleEmitter } from "../../../EmitterTypes/pointParticleEmitter.js";
8
+ /**
9
+ * @internal
10
+ */
11
+ export class CreateParticleBlock extends NodeParticleBlock {
12
+ /**
13
+ * Create a new CreateParticleBlock
14
+ * @param name defines the block name
15
+ */
16
+ constructor(name) {
17
+ super(name);
18
+ this.registerInput("emitPower", NodeParticleBlockConnectionPointTypes.Float, true, 1);
19
+ this.registerInput("lifeTime", NodeParticleBlockConnectionPointTypes.Float, true, 1);
20
+ this.registerInput("color", NodeParticleBlockConnectionPointTypes.Color4, true, new Color4(1, 1, 1, 1));
21
+ this.registerInput("scale", NodeParticleBlockConnectionPointTypes.Vector2, true, new Vector2(1, 1));
22
+ this.registerInput("angle", NodeParticleBlockConnectionPointTypes.Float, true, 0);
23
+ this.registerOutput("particle", NodeParticleBlockConnectionPointTypes.Particle);
24
+ }
25
+ /**
26
+ * Gets the current class name
27
+ * @returns the class name
28
+ */
29
+ getClassName() {
30
+ return "CreateParticleBlock";
31
+ }
32
+ /**
33
+ * Gets the emitPower input component
34
+ */
35
+ get emitPower() {
36
+ return this._inputs[0];
37
+ }
38
+ /**
39
+ * Gets the lifeTime input component
40
+ */
41
+ get lifeTime() {
42
+ return this._inputs[1];
43
+ }
44
+ /**
45
+ * Gets the color input component
46
+ */
47
+ get color() {
48
+ return this._inputs[2];
49
+ }
50
+ /**
51
+ * Gets the scale input component
52
+ */
53
+ get scale() {
54
+ return this._inputs[3];
55
+ }
56
+ /**
57
+ * Gets the angle input component
58
+ */
59
+ get angle() {
60
+ return this._inputs[4];
61
+ }
62
+ /**
63
+ * Gets the particle output component
64
+ */
65
+ get particle() {
66
+ return this._outputs[0];
67
+ }
68
+ /**
69
+ * @internal
70
+ */
71
+ _build(state) {
72
+ const system = new ParticleSystem(this.name, state.capacity, state.scene, null, false, undefined, true);
73
+ system.particleEmitterType = new PointParticleEmitter();
74
+ // Creation
75
+ system._lifeTimeCreation.process = (particle, system) => {
76
+ state.particleContext = particle;
77
+ particle.lifeTime = this.lifeTime.getConnectedValue(state);
78
+ system._emitPower = this.emitPower.getConnectedValue(state);
79
+ };
80
+ system._colorCreation.process = (particle) => {
81
+ state.particleContext = particle;
82
+ particle.color.copyFrom(this.color.getConnectedValue(state));
83
+ };
84
+ system._sizeCreation.process = (particle) => {
85
+ state.particleContext = particle;
86
+ particle.size = 1;
87
+ particle.scale.copyFrom(this.scale.getConnectedValue(state));
88
+ };
89
+ system._angleCreation.process = (particle) => {
90
+ state.particleContext = particle;
91
+ particle.angle = this.angle.getConnectedValue(state);
92
+ };
93
+ this.particle._storedValue = system;
94
+ }
95
+ }
96
+ RegisterClass("BABYLON.CreateParticleBlock", CreateParticleBlock);
97
+ //# sourceMappingURL=createParticleBlock.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createParticleBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/Particles/Node/Blocks/Emitters/createParticleBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qCAAqC,EAAE,MAAM,mDAAmD,CAAC;AAC1G,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAE5D,OAAO,EAAE,cAAc,EAAE,mCAAsC;AAQ/D,OAAO,EAAE,MAAM,EAAE,wCAA8B;AAC/C,OAAO,EAAE,OAAO,EAAE,yCAA+B;AACjD,OAAO,EAAE,aAAa,EAAE,sCAA4B;AACpD,OAAO,EAAE,oBAAoB,EAAE,sDAAyD;AAExF;;GAEG;AACH,MAAM,OAAO,mBAAoB,SAAQ,iBAAiB;IACtD;;;OAGG;IACH,YAAmB,IAAY;QAC3B,KAAK,CAAC,IAAI,CAAC,CAAC;QAEZ,IAAI,CAAC,aAAa,CAAC,WAAW,EAAE,qCAAqC,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;QACtF,IAAI,CAAC,aAAa,CAAC,UAAU,EAAE,qCAAqC,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;QACrF,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,qCAAqC,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QACxG,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,qCAAqC,CAAC,OAAO,EAAE,IAAI,EAAE,IAAI,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QACpG,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,qCAAqC,CAAC,KAAK,EAAE,IAAI,EAA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AC,CAAC;YAC3D,MAAM,CAAC,UAAU,GAAG,IAAI,CAAC,SAAS,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC;QAChE,CAAC,CAAC;QAEF,MAAM,CAAC,cAAc,CAAC,OAAO,GAAG,CAAC,QAAkB,EAAE,EAAE;YACnD,KAAK,CAAC,eAAe,GAAG,QAAQ,CAAC;YACjC,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC,CAAC;QACjE,CAAC,CAAC;QAEF,MAAM,CAAC,aAAa,CAAC,OAAO,GAAG,CAAC,QAAkB,EAAE,EAAE;YAClD,KAAK,CAAC,eAAe,GAAG,QAAQ,CAAC;YACjC,QAAQ,CAAC,IAAI,GAAG,CAAC,CAAC;YAClB,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC,CAAC;QACjE,CAAC,CAAC;QAEF,MAAM,CAAC,cAAc,CAAC,OAAO,GAAG,CAAC,QAAkB,EAAE,EAAE;YACnD,KAAK,CAAC,eAAe,GAAG,QAAQ,CAAC;YACjC,QAAQ,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC;QACzD,CAAC,CAAC;QAEF,IAAI,CAAC,QAAQ,CAAC,YAAY,GAAG,MAAM,CAAC;IACxC,CAAC;CACJ;AAED,aAAa,CAAC,6BAA6B,EAAE,mBAAmB,CAAC,CAAC","sourcesContent":["import { NodeParticleBlockConnectionPointTypes } from \"../../Enums/nodeParticleBlockConnectionPointTypes\";\r\nimport { NodeParticleBlock } from \"../../nodeParticleBlock\";\r\nimport type { NodeParticleConnectionPoint } from \"../../nodeParticleBlockConnectionPoint\";\r\nimport { ParticleSystem } from \"core/Particles/particleSystem\";\r\nimport type { NodeParticleBuildState } from \"../../nodeParticleBuildState\";\r\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\r\nimport type { _IExecutionQueueItem } from \"core/Particles/Queue/executionQueue\";\r\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\r\nimport { _RemoveFromQueue } from \"core/Particles/Queue/executionQueue\";\r\nimport type { Particle } from \"core/Particles/particle\";\r\nimport type { ThinParticleSystem } from \"core/Particles/thinParticleSystem\";\r\nimport { Color4 } from \"core/Maths/math.color\";\r\nimport { Vector2 } from \"core/Maths/math.vector\";\r\nimport { RegisterClass } from \"core/Misc/typeStore\";\r\nimport { PointParticleEmitter } from \"core/Particles/EmitterTypes/pointParticleEmitter\";\r\n\r\n/**\r\n * @internal\r\n */\r\nexport class CreateParticleBlock extends NodeParticleBlock {\r\n /**\r\n * Create a new CreateParticleBlock\r\n * @param name defines the block name\r\n */\r\n public constructor(name: string) {\r\n super(name);\r\n\r\n this.registerInput(\"emitPower\", NodeParticleBlockConnectionPointTypes.Float, true, 1);\r\n this.registerInput(\"lifeTime\", NodeParticleBlockConnectionPointTypes.Float, true, 1);\r\n this.registerInput(\"color\", NodeParticleBlockConnectionPointTypes.Color4, true, new Color4(1, 1, 1, 1));\r\n this.registerInput(\"scale\", NodeParticleBlockConnectionPointTypes.Vector2, true, new Vector2(1, 1));\r\n this.registerInput(\"angle\", NodeParticleBlockConnectionPointTypes.Float, true, 0);\r\n this.registerOutput(\"particle\", NodeParticleBlockConnectionPointTypes.Particle);\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public override getClassName() {\r\n return \"CreateParticleBlock\";\r\n }\r\n\r\n /**\r\n * Gets the emitPower input component\r\n */\r\n public get emitPower(): NodeParticleConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the lifeTime input component\r\n */\r\n public get lifeTime(): NodeParticleConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the color input component\r\n */\r\n public get color(): NodeParticleConnectionPoint {\r\n return this._inputs[2];\r\n }\r\n\r\n /**\r\n * Gets the scale input component\r\n */\r\n public get scale(): NodeParticleConnectionPoint {\r\n return this._inputs[3];\r\n }\r\n\r\n /**\r\n * Gets the angle input component\r\n */\r\n public get angle(): NodeParticleConnectionPoint {\r\n return this._inputs[4];\r\n }\r\n\r\n /**\r\n * Gets the particle output component\r\n */\r\n public get particle(): NodeParticleConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public override _build(state: NodeParticleBuildState) {\r\n const system = new ParticleSystem(this.name, state.capacity, state.scene, null, false, undefined, true);\r\n system.particleEmitterType = new PointParticleEmitter();\r\n\r\n // Creation\r\n system._lifeTimeCreation.process = (particle: Particle, system: ThinParticleSystem) => {\r\n state.particleContext = particle;\r\n particle.lifeTime = this.lifeTime.getConnectedValue(state);\r\n system._emitPower = this.emitPower.getConnectedValue(state);\r\n };\r\n\r\n system._colorCreation.process = (particle: Particle) => {\r\n state.particleContext = particle;\r\n particle.color.copyFrom(this.color.getConnectedValue(state));\r\n };\r\n\r\n system._sizeCreation.process = (particle: Particle) => {\r\n state.particleContext = particle;\r\n particle.size = 1;\r\n particle.scale.copyFrom(this.scale.getConnectedValue(state));\r\n };\r\n\r\n system._angleCreation.process = (particle: Particle) => {\r\n state.particleContext = particle;\r\n particle.angle = this.angle.getConnectedValue(state);\r\n };\r\n\r\n this.particle._storedValue = system;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.CreateParticleBlock\", CreateParticleBlock);\r\n"]}
@@ -0,0 +1,39 @@
1
+ import type { NodeParticleConnectionPoint } from "../../nodeParticleBlockConnectionPoint.js";
2
+ import type { NodeParticleBuildState } from "../../nodeParticleBuildState.js";
3
+ import { NodeParticleBlock } from "../../nodeParticleBlock.js";
4
+ /**
5
+ * Block used to provide a flow of particles emitted from a custom position.
6
+ */
7
+ export declare class CustomShapeBlock extends NodeParticleBlock {
8
+ /**
9
+ * Create a new CustomShapeBlock
10
+ * @param name defines the block name
11
+ */
12
+ constructor(name: string);
13
+ /**
14
+ * Gets the current class name
15
+ * @returns the class name
16
+ */
17
+ getClassName(): string;
18
+ /**
19
+ * Gets the particle component
20
+ */
21
+ get particle(): NodeParticleConnectionPoint;
22
+ /**
23
+ * Gets the position input component
24
+ */
25
+ get position(): NodeParticleConnectionPoint;
26
+ /**
27
+ * Gets the direction input component
28
+ */
29
+ get direction(): NodeParticleConnectionPoint;
30
+ /**
31
+ * Gets the output component
32
+ */
33
+ get output(): NodeParticleConnectionPoint;
34
+ /**
35
+ * Builds the block
36
+ * @param state defines the build state
37
+ */
38
+ _build(state: NodeParticleBuildState): void;
39
+ }