@onerjs/core 8.41.5 → 8.41.7

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 (579) hide show
  1. package/Animations/animation.d.ts +6 -2
  2. package/Animations/animation.js +28 -4
  3. package/Animations/animation.js.map +1 -1
  4. package/Animations/animationGroup.d.ts +2 -1
  5. package/Animations/animationGroup.js +3 -2
  6. package/Animations/animationGroup.js.map +1 -1
  7. package/Animations/animatorAvatar.d.ts +161 -0
  8. package/Animations/animatorAvatar.js +573 -0
  9. package/Animations/animatorAvatar.js.map +1 -0
  10. package/Animations/index.d.ts +1 -0
  11. package/Animations/index.js +1 -0
  12. package/Animations/index.js.map +1 -1
  13. package/AudioV2/webAudio/webAudioSoundSource.d.ts +2 -2
  14. package/AudioV2/webAudio/webAudioSoundSource.js +12 -2
  15. package/AudioV2/webAudio/webAudioSoundSource.js.map +1 -1
  16. package/Bones/index.d.ts +1 -0
  17. package/Bones/index.js +1 -0
  18. package/Bones/index.js.map +1 -1
  19. package/Bones/skeleton.d.ts +13 -0
  20. package/Bones/skeleton.functions.d.ts +26 -0
  21. package/Bones/skeleton.functions.js +91 -0
  22. package/Bones/skeleton.functions.js.map +1 -0
  23. package/Bones/skeleton.js +26 -0
  24. package/Bones/skeleton.js.map +1 -1
  25. package/Cameras/Inputs/geospatialCameraPointersInput.d.ts +16 -0
  26. package/Cameras/Inputs/geospatialCameraPointersInput.js +19 -3
  27. package/Cameras/Inputs/geospatialCameraPointersInput.js.map +1 -1
  28. package/Cameras/Limits/geospatialLimits.d.ts +0 -6
  29. package/Cameras/Limits/geospatialLimits.js +0 -6
  30. package/Cameras/Limits/geospatialLimits.js.map +1 -1
  31. package/Cameras/geospatialCamera.d.ts +5 -0
  32. package/Cameras/geospatialCamera.js +54 -25
  33. package/Cameras/geospatialCamera.js.map +1 -1
  34. package/Cameras/geospatialCameraMovement.d.ts +8 -1
  35. package/Cameras/geospatialCameraMovement.js +29 -8
  36. package/Cameras/geospatialCameraMovement.js.map +1 -1
  37. package/Collisions/gpuPicker.d.ts +11 -0
  38. package/Collisions/gpuPicker.js +148 -19
  39. package/Collisions/gpuPicker.js.map +1 -1
  40. package/Debug/skeletonViewer.d.ts +4 -8
  41. package/Debug/skeletonViewer.js +13 -22
  42. package/Debug/skeletonViewer.js.map +1 -1
  43. package/Engines/Extensions/engine.multiview.d.ts +2 -0
  44. package/Engines/Extensions/engine.multiview.js +7 -3
  45. package/Engines/Extensions/engine.multiview.js.map +1 -1
  46. package/Engines/abstractEngine.d.ts +2 -2
  47. package/Engines/abstractEngine.js +2 -2
  48. package/Engines/abstractEngine.js.map +1 -1
  49. package/Engines/constants.d.ts +4 -0
  50. package/Engines/constants.js +4 -0
  51. package/Engines/constants.js.map +1 -1
  52. package/Engines/webgpuEngine.d.ts +1 -4
  53. package/Engines/webgpuEngine.js +8 -6
  54. package/Engines/webgpuEngine.js.map +1 -1
  55. package/FrameGraph/frameGraphContext.js +1 -1
  56. package/FrameGraph/frameGraphContext.js.map +1 -1
  57. package/FrameGraph/frameGraphRenderContext.js +2 -2
  58. package/FrameGraph/frameGraphRenderContext.js.map +1 -1
  59. package/Instrumentation/engineInstrumentation.js +2 -1
  60. package/Instrumentation/engineInstrumentation.js.map +1 -1
  61. package/Layers/effectLayer.js +1 -3
  62. package/Layers/effectLayer.js.map +1 -1
  63. package/Lights/Shadows/cascadedShadowGenerator.js +2 -2
  64. package/Lights/Shadows/cascadedShadowGenerator.js.map +1 -1
  65. package/Lights/Shadows/shadowGenerator.js +3 -4
  66. package/Lights/Shadows/shadowGenerator.js.map +1 -1
  67. package/Lights/lightingVolume.js +1 -1
  68. package/Lights/lightingVolume.js.map +1 -1
  69. package/Materials/Background/backgroundMaterial.js +37 -2
  70. package/Materials/Background/backgroundMaterial.js.map +1 -1
  71. package/Materials/GaussianSplatting/gaussianSplattingGpuPickingMaterialPlugin.d.ts +109 -0
  72. package/Materials/GaussianSplatting/gaussianSplattingGpuPickingMaterialPlugin.js +210 -0
  73. package/Materials/GaussianSplatting/gaussianSplattingGpuPickingMaterialPlugin.js.map +1 -0
  74. package/Materials/GaussianSplatting/gaussianSplattingMaterial.d.ts +1 -0
  75. package/Materials/GaussianSplatting/gaussianSplattingMaterial.js +71 -15
  76. package/Materials/GaussianSplatting/gaussianSplattingMaterial.js.map +1 -1
  77. package/Materials/GaussianSplatting/gaussianSplattingSolidColorMaterialPlugin.d.ts +86 -0
  78. package/Materials/GaussianSplatting/gaussianSplattingSolidColorMaterialPlugin.js +161 -0
  79. package/Materials/GaussianSplatting/gaussianSplattingSolidColorMaterialPlugin.js.map +1 -0
  80. package/Materials/GreasedLine/greasedLinePluginMaterial.js +0 -6
  81. package/Materials/GreasedLine/greasedLinePluginMaterial.js.map +1 -1
  82. package/Materials/GreasedLine/greasedLinePluginMaterialShadersGLSL.js +0 -1
  83. package/Materials/GreasedLine/greasedLinePluginMaterialShadersGLSL.js.map +1 -1
  84. package/Materials/GreasedLine/greasedLinePluginMaterialShadersWGSL.js +0 -1
  85. package/Materials/GreasedLine/greasedLinePluginMaterialShadersWGSL.js.map +1 -1
  86. package/Materials/Node/Blocks/Dual/clipPlanesBlock.d.ts +14 -0
  87. package/Materials/Node/Blocks/Dual/clipPlanesBlock.js +14 -0
  88. package/Materials/Node/Blocks/Dual/clipPlanesBlock.js.map +1 -1
  89. package/Materials/Node/Blocks/Dual/currentScreenBlock.d.ts +20 -1
  90. package/Materials/Node/Blocks/Dual/currentScreenBlock.js +20 -1
  91. package/Materials/Node/Blocks/Dual/currentScreenBlock.js.map +1 -1
  92. package/Materials/Node/Blocks/Dual/depthSourceBlock.d.ts +13 -0
  93. package/Materials/Node/Blocks/Dual/depthSourceBlock.js +13 -0
  94. package/Materials/Node/Blocks/Dual/depthSourceBlock.js.map +1 -1
  95. package/Materials/Node/Blocks/Dual/fogBlock.d.ts +21 -0
  96. package/Materials/Node/Blocks/Dual/fogBlock.js +21 -0
  97. package/Materials/Node/Blocks/Dual/fogBlock.js.map +1 -1
  98. package/Materials/Node/Blocks/Dual/imageSourceBlock.d.ts +21 -0
  99. package/Materials/Node/Blocks/Dual/imageSourceBlock.js +21 -0
  100. package/Materials/Node/Blocks/Dual/imageSourceBlock.js.map +1 -1
  101. package/Materials/Node/Blocks/Dual/lightBlock.d.ts +38 -0
  102. package/Materials/Node/Blocks/Dual/lightBlock.js +38 -0
  103. package/Materials/Node/Blocks/Dual/lightBlock.js.map +1 -1
  104. package/Materials/Node/Blocks/Dual/reflectionTextureBaseBlock.d.ts +29 -0
  105. package/Materials/Node/Blocks/Dual/reflectionTextureBaseBlock.js +29 -0
  106. package/Materials/Node/Blocks/Dual/reflectionTextureBaseBlock.js.map +1 -1
  107. package/Materials/Node/Blocks/Dual/reflectionTextureBlock.d.ts +5 -0
  108. package/Materials/Node/Blocks/Dual/reflectionTextureBlock.js +5 -0
  109. package/Materials/Node/Blocks/Dual/reflectionTextureBlock.js.map +1 -1
  110. package/Materials/Node/Blocks/Dual/sceneDepthBlock.d.ts +16 -0
  111. package/Materials/Node/Blocks/Dual/sceneDepthBlock.js +16 -0
  112. package/Materials/Node/Blocks/Dual/sceneDepthBlock.js.map +1 -1
  113. package/Materials/Node/Blocks/Dual/smartFilterTextureBlock.d.ts +16 -0
  114. package/Materials/Node/Blocks/Dual/smartFilterTextureBlock.js +16 -0
  115. package/Materials/Node/Blocks/Dual/smartFilterTextureBlock.js.map +1 -1
  116. package/Materials/Node/Blocks/Dual/textureBlock.d.ts +34 -0
  117. package/Materials/Node/Blocks/Dual/textureBlock.js +34 -0
  118. package/Materials/Node/Blocks/Dual/textureBlock.js.map +1 -1
  119. package/Materials/Node/Blocks/Fragment/TBNBlock.d.ts +17 -0
  120. package/Materials/Node/Blocks/Fragment/TBNBlock.js +17 -2
  121. package/Materials/Node/Blocks/Fragment/TBNBlock.js.map +1 -1
  122. package/Materials/Node/Blocks/Fragment/ambientOcclusionBlock.d.ts +7 -0
  123. package/Materials/Node/Blocks/Fragment/ambientOcclusionBlock.js +7 -0
  124. package/Materials/Node/Blocks/Fragment/ambientOcclusionBlock.js.map +1 -1
  125. package/Materials/Node/Blocks/Fragment/fragmentOutputBlock.d.ts +21 -0
  126. package/Materials/Node/Blocks/Fragment/fragmentOutputBlock.js +21 -0
  127. package/Materials/Node/Blocks/Fragment/fragmentOutputBlock.js.map +1 -1
  128. package/Materials/Node/Blocks/Fragment/heightToNormalBlock.d.ts +10 -0
  129. package/Materials/Node/Blocks/Fragment/heightToNormalBlock.js +10 -0
  130. package/Materials/Node/Blocks/Fragment/heightToNormalBlock.js.map +1 -1
  131. package/Materials/Node/Blocks/Fragment/imageProcessingBlock.d.ts +28 -0
  132. package/Materials/Node/Blocks/Fragment/imageProcessingBlock.js +28 -0
  133. package/Materials/Node/Blocks/Fragment/imageProcessingBlock.js.map +1 -1
  134. package/Materials/Node/Blocks/Fragment/perturbNormalBlock.d.ts +30 -0
  135. package/Materials/Node/Blocks/Fragment/perturbNormalBlock.js +30 -1
  136. package/Materials/Node/Blocks/Fragment/perturbNormalBlock.js.map +1 -1
  137. package/Materials/Node/Blocks/Fragment/screenSizeBlock.d.ts +4 -0
  138. package/Materials/Node/Blocks/Fragment/screenSizeBlock.js +4 -0
  139. package/Materials/Node/Blocks/Fragment/screenSizeBlock.js.map +1 -1
  140. package/Materials/Node/Blocks/Fragment/screenSpaceBlock.d.ts +5 -0
  141. package/Materials/Node/Blocks/Fragment/screenSpaceBlock.js +5 -0
  142. package/Materials/Node/Blocks/Fragment/screenSpaceBlock.js.map +1 -1
  143. package/Materials/Node/Blocks/Fragment/twirlBlock.d.ts +3 -0
  144. package/Materials/Node/Blocks/Fragment/twirlBlock.js +3 -0
  145. package/Materials/Node/Blocks/Fragment/twirlBlock.js.map +1 -1
  146. package/Materials/Node/Blocks/GaussianSplatting/splatReaderBlock.d.ts +6 -0
  147. package/Materials/Node/Blocks/GaussianSplatting/splatReaderBlock.js +6 -0
  148. package/Materials/Node/Blocks/GaussianSplatting/splatReaderBlock.js.map +1 -1
  149. package/Materials/Node/Blocks/Input/inputBlock.d.ts +16 -0
  150. package/Materials/Node/Blocks/Input/inputBlock.js +16 -1
  151. package/Materials/Node/Blocks/Input/inputBlock.js.map +1 -1
  152. package/Materials/Node/Blocks/Input/prePassTextureBlock.d.ts +5 -0
  153. package/Materials/Node/Blocks/Input/prePassTextureBlock.js +5 -0
  154. package/Materials/Node/Blocks/Input/prePassTextureBlock.js.map +1 -1
  155. package/Materials/Node/Blocks/PBR/anisotropyBlock.d.ts +10 -0
  156. package/Materials/Node/Blocks/PBR/anisotropyBlock.js +10 -1
  157. package/Materials/Node/Blocks/PBR/anisotropyBlock.js.map +1 -1
  158. package/Materials/Node/Blocks/PBR/clearCoatBlock.d.ts +23 -0
  159. package/Materials/Node/Blocks/PBR/clearCoatBlock.js +23 -1
  160. package/Materials/Node/Blocks/PBR/clearCoatBlock.js.map +1 -1
  161. package/Materials/Node/Blocks/PBR/iridescenceBlock.d.ts +17 -0
  162. package/Materials/Node/Blocks/PBR/iridescenceBlock.js +17 -0
  163. package/Materials/Node/Blocks/PBR/iridescenceBlock.js.map +1 -1
  164. package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.d.ts +41 -0
  165. package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.js +41 -0
  166. package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.js.map +1 -1
  167. package/Materials/Node/Blocks/PBR/reflectionBlock.d.ts +21 -0
  168. package/Materials/Node/Blocks/PBR/reflectionBlock.js +21 -0
  169. package/Materials/Node/Blocks/PBR/reflectionBlock.js.map +1 -1
  170. package/Materials/Node/Blocks/PBR/refractionBlock.d.ts +29 -0
  171. package/Materials/Node/Blocks/PBR/refractionBlock.js +29 -0
  172. package/Materials/Node/Blocks/PBR/refractionBlock.js.map +1 -1
  173. package/Materials/Node/Blocks/PBR/sheenBlock.d.ts +14 -0
  174. package/Materials/Node/Blocks/PBR/sheenBlock.js +14 -0
  175. package/Materials/Node/Blocks/PBR/sheenBlock.js.map +1 -1
  176. package/Materials/Node/Blocks/PBR/subSurfaceBlock.d.ts +7 -0
  177. package/Materials/Node/Blocks/PBR/subSurfaceBlock.js +7 -0
  178. package/Materials/Node/Blocks/PBR/subSurfaceBlock.js.map +1 -1
  179. package/Materials/Node/Blocks/Particle/particleTextureBlock.d.ts +23 -0
  180. package/Materials/Node/Blocks/Particle/particleTextureBlock.js +23 -0
  181. package/Materials/Node/Blocks/Particle/particleTextureBlock.js.map +1 -1
  182. package/Materials/Node/Blocks/Teleport/teleportInBlock.d.ts +6 -0
  183. package/Materials/Node/Blocks/Teleport/teleportInBlock.js +6 -0
  184. package/Materials/Node/Blocks/Teleport/teleportInBlock.js.map +1 -1
  185. package/Materials/Node/Blocks/Teleport/teleportOutBlock.d.ts +17 -0
  186. package/Materials/Node/Blocks/Teleport/teleportOutBlock.js +17 -0
  187. package/Materials/Node/Blocks/Teleport/teleportOutBlock.js.map +1 -1
  188. package/Materials/Node/Blocks/Vertex/bonesBlock.d.ts +22 -0
  189. package/Materials/Node/Blocks/Vertex/bonesBlock.js +22 -0
  190. package/Materials/Node/Blocks/Vertex/bonesBlock.js.map +1 -1
  191. package/Materials/Node/Blocks/Vertex/instancesBlock.d.ts +13 -0
  192. package/Materials/Node/Blocks/Vertex/instancesBlock.js +13 -0
  193. package/Materials/Node/Blocks/Vertex/instancesBlock.js.map +1 -1
  194. package/Materials/Node/Blocks/Vertex/lightInformationBlock.d.ts +20 -0
  195. package/Materials/Node/Blocks/Vertex/lightInformationBlock.js +20 -0
  196. package/Materials/Node/Blocks/Vertex/lightInformationBlock.js.map +1 -1
  197. package/Materials/Node/Blocks/Vertex/morphTargetsBlock.d.ts +27 -0
  198. package/Materials/Node/Blocks/Vertex/morphTargetsBlock.js +27 -0
  199. package/Materials/Node/Blocks/Vertex/morphTargetsBlock.js.map +1 -1
  200. package/Materials/Node/Blocks/clampBlock.d.ts +10 -0
  201. package/Materials/Node/Blocks/clampBlock.js +10 -0
  202. package/Materials/Node/Blocks/clampBlock.js.map +1 -1
  203. package/Materials/Node/Blocks/cloudBlock.d.ts +10 -0
  204. package/Materials/Node/Blocks/cloudBlock.js +10 -0
  205. package/Materials/Node/Blocks/cloudBlock.js.map +1 -1
  206. package/Materials/Node/Blocks/colorMergerBlock.d.ts +10 -0
  207. package/Materials/Node/Blocks/colorMergerBlock.js +10 -0
  208. package/Materials/Node/Blocks/colorMergerBlock.js.map +1 -1
  209. package/Materials/Node/Blocks/conditionalBlock.d.ts +14 -0
  210. package/Materials/Node/Blocks/conditionalBlock.js +14 -0
  211. package/Materials/Node/Blocks/conditionalBlock.js.map +1 -1
  212. package/Materials/Node/Blocks/curveBlock.d.ts +10 -0
  213. package/Materials/Node/Blocks/curveBlock.js +10 -0
  214. package/Materials/Node/Blocks/curveBlock.js.map +1 -1
  215. package/Materials/Node/Blocks/customBlock.d.ts +10 -0
  216. package/Materials/Node/Blocks/customBlock.js +10 -0
  217. package/Materials/Node/Blocks/customBlock.js.map +1 -1
  218. package/Materials/Node/Blocks/debugBlock.d.ts +10 -0
  219. package/Materials/Node/Blocks/debugBlock.js +10 -0
  220. package/Materials/Node/Blocks/debugBlock.js.map +1 -1
  221. package/Materials/Node/Blocks/fresnelBlock.d.ts +4 -0
  222. package/Materials/Node/Blocks/fresnelBlock.js +4 -0
  223. package/Materials/Node/Blocks/fresnelBlock.js.map +1 -1
  224. package/Materials/Node/Blocks/gradientBlock.d.ts +10 -0
  225. package/Materials/Node/Blocks/gradientBlock.js +10 -0
  226. package/Materials/Node/Blocks/gradientBlock.js.map +1 -1
  227. package/Materials/Node/Blocks/loopBlock.d.ts +10 -0
  228. package/Materials/Node/Blocks/loopBlock.js +10 -0
  229. package/Materials/Node/Blocks/loopBlock.js.map +1 -1
  230. package/Materials/Node/Blocks/matrixBuilderBlock.d.ts +1 -0
  231. package/Materials/Node/Blocks/matrixBuilderBlock.js +1 -0
  232. package/Materials/Node/Blocks/matrixBuilderBlock.js.map +1 -1
  233. package/Materials/Node/Blocks/meshAttributeExistsBlock.d.ts +10 -0
  234. package/Materials/Node/Blocks/meshAttributeExistsBlock.js +10 -0
  235. package/Materials/Node/Blocks/meshAttributeExistsBlock.js.map +1 -1
  236. package/Materials/Node/Blocks/pannerBlock.d.ts +5 -0
  237. package/Materials/Node/Blocks/pannerBlock.js +5 -0
  238. package/Materials/Node/Blocks/pannerBlock.js.map +1 -1
  239. package/Materials/Node/Blocks/remapBlock.d.ts +10 -0
  240. package/Materials/Node/Blocks/remapBlock.js +10 -0
  241. package/Materials/Node/Blocks/remapBlock.js.map +1 -1
  242. package/Materials/Node/Blocks/rotate2dBlock.d.ts +1 -0
  243. package/Materials/Node/Blocks/rotate2dBlock.js +1 -0
  244. package/Materials/Node/Blocks/rotate2dBlock.js.map +1 -1
  245. package/Materials/Node/Blocks/transformBlock.d.ts +10 -0
  246. package/Materials/Node/Blocks/transformBlock.js +10 -0
  247. package/Materials/Node/Blocks/transformBlock.js.map +1 -1
  248. package/Materials/Node/Blocks/triPlanarBlock.d.ts +22 -0
  249. package/Materials/Node/Blocks/triPlanarBlock.js +22 -0
  250. package/Materials/Node/Blocks/triPlanarBlock.js.map +1 -1
  251. package/Materials/Node/Blocks/trigonometryBlock.d.ts +10 -0
  252. package/Materials/Node/Blocks/trigonometryBlock.js +10 -0
  253. package/Materials/Node/Blocks/trigonometryBlock.js.map +1 -1
  254. package/Materials/Node/Blocks/vectorMergerBlock.d.ts +10 -0
  255. package/Materials/Node/Blocks/vectorMergerBlock.js +10 -0
  256. package/Materials/Node/Blocks/vectorMergerBlock.js.map +1 -1
  257. package/Materials/Node/Blocks/viewDirectionBlock.d.ts +5 -0
  258. package/Materials/Node/Blocks/viewDirectionBlock.js +5 -0
  259. package/Materials/Node/Blocks/viewDirectionBlock.js.map +1 -1
  260. package/Materials/Node/Blocks/waveBlock.d.ts +10 -0
  261. package/Materials/Node/Blocks/waveBlock.js +10 -0
  262. package/Materials/Node/Blocks/waveBlock.js.map +1 -1
  263. package/Materials/Node/Blocks/worleyNoise3DBlock.d.ts +1 -0
  264. package/Materials/Node/Blocks/worleyNoise3DBlock.js +1 -0
  265. package/Materials/Node/Blocks/worleyNoise3DBlock.js.map +1 -1
  266. package/Materials/Node/nodeMaterial.d.ts +13 -0
  267. package/Materials/Node/nodeMaterial.js +14 -2
  268. package/Materials/Node/nodeMaterial.js.map +1 -1
  269. package/Materials/Node/nodeMaterialBlock.d.ts +0 -3
  270. package/Materials/Node/nodeMaterialBlock.js +1 -6
  271. package/Materials/Node/nodeMaterialBlock.js.map +1 -1
  272. package/Materials/Node/nodeMaterialBlockConnectionPoint.js +1 -2
  273. package/Materials/Node/nodeMaterialBlockConnectionPoint.js.map +1 -1
  274. package/Materials/Textures/Procedurals/proceduralTexture.js +1 -1
  275. package/Materials/Textures/Procedurals/proceduralTexture.js.map +1 -1
  276. package/Materials/Textures/mirrorTexture.js +1 -1
  277. package/Materials/Textures/mirrorTexture.js.map +1 -1
  278. package/Materials/index.d.ts +2 -0
  279. package/Materials/index.js +2 -0
  280. package/Materials/index.js.map +1 -1
  281. package/Maths/math.constants.d.ts +2 -1
  282. package/Maths/math.constants.js +3 -2
  283. package/Maths/math.constants.js.map +1 -1
  284. package/Meshes/Builders/capsuleBuilder.js +0 -3
  285. package/Meshes/Builders/capsuleBuilder.js.map +1 -1
  286. package/Meshes/Builders/cylinderBuilder.d.ts +1 -1
  287. package/Meshes/Builders/cylinderBuilder.js +1 -2
  288. package/Meshes/Builders/cylinderBuilder.js.map +1 -1
  289. package/Meshes/Builders/decalBuilder.js +2 -0
  290. package/Meshes/Builders/decalBuilder.js.map +1 -1
  291. package/Meshes/Builders/discBuilder.js +0 -1
  292. package/Meshes/Builders/discBuilder.js.map +1 -1
  293. package/Meshes/Builders/groundBuilder.d.ts +50 -54
  294. package/Meshes/Builders/groundBuilder.js +50 -54
  295. package/Meshes/Builders/groundBuilder.js.map +1 -1
  296. package/Meshes/Builders/tiledBoxBuilder.d.ts +0 -26
  297. package/Meshes/Builders/tiledBoxBuilder.js +0 -26
  298. package/Meshes/Builders/tiledBoxBuilder.js.map +1 -1
  299. package/Meshes/Builders/tiledPlaneBuilder.d.ts +0 -25
  300. package/Meshes/Builders/tiledPlaneBuilder.js +0 -25
  301. package/Meshes/Builders/tiledPlaneBuilder.js.map +1 -1
  302. package/Meshes/Builders/torusBuilder.d.ts +0 -13
  303. package/Meshes/Builders/torusBuilder.js +0 -13
  304. package/Meshes/Builders/torusBuilder.js.map +1 -1
  305. package/Meshes/Builders/torusKnotBuilder.d.ts +0 -19
  306. package/Meshes/Builders/torusKnotBuilder.js +0 -19
  307. package/Meshes/Builders/torusKnotBuilder.js.map +1 -1
  308. package/Meshes/Compression/dracoCompressionWorker.js.map +1 -1
  309. package/Meshes/Compression/dracoDecoder.js.map +1 -1
  310. package/Meshes/Compression/dracoDecoder.types.d.ts +11 -0
  311. package/Meshes/Compression/dracoDecoder.types.js.map +1 -1
  312. package/Meshes/Compression/dracoEncoder.js.map +1 -1
  313. package/Meshes/Compression/meshoptCompression.js +0 -2
  314. package/Meshes/Compression/meshoptCompression.js.map +1 -1
  315. package/Meshes/GaussianSplatting/gaussianSplattingMesh.js +17 -1
  316. package/Meshes/GaussianSplatting/gaussianSplattingMesh.js.map +1 -1
  317. package/Meshes/GreasedLine/greasedLineRibbonMesh.js +0 -8
  318. package/Meshes/GreasedLine/greasedLineRibbonMesh.js.map +1 -1
  319. package/Meshes/Node/Blocks/Instances/instantiateBaseBlock.d.ts +1 -0
  320. package/Meshes/Node/Blocks/Instances/instantiateBaseBlock.js +1 -0
  321. package/Meshes/Node/Blocks/Instances/instantiateBaseBlock.js.map +1 -1
  322. package/Meshes/Node/Blocks/Instances/instantiateOnFacesBlock.d.ts +1 -0
  323. package/Meshes/Node/Blocks/Instances/instantiateOnFacesBlock.js +1 -0
  324. package/Meshes/Node/Blocks/Instances/instantiateOnFacesBlock.js.map +1 -1
  325. package/Meshes/Node/Blocks/Instances/instantiateOnVerticesBlock.d.ts +1 -0
  326. package/Meshes/Node/Blocks/Instances/instantiateOnVerticesBlock.js +1 -0
  327. package/Meshes/Node/Blocks/Instances/instantiateOnVerticesBlock.js.map +1 -1
  328. package/Meshes/Node/Blocks/Instances/instantiateOnVolumeBlock.d.ts +1 -0
  329. package/Meshes/Node/Blocks/Instances/instantiateOnVolumeBlock.js +1 -0
  330. package/Meshes/Node/Blocks/Instances/instantiateOnVolumeBlock.js.map +1 -1
  331. package/Meshes/Node/Blocks/Matrices/scalingBlock.d.ts +1 -0
  332. package/Meshes/Node/Blocks/Matrices/scalingBlock.js +1 -0
  333. package/Meshes/Node/Blocks/Matrices/scalingBlock.js.map +1 -1
  334. package/Meshes/Node/Blocks/Matrices/translationBlock.d.ts +1 -0
  335. package/Meshes/Node/Blocks/Matrices/translationBlock.js +1 -0
  336. package/Meshes/Node/Blocks/Matrices/translationBlock.js.map +1 -1
  337. package/Meshes/Node/Blocks/Set/aggregatorBlock.d.ts +1 -0
  338. package/Meshes/Node/Blocks/Set/aggregatorBlock.js +1 -0
  339. package/Meshes/Node/Blocks/Set/aggregatorBlock.js.map +1 -1
  340. package/Meshes/Node/Blocks/Set/latticeBlock.d.ts +1 -0
  341. package/Meshes/Node/Blocks/Set/latticeBlock.js +1 -0
  342. package/Meshes/Node/Blocks/Set/latticeBlock.js.map +1 -1
  343. package/Meshes/Node/Blocks/Set/setColorsBlock.d.ts +1 -0
  344. package/Meshes/Node/Blocks/Set/setColorsBlock.js +1 -0
  345. package/Meshes/Node/Blocks/Set/setColorsBlock.js.map +1 -1
  346. package/Meshes/Node/Blocks/Set/setMaterialIDBlock.d.ts +1 -0
  347. package/Meshes/Node/Blocks/Set/setMaterialIDBlock.js +1 -0
  348. package/Meshes/Node/Blocks/Set/setMaterialIDBlock.js.map +1 -1
  349. package/Meshes/Node/Blocks/Set/setNormalsBlock.d.ts +1 -0
  350. package/Meshes/Node/Blocks/Set/setNormalsBlock.js +1 -0
  351. package/Meshes/Node/Blocks/Set/setNormalsBlock.js.map +1 -1
  352. package/Meshes/Node/Blocks/Set/setPositionsBlock.d.ts +1 -0
  353. package/Meshes/Node/Blocks/Set/setPositionsBlock.js +1 -0
  354. package/Meshes/Node/Blocks/Set/setPositionsBlock.js.map +1 -1
  355. package/Meshes/Node/Blocks/Set/setTangentsBlock.d.ts +1 -0
  356. package/Meshes/Node/Blocks/Set/setTangentsBlock.js +1 -0
  357. package/Meshes/Node/Blocks/Set/setTangentsBlock.js.map +1 -1
  358. package/Meshes/Node/Blocks/Set/setUVsBlock.d.ts +1 -0
  359. package/Meshes/Node/Blocks/Set/setUVsBlock.js +1 -0
  360. package/Meshes/Node/Blocks/Set/setUVsBlock.js.map +1 -1
  361. package/Meshes/Node/Blocks/Sources/boxBlock.d.ts +2 -0
  362. package/Meshes/Node/Blocks/Sources/boxBlock.js +2 -0
  363. package/Meshes/Node/Blocks/Sources/boxBlock.js.map +1 -1
  364. package/Meshes/Node/Blocks/Sources/capsuleBlock.d.ts +2 -0
  365. package/Meshes/Node/Blocks/Sources/capsuleBlock.js +2 -0
  366. package/Meshes/Node/Blocks/Sources/capsuleBlock.js.map +1 -1
  367. package/Meshes/Node/Blocks/Sources/cylinderBlock.d.ts +2 -0
  368. package/Meshes/Node/Blocks/Sources/cylinderBlock.js +2 -0
  369. package/Meshes/Node/Blocks/Sources/cylinderBlock.js.map +1 -1
  370. package/Meshes/Node/Blocks/Sources/discBlock.d.ts +2 -0
  371. package/Meshes/Node/Blocks/Sources/discBlock.js +2 -0
  372. package/Meshes/Node/Blocks/Sources/discBlock.js.map +1 -1
  373. package/Meshes/Node/Blocks/Sources/gridBlock.d.ts +2 -0
  374. package/Meshes/Node/Blocks/Sources/gridBlock.js +2 -0
  375. package/Meshes/Node/Blocks/Sources/gridBlock.js.map +1 -1
  376. package/Meshes/Node/Blocks/Sources/icoSphereBlock.d.ts +2 -0
  377. package/Meshes/Node/Blocks/Sources/icoSphereBlock.js +2 -0
  378. package/Meshes/Node/Blocks/Sources/icoSphereBlock.js.map +1 -1
  379. package/Meshes/Node/Blocks/Sources/meshBlock.d.ts +1 -0
  380. package/Meshes/Node/Blocks/Sources/meshBlock.js +1 -0
  381. package/Meshes/Node/Blocks/Sources/meshBlock.js.map +1 -1
  382. package/Meshes/Node/Blocks/Sources/planeBlock.d.ts +2 -0
  383. package/Meshes/Node/Blocks/Sources/planeBlock.js +2 -0
  384. package/Meshes/Node/Blocks/Sources/planeBlock.js.map +1 -1
  385. package/Meshes/Node/Blocks/Sources/pointListBlock.d.ts +2 -1
  386. package/Meshes/Node/Blocks/Sources/pointListBlock.js +2 -1
  387. package/Meshes/Node/Blocks/Sources/pointListBlock.js.map +1 -1
  388. package/Meshes/Node/Blocks/Sources/sphereBlock.d.ts +2 -0
  389. package/Meshes/Node/Blocks/Sources/sphereBlock.js +2 -0
  390. package/Meshes/Node/Blocks/Sources/sphereBlock.js.map +1 -1
  391. package/Meshes/Node/Blocks/Sources/torusBlock.d.ts +2 -0
  392. package/Meshes/Node/Blocks/Sources/torusBlock.js +2 -0
  393. package/Meshes/Node/Blocks/Sources/torusBlock.js.map +1 -1
  394. package/Meshes/Node/Blocks/Teleport/teleportInBlock.d.ts +1 -0
  395. package/Meshes/Node/Blocks/Teleport/teleportInBlock.js +1 -0
  396. package/Meshes/Node/Blocks/Teleport/teleportInBlock.js.map +1 -1
  397. package/Meshes/Node/Blocks/Teleport/teleportOutBlock.d.ts +3 -0
  398. package/Meshes/Node/Blocks/Teleport/teleportOutBlock.js +3 -0
  399. package/Meshes/Node/Blocks/Teleport/teleportOutBlock.js.map +1 -1
  400. package/Meshes/Node/Blocks/Textures/geometryTextureBlock.d.ts +1 -0
  401. package/Meshes/Node/Blocks/Textures/geometryTextureBlock.js +1 -1
  402. package/Meshes/Node/Blocks/Textures/geometryTextureBlock.js.map +1 -1
  403. package/Meshes/Node/Blocks/Textures/geometryTextureFetchBlock.d.ts +1 -0
  404. package/Meshes/Node/Blocks/Textures/geometryTextureFetchBlock.js +1 -0
  405. package/Meshes/Node/Blocks/Textures/geometryTextureFetchBlock.js.map +1 -1
  406. package/Meshes/Node/Blocks/booleanGeometryBlock.d.ts +1 -0
  407. package/Meshes/Node/Blocks/booleanGeometryBlock.js +1 -1
  408. package/Meshes/Node/Blocks/booleanGeometryBlock.js.map +1 -1
  409. package/Meshes/Node/Blocks/cleanGeometryBlock.d.ts +1 -0
  410. package/Meshes/Node/Blocks/cleanGeometryBlock.js +1 -0
  411. package/Meshes/Node/Blocks/cleanGeometryBlock.js.map +1 -1
  412. package/Meshes/Node/Blocks/conditionBlock.d.ts +2 -0
  413. package/Meshes/Node/Blocks/conditionBlock.js +2 -0
  414. package/Meshes/Node/Blocks/conditionBlock.js.map +1 -1
  415. package/Meshes/Node/Blocks/geometryClampBlock.d.ts +1 -0
  416. package/Meshes/Node/Blocks/geometryClampBlock.js +1 -0
  417. package/Meshes/Node/Blocks/geometryClampBlock.js.map +1 -1
  418. package/Meshes/Node/Blocks/geometryCollectionBlock.d.ts +1 -0
  419. package/Meshes/Node/Blocks/geometryCollectionBlock.js +1 -0
  420. package/Meshes/Node/Blocks/geometryCollectionBlock.js.map +1 -1
  421. package/Meshes/Node/Blocks/geometryCurveBlock.d.ts +2 -0
  422. package/Meshes/Node/Blocks/geometryCurveBlock.js +2 -0
  423. package/Meshes/Node/Blocks/geometryCurveBlock.js.map +1 -1
  424. package/Meshes/Node/Blocks/geometryEaseBlock.d.ts +2 -0
  425. package/Meshes/Node/Blocks/geometryEaseBlock.js +2 -0
  426. package/Meshes/Node/Blocks/geometryEaseBlock.js.map +1 -1
  427. package/Meshes/Node/Blocks/geometryInputBlock.d.ts +3 -0
  428. package/Meshes/Node/Blocks/geometryInputBlock.js +3 -0
  429. package/Meshes/Node/Blocks/geometryInputBlock.js.map +1 -1
  430. package/Meshes/Node/Blocks/geometryOptimizeBlock.d.ts +1 -0
  431. package/Meshes/Node/Blocks/geometryOptimizeBlock.js +1 -0
  432. package/Meshes/Node/Blocks/geometryOptimizeBlock.js.map +1 -1
  433. package/Meshes/Node/Blocks/geometryTransformBlock.d.ts +1 -0
  434. package/Meshes/Node/Blocks/geometryTransformBlock.js +1 -0
  435. package/Meshes/Node/Blocks/geometryTransformBlock.js.map +1 -1
  436. package/Meshes/Node/Blocks/geometryTrigonometryBlock.d.ts +2 -0
  437. package/Meshes/Node/Blocks/geometryTrigonometryBlock.js +2 -0
  438. package/Meshes/Node/Blocks/geometryTrigonometryBlock.js.map +1 -1
  439. package/Meshes/Node/Blocks/mappingBlock.d.ts +1 -0
  440. package/Meshes/Node/Blocks/mappingBlock.js +1 -0
  441. package/Meshes/Node/Blocks/mappingBlock.js.map +1 -1
  442. package/Meshes/Node/Blocks/mathBlock.d.ts +1 -0
  443. package/Meshes/Node/Blocks/mathBlock.js +1 -0
  444. package/Meshes/Node/Blocks/mathBlock.js.map +1 -1
  445. package/Meshes/Node/Blocks/mergeGeometryBlock.d.ts +1 -0
  446. package/Meshes/Node/Blocks/mergeGeometryBlock.js +1 -0
  447. package/Meshes/Node/Blocks/mergeGeometryBlock.js.map +1 -1
  448. package/Meshes/Node/Blocks/randomBlock.d.ts +2 -0
  449. package/Meshes/Node/Blocks/randomBlock.js +2 -0
  450. package/Meshes/Node/Blocks/randomBlock.js.map +1 -1
  451. package/Meshes/Node/Blocks/subdivideBlock.d.ts +1 -0
  452. package/Meshes/Node/Blocks/subdivideBlock.js +1 -0
  453. package/Meshes/Node/Blocks/subdivideBlock.js.map +1 -1
  454. package/Meshes/Node/Interfaces/nodeGeometryTextureData.d.ts +3 -0
  455. package/Meshes/Node/Interfaces/nodeGeometryTextureData.js.map +1 -1
  456. package/Meshes/Node/nodeGeometry.js +0 -2
  457. package/Meshes/Node/nodeGeometry.js.map +1 -1
  458. package/Meshes/Node/nodeGeometryBlockConnectionPoint.js +0 -1
  459. package/Meshes/Node/nodeGeometryBlockConnectionPoint.js.map +1 -1
  460. package/Meshes/Node/nodeGeometryBuildState.js +0 -1
  461. package/Meshes/Node/nodeGeometryBuildState.js.map +1 -1
  462. package/Meshes/WebGL/webGLDataBuffer.d.ts +2 -0
  463. package/Meshes/WebGL/webGLDataBuffer.js +2 -0
  464. package/Meshes/WebGL/webGLDataBuffer.js.map +1 -1
  465. package/Meshes/WebGPU/webgpuDataBuffer.d.ts +4 -0
  466. package/Meshes/WebGPU/webgpuDataBuffer.js +4 -0
  467. package/Meshes/WebGPU/webgpuDataBuffer.js.map +1 -1
  468. package/Meshes/abstractMesh.d.ts +1 -0
  469. package/Meshes/abstractMesh.decalMap.d.ts +1 -0
  470. package/Meshes/abstractMesh.decalMap.js.map +1 -1
  471. package/Meshes/abstractMesh.js +1 -6
  472. package/Meshes/abstractMesh.js.map +1 -1
  473. package/Meshes/csg.js +0 -6
  474. package/Meshes/csg.js.map +1 -1
  475. package/Meshes/csg2.js +1 -2
  476. package/Meshes/csg2.js.map +1 -1
  477. package/Meshes/geodesicMesh.d.ts +26 -0
  478. package/Meshes/geodesicMesh.js +18 -3
  479. package/Meshes/geodesicMesh.js.map +1 -1
  480. package/Meshes/groundMesh.d.ts +1 -0
  481. package/Meshes/groundMesh.js +1 -0
  482. package/Meshes/groundMesh.js.map +1 -1
  483. package/Meshes/index.js +0 -2
  484. package/Meshes/index.js.map +1 -1
  485. package/Meshes/instancedMesh.d.ts +18 -3
  486. package/Meshes/instancedMesh.js +11 -3
  487. package/Meshes/instancedMesh.js.map +1 -1
  488. package/Meshes/mesh.d.ts +291 -204
  489. package/Meshes/mesh.js +290 -213
  490. package/Meshes/mesh.js.map +1 -1
  491. package/Meshes/mesh.vertexData.d.ts +15 -19
  492. package/Meshes/mesh.vertexData.js +15 -19
  493. package/Meshes/mesh.vertexData.js.map +1 -1
  494. package/Meshes/meshSimplification.d.ts +0 -1
  495. package/Meshes/meshSimplification.js +6 -1
  496. package/Meshes/meshSimplification.js.map +1 -1
  497. package/Meshes/meshSimplificationSceneComponent.d.ts +2 -0
  498. package/Meshes/meshSimplificationSceneComponent.js.map +1 -1
  499. package/Meshes/meshUVSpaceRenderer.d.ts +1 -0
  500. package/Meshes/meshUVSpaceRenderer.js.map +1 -1
  501. package/Meshes/polygonMesh.js +4 -0
  502. package/Meshes/polygonMesh.js.map +1 -1
  503. package/Meshes/subMesh.project.d.ts +1 -0
  504. package/Meshes/subMesh.project.js.map +1 -1
  505. package/Meshes/thinInstanceMesh.d.ts +5 -0
  506. package/Meshes/thinInstanceMesh.js.map +1 -1
  507. package/Meshes/transformNode.d.ts +1 -1
  508. package/Meshes/transformNode.js +1 -1
  509. package/Meshes/transformNode.js.map +1 -1
  510. package/Misc/dataStorage.d.ts +13 -0
  511. package/Misc/dataStorage.js +25 -0
  512. package/Misc/dataStorage.js.map +1 -1
  513. package/Morph/morphTarget.d.ts +9 -5
  514. package/Morph/morphTarget.js +15 -7
  515. package/Morph/morphTarget.js.map +1 -1
  516. package/Morph/morphTargetManager.d.ts +3 -1
  517. package/Morph/morphTargetManager.js +5 -2
  518. package/Morph/morphTargetManager.js.map +1 -1
  519. package/Particles/Node/Blocks/Emitters/boxShapeBlock.js +1 -1
  520. package/Particles/Node/Blocks/Emitters/boxShapeBlock.js.map +1 -1
  521. package/Particles/Node/Blocks/Emitters/coneShapeBlock.js +1 -1
  522. package/Particles/Node/Blocks/Emitters/coneShapeBlock.js.map +1 -1
  523. package/Particles/Node/Blocks/Emitters/customShapeBlock.js +1 -1
  524. package/Particles/Node/Blocks/Emitters/customShapeBlock.js.map +1 -1
  525. package/Particles/Node/Blocks/Emitters/cylinderShapeBlock.js +1 -1
  526. package/Particles/Node/Blocks/Emitters/cylinderShapeBlock.js.map +1 -1
  527. package/Particles/Node/Blocks/Emitters/emitters.functions.js +3 -3
  528. package/Particles/Node/Blocks/Emitters/emitters.functions.js.map +1 -1
  529. package/Particles/Node/Blocks/Emitters/meshShapeBlock.js +1 -1
  530. package/Particles/Node/Blocks/Emitters/meshShapeBlock.js.map +1 -1
  531. package/Particles/Node/Blocks/Emitters/pointShapeBlock.js +1 -1
  532. package/Particles/Node/Blocks/Emitters/pointShapeBlock.js.map +1 -1
  533. package/Particles/Node/Blocks/Emitters/sphereShapeBlock.js +1 -1
  534. package/Particles/Node/Blocks/Emitters/sphereShapeBlock.js.map +1 -1
  535. package/Particles/Node/Blocks/Update/basicPositionUpdateBlock.js +2 -2
  536. package/Particles/Node/Blocks/Update/basicPositionUpdateBlock.js.map +1 -1
  537. package/Particles/Node/Blocks/Update/updateNoiseBlock.js +7 -7
  538. package/Particles/Node/Blocks/Update/updateNoiseBlock.js.map +1 -1
  539. package/Particles/Node/Blocks/particleLocalVariableBlock.js +2 -2
  540. package/Particles/Node/Blocks/particleLocalVariableBlock.js.map +1 -1
  541. package/Particles/Node/nodeParticleBuildState.js +7 -7
  542. package/Particles/Node/nodeParticleBuildState.js.map +1 -1
  543. package/Particles/Node/nodeParticleSystemSet.helper.js +9 -4
  544. package/Particles/Node/nodeParticleSystemSet.helper.js.map +1 -1
  545. package/Particles/particle.d.ts +73 -61
  546. package/Particles/particle.js +106 -91
  547. package/Particles/particle.js.map +1 -1
  548. package/Particles/particleSystem.js +5 -5
  549. package/Particles/particleSystem.js.map +1 -1
  550. package/Particles/thinParticleSystem.function.js +83 -83
  551. package/Particles/thinParticleSystem.function.js.map +1 -1
  552. package/Particles/thinParticleSystem.js +8 -8
  553. package/Particles/thinParticleSystem.js.map +1 -1
  554. package/Physics/v2/Plugins/havokPlugin.d.ts +89 -3
  555. package/Physics/v2/Plugins/havokPlugin.js +388 -53
  556. package/Physics/v2/Plugins/havokPlugin.js.map +1 -1
  557. package/Probes/reflectionProbe.js +10 -7
  558. package/Probes/reflectionProbe.js.map +1 -1
  559. package/Rendering/depthRenderer.js +1 -1
  560. package/Rendering/depthRenderer.js.map +1 -1
  561. package/Rendering/objectRenderer.d.ts +3 -1
  562. package/Rendering/objectRenderer.js +28 -8
  563. package/Rendering/objectRenderer.js.map +1 -1
  564. package/Rendering/reflectiveShadowMap.js +1 -1
  565. package/Rendering/reflectiveShadowMap.js.map +1 -1
  566. package/Rendering/thinDepthPeelingRenderer.js +8 -0
  567. package/Rendering/thinDepthPeelingRenderer.js.map +1 -1
  568. package/Shaders/gaussianSplatting.fragment.js +8 -2
  569. package/Shaders/gaussianSplatting.fragment.js.map +1 -1
  570. package/Shaders/gaussianSplatting.vertex.js +8 -2
  571. package/Shaders/gaussianSplatting.vertex.js.map +1 -1
  572. package/ShadersWGSL/gaussianSplatting.fragment.js +7 -1
  573. package/ShadersWGSL/gaussianSplatting.fragment.js.map +1 -1
  574. package/ShadersWGSL/gaussianSplatting.vertex.js +8 -2
  575. package/ShadersWGSL/gaussianSplatting.vertex.js.map +1 -1
  576. package/package.json +1 -1
  577. package/scene.d.ts +22 -4
  578. package/scene.js +33 -20
  579. package/scene.js.map +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"updateNoiseBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/Particles/Node/Blocks/Update/updateNoiseBlock.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,yCAA+B;AAC7D,OAAO,EAAE,aAAa,EAAE,sCAA4B;AACpD,OAAO,EAAE,iBAAiB,EAAE,mCAA8C;AAC1E,OAAO,EAAE,qCAAqC,EAAE,6DAAwE;AACxH,OAAO,EAAE,gBAAgB,EAAE,yCAA4C;AAEvE;;GAEG;AACH,MAAM,OAAO,gBAAiB,SAAQ,iBAAiB;IACnD;;;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,cAAc,EAAE,qCAAqC,CAAC,OAAO,CAAC,CAAC;QAClF,IAAI,CAAC,aAAa,CAAC,UAAU,EAAE,qCAAqC,CAAC,OAAO,EAAE,IAAI,EAAE,IAAI,OAAO,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;QAChH,IAAI,CAAC,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GAAG,eAAe,CAAC;QAC/C,CAAC;QAED,IAAI,CAAC,MAAM,CAAC,YAAY,GAAG,MAAM,CAAC;IACtC,CAAC;CACJ;AAED,aAAa,CAAC,0BAA0B,EAAE,gBAAgB,CAAC,CAAC","sourcesContent":["import type { Nullable } from \"core/types\";\r\nimport type { ISize } from \"core/Maths/math.size\";\r\nimport type { ProceduralTexture } from \"core/Materials/Textures/Procedurals/proceduralTexture\";\r\nimport type { Particle } from \"core/Particles/particle\";\r\nimport type { ThinParticleSystem } from \"core/Particles/thinParticleSystem\";\r\nimport type { NodeParticleConnectionPoint } from \"core/Particles/Node/nodeParticleBlockConnectionPoint\";\r\nimport type { NodeParticleBuildState } from \"core/Particles/Node/nodeParticleBuildState\";\r\nimport type { ParticleTextureSourceBlock } from \"core/Particles/Node/Blocks/particleSourceTextureBlock\";\r\n\r\nimport { TmpVectors, Vector3 } from \"core/Maths/math.vector\";\r\nimport { RegisterClass } from \"core/Misc/typeStore\";\r\nimport { NodeParticleBlock } from \"core/Particles/Node/nodeParticleBlock\";\r\nimport { NodeParticleBlockConnectionPointTypes } from \"core/Particles/Node/Enums/nodeParticleBlockConnectionPointTypes\";\r\nimport { _ConnectAtTheEnd } from \"core/Particles/Queue/executionQueue\";\r\n\r\n/**\r\n * Block used to update particle position based on a noise texture\r\n */\r\nexport class UpdateNoiseBlock extends NodeParticleBlock {\r\n /**\r\n * Create a new UpdateNoiseBlock\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(\"noiseTexture\", NodeParticleBlockConnectionPointTypes.Texture);\r\n this.registerInput(\"strength\", NodeParticleBlockConnectionPointTypes.Vector3, true, new Vector3(100, 100, 100));\r\n this.registerOutput(\"output\", NodeParticleBlockConnectionPointTypes.Particle);\r\n }\r\n\r\n /**\r\n * Gets the particle 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 noiseTexture input component\r\n */\r\n public get noiseTexture(): NodeParticleConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the strength input component\r\n */\r\n public get strength(): NodeParticleConnectionPoint {\r\n return this._inputs[2];\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 * Gets the current class name\r\n * @returns the class name\r\n */\r\n public override getClassName() {\r\n return \"UpdateNoiseBlock\";\r\n }\r\n\r\n /**\r\n * Builds the block\r\n * @param state defines the current build state\r\n */\r\n public override _build(state: NodeParticleBuildState) {\r\n const system = this.particle.getConnectedValue(state) as ThinParticleSystem;\r\n\r\n const strength = this.strength.getConnectedValue(state) as Vector3;\r\n if (!strength) {\r\n return;\r\n }\r\n\r\n const noiseTextureBlock = this.noiseTexture.connectedPoint?.ownerBlock as ParticleTextureSourceBlock;\r\n if (!noiseTextureBlock) {\r\n return;\r\n }\r\n\r\n // These will be updated each frame for procedural textures\r\n let noiseTextureData: Nullable<Uint8Array | Uint8ClampedArray> = null;\r\n let noiseTextureSize: Nullable<ISize> = null;\r\n let lastFrameId = -1;\r\n\r\n const processNoise = (particle: Particle) => {\r\n // Get the texture directly from the block's stored value to support procedural textures\r\n // (as the block caches the texture data)\r\n const texture = noiseTextureBlock.texture._storedValue as ProceduralTexture;\r\n if (!texture || !texture.isReady()) {\r\n return;\r\n }\r\n\r\n // Fetch fresh texture data once per frame (like in thinParticleSystem)\r\n const currentFrameId = texture.getScene()?.getFrameId() ?? -1;\r\n if (currentFrameId !== lastFrameId) {\r\n lastFrameId = currentFrameId;\r\n\r\n // Texture size only needs to be fetched once\r\n if (!noiseTextureSize) {\r\n noiseTextureSize = texture.getSize();\r\n }\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises, github/no-then\r\n texture.getContent()?.then((data) => {\r\n noiseTextureData = data as Uint8Array;\r\n });\r\n }\r\n\r\n // Skip if we don't have texture data yet\r\n if (!noiseTextureData || !noiseTextureSize) {\r\n return;\r\n }\r\n\r\n if (!particle._randomNoiseCoordinates1) {\r\n particle._randomNoiseCoordinates1 = new Vector3(Math.random(), Math.random(), Math.random());\r\n }\r\n\r\n if (!particle._randomNoiseCoordinates2) {\r\n particle._randomNoiseCoordinates2 = new Vector3(Math.random(), Math.random(), Math.random());\r\n }\r\n\r\n const fetchedColorR = system._fetchR(\r\n particle._randomNoiseCoordinates1.x,\r\n particle._randomNoiseCoordinates1.y,\r\n noiseTextureSize.width,\r\n noiseTextureSize.height,\r\n noiseTextureData\r\n );\r\n const fetchedColorG = system._fetchR(\r\n particle._randomNoiseCoordinates1.z,\r\n particle._randomNoiseCoordinates2.x,\r\n noiseTextureSize.width,\r\n noiseTextureSize.height,\r\n noiseTextureData\r\n );\r\n const fetchedColorB = system._fetchR(\r\n particle._randomNoiseCoordinates2.y,\r\n particle._randomNoiseCoordinates2.z,\r\n noiseTextureSize.width,\r\n noiseTextureSize.height,\r\n noiseTextureData\r\n );\r\n\r\n const force = TmpVectors.Vector3[0];\r\n const scaledForce = TmpVectors.Vector3[1];\r\n\r\n force.copyFromFloats((2 * fetchedColorR - 1) * strength.x, (2 * fetchedColorG - 1) * strength.y, (2 * fetchedColorB - 1) * strength.z);\r\n\r\n force.scaleToRef(system._tempScaledUpdateSpeed, scaledForce);\r\n particle.direction.addInPlace(scaledForce);\r\n };\r\n\r\n const noiseProcessing = {\r\n process: processNoise,\r\n previousItem: null,\r\n nextItem: null,\r\n };\r\n\r\n if (system._updateQueueStart) {\r\n _ConnectAtTheEnd(noiseProcessing, system._updateQueueStart);\r\n } else {\r\n system._updateQueueStart = noiseProcessing;\r\n }\r\n\r\n this.output._storedValue = system;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.UpdateNoiseBlock\", UpdateNoiseBlock);\r\n"]}
1
+ {"version":3,"file":"updateNoiseBlock.js","sourceRoot":"","sources":["../../../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M,EACvB,gBAAgB,CACnB,CAAC;YAEF,MAAM,KAAK,GAAG,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;YACpC,MAAM,WAAW,GAAG,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;YAE1C,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC,GAAG,aAAa,GAAG,CAAC,CAAC,GAAG,QAAQ,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,aAAa,GAAG,CAAC,CAAC,GAAG,QAAQ,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,aAAa,GAAG,CAAC,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;YAEvI,KAAK,CAAC,UAAU,CAAC,MAAM,CAAC,sBAAsB,EAAE,WAAW,CAAC,CAAC;YAC7D,QAAQ,CAAC,SAAS,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;QAC/C,CAAC,CAAC;QAEF,MAAM,eAAe,GAAG;YACpB,OAAO,EAAE,YAAY;YACrB,YAAY,EAAE,IAAI;YAClB,QAAQ,EAAE,IAAI;SACjB,CAAC;QAEF,IAAI,MAAM,CAAC,iBAAiB,EAAE,CAAC;YAC3B,gBAAgB,CAAC,eAAe,EAAE,MAAM,CAAC,iBAAiB,CAAC,CAAC;QAChE,CAAC;aAAM,CAAC;YACJ,MAAM,CAAC,iBAAiB,GAAG,eAAe,CAAC;QAC/C,CAAC;QAED,IAAI,CAAC,MAAM,CAAC,YAAY,GAAG,MAAM,CAAC;IACtC,CAAC;CACJ;AAED,aAAa,CAAC,0BAA0B,EAAE,gBAAgB,CAAC,CAAC","sourcesContent":["import type { Nullable } from \"core/types\";\r\nimport type { ISize } from \"core/Maths/math.size\";\r\nimport type { ProceduralTexture } from \"core/Materials/Textures/Procedurals/proceduralTexture\";\r\nimport type { Particle } from \"core/Particles/particle\";\r\nimport type { ThinParticleSystem } from \"core/Particles/thinParticleSystem\";\r\nimport type { NodeParticleConnectionPoint } from \"core/Particles/Node/nodeParticleBlockConnectionPoint\";\r\nimport type { NodeParticleBuildState } from \"core/Particles/Node/nodeParticleBuildState\";\r\nimport type { ParticleTextureSourceBlock } from \"core/Particles/Node/Blocks/particleSourceTextureBlock\";\r\n\r\nimport { TmpVectors, Vector3 } from \"core/Maths/math.vector\";\r\nimport { RegisterClass } from \"core/Misc/typeStore\";\r\nimport { NodeParticleBlock } from \"core/Particles/Node/nodeParticleBlock\";\r\nimport { NodeParticleBlockConnectionPointTypes } from \"core/Particles/Node/Enums/nodeParticleBlockConnectionPointTypes\";\r\nimport { _ConnectAtTheEnd } from \"core/Particles/Queue/executionQueue\";\r\n\r\n/**\r\n * Block used to update particle position based on a noise texture\r\n */\r\nexport class UpdateNoiseBlock extends NodeParticleBlock {\r\n /**\r\n * Create a new UpdateNoiseBlock\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(\"noiseTexture\", NodeParticleBlockConnectionPointTypes.Texture);\r\n this.registerInput(\"strength\", NodeParticleBlockConnectionPointTypes.Vector3, true, new Vector3(100, 100, 100));\r\n this.registerOutput(\"output\", NodeParticleBlockConnectionPointTypes.Particle);\r\n }\r\n\r\n /**\r\n * Gets the particle 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 noiseTexture input component\r\n */\r\n public get noiseTexture(): NodeParticleConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the strength input component\r\n */\r\n public get strength(): NodeParticleConnectionPoint {\r\n return this._inputs[2];\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 * Gets the current class name\r\n * @returns the class name\r\n */\r\n public override getClassName() {\r\n return \"UpdateNoiseBlock\";\r\n }\r\n\r\n /**\r\n * Builds the block\r\n * @param state defines the current build state\r\n */\r\n public override _build(state: NodeParticleBuildState) {\r\n const system = this.particle.getConnectedValue(state) as ThinParticleSystem;\r\n\r\n const strength = this.strength.getConnectedValue(state) as Vector3;\r\n if (!strength) {\r\n return;\r\n }\r\n\r\n const noiseTextureBlock = this.noiseTexture.connectedPoint?.ownerBlock as ParticleTextureSourceBlock;\r\n if (!noiseTextureBlock) {\r\n return;\r\n }\r\n\r\n // These will be updated each frame for procedural textures\r\n let noiseTextureData: Nullable<Uint8Array | Uint8ClampedArray> = null;\r\n let noiseTextureSize: Nullable<ISize> = null;\r\n let lastFrameId = -1;\r\n\r\n const processNoise = (particle: Particle) => {\r\n // Get the texture directly from the block's stored value to support procedural textures\r\n // (as the block caches the texture data)\r\n const texture = noiseTextureBlock.texture._storedValue as ProceduralTexture;\r\n if (!texture || !texture.isReady()) {\r\n return;\r\n }\r\n\r\n // Fetch fresh texture data once per frame (like in thinParticleSystem)\r\n const currentFrameId = texture.getScene()?.getFrameId() ?? -1;\r\n if (currentFrameId !== lastFrameId) {\r\n lastFrameId = currentFrameId;\r\n\r\n // Texture size only needs to be fetched once\r\n if (!noiseTextureSize) {\r\n noiseTextureSize = texture.getSize();\r\n }\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises, github/no-then\r\n texture.getContent()?.then((data) => {\r\n noiseTextureData = data as Uint8Array;\r\n });\r\n }\r\n\r\n // Skip if we don't have texture data yet\r\n if (!noiseTextureData || !noiseTextureSize) {\r\n return;\r\n }\r\n\r\n if (!particle._properties.randomNoiseCoordinates1) {\r\n particle._properties.randomNoiseCoordinates1 = new Vector3(Math.random(), Math.random(), Math.random());\r\n }\r\n\r\n if (!particle._properties.randomNoiseCoordinates2) {\r\n particle._properties.randomNoiseCoordinates2 = new Vector3(Math.random(), Math.random(), Math.random());\r\n }\r\n\r\n const fetchedColorR = system._fetchR(\r\n particle._properties.randomNoiseCoordinates1.x,\r\n particle._properties.randomNoiseCoordinates1.y,\r\n noiseTextureSize.width,\r\n noiseTextureSize.height,\r\n noiseTextureData\r\n );\r\n const fetchedColorG = system._fetchR(\r\n particle._properties.randomNoiseCoordinates1.z,\r\n particle._properties.randomNoiseCoordinates2.x,\r\n noiseTextureSize.width,\r\n noiseTextureSize.height,\r\n noiseTextureData\r\n );\r\n const fetchedColorB = system._fetchR(\r\n particle._properties.randomNoiseCoordinates2.y,\r\n particle._properties.randomNoiseCoordinates2.z,\r\n noiseTextureSize.width,\r\n noiseTextureSize.height,\r\n noiseTextureData\r\n );\r\n\r\n const force = TmpVectors.Vector3[0];\r\n const scaledForce = TmpVectors.Vector3[1];\r\n\r\n force.copyFromFloats((2 * fetchedColorR - 1) * strength.x, (2 * fetchedColorG - 1) * strength.y, (2 * fetchedColorB - 1) * strength.z);\r\n\r\n force.scaleToRef(system._tempScaledUpdateSpeed, scaledForce);\r\n particle.direction.addInPlace(scaledForce);\r\n };\r\n\r\n const noiseProcessing = {\r\n process: processNoise,\r\n previousItem: null,\r\n nextItem: null,\r\n };\r\n\r\n if (system._updateQueueStart) {\r\n _ConnectAtTheEnd(noiseProcessing, system._updateQueueStart);\r\n } else {\r\n system._updateQueueStart = noiseProcessing;\r\n }\r\n\r\n this.output._storedValue = system;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.UpdateNoiseBlock\", UpdateNoiseBlock);\r\n"]}
@@ -74,9 +74,9 @@ export class ParticleLocalVariableBlock extends NodeParticleBlock {
74
74
  }
75
75
  this._storage.set(id, value);
76
76
  if (this.scope === ParticleLocalVariableBlockScope.Particle) {
77
- state.particleContext.onReset = () => {
77
+ state.particleContext._properties.onReset = () => {
78
78
  this._storage.delete(id);
79
- state.particleContext.onReset = null;
79
+ state.particleContext._properties.onReset = null;
80
80
  };
81
81
  }
82
82
  state.systemContext.onDisposeObservable.addOnce(() => {
@@ -1 +1 @@
1
- {"version":3,"file":"particleLocalVariableBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Particles/Node/Blocks/particleLocalVariableBlock.ts"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,mBAAmB,GAAG,KAAK,CAAC,SAAS,EAAE,CAAC;QAE9C,mBAAmB,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;QAEvC,OAAO,mBAAmB,CAAC;IAC/B,CAAC;IAEe,YAAY,CAAC,mBAAwB;QACjD,KAAK,CAAC,YAAY,CAAC,mBAAmB,CAAC,CAAC;QAExC,IAAI,CAAC,KAAK,GAAG,mBAAmB,CAAC,KAAK,CAAC;IAC3C,CAAC;IAEe,OAAO;QACnB,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC;QACtB,KAAK,CAAC,OAAO,EAAE,CAAC;IACpB,CAAC;CACJ;AA7GU;IARN,sBAAsB,CAAC,OAAO,uCAA+B,UAAU,EAAE;QACtE,QAAQ,EAAE,IAAI;QACd,SAAS,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE;QAC5B,OAAO,EAAE;YACL,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,+BAA+B,CAAC,QAAQ,EAAE;YACtE,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,+BAA+B,CAAC,IAAI,EAAE;SACjE;KACJ,CAAC;yDACsD;AA+G5D,aAAa,CAAC,oCAAoC,EAAE,0BAA0B,CAAC,CAAC","sourcesContent":["import { editableInPropertyPage, PropertyTypeForEdition } from \"core/Decorators/nodeDecorator\";\r\nimport { RegisterClass } from \"../../../Misc/typeStore\";\r\nimport { NodeParticleBlockConnectionPointTypes } from \"../Enums/nodeParticleBlockConnectionPointTypes\";\r\nimport { NodeParticleBlock } from \"../nodeParticleBlock\";\r\nimport type { NodeParticleConnectionPoint } from \"../nodeParticleBlockConnectionPoint\";\r\nimport type { NodeParticleBuildState } from \"../nodeParticleBuildState\";\r\n\r\nexport enum ParticleLocalVariableBlockScope {\r\n Particle = 0,\r\n Loop = 1,\r\n}\r\n\r\n/**\r\n * Defines a block used to store local values\r\n * #A1OS53#5\r\n */\r\nexport class ParticleLocalVariableBlock extends NodeParticleBlock {\r\n /**\r\n * Gets or sets the scope used by the block\r\n */\r\n @editableInPropertyPage(\"Scope\", PropertyTypeForEdition.List, \"ADVANCED\", {\r\n embedded: true,\r\n notifiers: { rebuild: true },\r\n options: [\r\n { label: \"Particle\", value: ParticleLocalVariableBlockScope.Particle },\r\n { label: \"Loop\", value: ParticleLocalVariableBlockScope.Loop },\r\n ],\r\n })\r\n public scope = ParticleLocalVariableBlockScope.Particle;\r\n private _storage = new Map<number, any>();\r\n\r\n /**\r\n * Create a new ParticleLocalVariableBlock\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._isDebug = true;\r\n\r\n this.registerInput(\"input\", NodeParticleBlockConnectionPointTypes.AutoDetect);\r\n this.registerOutput(\"output\", NodeParticleBlockConnectionPointTypes.BasedOnInput);\r\n\r\n this._outputs[0]._typeConnectionSource = this._inputs[0];\r\n this._inputs[0].excludedConnectionPointTypes.push(NodeParticleBlockConnectionPointTypes.FloatGradient);\r\n this._inputs[0].excludedConnectionPointTypes.push(NodeParticleBlockConnectionPointTypes.Vector2Gradient);\r\n this._inputs[0].excludedConnectionPointTypes.push(NodeParticleBlockConnectionPointTypes.Vector3Gradient);\r\n this._inputs[0].excludedConnectionPointTypes.push(NodeParticleBlockConnectionPointTypes.Color4Gradient);\r\n this._inputs[0].excludedConnectionPointTypes.push(NodeParticleBlockConnectionPointTypes.System);\r\n this._inputs[0].excludedConnectionPointTypes.push(NodeParticleBlockConnectionPointTypes.Particle);\r\n this._inputs[0].excludedConnectionPointTypes.push(NodeParticleBlockConnectionPointTypes.Texture);\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 \"ParticleLocalVariableBlock\";\r\n }\r\n\r\n /**\r\n * Gets the input component\r\n */\r\n public get input(): NodeParticleConnectionPoint {\r\n return this._inputs[0];\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(state: NodeParticleBuildState) {\r\n if (!this.input.isConnected) {\r\n this.output._storedFunction = null;\r\n this.output._storedValue = null;\r\n return;\r\n }\r\n\r\n const func = (state: NodeParticleBuildState) => {\r\n if (!state.particleContext && !state.systemContext) {\r\n this._storage.clear();\r\n return null;\r\n }\r\n\r\n const id = (this.scope === ParticleLocalVariableBlockScope.Particle ? state.particleContext?.id : state.systemContext?.getScene()!.getFrameId()) || -1;\r\n\r\n if (!this._storage.has(id)) {\r\n let value = this.input.getConnectedValue(state);\r\n\r\n if (value.clone) {\r\n value = value.clone(); // We clone to snapshot the value at this moment\r\n }\r\n this._storage.set(id, value);\r\n\r\n if (this.scope === ParticleLocalVariableBlockScope.Particle) {\r\n state.particleContext!.onReset = () => {\r\n this._storage.delete(id);\r\n state.particleContext!.onReset = null;\r\n };\r\n }\r\n state.systemContext!.onDisposeObservable.addOnce(() => {\r\n this._storage.clear();\r\n });\r\n }\r\n\r\n return this._storage.get(id);\r\n };\r\n\r\n if (this.output.isConnected) {\r\n this.output._storedFunction = func;\r\n } else {\r\n this.output._storedValue = func(state);\r\n }\r\n }\r\n\r\n public override serialize(): any {\r\n const serializationObject = super.serialize();\r\n\r\n serializationObject.scope = this.scope;\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.scope = serializationObject.scope;\r\n }\r\n\r\n public override dispose() {\r\n this._storage.clear();\r\n super.dispose();\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.ParticleLocalVariableBlock\", ParticleLocalVariableBlock);\r\n"]}
1
+ {"version":3,"file":"particleLocalVariableBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Particles/Node/Blocks/particleLocalVariableBlock.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,sBAAsB,EAA0B,6CAAsC;AAC/F,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,E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CAAC;QAEvC,OAAO,mBAAmB,CAAC;IAC/B,CAAC;IAEe,YAAY,CAAC,mBAAwB;QACjD,KAAK,CAAC,YAAY,CAAC,mBAAmB,CAAC,CAAC;QAExC,IAAI,CAAC,KAAK,GAAG,mBAAmB,CAAC,KAAK,CAAC;IAC3C,CAAC;IAEe,OAAO;QACnB,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC;QACtB,KAAK,CAAC,OAAO,EAAE,CAAC;IACpB,CAAC;CACJ;AA7GU;IARN,sBAAsB,CAAC,OAAO,uCAA+B,UAAU,EAAE;QACtE,QAAQ,EAAE,IAAI;QACd,SAAS,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE;QAC5B,OAAO,EAAE;YACL,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,+BAA+B,CAAC,QAAQ,EAAE;YACtE,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,+BAA+B,CAAC,IAAI,EAAE;SACjE;KACJ,CAAC;yDACsD;AA+G5D,aAAa,CAAC,oCAAoC,EAAE,0BAA0B,CAAC,CAAC","sourcesContent":["import { editableInPropertyPage, PropertyTypeForEdition } from \"core/Decorators/nodeDecorator\";\r\nimport { RegisterClass } from \"../../../Misc/typeStore\";\r\nimport { NodeParticleBlockConnectionPointTypes } from \"../Enums/nodeParticleBlockConnectionPointTypes\";\r\nimport { NodeParticleBlock } from \"../nodeParticleBlock\";\r\nimport type { NodeParticleConnectionPoint } from \"../nodeParticleBlockConnectionPoint\";\r\nimport type { NodeParticleBuildState } from \"../nodeParticleBuildState\";\r\n\r\nexport enum ParticleLocalVariableBlockScope {\r\n Particle = 0,\r\n Loop = 1,\r\n}\r\n\r\n/**\r\n * Defines a block used to store local values\r\n * #A1OS53#5\r\n */\r\nexport class ParticleLocalVariableBlock extends NodeParticleBlock {\r\n /**\r\n * Gets or sets the scope used by the block\r\n */\r\n @editableInPropertyPage(\"Scope\", PropertyTypeForEdition.List, \"ADVANCED\", {\r\n embedded: true,\r\n notifiers: { rebuild: true },\r\n options: [\r\n { label: \"Particle\", value: ParticleLocalVariableBlockScope.Particle },\r\n { label: \"Loop\", value: ParticleLocalVariableBlockScope.Loop },\r\n ],\r\n })\r\n public scope = ParticleLocalVariableBlockScope.Particle;\r\n private _storage = new Map<number, any>();\r\n\r\n /**\r\n * Create a new ParticleLocalVariableBlock\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._isDebug = true;\r\n\r\n this.registerInput(\"input\", NodeParticleBlockConnectionPointTypes.AutoDetect);\r\n this.registerOutput(\"output\", NodeParticleBlockConnectionPointTypes.BasedOnInput);\r\n\r\n this._outputs[0]._typeConnectionSource = this._inputs[0];\r\n this._inputs[0].excludedConnectionPointTypes.push(NodeParticleBlockConnectionPointTypes.FloatGradient);\r\n this._inputs[0].excludedConnectionPointTypes.push(NodeParticleBlockConnectionPointTypes.Vector2Gradient);\r\n this._inputs[0].excludedConnectionPointTypes.push(NodeParticleBlockConnectionPointTypes.Vector3Gradient);\r\n this._inputs[0].excludedConnectionPointTypes.push(NodeParticleBlockConnectionPointTypes.Color4Gradient);\r\n this._inputs[0].excludedConnectionPointTypes.push(NodeParticleBlockConnectionPointTypes.System);\r\n this._inputs[0].excludedConnectionPointTypes.push(NodeParticleBlockConnectionPointTypes.Particle);\r\n this._inputs[0].excludedConnectionPointTypes.push(NodeParticleBlockConnectionPointTypes.Texture);\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 \"ParticleLocalVariableBlock\";\r\n }\r\n\r\n /**\r\n * Gets the input component\r\n */\r\n public get input(): NodeParticleConnectionPoint {\r\n return this._inputs[0];\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(state: NodeParticleBuildState) {\r\n if (!this.input.isConnected) {\r\n this.output._storedFunction = null;\r\n this.output._storedValue = null;\r\n return;\r\n }\r\n\r\n const func = (state: NodeParticleBuildState) => {\r\n if (!state.particleContext && !state.systemContext) {\r\n this._storage.clear();\r\n return null;\r\n }\r\n\r\n const id = (this.scope === ParticleLocalVariableBlockScope.Particle ? state.particleContext?.id : state.systemContext?.getScene()!.getFrameId()) || -1;\r\n\r\n if (!this._storage.has(id)) {\r\n let value = this.input.getConnectedValue(state);\r\n\r\n if (value.clone) {\r\n value = value.clone(); // We clone to snapshot the value at this moment\r\n }\r\n this._storage.set(id, value);\r\n\r\n if (this.scope === ParticleLocalVariableBlockScope.Particle) {\r\n state.particleContext!._properties.onReset = () => {\r\n this._storage.delete(id);\r\n state.particleContext!._properties.onReset = null;\r\n };\r\n }\r\n state.systemContext!.onDisposeObservable.addOnce(() => {\r\n this._storage.clear();\r\n });\r\n }\r\n\r\n return this._storage.get(id);\r\n };\r\n\r\n if (this.output.isConnected) {\r\n this.output._storedFunction = func;\r\n } else {\r\n this.output._storedValue = func(state);\r\n }\r\n }\r\n\r\n public override serialize(): any {\r\n const serializationObject = super.serialize();\r\n\r\n serializationObject.scope = this.scope;\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.scope = serializationObject.scope;\r\n }\r\n\r\n public override dispose() {\r\n this._storage.clear();\r\n super.dispose();\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.ParticleLocalVariableBlock\", ParticleLocalVariableBlock);\r\n"]}
@@ -76,10 +76,10 @@ export class NodeParticleBuildState {
76
76
  case NodeParticleContextualSources.Direction:
77
77
  return this.particleContext.direction;
78
78
  case NodeParticleContextualSources.DirectionScale:
79
- return this.particleContext._directionScale;
79
+ return this.particleContext._properties.directionScale;
80
80
  case NodeParticleContextualSources.ScaledDirection:
81
- this.particleContext.direction.scaleToRef(this.particleContext._directionScale, this.particleContext._scaledDirection);
82
- return this.particleContext._scaledDirection;
81
+ this.particleContext.direction.scaleToRef(this.particleContext._properties.directionScale, this.particleContext._properties.scaledDirection);
82
+ return this.particleContext._properties.scaledDirection;
83
83
  case NodeParticleContextualSources.Color:
84
84
  return this.particleContext.color;
85
85
  case NodeParticleContextualSources.InitialColor:
@@ -105,16 +105,16 @@ export class NodeParticleBuildState {
105
105
  case NodeParticleContextualSources.SpriteCellStart:
106
106
  return this.systemContext.startSpriteCellID;
107
107
  case NodeParticleContextualSources.InitialDirection:
108
- return this.particleContext._initialDirection;
108
+ return this.particleContext._properties.initialDirection;
109
109
  case NodeParticleContextualSources.ColorStep:
110
110
  return this.particleContext.colorStep;
111
111
  case NodeParticleContextualSources.ScaledColorStep:
112
112
  this.particleContext.colorStep.scaleToRef(this.systemContext._scaledUpdateSpeed, this.systemContext._scaledColorStep);
113
113
  return this.systemContext._scaledColorStep;
114
114
  case NodeParticleContextualSources.LocalPositionUpdated:
115
- this.particleContext.direction.scaleToRef(this.particleContext._directionScale, this.particleContext._scaledDirection);
116
- this.particleContext._localPosition.addInPlace(this.particleContext._scaledDirection);
117
- Vector3.TransformCoordinatesToRef(this.particleContext._localPosition, this.systemContext._emitterWorldMatrix, this.particleContext.position);
115
+ this.particleContext.direction.scaleToRef(this.particleContext._properties.directionScale, this.particleContext._properties.scaledDirection);
116
+ this.particleContext._properties.localPosition.addInPlace(this.particleContext._properties.scaledDirection);
117
+ Vector3.TransformCoordinatesToRef(this.particleContext._properties.localPosition, this.systemContext._emitterWorldMatrix, this.particleContext.position);
118
118
  return this.particleContext.position;
119
119
  }
120
120
  return null;
@@ -1 +1 @@
1
- {"version":3,"file":"nodeParticleBuildState.js","sourceRoot":"","sources":["../../../../../dev/core/src/Particles/Node/nodeParticleBuildState.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,MAAM,EAAE,kCAA8B;AAC/C,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,mCAA+B;AAC1D,OAAO,EAAE,qCAAqC,EAAE,yDAAwE;AACxH,OAAO,EAAE,6BAA6B,EAAE,iDAAgE;AACxG,O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AC,YAAY,CAAC;YAC3C,KAAK,yBAAyB,CAAC,KAAK;gBAChC,OAAO,IAAI,CAAC,aAAa,CAAC,kBAAkB,CAAC;YACjD,KAAK,yBAAyB,CAAC,OAAO;gBAClC,OAAO,IAAI,CAAC,eAAe,CAAC;YAChC,KAAK,yBAAyB,CAAC,cAAc;gBACzC,OAAO,IAAI,CAAC,KAAK,CAAC,YAAY,EAAE,cAAc,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC;QACzE,CAAC;QAED,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ","sourcesContent":["import type { Scene } from \"core/scene\";\r\nimport type { Nullable } from \"core/types\";\r\nimport type { AbstractMesh } from \"core/Meshes/abstractMesh\";\r\nimport type { Particle } from \"core/Particles/particle\";\r\nimport type { ThinParticleSystem } from \"core/Particles/thinParticleSystem\";\r\nimport type { NodeParticleConnectionPoint } from \"core/Particles/Node/nodeParticleBlockConnectionPoint\";\r\n\r\nimport { Color4 } from \"core/Maths/math.color\";\r\nimport { Vector2, Vector3 } from \"core/Maths/math.vector\";\r\nimport { NodeParticleBlockConnectionPointTypes } from \"core/Particles/Node/Enums/nodeParticleBlockConnectionPointTypes\";\r\nimport { NodeParticleContextualSources } from \"core/Particles/Node/Enums/nodeParticleContextualSources\";\r\nimport { NodeParticleSystemSources } from \"core/Particles/Node/Enums/nodeParticleSystemSources\";\r\n\r\n/**\r\n * Class used to store node based geometry build state\r\n */\r\nexport class NodeParticleBuildState {\r\n /**\r\n * Gets the capactity of the particle system to build\r\n */\r\n public capacity: number;\r\n\r\n /**\r\n * Gets the scene where the particle system is built\r\n */\r\n public scene: Scene;\r\n\r\n /** Gets or sets the build identifier */\r\n public buildId: number;\r\n\r\n /** Gets or sets the list of non connected mandatory inputs */\r\n public notConnectedNonOptionalInputs: NodeParticleConnectionPoint[] = [];\r\n\r\n /** Gets or sets a boolean indicating that verbose mode is on */\r\n public verbose: boolean;\r\n\r\n /**\r\n * Gets or sets the particle context for contextual data\r\n */\r\n public particleContext: Nullable<Particle> = null;\r\n\r\n /**\r\n * Gets or sets the system context for contextual data\r\n */\r\n public systemContext: Nullable<ThinParticleSystem> = null;\r\n\r\n /**\r\n * Gets or sets the index of the gradient to use\r\n */\r\n public gradientIndex: number = 0;\r\n /**\r\n * Gets or sets next gradient in line\r\n */\r\n public nextGradientIndex: number = 0;\r\n /**\r\n * Gets or sets the next gradient value\r\n */\r\n public nextGradientValue: any;\r\n\r\n /**\r\n * Emits errors if any\r\n */\r\n public emitErrors() {\r\n let errorMessage = \"\";\r\n\r\n for (const notConnectedInput of this.notConnectedNonOptionalInputs) {\r\n errorMessage += `input ${notConnectedInput.name} from block ${\r\n notConnectedInput.ownerBlock.name\r\n }[${notConnectedInput.ownerBlock.getClassName()}] is not connected and is not optional.\\n`;\r\n }\r\n\r\n if (errorMessage) {\r\n // eslint-disable-next-line no-throw-literal\r\n throw \"Build of Node Particle System Set failed:\\n\" + errorMessage;\r\n }\r\n }\r\n\r\n /**\r\n * Adapt a value to a target type\r\n * @param source defines the value to adapt\r\n * @param targetType defines the target type\r\n * @returns the adapted value\r\n */\r\n adapt(source: NodeParticleConnectionPoint, targetType: NodeParticleBlockConnectionPointTypes) {\r\n const value = source.getConnectedValue(this) || 0;\r\n\r\n if (source.type === targetType) {\r\n return value;\r\n }\r\n\r\n switch (targetType) {\r\n case NodeParticleBlockConnectionPointTypes.Vector2:\r\n return new Vector2(value, value);\r\n case NodeParticleBlockConnectionPointTypes.Vector3:\r\n return new Vector3(value, value, value);\r\n case NodeParticleBlockConnectionPointTypes.Color4:\r\n return new Color4(value, value, value, value);\r\n }\r\n\r\n return null;\r\n }\r\n\r\n /**\r\n * Gets the value associated with a contextual source\r\n * @param source Source of the contextual value\r\n * @returns the value associated with the source\r\n */\r\n public getContextualValue(source: NodeParticleContextualSources) {\r\n if (!this.particleContext || !this.systemContext) {\r\n return null;\r\n }\r\n\r\n switch (source) {\r\n case NodeParticleContextualSources.Position:\r\n return this.particleContext.position;\r\n case NodeParticleContextualSources.Direction:\r\n return this.particleContext.direction;\r\n case NodeParticleContextualSources.DirectionScale:\r\n return this.particleContext._directionScale;\r\n case NodeParticleContextualSources.ScaledDirection:\r\n this.particleContext.direction.scaleToRef(this.particleContext._directionScale, this.particleContext._scaledDirection);\r\n return this.particleContext._scaledDirection;\r\n case NodeParticleContextualSources.Color:\r\n return this.particleContext.color;\r\n case NodeParticleContextualSources.InitialColor:\r\n return this.particleContext.initialColor;\r\n case NodeParticleContextualSources.ColorDead:\r\n return this.particleContext.colorDead;\r\n case NodeParticleContextualSources.Age:\r\n return this.particleContext.age;\r\n case NodeParticleContextualSources.Lifetime:\r\n return this.particleContext.lifeTime;\r\n case NodeParticleContextualSources.Angle:\r\n return this.particleContext.angle;\r\n case NodeParticleContextualSources.Scale:\r\n return this.particleContext.scale;\r\n case NodeParticleContextualSources.Size:\r\n return this.particleContext.size;\r\n case NodeParticleContextualSources.AgeGradient:\r\n return this.particleContext.age / this.particleContext.lifeTime;\r\n case NodeParticleContextualSources.SpriteCellEnd:\r\n return this.systemContext.endSpriteCellID;\r\n case NodeParticleContextualSources.SpriteCellIndex:\r\n return this.particleContext.cellIndex;\r\n case NodeParticleContextualSources.SpriteCellStart:\r\n return this.systemContext.startSpriteCellID;\r\n case NodeParticleContextualSources.InitialDirection:\r\n return this.particleContext._initialDirection;\r\n case NodeParticleContextualSources.ColorStep:\r\n return this.particleContext.colorStep;\r\n case NodeParticleContextualSources.ScaledColorStep:\r\n this.particleContext.colorStep.scaleToRef(this.systemContext._scaledUpdateSpeed, this.systemContext._scaledColorStep);\r\n return this.systemContext._scaledColorStep;\r\n case NodeParticleContextualSources.LocalPositionUpdated:\r\n this.particleContext.direction.scaleToRef(this.particleContext._directionScale, this.particleContext._scaledDirection);\r\n this.particleContext._localPosition!.addInPlace(this.particleContext._scaledDirection);\r\n Vector3.TransformCoordinatesToRef(this.particleContext._localPosition!, this.systemContext._emitterWorldMatrix, this.particleContext.position);\r\n return this.particleContext.position;\r\n }\r\n\r\n return null;\r\n }\r\n\r\n /**\r\n * Gets the emitter world matrix\r\n */\r\n public get emitterWorldMatrix() {\r\n if (!this.systemContext) {\r\n return null;\r\n }\r\n return this.systemContext._emitterWorldMatrix;\r\n }\r\n\r\n /**\r\n * Gets the emitter inverse world matrix\r\n */\r\n public get emitterInverseWorldMatrix() {\r\n if (!this.systemContext) {\r\n return null;\r\n }\r\n return this.systemContext._emitterInverseWorldMatrix;\r\n }\r\n\r\n /**\r\n * Gets the emitter position\r\n */\r\n public get emitterPosition(): Nullable<Vector3> {\r\n if (!this.systemContext) {\r\n return null;\r\n }\r\n\r\n if (!this.systemContext.emitter) {\r\n return null;\r\n }\r\n\r\n if (this.systemContext.emitter instanceof Vector3) {\r\n return this.systemContext.emitter;\r\n }\r\n\r\n return (<AbstractMesh>this.systemContext.emitter).absolutePosition;\r\n }\r\n\r\n /**\r\n * Gets the value associated with a system source\r\n * @param source Source of the system value\r\n * @returns the value associated with the source\r\n */\r\n public getSystemValue(source: NodeParticleSystemSources) {\r\n if (!this.systemContext) {\r\n return null;\r\n }\r\n\r\n switch (source) {\r\n case NodeParticleSystemSources.Time:\r\n return this.systemContext._actualFrame;\r\n case NodeParticleSystemSources.Delta:\r\n return this.systemContext._scaledUpdateSpeed;\r\n case NodeParticleSystemSources.Emitter:\r\n return this.emitterPosition;\r\n case NodeParticleSystemSources.CameraPosition:\r\n return this.scene.activeCamera?.globalPosition || Vector3.Zero();\r\n }\r\n\r\n return null;\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"nodeParticleBuildState.js","sourceRoot":"","sources":["../../../../../dev/core/src/Particles/Node/nodeParticleBuildState.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,MAAM,EAAE,kCAA8B;AAC/C,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,mCAA+B;AAC1D,OAAO,EAAE,qCAAqC,EAAE,yDAAwE;AACxH,OAAO,EAAE,6BAA6B,EAAE,iDAAgE;AACxG,OAAO,EAAE,yB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B,CAAC;QAED,QAAQ,MAAM,EAAE,CAAC;YACb,KAAK,yBAAyB,CAAC,IAAI;gBAC/B,OAAO,IAAI,CAAC,aAAa,CAAC,YAAY,CAAC;YAC3C,KAAK,yBAAyB,CAAC,KAAK;gBAChC,OAAO,IAAI,CAAC,aAAa,CAAC,kBAAkB,CAAC;YACjD,KAAK,yBAAyB,CAAC,OAAO;gBAClC,OAAO,IAAI,CAAC,eAAe,CAAC;YAChC,KAAK,yBAAyB,CAAC,cAAc;gBACzC,OAAO,IAAI,CAAC,KAAK,CAAC,YAAY,EAAE,cAAc,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC;QACzE,CAAC;QAED,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ","sourcesContent":["import type { Scene } from \"core/scene\";\r\nimport type { Nullable } from \"core/types\";\r\nimport type { AbstractMesh } from \"core/Meshes/abstractMesh\";\r\nimport type { Particle } from \"core/Particles/particle\";\r\nimport type { ThinParticleSystem } from \"core/Particles/thinParticleSystem\";\r\nimport type { NodeParticleConnectionPoint } from \"core/Particles/Node/nodeParticleBlockConnectionPoint\";\r\n\r\nimport { Color4 } from \"core/Maths/math.color\";\r\nimport { Vector2, Vector3 } from \"core/Maths/math.vector\";\r\nimport { NodeParticleBlockConnectionPointTypes } from \"core/Particles/Node/Enums/nodeParticleBlockConnectionPointTypes\";\r\nimport { NodeParticleContextualSources } from \"core/Particles/Node/Enums/nodeParticleContextualSources\";\r\nimport { NodeParticleSystemSources } from \"core/Particles/Node/Enums/nodeParticleSystemSources\";\r\n\r\n/**\r\n * Class used to store node based geometry build state\r\n */\r\nexport class NodeParticleBuildState {\r\n /**\r\n * Gets the capactity of the particle system to build\r\n */\r\n public capacity: number;\r\n\r\n /**\r\n * Gets the scene where the particle system is built\r\n */\r\n public scene: Scene;\r\n\r\n /** Gets or sets the build identifier */\r\n public buildId: number;\r\n\r\n /** Gets or sets the list of non connected mandatory inputs */\r\n public notConnectedNonOptionalInputs: NodeParticleConnectionPoint[] = [];\r\n\r\n /** Gets or sets a boolean indicating that verbose mode is on */\r\n public verbose: boolean;\r\n\r\n /**\r\n * Gets or sets the particle context for contextual data\r\n */\r\n public particleContext: Nullable<Particle> = null;\r\n\r\n /**\r\n * Gets or sets the system context for contextual data\r\n */\r\n public systemContext: Nullable<ThinParticleSystem> = null;\r\n\r\n /**\r\n * Gets or sets the index of the gradient to use\r\n */\r\n public gradientIndex: number = 0;\r\n /**\r\n * Gets or sets next gradient in line\r\n */\r\n public nextGradientIndex: number = 0;\r\n /**\r\n * Gets or sets the next gradient value\r\n */\r\n public nextGradientValue: any;\r\n\r\n /**\r\n * Emits errors if any\r\n */\r\n public emitErrors() {\r\n let errorMessage = \"\";\r\n\r\n for (const notConnectedInput of this.notConnectedNonOptionalInputs) {\r\n errorMessage += `input ${notConnectedInput.name} from block ${\r\n notConnectedInput.ownerBlock.name\r\n }[${notConnectedInput.ownerBlock.getClassName()}] is not connected and is not optional.\\n`;\r\n }\r\n\r\n if (errorMessage) {\r\n // eslint-disable-next-line no-throw-literal\r\n throw \"Build of Node Particle System Set failed:\\n\" + errorMessage;\r\n }\r\n }\r\n\r\n /**\r\n * Adapt a value to a target type\r\n * @param source defines the value to adapt\r\n * @param targetType defines the target type\r\n * @returns the adapted value\r\n */\r\n adapt(source: NodeParticleConnectionPoint, targetType: NodeParticleBlockConnectionPointTypes) {\r\n const value = source.getConnectedValue(this) || 0;\r\n\r\n if (source.type === targetType) {\r\n return value;\r\n }\r\n\r\n switch (targetType) {\r\n case NodeParticleBlockConnectionPointTypes.Vector2:\r\n return new Vector2(value, value);\r\n case NodeParticleBlockConnectionPointTypes.Vector3:\r\n return new Vector3(value, value, value);\r\n case NodeParticleBlockConnectionPointTypes.Color4:\r\n return new Color4(value, value, value, value);\r\n }\r\n\r\n return null;\r\n }\r\n\r\n /**\r\n * Gets the value associated with a contextual source\r\n * @param source Source of the contextual value\r\n * @returns the value associated with the source\r\n */\r\n public getContextualValue(source: NodeParticleContextualSources) {\r\n if (!this.particleContext || !this.systemContext) {\r\n return null;\r\n }\r\n\r\n switch (source) {\r\n case NodeParticleContextualSources.Position:\r\n return this.particleContext.position;\r\n case NodeParticleContextualSources.Direction:\r\n return this.particleContext.direction;\r\n case NodeParticleContextualSources.DirectionScale:\r\n return this.particleContext._properties.directionScale;\r\n case NodeParticleContextualSources.ScaledDirection:\r\n this.particleContext.direction.scaleToRef(this.particleContext._properties.directionScale, this.particleContext._properties.scaledDirection);\r\n return this.particleContext._properties.scaledDirection;\r\n case NodeParticleContextualSources.Color:\r\n return this.particleContext.color;\r\n case NodeParticleContextualSources.InitialColor:\r\n return this.particleContext.initialColor;\r\n case NodeParticleContextualSources.ColorDead:\r\n return this.particleContext.colorDead;\r\n case NodeParticleContextualSources.Age:\r\n return this.particleContext.age;\r\n case NodeParticleContextualSources.Lifetime:\r\n return this.particleContext.lifeTime;\r\n case NodeParticleContextualSources.Angle:\r\n return this.particleContext.angle;\r\n case NodeParticleContextualSources.Scale:\r\n return this.particleContext.scale;\r\n case NodeParticleContextualSources.Size:\r\n return this.particleContext.size;\r\n case NodeParticleContextualSources.AgeGradient:\r\n return this.particleContext.age / this.particleContext.lifeTime;\r\n case NodeParticleContextualSources.SpriteCellEnd:\r\n return this.systemContext.endSpriteCellID;\r\n case NodeParticleContextualSources.SpriteCellIndex:\r\n return this.particleContext.cellIndex;\r\n case NodeParticleContextualSources.SpriteCellStart:\r\n return this.systemContext.startSpriteCellID;\r\n case NodeParticleContextualSources.InitialDirection:\r\n return this.particleContext._properties.initialDirection;\r\n case NodeParticleContextualSources.ColorStep:\r\n return this.particleContext.colorStep;\r\n case NodeParticleContextualSources.ScaledColorStep:\r\n this.particleContext.colorStep.scaleToRef(this.systemContext._scaledUpdateSpeed, this.systemContext._scaledColorStep);\r\n return this.systemContext._scaledColorStep;\r\n case NodeParticleContextualSources.LocalPositionUpdated:\r\n this.particleContext.direction.scaleToRef(this.particleContext._properties.directionScale, this.particleContext._properties.scaledDirection);\r\n this.particleContext._properties.localPosition!.addInPlace(this.particleContext._properties.scaledDirection);\r\n Vector3.TransformCoordinatesToRef(this.particleContext._properties.localPosition!, this.systemContext._emitterWorldMatrix, this.particleContext.position);\r\n return this.particleContext.position;\r\n }\r\n\r\n return null;\r\n }\r\n\r\n /**\r\n * Gets the emitter world matrix\r\n */\r\n public get emitterWorldMatrix() {\r\n if (!this.systemContext) {\r\n return null;\r\n }\r\n return this.systemContext._emitterWorldMatrix;\r\n }\r\n\r\n /**\r\n * Gets the emitter inverse world matrix\r\n */\r\n public get emitterInverseWorldMatrix() {\r\n if (!this.systemContext) {\r\n return null;\r\n }\r\n return this.systemContext._emitterInverseWorldMatrix;\r\n }\r\n\r\n /**\r\n * Gets the emitter position\r\n */\r\n public get emitterPosition(): Nullable<Vector3> {\r\n if (!this.systemContext) {\r\n return null;\r\n }\r\n\r\n if (!this.systemContext.emitter) {\r\n return null;\r\n }\r\n\r\n if (this.systemContext.emitter instanceof Vector3) {\r\n return this.systemContext.emitter;\r\n }\r\n\r\n return (<AbstractMesh>this.systemContext.emitter).absolutePosition;\r\n }\r\n\r\n /**\r\n * Gets the value associated with a system source\r\n * @param source Source of the system value\r\n * @returns the value associated with the source\r\n */\r\n public getSystemValue(source: NodeParticleSystemSources) {\r\n if (!this.systemContext) {\r\n return null;\r\n }\r\n\r\n switch (source) {\r\n case NodeParticleSystemSources.Time:\r\n return this.systemContext._actualFrame;\r\n case NodeParticleSystemSources.Delta:\r\n return this.systemContext._scaledUpdateSpeed;\r\n case NodeParticleSystemSources.Emitter:\r\n return this.emitterPosition;\r\n case NodeParticleSystemSources.CameraPosition:\r\n return this.scene.activeCamera?.globalPosition || Vector3.Zero();\r\n }\r\n\r\n return null;\r\n }\r\n}\r\n"]}
@@ -12,6 +12,7 @@ import { ParticleGradientValueBlock } from "./Blocks/particleGradientValueBlock.
12
12
  import { ParticleInputBlock } from "./Blocks/particleInputBlock.js";
13
13
  import { ParticleMathBlock, ParticleMathBlockOperations } from "./Blocks/particleMathBlock.js";
14
14
  import { ParticleRandomBlock, ParticleRandomBlockLocks } from "./Blocks/particleRandomBlock.js";
15
+ import { ParticleLerpBlock } from "./Blocks/particleLerpBlock.js";
15
16
  import { ParticleTextureSourceBlock } from "./Blocks/particleSourceTextureBlock.js";
16
17
  import { ParticleVectorLengthBlock } from "./Blocks/particleVectorLengthBlock.js";
17
18
  import { SystemBlock } from "./Blocks/systemBlock.js";
@@ -184,10 +185,14 @@ function _CreateParticleColorBlockGroup(oldSystem, context) {
184
185
  return context.colorGradientValue0Output;
185
186
  }
186
187
  else {
187
- const randomColorBlock = new ParticleRandomBlock("Random color");
188
- _CreateAndConnectInput("Color 1", oldSystem.color1.clone(), randomColorBlock.min);
189
- _CreateAndConnectInput("Color 2", oldSystem.color2.clone(), randomColorBlock.max);
190
- return randomColorBlock.output;
188
+ const randomStepBlock = new ParticleRandomBlock("Random color step");
189
+ _CreateAndConnectInput("Min", 0, randomStepBlock.min);
190
+ _CreateAndConnectInput("Max", 1, randomStepBlock.max);
191
+ const lerpColorBlock = new ParticleLerpBlock("Lerp color");
192
+ _CreateAndConnectInput("Color 1", oldSystem.color1.clone(), lerpColorBlock.left);
193
+ _CreateAndConnectInput("Color 2", oldSystem.color2.clone(), lerpColorBlock.right);
194
+ randomStepBlock.output.connectTo(lerpColorBlock.gradient);
195
+ return lerpColorBlock.output;
191
196
  }
192
197
  }
193
198
  function _CreateParticleInitialValueFromGradient(gradients) {