@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,337 @@
1
+ import { Observable } from "../../Misc/observable.js";
2
+ import { NodeParticleBlockConnectionPointTypes } from "./Enums/nodeParticleBlockConnectionPointTypes.js";
3
+ /**
4
+ * Enum used to define the compatibility state between two connection points
5
+ */
6
+ export var NodeParticleConnectionPointCompatibilityStates;
7
+ (function (NodeParticleConnectionPointCompatibilityStates) {
8
+ /** Points are compatibles */
9
+ NodeParticleConnectionPointCompatibilityStates[NodeParticleConnectionPointCompatibilityStates["Compatible"] = 0] = "Compatible";
10
+ /** Points are incompatible because of their types */
11
+ NodeParticleConnectionPointCompatibilityStates[NodeParticleConnectionPointCompatibilityStates["TypeIncompatible"] = 1] = "TypeIncompatible";
12
+ /** Points are incompatible because they are in the same hierarchy **/
13
+ NodeParticleConnectionPointCompatibilityStates[NodeParticleConnectionPointCompatibilityStates["HierarchyIssue"] = 2] = "HierarchyIssue";
14
+ })(NodeParticleConnectionPointCompatibilityStates || (NodeParticleConnectionPointCompatibilityStates = {}));
15
+ /**
16
+ * Defines the direction of a connection point
17
+ */
18
+ export var NodeParticleConnectionPointDirection;
19
+ (function (NodeParticleConnectionPointDirection) {
20
+ /** Input */
21
+ NodeParticleConnectionPointDirection[NodeParticleConnectionPointDirection["Input"] = 0] = "Input";
22
+ /** Output */
23
+ NodeParticleConnectionPointDirection[NodeParticleConnectionPointDirection["Output"] = 1] = "Output";
24
+ })(NodeParticleConnectionPointDirection || (NodeParticleConnectionPointDirection = {}));
25
+ /**
26
+ * Defines a connection point for a block
27
+ */
28
+ export class NodeParticleConnectionPoint {
29
+ /** Gets the direction of the point */
30
+ get direction() {
31
+ return this._direction;
32
+ }
33
+ /**
34
+ * Gets or sets the connection point type (default is float)
35
+ */
36
+ get type() {
37
+ if (this._type === NodeParticleBlockConnectionPointTypes.AutoDetect) {
38
+ if (this._ownerBlock.isInput) {
39
+ return this._ownerBlock.type;
40
+ }
41
+ if (this._connectedPoint) {
42
+ return this._connectedPoint.type;
43
+ }
44
+ if (this._linkedConnectionSource) {
45
+ if (this._linkedConnectionSource.isConnected) {
46
+ return this._linkedConnectionSource.type;
47
+ }
48
+ if (this._linkedConnectionSource._defaultConnectionPointType) {
49
+ return this._linkedConnectionSource._defaultConnectionPointType;
50
+ }
51
+ }
52
+ if (this._defaultConnectionPointType) {
53
+ return this._defaultConnectionPointType;
54
+ }
55
+ }
56
+ if (this._type === NodeParticleBlockConnectionPointTypes.BasedOnInput) {
57
+ if (this._typeConnectionSource) {
58
+ if (!this._typeConnectionSource.isConnected && this._defaultConnectionPointType) {
59
+ return this._defaultConnectionPointType;
60
+ }
61
+ if (this._typeConnectionSourceTranslation) {
62
+ return this._typeConnectionSourceTranslation(this._typeConnectionSource.type);
63
+ }
64
+ return this._typeConnectionSource.type;
65
+ }
66
+ else if (this._defaultConnectionPointType) {
67
+ return this._defaultConnectionPointType;
68
+ }
69
+ }
70
+ return this._type;
71
+ }
72
+ set type(value) {
73
+ this._type = value;
74
+ }
75
+ /**
76
+ * Gets a boolean indicating that the current point is connected to another NodeMaterialBlock
77
+ */
78
+ get isConnected() {
79
+ return this.connectedPoint !== null || this.hasEndpoints;
80
+ }
81
+ /** Get the other side of the connection (if any) */
82
+ get connectedPoint() {
83
+ return this._connectedPoint;
84
+ }
85
+ /** Get the block that owns this connection point */
86
+ get ownerBlock() {
87
+ return this._ownerBlock;
88
+ }
89
+ /** Get the block connected on the other side of this connection (if any) */
90
+ get sourceBlock() {
91
+ if (!this._connectedPoint) {
92
+ return null;
93
+ }
94
+ return this._connectedPoint.ownerBlock;
95
+ }
96
+ /** Get the block connected on the endpoints of this connection (if any) */
97
+ get connectedBlocks() {
98
+ if (this._endpoints.length === 0) {
99
+ return [];
100
+ }
101
+ return this._endpoints.map((e) => e.ownerBlock);
102
+ }
103
+ /** Gets the list of connected endpoints */
104
+ get endpoints() {
105
+ return this._endpoints;
106
+ }
107
+ /** Gets a boolean indicating if that output point is connected to at least one input */
108
+ get hasEndpoints() {
109
+ return this._endpoints && this._endpoints.length > 0;
110
+ }
111
+ /** Get the inner type (ie AutoDetect for instance instead of the inferred one) */
112
+ get innerType() {
113
+ if (this._linkedConnectionSource && !this._isMainLinkSource && this._linkedConnectionSource.isConnected) {
114
+ return this.type;
115
+ }
116
+ return this._type;
117
+ }
118
+ /**
119
+ * Creates a new connection point
120
+ * @param name defines the connection point name
121
+ * @param ownerBlock defines the block hosting this connection point
122
+ * @param direction defines the direction of the connection point
123
+ */
124
+ constructor(name, ownerBlock, direction) {
125
+ /** @internal */
126
+ this._connectedPoint = null;
127
+ /** @internal */
128
+ this._storedValue = null;
129
+ /** @internal */
130
+ this._storedFunction = null;
131
+ /** @internal */
132
+ this._acceptedConnectionPointType = null;
133
+ this._endpoints = new Array();
134
+ this._type = NodeParticleBlockConnectionPointTypes.Particle;
135
+ /** @internal */
136
+ this._linkedConnectionSource = null;
137
+ /** @internal */
138
+ this._typeConnectionSource = null;
139
+ /** @internal */
140
+ this._typeConnectionSourceTranslation = null;
141
+ /** @internal */
142
+ this._defaultConnectionPointType = null;
143
+ /** @internal */
144
+ this._isMainLinkSource = false;
145
+ /**
146
+ * Gets or sets the additional types supported by this connection point
147
+ */
148
+ this.acceptedConnectionPointTypes = [];
149
+ /**
150
+ * Gets or sets the additional types excluded by this connection point
151
+ */
152
+ this.excludedConnectionPointTypes = [];
153
+ /**
154
+ * Observable triggered when this point is connected
155
+ */
156
+ this.onConnectionObservable = new Observable();
157
+ /**
158
+ * Observable triggered when this point is disconnected
159
+ */
160
+ this.onDisconnectionObservable = new Observable();
161
+ /**
162
+ * Gets or sets a boolean indicating that this connection point is exposed on a frame
163
+ */
164
+ this.isExposedOnFrame = false;
165
+ /**
166
+ * Gets or sets number indicating the position that the port is exposed to on a frame
167
+ */
168
+ this.exposedPortPosition = -1;
169
+ /**
170
+ * Gets the default value used for this point at creation time
171
+ */
172
+ this.defaultValue = null;
173
+ /**
174
+ * Gets or sets the default value used for this point if nothing is connected
175
+ */
176
+ this.value = null;
177
+ /**
178
+ * Gets or sets the min value accepted for this point if nothing is connected
179
+ */
180
+ this.valueMin = null;
181
+ /**
182
+ * Gets or sets the max value accepted for this point if nothing is connected
183
+ */
184
+ this.valueMax = null;
185
+ this._ownerBlock = ownerBlock;
186
+ this.name = name;
187
+ this._direction = direction;
188
+ }
189
+ /**
190
+ * Gets the current class name e.g. "NodeMaterialConnectionPoint"
191
+ * @returns the class name
192
+ */
193
+ getClassName() {
194
+ return "NodeParticleConnectionPoint";
195
+ }
196
+ /**
197
+ * Gets the value represented by this connection point
198
+ * @param state current evaluation state
199
+ * @returns the connected value or the value if nothing is connected
200
+ */
201
+ getConnectedValue(state) {
202
+ if (this.isConnected) {
203
+ if (this._connectedPoint?._storedFunction) {
204
+ return this._connectedPoint._storedFunction(state);
205
+ }
206
+ return this._connectedPoint._storedValue;
207
+ }
208
+ return this.value;
209
+ }
210
+ /**
211
+ * Gets a boolean indicating if the current point can be connected to another point
212
+ * @param connectionPoint defines the other connection point
213
+ * @returns a boolean
214
+ */
215
+ canConnectTo(connectionPoint) {
216
+ return this.checkCompatibilityState(connectionPoint) === 0 /* NodeParticleConnectionPointCompatibilityStates.Compatible */;
217
+ }
218
+ /**
219
+ * Gets a number indicating if the current point can be connected to another point
220
+ * @param connectionPoint defines the other connection point
221
+ * @returns a number defining the compatibility state
222
+ */
223
+ checkCompatibilityState(connectionPoint) {
224
+ const ownerBlock = this._ownerBlock;
225
+ const otherBlock = connectionPoint.ownerBlock;
226
+ if (this.type !== connectionPoint.type && connectionPoint.innerType !== NodeParticleBlockConnectionPointTypes.AutoDetect) {
227
+ // Accepted types
228
+ if (connectionPoint.acceptedConnectionPointTypes && connectionPoint.acceptedConnectionPointTypes.indexOf(this.type) !== -1) {
229
+ return 0 /* NodeParticleConnectionPointCompatibilityStates.Compatible */;
230
+ }
231
+ else {
232
+ return 1 /* NodeParticleConnectionPointCompatibilityStates.TypeIncompatible */;
233
+ }
234
+ }
235
+ // Excluded
236
+ if (connectionPoint.excludedConnectionPointTypes && connectionPoint.excludedConnectionPointTypes.indexOf(this.type) !== -1) {
237
+ return 1 /* NodeParticleConnectionPointCompatibilityStates.TypeIncompatible */;
238
+ }
239
+ // Check hierarchy
240
+ let targetBlock = otherBlock;
241
+ let sourceBlock = ownerBlock;
242
+ if (this.direction === 0 /* NodeParticleConnectionPointDirection.Input */) {
243
+ targetBlock = ownerBlock;
244
+ sourceBlock = otherBlock;
245
+ }
246
+ if (targetBlock.isAnAncestorOf(sourceBlock)) {
247
+ return 2 /* NodeParticleConnectionPointCompatibilityStates.HierarchyIssue */;
248
+ }
249
+ return 0 /* NodeParticleConnectionPointCompatibilityStates.Compatible */;
250
+ }
251
+ /**
252
+ * Connect this point to another connection point
253
+ * @param connectionPoint defines the other connection point
254
+ * @param ignoreConstraints defines if the system will ignore connection type constraints (default is false)
255
+ * @returns the current connection point
256
+ */
257
+ connectTo(connectionPoint, ignoreConstraints = false) {
258
+ if (!ignoreConstraints && !this.canConnectTo(connectionPoint)) {
259
+ // eslint-disable-next-line no-throw-literal
260
+ throw `Cannot connect these two connectors. source: "${this.ownerBlock.name}".${this.name}, target: "${connectionPoint.ownerBlock.name}".${connectionPoint.name}`;
261
+ }
262
+ this._endpoints.push(connectionPoint);
263
+ connectionPoint._connectedPoint = this;
264
+ this.onConnectionObservable.notifyObservers(connectionPoint);
265
+ connectionPoint.onConnectionObservable.notifyObservers(this);
266
+ return this;
267
+ }
268
+ /**
269
+ * Disconnect this point from one of his endpoint
270
+ * @param endpoint defines the other connection point
271
+ * @returns the current connection point
272
+ */
273
+ disconnectFrom(endpoint) {
274
+ const index = this._endpoints.indexOf(endpoint);
275
+ if (index === -1) {
276
+ return this;
277
+ }
278
+ this._endpoints.splice(index, 1);
279
+ endpoint._connectedPoint = null;
280
+ this.onDisconnectionObservable.notifyObservers(endpoint);
281
+ endpoint.onDisconnectionObservable.notifyObservers(this);
282
+ return this;
283
+ }
284
+ /**
285
+ * Fill the list of excluded connection point types with all types other than those passed in the parameter
286
+ * @param mask Types (ORed values of NodeMaterialBlockConnectionPointTypes) that are allowed, and thus will not be pushed to the excluded list
287
+ */
288
+ addExcludedConnectionPointFromAllowedTypes(mask) {
289
+ let bitmask = 1;
290
+ while (bitmask < NodeParticleBlockConnectionPointTypes.All) {
291
+ if (!(mask & bitmask)) {
292
+ this.excludedConnectionPointTypes.push(bitmask);
293
+ }
294
+ bitmask = bitmask << 1;
295
+ }
296
+ }
297
+ /**
298
+ * Serializes this point in a JSON representation
299
+ * @param isInput defines if the connection point is an input (default is true)
300
+ * @returns the serialized point object
301
+ */
302
+ serialize(isInput = true) {
303
+ const serializationObject = {};
304
+ serializationObject.name = this.name;
305
+ serializationObject.displayName = this.displayName;
306
+ if (this.value !== undefined && this.value !== null) {
307
+ if (this.value.asArray) {
308
+ serializationObject.valueType = "BABYLON." + this.value.getClassName();
309
+ serializationObject.value = this.value.asArray();
310
+ }
311
+ else {
312
+ serializationObject.valueType = "number";
313
+ serializationObject.value = this.value;
314
+ }
315
+ }
316
+ if (isInput && this.connectedPoint) {
317
+ serializationObject.inputName = this.name;
318
+ serializationObject.targetBlockId = this.connectedPoint.ownerBlock.uniqueId;
319
+ serializationObject.targetConnectionName = this.connectedPoint.name;
320
+ serializationObject.isExposedOnFrame = true;
321
+ serializationObject.exposedPortPosition = this.exposedPortPosition;
322
+ }
323
+ if (this.isExposedOnFrame || this.exposedPortPosition >= 0) {
324
+ serializationObject.isExposedOnFrame = true;
325
+ serializationObject.exposedPortPosition = this.exposedPortPosition;
326
+ }
327
+ return serializationObject;
328
+ }
329
+ /**
330
+ * Release resources
331
+ */
332
+ dispose() {
333
+ this.onConnectionObservable.clear();
334
+ this.onDisconnectionObservable.clear();
335
+ }
336
+ }
337
+ //# sourceMappingURL=nodeParticleBlockConnectionPoint.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nodeParticleBlockConnectionPoint.js","sourceRoot":"","sources":["../../../../../dev/core/src/Particles/Node/nodeParticleBlockConnectionPoint.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEnD,OAAO,EAAE,qCAAqC,EAAE,MAAM,+CAA+C,CAAC;AAItG;;GAEG;AACH,MAAM,CAAN,IAAkB,8CAOjB;AAPD,WAAkB,8CAA8C;IAC5D,6BAA6B;IAC7B,+HAAU,CAAA;IACV,qDAAqD;IACrD,2IAAgB,CAAA;IAChB,sEAAsE;IACtE,uIAAc,CAAA;AAClB,CAAC,EAPiB,8CAA8C,KAA9C,8CAA8C,QAO/D;AAED;;GAEG;AACH,MAAM,CAAN,IAAkB,oCAKjB;AALD,WAAkB,oCAAoC;IAClD,YAAY;IACZ,iGAAK,C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OAAO,EAAE,CAAC;YACrD,CAAC;iBAAM,CAAC;gBACJ,mBAAmB,CAAC,SAAS,GAAG,QAAQ,CAAC;gBACzC,mBAAmB,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;YAC3C,CAAC;QACL,CAAC;QAED,IAAI,OAAO,IAAI,IAAI,CAAC,cAAc,EAAE,CAAC;YACjC,mBAAmB,CAAC,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC;YAC1C,mBAAmB,CAAC,aAAa,GAAG,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC,QAAQ,CAAC;YAC5E,mBAAmB,CAAC,oBAAoB,GAAG,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC;YACpE,mBAAmB,CAAC,gBAAgB,GAAG,IAAI,CAAC;YAC5C,mBAAmB,CAAC,mBAAmB,GAAG,IAAI,CAAC,mBAAmB,CAAC;QACvE,CAAC;QAED,IAAI,IAAI,CAAC,gBAAgB,IAAI,IAAI,CAAC,mBAAmB,IAAI,CAAC,EAAE,CAAC;YACzD,mBAAmB,CAAC,gBAAgB,GAAG,IAAI,CAAC;YAC5C,mBAAmB,CAAC,mBAAmB,GAAG,IAAI,CAAC,mBAAmB,CAAC;QACvE,CAAC;QAED,OAAO,mBAAmB,CAAC;IAC/B,CAAC;IAED;;OAEG;IACI,OAAO;QACV,IAAI,CAAC,sBAAsB,CAAC,KAAK,EAAE,CAAC;QACpC,IAAI,CAAC,yBAAyB,CAAC,KAAK,EAAE,CAAC;IAC3C,CAAC;CACJ","sourcesContent":["import type { Nullable } from \"../../types\";\r\nimport { Observable } from \"../../Misc/observable\";\r\nimport type { NodeParticleBlock } from \"./nodeParticleBlock\";\r\nimport { NodeParticleBlockConnectionPointTypes } from \"./Enums/nodeParticleBlockConnectionPointTypes\";\r\nimport type { NodeParticleBuildState } from \"./nodeParticleBuildState\";\r\nimport type { ParticleInputBlock } from \"./Blocks/particleInputBlock\";\r\n\r\n/**\r\n * Enum used to define the compatibility state between two connection points\r\n */\r\nexport const enum NodeParticleConnectionPointCompatibilityStates {\r\n /** Points are compatibles */\r\n Compatible,\r\n /** Points are incompatible because of their types */\r\n TypeIncompatible,\r\n /** Points are incompatible because they are in the same hierarchy **/\r\n HierarchyIssue,\r\n}\r\n\r\n/**\r\n * Defines the direction of a connection point\r\n */\r\nexport const enum NodeParticleConnectionPointDirection {\r\n /** Input */\r\n Input,\r\n /** Output */\r\n Output,\r\n}\r\n\r\n/**\r\n * Defines a connection point for a block\r\n */\r\nexport class NodeParticleConnectionPoint {\r\n /** @internal */\r\n public _ownerBlock: NodeParticleBlock;\r\n /** @internal */\r\n public _connectedPoint: Nullable<NodeParticleConnectionPoint> = null;\r\n\r\n /** @internal */\r\n public _storedValue: any = null;\r\n /** @internal */\r\n public _storedFunction: Nullable<(state: NodeParticleBuildState) => any> = null;\r\n\r\n /** @internal */\r\n public _acceptedConnectionPointType: Nullable<NodeParticleConnectionPoint> = null;\r\n\r\n private _endpoints = new Array<NodeParticleConnectionPoint>();\r\n private _direction: NodeParticleConnectionPointDirection;\r\n private _type = NodeParticleBlockConnectionPointTypes.Particle;\r\n\r\n /** @internal */\r\n public _linkedConnectionSource: Nullable<NodeParticleConnectionPoint> = null;\r\n\r\n /** @internal */\r\n public _typeConnectionSource: Nullable<NodeParticleConnectionPoint> = null;\r\n\r\n /** @internal */\r\n public _typeConnectionSourceTranslation: Nullable<(source: NodeParticleBlockConnectionPointTypes) => NodeParticleBlockConnectionPointTypes> = null;\r\n\r\n /** @internal */\r\n public _defaultConnectionPointType: Nullable<NodeParticleBlockConnectionPointTypes> = null;\r\n\r\n /** @internal */\r\n public _isMainLinkSource = false;\r\n\r\n /** Gets the direction of the point */\r\n public get direction() {\r\n return this._direction;\r\n }\r\n\r\n /**\r\n * Gets or sets the additional types supported by this connection point\r\n */\r\n public acceptedConnectionPointTypes: NodeParticleBlockConnectionPointTypes[] = [];\r\n\r\n /**\r\n * Gets or sets the additional types excluded by this connection point\r\n */\r\n public excludedConnectionPointTypes: NodeParticleBlockConnectionPointTypes[] = [];\r\n\r\n /**\r\n * Observable triggered when this point is connected\r\n */\r\n public onConnectionObservable = new Observable<NodeParticleConnectionPoint>();\r\n\r\n /**\r\n * Observable triggered when this point is disconnected\r\n */\r\n public onDisconnectionObservable = new Observable<NodeParticleConnectionPoint>();\r\n\r\n /**\r\n * Gets or sets a boolean indicating that this connection point is exposed on a frame\r\n */\r\n public isExposedOnFrame: boolean = false;\r\n\r\n /**\r\n * Gets or sets number indicating the position that the port is exposed to on a frame\r\n */\r\n public exposedPortPosition: number = -1;\r\n\r\n /**\r\n * Gets the default value used for this point at creation time\r\n */\r\n public defaultValue: Nullable<any> = null;\r\n\r\n /**\r\n * Gets or sets the default value used for this point if nothing is connected\r\n */\r\n public value: Nullable<any> = null;\r\n\r\n /**\r\n * Gets or sets the min value accepted for this point if nothing is connected\r\n */\r\n public valueMin: Nullable<any> = null;\r\n\r\n /**\r\n * Gets or sets the max value accepted for this point if nothing is connected\r\n */\r\n public valueMax: Nullable<any> = null;\r\n\r\n /**\r\n * Gets or sets the connection point type (default is float)\r\n */\r\n public get type(): NodeParticleBlockConnectionPointTypes {\r\n if (this._type === NodeParticleBlockConnectionPointTypes.AutoDetect) {\r\n if (this._ownerBlock.isInput) {\r\n return (this._ownerBlock as ParticleInputBlock).type;\r\n }\r\n\r\n if (this._connectedPoint) {\r\n return this._connectedPoint.type;\r\n }\r\n\r\n if (this._linkedConnectionSource) {\r\n if (this._linkedConnectionSource.isConnected) {\r\n return this._linkedConnectionSource.type;\r\n }\r\n if (this._linkedConnectionSource._defaultConnectionPointType) {\r\n return this._linkedConnectionSource._defaultConnectionPointType;\r\n }\r\n }\r\n\r\n if (this._defaultConnectionPointType) {\r\n return this._defaultConnectionPointType;\r\n }\r\n }\r\n\r\n if (this._type === NodeParticleBlockConnectionPointTypes.BasedOnInput) {\r\n if (this._typeConnectionSource) {\r\n if (!this._typeConnectionSource.isConnected && this._defaultConnectionPointType) {\r\n return this._defaultConnectionPointType;\r\n }\r\n if (this._typeConnectionSourceTranslation) {\r\n return this._typeConnectionSourceTranslation(this._typeConnectionSource.type);\r\n }\r\n return this._typeConnectionSource.type;\r\n } else if (this._defaultConnectionPointType) {\r\n return this._defaultConnectionPointType;\r\n }\r\n }\r\n\r\n return this._type;\r\n }\r\n\r\n public set type(value: NodeParticleBlockConnectionPointTypes) {\r\n this._type = value;\r\n }\r\n\r\n /**\r\n * Gets or sets the connection point name\r\n */\r\n public name: string;\r\n\r\n /**\r\n * Gets or sets the connection point display name\r\n */\r\n public displayName: string;\r\n\r\n /**\r\n * Gets or sets a boolean indicating that this connection point can be omitted\r\n */\r\n public isOptional: boolean;\r\n\r\n /**\r\n * Gets a boolean indicating that the current point is connected to another NodeMaterialBlock\r\n */\r\n public get isConnected(): boolean {\r\n return this.connectedPoint !== null || this.hasEndpoints;\r\n }\r\n\r\n /** Get the other side of the connection (if any) */\r\n public get connectedPoint(): Nullable<NodeParticleConnectionPoint> {\r\n return this._connectedPoint;\r\n }\r\n\r\n /** Get the block that owns this connection point */\r\n public get ownerBlock(): NodeParticleBlock {\r\n return this._ownerBlock;\r\n }\r\n\r\n /** Get the block connected on the other side of this connection (if any) */\r\n public get sourceBlock(): Nullable<NodeParticleBlock> {\r\n if (!this._connectedPoint) {\r\n return null;\r\n }\r\n\r\n return this._connectedPoint.ownerBlock;\r\n }\r\n\r\n /** Get the block connected on the endpoints of this connection (if any) */\r\n public get connectedBlocks(): Array<NodeParticleBlock> {\r\n if (this._endpoints.length === 0) {\r\n return [];\r\n }\r\n\r\n return this._endpoints.map((e) => e.ownerBlock);\r\n }\r\n\r\n /** Gets the list of connected endpoints */\r\n public get endpoints() {\r\n return this._endpoints;\r\n }\r\n\r\n /** Gets a boolean indicating if that output point is connected to at least one input */\r\n public get hasEndpoints(): boolean {\r\n return this._endpoints && this._endpoints.length > 0;\r\n }\r\n\r\n /** Get the inner type (ie AutoDetect for instance instead of the inferred one) */\r\n public get innerType() {\r\n if (this._linkedConnectionSource && !this._isMainLinkSource && this._linkedConnectionSource.isConnected) {\r\n return this.type;\r\n }\r\n return this._type;\r\n }\r\n\r\n /**\r\n * Creates a new connection point\r\n * @param name defines the connection point name\r\n * @param ownerBlock defines the block hosting this connection point\r\n * @param direction defines the direction of the connection point\r\n */\r\n public constructor(name: string, ownerBlock: NodeParticleBlock, direction: NodeParticleConnectionPointDirection) {\r\n this._ownerBlock = ownerBlock;\r\n this.name = name;\r\n this._direction = direction;\r\n }\r\n\r\n /**\r\n * Gets the current class name e.g. \"NodeMaterialConnectionPoint\"\r\n * @returns the class name\r\n */\r\n public getClassName(): string {\r\n return \"NodeParticleConnectionPoint\";\r\n }\r\n\r\n /**\r\n * Gets the value represented by this connection point\r\n * @param state current evaluation state\r\n * @returns the connected value or the value if nothing is connected\r\n */\r\n public getConnectedValue(state: NodeParticleBuildState) {\r\n if (this.isConnected) {\r\n if (this._connectedPoint?._storedFunction) {\r\n return this._connectedPoint._storedFunction(state);\r\n }\r\n return this._connectedPoint!._storedValue;\r\n }\r\n return this.value;\r\n }\r\n\r\n /**\r\n * Gets a boolean indicating if the current point can be connected to another point\r\n * @param connectionPoint defines the other connection point\r\n * @returns a boolean\r\n */\r\n public canConnectTo(connectionPoint: NodeParticleConnectionPoint) {\r\n return this.checkCompatibilityState(connectionPoint) === NodeParticleConnectionPointCompatibilityStates.Compatible;\r\n }\r\n\r\n /**\r\n * Gets a number indicating if the current point can be connected to another point\r\n * @param connectionPoint defines the other connection point\r\n * @returns a number defining the compatibility state\r\n */\r\n public checkCompatibilityState(connectionPoint: NodeParticleConnectionPoint): NodeParticleConnectionPointCompatibilityStates {\r\n const ownerBlock = this._ownerBlock;\r\n const otherBlock = connectionPoint.ownerBlock;\r\n\r\n if (this.type !== connectionPoint.type && connectionPoint.innerType !== NodeParticleBlockConnectionPointTypes.AutoDetect) {\r\n // Accepted types\r\n if (connectionPoint.acceptedConnectionPointTypes && connectionPoint.acceptedConnectionPointTypes.indexOf(this.type) !== -1) {\r\n return NodeParticleConnectionPointCompatibilityStates.Compatible;\r\n } else {\r\n return NodeParticleConnectionPointCompatibilityStates.TypeIncompatible;\r\n }\r\n }\r\n\r\n // Excluded\r\n if (connectionPoint.excludedConnectionPointTypes && connectionPoint.excludedConnectionPointTypes.indexOf(this.type) !== -1) {\r\n return NodeParticleConnectionPointCompatibilityStates.TypeIncompatible;\r\n }\r\n\r\n // Check hierarchy\r\n let targetBlock = otherBlock;\r\n let sourceBlock = ownerBlock;\r\n if (this.direction === NodeParticleConnectionPointDirection.Input) {\r\n targetBlock = ownerBlock;\r\n sourceBlock = otherBlock;\r\n }\r\n\r\n if (targetBlock.isAnAncestorOf(sourceBlock)) {\r\n return NodeParticleConnectionPointCompatibilityStates.HierarchyIssue;\r\n }\r\n\r\n return NodeParticleConnectionPointCompatibilityStates.Compatible;\r\n }\r\n\r\n /**\r\n * Connect this point to another connection point\r\n * @param connectionPoint defines the other connection point\r\n * @param ignoreConstraints defines if the system will ignore connection type constraints (default is false)\r\n * @returns the current connection point\r\n */\r\n public connectTo(connectionPoint: NodeParticleConnectionPoint, ignoreConstraints = false): NodeParticleConnectionPoint {\r\n if (!ignoreConstraints && !this.canConnectTo(connectionPoint)) {\r\n // eslint-disable-next-line no-throw-literal\r\n throw `Cannot connect these two connectors. source: \"${this.ownerBlock.name}\".${this.name}, target: \"${connectionPoint.ownerBlock.name}\".${connectionPoint.name}`;\r\n }\r\n\r\n this._endpoints.push(connectionPoint);\r\n connectionPoint._connectedPoint = this;\r\n\r\n this.onConnectionObservable.notifyObservers(connectionPoint);\r\n connectionPoint.onConnectionObservable.notifyObservers(this);\r\n\r\n return this;\r\n }\r\n\r\n /**\r\n * Disconnect this point from one of his endpoint\r\n * @param endpoint defines the other connection point\r\n * @returns the current connection point\r\n */\r\n public disconnectFrom(endpoint: NodeParticleConnectionPoint): NodeParticleConnectionPoint {\r\n const index = this._endpoints.indexOf(endpoint);\r\n\r\n if (index === -1) {\r\n return this;\r\n }\r\n\r\n this._endpoints.splice(index, 1);\r\n endpoint._connectedPoint = null;\r\n\r\n this.onDisconnectionObservable.notifyObservers(endpoint);\r\n endpoint.onDisconnectionObservable.notifyObservers(this);\r\n\r\n return this;\r\n }\r\n\r\n /**\r\n * Fill the list of excluded connection point types with all types other than those passed in the parameter\r\n * @param mask Types (ORed values of NodeMaterialBlockConnectionPointTypes) that are allowed, and thus will not be pushed to the excluded list\r\n */\r\n public addExcludedConnectionPointFromAllowedTypes(mask: number): void {\r\n let bitmask = 1;\r\n while (bitmask < NodeParticleBlockConnectionPointTypes.All) {\r\n if (!(mask & bitmask)) {\r\n this.excludedConnectionPointTypes.push(bitmask);\r\n }\r\n bitmask = bitmask << 1;\r\n }\r\n }\r\n\r\n /**\r\n * Serializes this point in a JSON representation\r\n * @param isInput defines if the connection point is an input (default is true)\r\n * @returns the serialized point object\r\n */\r\n public serialize(isInput = true): any {\r\n const serializationObject: any = {};\r\n\r\n serializationObject.name = this.name;\r\n serializationObject.displayName = this.displayName;\r\n if (this.value !== undefined && this.value !== null) {\r\n if (this.value.asArray) {\r\n serializationObject.valueType = \"BABYLON.\" + this.value.getClassName();\r\n serializationObject.value = this.value.asArray();\r\n } else {\r\n serializationObject.valueType = \"number\";\r\n serializationObject.value = this.value;\r\n }\r\n }\r\n\r\n if (isInput && this.connectedPoint) {\r\n serializationObject.inputName = this.name;\r\n serializationObject.targetBlockId = this.connectedPoint.ownerBlock.uniqueId;\r\n serializationObject.targetConnectionName = this.connectedPoint.name;\r\n serializationObject.isExposedOnFrame = true;\r\n serializationObject.exposedPortPosition = this.exposedPortPosition;\r\n }\r\n\r\n if (this.isExposedOnFrame || this.exposedPortPosition >= 0) {\r\n serializationObject.isExposedOnFrame = true;\r\n serializationObject.exposedPortPosition = this.exposedPortPosition;\r\n }\r\n\r\n return serializationObject;\r\n }\r\n\r\n /**\r\n * Release resources\r\n */\r\n public dispose() {\r\n this.onConnectionObservable.clear();\r\n this.onDisconnectionObservable.clear();\r\n }\r\n}\r\n"]}
@@ -0,0 +1,89 @@
1
+ import type { Scene } from "../../scene.js";
2
+ import type { NodeParticleConnectionPoint } from "./nodeParticleBlockConnectionPoint.js";
3
+ import { NodeParticleContextualSources } from "./Enums/nodeParticleContextualSources.js";
4
+ import type { Particle } from "../particle.js";
5
+ import type { Nullable } from "../../types.js";
6
+ import { NodeParticleBlockConnectionPointTypes } from "./Enums/nodeParticleBlockConnectionPointTypes.js";
7
+ import { Vector2, Vector3 } from "../../Maths/math.vector.js";
8
+ import type { ThinParticleSystem } from "../thinParticleSystem.js";
9
+ import { Color4 } from "../../Maths/math.color.js";
10
+ import { NodeParticleSystemSources } from "./Enums/nodeParticleSystemSources.js";
11
+ import type { AbstractMesh } from "../../Meshes/abstractMesh.js";
12
+ /**
13
+ * Class used to store node based geometry build state
14
+ */
15
+ export declare class NodeParticleBuildState {
16
+ /**
17
+ * Gets the capactity of the particle system to build
18
+ */
19
+ capacity: number;
20
+ /**
21
+ * Gets the scene where the particle system is built
22
+ */
23
+ scene: Scene;
24
+ /** Gets or sets the build identifier */
25
+ buildId: number;
26
+ /** Gets or sets the list of non connected mandatory inputs */
27
+ notConnectedNonOptionalInputs: NodeParticleConnectionPoint[];
28
+ /** Gets or sets a boolean indicating that verbose mode is on */
29
+ verbose: boolean;
30
+ /**
31
+ * Gets or sets the particle context for contextual data
32
+ */
33
+ particleContext: Nullable<Particle>;
34
+ /**
35
+ * Gets or sets the system context for contextual data
36
+ */
37
+ systemContext: Nullable<ThinParticleSystem>;
38
+ /**
39
+ * Gets or sets the index of the gradient to use
40
+ */
41
+ gradientIndex: number;
42
+ /**
43
+ * Gets or sets next gradient in line
44
+ */
45
+ nextGradientIndex: number;
46
+ /**
47
+ * Gets or sets the next gradient value
48
+ */
49
+ nextGradientValue: any;
50
+ /**
51
+ * Emits errors if any
52
+ */
53
+ emitErrors(): void;
54
+ /**
55
+ * Adapt a value to a target type
56
+ * @param source defines the value to adapt
57
+ * @param targetType defines the target type
58
+ * @returns the adapted value
59
+ */
60
+ adapt(source: NodeParticleConnectionPoint, targetType: NodeParticleBlockConnectionPointTypes): any;
61
+ /**
62
+ * Gets the value associated with a contextual source
63
+ * @param source Source of the contextual value
64
+ * @returns the value associated with the source
65
+ */
66
+ getContextualValue(source: NodeParticleContextualSources): number | Vector3 | Color4 | Vector2 | null;
67
+ /**
68
+ * Gets a boolean indicating if the emitter is a transform node (or a simple vector3)
69
+ */
70
+ get isEmitterTransformNode(): boolean;
71
+ /**
72
+ * Gets the emitter world matrix
73
+ */
74
+ get emitterWorldMatrix(): import("../../Maths/math.vector.js").Matrix | null;
75
+ /**
76
+ * Gets the emitter inverse world matrix
77
+ */
78
+ get emitterInverseWorldMatrix(): import("../../Maths/math.vector.js").Matrix | null;
79
+ /**
80
+ * Gets the emitter position
81
+ */
82
+ get emitterPosition(): Vector3 | null;
83
+ /**
84
+ * Gets the value associated with a system source
85
+ * @param source Source of the system value
86
+ * @returns the value associated with the source
87
+ */
88
+ getSystemValue(source: NodeParticleSystemSources): number | Nullable<Vector3 | AbstractMesh>;
89
+ }
@@ -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