@onerjs/core 8.55.7 → 8.55.9

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 (261) hide show
  1. package/Animations/animation.pure.js +2 -2
  2. package/Animations/animation.pure.js.map +1 -1
  3. package/Animations/runtimeAnimation.js +4 -0
  4. package/Animations/runtimeAnimation.js.map +1 -1
  5. package/Behaviors/Cameras/autoRotationBehavior.js +1 -1
  6. package/Behaviors/Cameras/autoRotationBehavior.js.map +1 -1
  7. package/Behaviors/Meshes/followBehavior.js +1 -0
  8. package/Behaviors/Meshes/followBehavior.js.map +1 -1
  9. package/Behaviors/Meshes/surfaceMagnetismBehavior.js +1 -0
  10. package/Behaviors/Meshes/surfaceMagnetismBehavior.js.map +1 -1
  11. package/Cameras/Inputs/followCameraMouseWheelInput.js +2 -2
  12. package/Cameras/Inputs/followCameraMouseWheelInput.js.map +1 -1
  13. package/Cameras/Inputs/followCameraPointersInput.d.ts +15 -0
  14. package/Cameras/Inputs/followCameraPointersInput.js +18 -3
  15. package/Cameras/Inputs/followCameraPointersInput.js.map +1 -1
  16. package/Cameras/Stereoscopic/stereoscopicScreenUniversalCamera.js +1 -1
  17. package/Cameras/Stereoscopic/stereoscopicScreenUniversalCamera.js.map +1 -1
  18. package/Cameras/Stereoscopic/stereoscopicUniversalCamera.pure.js +1 -1
  19. package/Cameras/Stereoscopic/stereoscopicUniversalCamera.pure.js.map +1 -1
  20. package/Cameras/arcRotateCamera.pure.js +1 -1
  21. package/Cameras/arcRotateCamera.pure.js.map +1 -1
  22. package/Collisions/gpuPicker.d.ts +1 -0
  23. package/Collisions/gpuPicker.js +5 -4
  24. package/Collisions/gpuPicker.js.map +1 -1
  25. package/Culling/Helper/boundingInfoHelper.js +1 -1
  26. package/Culling/Helper/boundingInfoHelper.js.map +1 -1
  27. package/Culling/boundingSphere.js +7 -4
  28. package/Culling/boundingSphere.js.map +1 -1
  29. package/Engines/Extensions/engine.prefilteredCubeTexture.pure.js +1 -1
  30. package/Engines/Extensions/engine.prefilteredCubeTexture.pure.js.map +1 -1
  31. package/Engines/Native/Extensions/nativeEngine.cubeTexture.pure.js +48 -6
  32. package/Engines/Native/Extensions/nativeEngine.cubeTexture.pure.js.map +1 -1
  33. package/Engines/Native/nativeInterfaces.d.ts +1 -1
  34. package/Engines/Native/nativeInterfaces.js.map +1 -1
  35. package/Engines/abstractEngine.pure.js +2 -2
  36. package/Engines/abstractEngine.pure.js.map +1 -1
  37. package/Engines/engine.d.ts +10 -1
  38. package/Engines/thinNativeEngine.pure.d.ts +6 -1
  39. package/Engines/thinNativeEngine.pure.js +29 -2
  40. package/Engines/thinNativeEngine.pure.js.map +1 -1
  41. package/FlowGraph/Blocks/Data/flowGraphIsKeyPressedBlock.d.ts +3 -63
  42. package/FlowGraph/Blocks/Data/flowGraphIsKeyPressedBlock.js +5 -71
  43. package/FlowGraph/Blocks/Data/flowGraphIsKeyPressedBlock.js.map +1 -1
  44. package/FlowGraph/Blocks/Data/flowGraphIsKeyPressedBlock.pure.d.ts +71 -0
  45. package/FlowGraph/Blocks/Data/flowGraphIsKeyPressedBlock.pure.js +86 -0
  46. package/FlowGraph/Blocks/Data/flowGraphIsKeyPressedBlock.pure.js.map +1 -0
  47. package/FlowGraph/Blocks/Data/pure.d.ts +1 -0
  48. package/FlowGraph/Blocks/Data/pure.js +1 -0
  49. package/FlowGraph/Blocks/Data/pure.js.map +1 -1
  50. package/FlowGraph/Blocks/Event/flowGraphKeyDownEventBlock.d.ts +3 -37
  51. package/FlowGraph/Blocks/Event/flowGraphKeyDownEventBlock.js +5 -39
  52. package/FlowGraph/Blocks/Event/flowGraphKeyDownEventBlock.js.map +1 -1
  53. package/FlowGraph/Blocks/Event/flowGraphKeyDownEventBlock.pure.d.ts +45 -0
  54. package/FlowGraph/Blocks/Event/flowGraphKeyDownEventBlock.pure.js +54 -0
  55. package/FlowGraph/Blocks/Event/flowGraphKeyDownEventBlock.pure.js.map +1 -0
  56. package/FlowGraph/Blocks/Event/flowGraphKeyUpEventBlock.d.ts +3 -17
  57. package/FlowGraph/Blocks/Event/flowGraphKeyUpEventBlock.js +5 -22
  58. package/FlowGraph/Blocks/Event/flowGraphKeyUpEventBlock.js.map +1 -1
  59. package/FlowGraph/Blocks/Event/flowGraphKeyUpEventBlock.pure.d.ts +25 -0
  60. package/FlowGraph/Blocks/Event/flowGraphKeyUpEventBlock.pure.js +37 -0
  61. package/FlowGraph/Blocks/Event/flowGraphKeyUpEventBlock.pure.js.map +1 -0
  62. package/FlowGraph/Blocks/Event/pure.d.ts +2 -0
  63. package/FlowGraph/Blocks/Event/pure.js +2 -0
  64. package/FlowGraph/Blocks/Event/pure.js.map +1 -1
  65. package/FlowGraph/Blocks/flowGraphBlockFactory.d.ts +1 -1
  66. package/FlowGraph/Blocks/flowGraphBlockFactory.js +198 -172
  67. package/FlowGraph/Blocks/flowGraphBlockFactory.js.map +1 -1
  68. package/FrameGraph/frameGraph.js +10 -1
  69. package/FrameGraph/frameGraph.js.map +1 -1
  70. package/Gamepads/gamepadManager.d.ts +1 -0
  71. package/Gamepads/gamepadManager.js +5 -2
  72. package/Gamepads/gamepadManager.js.map +1 -1
  73. package/Gizmos/scaleGizmo.js +1 -0
  74. package/Gizmos/scaleGizmo.js.map +1 -1
  75. package/Lights/IES/iesLoader.js +6 -8
  76. package/Lights/IES/iesLoader.js.map +1 -1
  77. package/Lights/Shadows/cascadedShadowGenerator.pure.js +4 -6
  78. package/Lights/Shadows/cascadedShadowGenerator.pure.js.map +1 -1
  79. package/Lights/Shadows/shadowGenerator.js +2 -2
  80. package/Lights/Shadows/shadowGenerator.js.map +1 -1
  81. package/Lights/light.js +3 -5
  82. package/Lights/light.js.map +1 -1
  83. package/Lights/spotLight.pure.js +1 -1
  84. package/Lights/spotLight.pure.js.map +1 -1
  85. package/Materials/Background/backgroundMaterial.pure.d.ts +1 -1
  86. package/Materials/Background/backgroundMaterial.pure.js +3 -12
  87. package/Materials/Background/backgroundMaterial.pure.js.map +1 -1
  88. package/Materials/GaussianSplatting/gaussianSplattingMaterial.pure.js +2 -0
  89. package/Materials/GaussianSplatting/gaussianSplattingMaterial.pure.js.map +1 -1
  90. package/Materials/Node/Blocks/Fragment/TBNBlock.pure.js +1 -1
  91. package/Materials/Node/Blocks/Fragment/TBNBlock.pure.js.map +1 -1
  92. package/Materials/PBR/openpbrMaterial.pure.d.ts +1 -1
  93. package/Materials/PBR/openpbrMaterial.pure.js +3 -12
  94. package/Materials/PBR/openpbrMaterial.pure.js.map +1 -1
  95. package/Materials/PBR/pbrBaseMaterial.pure.d.ts +1 -1
  96. package/Materials/PBR/pbrBaseMaterial.pure.js +3 -12
  97. package/Materials/PBR/pbrBaseMaterial.pure.js.map +1 -1
  98. package/Materials/Textures/renderTargetTexture.pure.js +1 -1
  99. package/Materials/Textures/renderTargetTexture.pure.js.map +1 -1
  100. package/Materials/material.pure.js +2 -2
  101. package/Materials/material.pure.js.map +1 -1
  102. package/Materials/standardMaterial.pure.d.ts +1 -1
  103. package/Materials/standardMaterial.pure.js +4 -13
  104. package/Materials/standardMaterial.pure.js.map +1 -1
  105. package/Maths/math.path.js +1 -1
  106. package/Maths/math.path.js.map +1 -1
  107. package/Maths/math.polar.js +1 -1
  108. package/Maths/math.polar.js.map +1 -1
  109. package/Maths/math.vector.pure.js +4 -3
  110. package/Maths/math.vector.pure.js.map +1 -1
  111. package/Meshes/GaussianSplatting/gaussianSplattingMesh.pure.d.ts +72 -0
  112. package/Meshes/GaussianSplatting/gaussianSplattingMesh.pure.js +164 -1
  113. package/Meshes/GaussianSplatting/gaussianSplattingMesh.pure.js.map +1 -1
  114. package/Meshes/GaussianSplatting/gaussianSplattingMeshBase.pure.d.ts +2 -1
  115. package/Meshes/GaussianSplatting/gaussianSplattingMeshBase.pure.js +36 -18
  116. package/Meshes/GaussianSplatting/gaussianSplattingMeshBase.pure.js.map +1 -1
  117. package/Meshes/GaussianSplatting/gaussianSplattingPartProxyMesh.pure.d.ts +5 -4
  118. package/Meshes/GaussianSplatting/gaussianSplattingPartProxyMesh.pure.js +25 -8
  119. package/Meshes/GaussianSplatting/gaussianSplattingPartProxyMesh.pure.js.map +1 -1
  120. package/Meshes/GreasedLine/greasedLineRibbonMesh.pure.js +3 -3
  121. package/Meshes/GreasedLine/greasedLineRibbonMesh.pure.js.map +1 -1
  122. package/Meshes/Node/Blocks/Instances/instantiateOnVolumeBlock.pure.js +1 -1
  123. package/Meshes/Node/Blocks/Instances/instantiateOnVolumeBlock.pure.js.map +1 -1
  124. package/Meshes/Node/Blocks/geometryOptimizeBlock.pure.js +2 -2
  125. package/Meshes/Node/Blocks/geometryOptimizeBlock.pure.js.map +1 -1
  126. package/Meshes/Node/Blocks/mappingBlock.pure.js +2 -2
  127. package/Meshes/Node/Blocks/mappingBlock.pure.js.map +1 -1
  128. package/Meshes/csg.js +5 -5
  129. package/Meshes/csg.js.map +1 -1
  130. package/Meshes/groundMesh.pure.js +1 -1
  131. package/Meshes/groundMesh.pure.js.map +1 -1
  132. package/Meshes/mesh.pure.js +2 -2
  133. package/Meshes/mesh.pure.js.map +1 -1
  134. package/Misc/deepMerger.js +1 -1
  135. package/Misc/deepMerger.js.map +1 -1
  136. package/Misc/dumpTools.pure.js +1 -1
  137. package/Misc/dumpTools.pure.js.map +1 -1
  138. package/Misc/index.d.ts +1 -0
  139. package/Misc/index.js +1 -0
  140. package/Misc/index.js.map +1 -1
  141. package/Misc/pure.d.ts +1 -0
  142. package/Misc/pure.js +1 -0
  143. package/Misc/pure.js.map +1 -1
  144. package/Misc/shaderImportLoader.d.ts +25 -0
  145. package/Misc/shaderImportLoader.js +54 -0
  146. package/Misc/shaderImportLoader.js.map +1 -0
  147. package/Misc/tools.pure.js +1 -1
  148. package/Misc/tools.pure.js.map +1 -1
  149. package/Particles/Node/Blocks/particleClampBlock.pure.d.ts +0 -1
  150. package/Particles/Node/Blocks/particleClampBlock.pure.js +1 -6
  151. package/Particles/Node/Blocks/particleClampBlock.pure.js.map +1 -1
  152. package/Particles/Node/Blocks/particleMathBlock.pure.js +1 -1
  153. package/Particles/Node/Blocks/particleMathBlock.pure.js.map +1 -1
  154. package/Particles/Node/Blocks/particleNLerpBlock.pure.js +8 -3
  155. package/Particles/Node/Blocks/particleNLerpBlock.pure.js.map +1 -1
  156. package/Particles/Node/Blocks/particleSmoothStepBlock.pure.js +3 -2
  157. package/Particles/Node/Blocks/particleSmoothStepBlock.pure.js.map +1 -1
  158. package/Particles/Node/Blocks/particleStepBlock.pure.js +3 -2
  159. package/Particles/Node/Blocks/particleStepBlock.pure.js.map +1 -1
  160. package/PostProcesses/RenderPipeline/Pipelines/defaultRenderingPipeline.pure.js +1 -1
  161. package/PostProcesses/RenderPipeline/Pipelines/defaultRenderingPipeline.pure.js.map +1 -1
  162. package/PostProcesses/depthOfFieldEffect.js +1 -1
  163. package/PostProcesses/depthOfFieldEffect.js.map +1 -1
  164. package/PostProcesses/screenSpaceCurvaturePostProcess.pure.js +1 -1
  165. package/PostProcesses/screenSpaceCurvaturePostProcess.pure.js.map +1 -1
  166. package/PostProcesses/sharpenPostProcess.pure.js +1 -1
  167. package/PostProcesses/sharpenPostProcess.pure.js.map +1 -1
  168. package/Rendering/IBLShadows/iblShadowsRenderPipeline.pure.d.ts +12 -0
  169. package/Rendering/IBLShadows/iblShadowsRenderPipeline.pure.js +15 -1
  170. package/Rendering/IBLShadows/iblShadowsRenderPipeline.pure.js.map +1 -1
  171. package/Rendering/IBLShadows/iblShadowsVoxelRenderer.pure.d.ts +14 -0
  172. package/Rendering/IBLShadows/iblShadowsVoxelRenderer.pure.js +122 -6
  173. package/Rendering/IBLShadows/iblShadowsVoxelRenderer.pure.js.map +1 -1
  174. package/Rendering/IBLShadows/iblShadowsVoxelTracingPass.d.ts +7 -0
  175. package/Rendering/IBLShadows/iblShadowsVoxelTracingPass.js +17 -0
  176. package/Rendering/IBLShadows/iblShadowsVoxelTracingPass.js.map +1 -1
  177. package/Rendering/boundingBoxRenderer.pure.js +3 -3
  178. package/Rendering/boundingBoxRenderer.pure.js.map +1 -1
  179. package/Rendering/outlineRenderer.pure.js +1 -0
  180. package/Rendering/outlineRenderer.pure.js.map +1 -1
  181. package/Rendering/subSurfaceConfiguration.js +1 -1
  182. package/Rendering/subSurfaceConfiguration.js.map +1 -1
  183. package/Rendering/subSurfaceSceneComponent.pure.d.ts +1 -1
  184. package/Rendering/subSurfaceSceneComponent.pure.js +1 -1
  185. package/Rendering/subSurfaceSceneComponent.pure.js.map +1 -1
  186. package/Rendering/utilityLayerRenderer.js +1 -1
  187. package/Rendering/utilityLayerRenderer.js.map +1 -1
  188. package/Shaders/gaussianSplattingVoxel.fragment.js +4 -10
  189. package/Shaders/gaussianSplattingVoxel.fragment.js.map +1 -1
  190. package/Shaders/iblCombineVoxelGrids.fragment.js +1 -1
  191. package/Shaders/iblCombineVoxelGrids.fragment.js.map +1 -1
  192. package/Shaders/iblShadowVoxelTracing.fragment.js +24 -7
  193. package/Shaders/iblShadowVoxelTracing.fragment.js.map +1 -1
  194. package/ShadersWGSL/ShadersInclude/iblVoxelOpacityAtomicMax.d.ts +5 -0
  195. package/ShadersWGSL/ShadersInclude/iblVoxelOpacityAtomicMax.js +13 -0
  196. package/ShadersWGSL/ShadersInclude/iblVoxelOpacityAtomicMax.js.map +1 -0
  197. package/ShadersWGSL/gaussianSplattingVoxel.fragment.js +15 -9
  198. package/ShadersWGSL/gaussianSplattingVoxel.fragment.js.map +1 -1
  199. package/ShadersWGSL/iblCombineVoxelGrids.fragment.js +1 -1
  200. package/ShadersWGSL/iblCombineVoxelGrids.fragment.js.map +1 -1
  201. package/ShadersWGSL/iblCopyVoxelBufferToGrid.compute.d.ts +5 -0
  202. package/ShadersWGSL/iblCopyVoxelBufferToGrid.compute.js +14 -0
  203. package/ShadersWGSL/iblCopyVoxelBufferToGrid.compute.js.map +1 -0
  204. package/ShadersWGSL/iblShadowVoxelTracing.fragment.js +24 -7
  205. package/ShadersWGSL/iblShadowVoxelTracing.fragment.js.map +1 -1
  206. package/ShadersWGSL/iblVoxelGrid.fragment.js +26 -6
  207. package/ShadersWGSL/iblVoxelGrid.fragment.js.map +1 -1
  208. package/SmartAssets/smartAssetManager.pure.js +1 -1
  209. package/SmartAssets/smartAssetManager.pure.js.map +1 -1
  210. package/Sprites/thinSprite.js +1 -1
  211. package/Sprites/thinSprite.js.map +1 -1
  212. package/XR/features/Layers/WebXRCompositionLayer.d.ts +130 -12
  213. package/XR/features/Layers/WebXRCompositionLayer.js +192 -3
  214. package/XR/features/Layers/WebXRCompositionLayer.js.map +1 -1
  215. package/XR/features/Layers/WebXRFallbackLayer.d.ts +84 -0
  216. package/XR/features/Layers/WebXRFallbackLayer.js +137 -0
  217. package/XR/features/Layers/WebXRFallbackLayer.js.map +1 -0
  218. package/XR/features/Layers/WebXRWebGPUCompositionLayer.d.ts +4 -4
  219. package/XR/features/Layers/WebXRWebGPUCompositionLayer.js.map +1 -1
  220. package/XR/features/WebXRAnchorSystem.pure.d.ts +45 -0
  221. package/XR/features/WebXRAnchorSystem.pure.js +153 -13
  222. package/XR/features/WebXRAnchorSystem.pure.js.map +1 -1
  223. package/XR/features/WebXRLayers.pure.d.ts +171 -8
  224. package/XR/features/WebXRLayers.pure.js +500 -98
  225. package/XR/features/WebXRLayers.pure.js.map +1 -1
  226. package/XR/features/WebXRLayersFallback.d.ts +5 -0
  227. package/XR/features/WebXRLayersFallback.js +8 -0
  228. package/XR/features/WebXRLayersFallback.js.map +1 -0
  229. package/XR/features/WebXRLayersFallback.pure.d.ts +6 -0
  230. package/XR/features/WebXRLayersFallback.pure.js +44 -0
  231. package/XR/features/WebXRLayersFallback.pure.js.map +1 -0
  232. package/XR/features/WebXRLightEstimation.pure.d.ts +3 -4
  233. package/XR/features/WebXRLightEstimation.pure.js +22 -21
  234. package/XR/features/WebXRLightEstimation.pure.js.map +1 -1
  235. package/XR/features/WebXRMeshDetector.pure.d.ts +5 -0
  236. package/XR/features/WebXRMeshDetector.pure.js +1 -0
  237. package/XR/features/WebXRMeshDetector.pure.js.map +1 -1
  238. package/XR/features/WebXRNearInteraction.pure.js +3 -3
  239. package/XR/features/WebXRNearInteraction.pure.js.map +1 -1
  240. package/XR/features/WebXRPlaneDetector.pure.d.ts +9 -5
  241. package/XR/features/WebXRPlaneDetector.pure.js +12 -8
  242. package/XR/features/WebXRPlaneDetector.pure.js.map +1 -1
  243. package/XR/features/pure.d.ts +1 -0
  244. package/XR/features/pure.js +1 -0
  245. package/XR/features/pure.js.map +1 -1
  246. package/XR/webXRCamera.d.ts +2 -0
  247. package/XR/webXRCamera.js +8 -2
  248. package/XR/webXRCamera.js.map +1 -1
  249. package/XR/webXRLayerWrapper.d.ts +19 -5
  250. package/XR/webXRLayerWrapper.js +9 -0
  251. package/XR/webXRLayerWrapper.js.map +1 -1
  252. package/XR/webXRRenderTargetTextureProvider.d.ts +4 -4
  253. package/XR/webXRRenderTargetTextureProvider.js.map +1 -1
  254. package/XR/webXRWebGLRenderTargetTextureProvider.d.ts +2 -1
  255. package/XR/webXRWebGLRenderTargetTextureProvider.js.map +1 -1
  256. package/XR/webXRWebGPURenderTargetTextureProvider.d.ts +3 -3
  257. package/XR/webXRWebGPURenderTargetTextureProvider.js.map +1 -1
  258. package/package.json +1 -1
  259. package/scene.pure.d.ts +5 -0
  260. package/scene.pure.js +25 -0
  261. package/scene.pure.js.map +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"particleClampBlock.pure.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Particles/Node/Blocks/particleClampBlock.pure.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAE7D,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,qCAAqC,EAAE,MAAM,gDAAgD,CAAC;AAGvG,OAAO,EAAE,MAAM,EAAE,MAAM,gCAAgC,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM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oBACjD,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;gBAClG,CAAC;gBACD,KAAK,qCAAqC,CAAC,MAAM,CAAC,CAAC,CAAC;oBAChD,OAAO,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;gBAC1H,CAAC;YACL,CAAC;YAED,OAAO,CAAC,CAAC;QACb,CAAC,CAAC;QAEF,OAAO,IAAI,CAAC;IAChB,CAAC;IAEe,YAAY,CAAC,mBAAwB;QACjD,KAAK,CAAC,YAAY,CAAC,mBAAmB,CAAC,CAAC;QAExC,IAAI,CAAC,OAAO,GAAG,mBAAmB,CAAC,OAAO,CAAC;QAC3C,IAAI,CAAC,OAAO,GAAG,mBAAmB,CAAC,OAAO,CAAC;IAC/C,CAAC;CACJ;AAED,IAAI,WAAW,GAAG,KAAK,CAAC;AACxB;;;GAGG;AACH,MAAM,UAAU,0BAA0B;IACtC,IAAI,WAAW,EAAE,CAAC;QACd,OAAO;IACX,CAAC;IACD,WAAW,GAAG,IAAI,CAAC;IAEnB,aAAa,CAAC,4BAA4B,EAAE,kBAAkB,CAAC,CAAC;AACpE,CAAC","sourcesContent":["/** This file must only contain pure code and pure imports */\r\n\r\nimport { Vector2, Vector3 } from \"core/Maths/math.vector.pure\";\r\nimport { NodeParticleBlock } from \"../nodeParticleBlock\";\r\nimport { NodeParticleBlockConnectionPointTypes } from \"../Enums/nodeParticleBlockConnectionPointTypes\";\r\nimport { type NodeParticleConnectionPoint } from \"../nodeParticleBlockConnectionPoint\";\r\nimport { type NodeParticleBuildState } from \"../nodeParticleBuildState\";\r\nimport { Color4 } from \"../../../Maths/math.color.pure\";\r\nimport { RegisterClass } from \"../../../Misc/typeStore\";\r\n\r\n/**\r\n * Block used to clamp a float\r\n */\r\nexport class ParticleClampBlock extends NodeParticleBlock {\r\n /** Gets or sets the minimum range */\r\n public get minimum() {\r\n return this.min.value;\r\n }\r\n\r\n public set minimum(value: number) {\r\n this.min.value = value;\r\n }\r\n\r\n /** Gets or sets the maximum range */\r\n public get maximum() {\r\n return this.max.value;\r\n }\r\n\r\n public set maximum(value: number) {\r\n this.max.value = value;\r\n }\r\n\r\n /**\r\n * Creates a new ParticleClampBlock\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(\"value\", NodeParticleBlockConnectionPointTypes.AutoDetect);\r\n this.registerInput(\"min\", NodeParticleBlockConnectionPointTypes.Float, true, 0);\r\n this.registerInput(\"max\", NodeParticleBlockConnectionPointTypes.Float, true, 1);\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.Matrix);\r\n this._inputs[0].excludedConnectionPointTypes.push(NodeParticleBlockConnectionPointTypes.Particle);\r\n this._inputs[0].excludedConnectionPointTypes.push(NodeParticleBlockConnectionPointTypes.Texture);\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 }\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 \"ParticleClampBlock\";\r\n }\r\n\r\n /**\r\n * Gets the value input component\r\n */\r\n public get value(): NodeParticleConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the min input component\r\n */\r\n public get min(): NodeParticleConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the max input component\r\n */\r\n public get max(): 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 public override _build(state: NodeParticleBuildState) {\r\n if (!this.value.isConnected) {\r\n this.output._storedFunction = null;\r\n this.output._storedValue = null;\r\n return;\r\n }\r\n\r\n const func = (value: number, min: number, max: number) => {\r\n return Math.max(min, Math.min(value, max));\r\n };\r\n\r\n this.output._storedFunction = (state) => {\r\n const value = this.value.getConnectedValue(state);\r\n const min = this.min.isConnected ? this.min.getConnectedValue(state) : this.minimum;\r\n const max = this.max.isConnected ? this.max.getConnectedValue(state) : this.maximum;\r\n\r\n switch (this.value.type) {\r\n case NodeParticleBlockConnectionPointTypes.Int:\r\n case NodeParticleBlockConnectionPointTypes.Float: {\r\n return func(value, min, max);\r\n }\r\n case NodeParticleBlockConnectionPointTypes.Vector2: {\r\n return new Vector2(func(value.x, min, max), func(value.y, min, max));\r\n }\r\n case NodeParticleBlockConnectionPointTypes.Vector3: {\r\n return new Vector3(func(value.x, min, max), func(value.y, min, max), func(value.z, min, max));\r\n }\r\n case NodeParticleBlockConnectionPointTypes.Color4: {\r\n return new Color4(func(value.x, min, max), func(value.y, min, max), func(value.z, min, max), func(value.w, min, max));\r\n }\r\n }\r\n\r\n return 0;\r\n };\r\n\r\n return this;\r\n }\r\n\r\n public override _deserialize(serializationObject: any) {\r\n super._deserialize(serializationObject);\r\n\r\n this.minimum = serializationObject.minimum;\r\n this.maximum = serializationObject.maximum;\r\n }\r\n}\r\n\r\nlet _Registered = false;\r\n/**\r\n * Register side effects for particleClampBlock.\r\n * Safe to call multiple times; only the first call has an effect.\r\n */\r\nexport function RegisterParticleClampBlock(): void {\r\n if (_Registered) {\r\n return;\r\n }\r\n _Registered = true;\r\n\r\n RegisterClass(\"BABYLON.ParticleClampBlock\", ParticleClampBlock);\r\n}\r\n"]}
1
+ {"version":3,"file":"particleClampBlock.pure.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Particles/Node/Blocks/particleClampBlock.pure.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAE7D,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,qCAAqC,EAAE,MAAM,gDAAgD,CAAC;AAGvG,OAAO,EAAE,MAAM,EAAE,MAAM,gCAAgC,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAExD;;GAEG;AACH,MAAM,OAAO,kBAAmB,SAAQ,iBAAiB;IACrD,qCAAqC;IACrC,IAAW,OAAO;QACd,OAAO,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC;IAC1B,CAAC;IAED,IAAW,OAAO,CAAC,KAAa;QAC5B,IAAI,CAAC,GAAG,CAAC,KAAK,GAAG,KAAK,CAAC;IAC3B,CAAC;IAED,qCAAqC;IACrC,IAAW,OAAO;QACd,OAAO,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC;IAC1B,CAAC;IAED,IAAW,OAAO,CAAC,KAAa;QAC5B,IAAI,CAAC,GAAG,CAAC,KAAK,GAAG,KAAK,CAAC;IAC3B,CAAC;IAED;;;OAGG;I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IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;gBAC1H,CAAC;YACL,CAAC;YAED,OAAO,CAAC,CAAC;QACb,CAAC,CAAC;QAEF,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ;AAED,IAAI,WAAW,GAAG,KAAK,CAAC;AACxB;;;GAGG;AACH,MAAM,UAAU,0BAA0B;IACtC,IAAI,WAAW,EAAE,CAAC;QACd,OAAO;IACX,CAAC;IACD,WAAW,GAAG,IAAI,CAAC;IAEnB,aAAa,CAAC,4BAA4B,EAAE,kBAAkB,CAAC,CAAC;AACpE,CAAC","sourcesContent":["/** This file must only contain pure code and pure imports */\r\n\r\nimport { Vector2, Vector3 } from \"core/Maths/math.vector.pure\";\r\nimport { NodeParticleBlock } from \"../nodeParticleBlock\";\r\nimport { NodeParticleBlockConnectionPointTypes } from \"../Enums/nodeParticleBlockConnectionPointTypes\";\r\nimport { type NodeParticleConnectionPoint } from \"../nodeParticleBlockConnectionPoint\";\r\nimport { type NodeParticleBuildState } from \"../nodeParticleBuildState\";\r\nimport { Color4 } from \"../../../Maths/math.color.pure\";\r\nimport { RegisterClass } from \"../../../Misc/typeStore\";\r\n\r\n/**\r\n * Block used to clamp a float\r\n */\r\nexport class ParticleClampBlock extends NodeParticleBlock {\r\n /** Gets or sets the minimum range */\r\n public get minimum() {\r\n return this.min.value;\r\n }\r\n\r\n public set minimum(value: number) {\r\n this.min.value = value;\r\n }\r\n\r\n /** Gets or sets the maximum range */\r\n public get maximum() {\r\n return this.max.value;\r\n }\r\n\r\n public set maximum(value: number) {\r\n this.max.value = value;\r\n }\r\n\r\n /**\r\n * Creates a new ParticleClampBlock\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(\"value\", NodeParticleBlockConnectionPointTypes.AutoDetect);\r\n this.registerInput(\"min\", NodeParticleBlockConnectionPointTypes.Float, true, 0);\r\n this.registerInput(\"max\", NodeParticleBlockConnectionPointTypes.Float, true, 1);\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.Matrix);\r\n this._inputs[0].excludedConnectionPointTypes.push(NodeParticleBlockConnectionPointTypes.Particle);\r\n this._inputs[0].excludedConnectionPointTypes.push(NodeParticleBlockConnectionPointTypes.Texture);\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 }\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 \"ParticleClampBlock\";\r\n }\r\n\r\n /**\r\n * Gets the value input component\r\n */\r\n public get value(): NodeParticleConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the min input component\r\n */\r\n public get min(): NodeParticleConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the max input component\r\n */\r\n public get max(): 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 public override _build(state: NodeParticleBuildState) {\r\n if (!this.value.isConnected) {\r\n this.output._storedFunction = null;\r\n this.output._storedValue = null;\r\n return;\r\n }\r\n\r\n const func = (value: number, min: number, max: number) => {\r\n return Math.max(min, Math.min(value, max));\r\n };\r\n\r\n this.output._storedFunction = (state) => {\r\n const value = this.value.getConnectedValue(state);\r\n const min = this.min.isConnected ? this.min.getConnectedValue(state) : this.minimum;\r\n const max = this.max.isConnected ? this.max.getConnectedValue(state) : this.maximum;\r\n\r\n switch (this.value.type) {\r\n case NodeParticleBlockConnectionPointTypes.Int:\r\n case NodeParticleBlockConnectionPointTypes.Float: {\r\n return func(value, min, max);\r\n }\r\n case NodeParticleBlockConnectionPointTypes.Vector2: {\r\n return new Vector2(func(value.x, min, max), func(value.y, min, max));\r\n }\r\n case NodeParticleBlockConnectionPointTypes.Vector3: {\r\n return new Vector3(func(value.x, min, max), func(value.y, min, max), func(value.z, min, max));\r\n }\r\n case NodeParticleBlockConnectionPointTypes.Color4: {\r\n return new Color4(func(value.r, min, max), func(value.g, min, max), func(value.b, min, max), func(value.a, min, max));\r\n }\r\n }\r\n\r\n return 0;\r\n };\r\n\r\n return this;\r\n }\r\n}\r\n\r\nlet _Registered = false;\r\n/**\r\n * Register side effects for particleClampBlock.\r\n * Safe to call multiple times; only the first call has an effect.\r\n */\r\nexport function RegisterParticleClampBlock(): void {\r\n if (_Registered) {\r\n return;\r\n }\r\n _Registered = true;\r\n\r\n RegisterClass(\"BABYLON.ParticleClampBlock\", ParticleClampBlock);\r\n}\r\n"]}
@@ -238,7 +238,7 @@ let ParticleMathBlock = (() => {
238
238
  func = (state) => {
239
239
  const other = vector.getConnectedValue(state);
240
240
  const { r, g, b, a } = state.adapt(scalar, vector.type);
241
- return new Color4(Math.max(other.r, r), Math.min(other.g, g), Math.min(other.b, b), Math.min(other.a, a));
241
+ return new Color4(Math.max(other.r, r), Math.max(other.g, g), Math.max(other.b, b), Math.max(other.a, a));
242
242
  };
243
243
  break;
244
244
  }
@@ -1 +1 @@
1
- {"version":3,"file":"particleMathBlock.pure.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Particles/Node/Blocks/particleMathBlock.pure.ts"],"names":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,YAAY,CAAC,mBAAwB;gBACjD,KAAK,CAAC,YAAY,CAAC,mBAAmB,CAAC,CAAC;gBAExC,IAAI,CAAC,SAAS,GAAG,mBAAmB,CAAC,SAAS,CAAC;YACnD,CAAC;;;;qCA7TA,sBAAsB,CAAC,WAAW,uCAA+B,UAAU,EAAE;oBAC1E,SAAS,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE;oBAC5B,QAAQ,EAAE,IAAI;oBACd,OAAO,EAAE;wBACL,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,2BAA2B,CAAC,GAAG,EAAE;wBACxD,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,2BAA2B,CAAC,QAAQ,EAAE;wBAClE,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,2BAA2B,CAAC,QAAQ,EAAE;wBAClE,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,2BAA2B,CAAC,MAAM,EAAE;wBAC9D,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,2BAA2B,CAAC,GAAG,EAAE;wBACxD,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,2BAA2B,CAAC,GAAG,EAAE;qBAC3D;iBACJ,CAAC;YACF,6KAAO,SAAS,6BAAT,SAAS,6FAAmC;;;;;SAhB1C,iBAAiB;AAoU9B,IAAI,WAAW,GAAG,KAAK,CAAC;AACxB;;;GAGG;AACH,MAAM,UAAU,yBAAyB;IACrC,IAAI,WAAW,EAAE,CAAC;QACd,OAAO;IACX,CAAC;IACD,WAAW,GAAG,IAAI,CAAC;IAEnB,aAAa,CAAC,2BAA2B,EAAE,iBAAiB,CAAC,CAAC;AAClE,CAAC","sourcesContent":["/** This file must only contain pure code and pure imports */\r\n\r\nimport { Vector2, Vector3 } from \"core/Maths/math.vector.pure\";\r\nimport { PropertyTypeForEdition, editableInPropertyPage } from \"../../../Decorators/nodeDecorator\";\r\nimport { type Observer } from \"core/Misc/observable.pure\";\r\nimport { NodeParticleBlock } from \"../nodeParticleBlock\";\r\nimport { type NodeParticleConnectionPoint } from \"../nodeParticleBlockConnectionPoint\";\r\nimport { NodeParticleBlockConnectionPointTypes } from \"../Enums/nodeParticleBlockConnectionPointTypes\";\r\nimport { type NodeParticleBuildState } from \"../nodeParticleBuildState\";\r\nimport { Color4 } from \"core/Maths/math.color.pure\";\r\nimport { RegisterClass } from \"../../../Misc/typeStore\";\r\n\r\n/**\r\n * Operations supported by the Math block\r\n */\r\nexport enum ParticleMathBlockOperations {\r\n /** Add */\r\n Add,\r\n /** Subtract */\r\n Subtract,\r\n /** Multiply */\r\n Multiply,\r\n /** Divide */\r\n Divide,\r\n /** Max */\r\n Max,\r\n /** Min */\r\n Min,\r\n}\r\n\r\n/**\r\n * Block used to apply math functions\r\n */\r\nexport class ParticleMathBlock extends NodeParticleBlock {\r\n /**\r\n * Gets or sets the operation applied by the block\r\n */\r\n @editableInPropertyPage(\"Operation\", PropertyTypeForEdition.List, \"ADVANCED\", {\r\n notifiers: { rebuild: true },\r\n embedded: true,\r\n options: [\r\n { label: \"Add\", value: ParticleMathBlockOperations.Add },\r\n { label: \"Subtract\", value: ParticleMathBlockOperations.Subtract },\r\n { label: \"Multiply\", value: ParticleMathBlockOperations.Multiply },\r\n { label: \"Divide\", value: ParticleMathBlockOperations.Divide },\r\n { label: \"Max\", value: ParticleMathBlockOperations.Max },\r\n { label: \"Min\", value: ParticleMathBlockOperations.Min },\r\n ],\r\n })\r\n public operation = ParticleMathBlockOperations.Add;\r\n\r\n private readonly _connectionObservers: Observer<NodeParticleConnectionPoint>[];\r\n\r\n /**\r\n * Create a new ParticleMathBlock\r\n * @param name defines the block name\r\n */\r\n public constructor(name: string) {\r\n super(name);\r\n\r\n this.registerInput(\"left\", NodeParticleBlockConnectionPointTypes.AutoDetect);\r\n this.registerInput(\"right\", NodeParticleBlockConnectionPointTypes.AutoDetect);\r\n\r\n this.registerOutput(\"output\", NodeParticleBlockConnectionPointTypes.BasedOnInput);\r\n\r\n this.output._typeConnectionSource = this.left;\r\n\r\n const excludedConnectionPointTypes = [\r\n NodeParticleBlockConnectionPointTypes.Matrix,\r\n NodeParticleBlockConnectionPointTypes.Particle,\r\n NodeParticleBlockConnectionPointTypes.Texture,\r\n NodeParticleBlockConnectionPointTypes.System,\r\n NodeParticleBlockConnectionPointTypes.FloatGradient,\r\n NodeParticleBlockConnectionPointTypes.Color4Gradient,\r\n NodeParticleBlockConnectionPointTypes.Vector2Gradient,\r\n NodeParticleBlockConnectionPointTypes.Vector3Gradient,\r\n ] as const;\r\n\r\n this.left.excludedConnectionPointTypes.push(...excludedConnectionPointTypes);\r\n this.right.excludedConnectionPointTypes.push(...excludedConnectionPointTypes);\r\n\r\n this._linkConnectionTypes(0, 1);\r\n\r\n this._connectionObservers = [\r\n this.left.onConnectionObservable.add(() => this._updateInputOutputTypes()),\r\n this.left.onDisconnectionObservable.add(() => this._updateInputOutputTypes()),\r\n this.right.onConnectionObservable.add(() => this._updateInputOutputTypes()),\r\n this.right.onDisconnectionObservable.add(() => this._updateInputOutputTypes()),\r\n ];\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 \"ParticleMathBlock\";\r\n }\r\n\r\n /**\r\n * Gets the left input component\r\n */\r\n public get left(): NodeParticleConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the right input component\r\n */\r\n public get right(): NodeParticleConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the geometry 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 let func: (state: NodeParticleBuildState) => any;\r\n const left = this.left;\r\n const right = this.right;\r\n\r\n if (!left.isConnected || !right.isConnected) {\r\n this.output._storedFunction = null;\r\n this.output._storedValue = null;\r\n return;\r\n }\r\n\r\n const leftIsScalar = left.type === NodeParticleBlockConnectionPointTypes.Float || left.type === NodeParticleBlockConnectionPointTypes.Int;\r\n const rightIsScalar = right.type === NodeParticleBlockConnectionPointTypes.Float || right.type === NodeParticleBlockConnectionPointTypes.Int;\r\n\r\n // If both input types are scalars, then this is a scalar operation.\r\n const isScalar = leftIsScalar && rightIsScalar;\r\n\r\n switch (this.operation) {\r\n case ParticleMathBlockOperations.Add: {\r\n if (isScalar) {\r\n func = (state) => {\r\n return left.getConnectedValue(state) + right.getConnectedValue(state);\r\n };\r\n } else if (leftIsScalar) {\r\n func = (state) => {\r\n return state.adapt(left, right.type).add(right.getConnectedValue(state));\r\n };\r\n } else {\r\n func = (state) => {\r\n return left.getConnectedValue(state).add(state.adapt(right, left.type));\r\n };\r\n }\r\n break;\r\n }\r\n case ParticleMathBlockOperations.Subtract: {\r\n if (isScalar) {\r\n func = (state) => {\r\n return left.getConnectedValue(state) - right.getConnectedValue(state);\r\n };\r\n } else if (leftIsScalar) {\r\n func = (state) => {\r\n return state.adapt(left, right.type).subtract(right.getConnectedValue(state));\r\n };\r\n } else {\r\n func = (state) => {\r\n return left.getConnectedValue(state).subtract(state.adapt(right, left.type));\r\n };\r\n }\r\n break;\r\n }\r\n case ParticleMathBlockOperations.Multiply: {\r\n if (isScalar) {\r\n func = (state) => {\r\n return left.getConnectedValue(state) * right.getConnectedValue(state);\r\n };\r\n } else if (leftIsScalar) {\r\n func = (state) => {\r\n return state.adapt(left, right.type).multiply(right.getConnectedValue(state));\r\n };\r\n } else {\r\n func = (state) => {\r\n return left.getConnectedValue(state).multiply(state.adapt(right, left.type));\r\n };\r\n }\r\n break;\r\n }\r\n case ParticleMathBlockOperations.Divide: {\r\n if (isScalar) {\r\n func = (state) => {\r\n return left.getConnectedValue(state) / right.getConnectedValue(state);\r\n };\r\n } else if (leftIsScalar) {\r\n func = (state) => {\r\n return state.adapt(left, right.type).divide(right.getConnectedValue(state));\r\n };\r\n } else {\r\n func = (state) => {\r\n return left.getConnectedValue(state).divide(state.adapt(right, left.type));\r\n };\r\n }\r\n break;\r\n }\r\n case ParticleMathBlockOperations.Min: {\r\n if (isScalar) {\r\n func = (state) => {\r\n return Math.min(left.getConnectedValue(state), right.getConnectedValue(state));\r\n };\r\n } else {\r\n const [vector, scalar] = leftIsScalar ? [right, left] : [left, right];\r\n\r\n switch (vector.type) {\r\n case NodeParticleBlockConnectionPointTypes.Vector2: {\r\n func = (state) => {\r\n return Vector2.Minimize(vector.getConnectedValue(state), state.adapt(scalar, vector.type));\r\n };\r\n break;\r\n }\r\n case NodeParticleBlockConnectionPointTypes.Vector3: {\r\n func = (state) => {\r\n return Vector3.Minimize(vector.getConnectedValue(state), state.adapt(scalar, vector.type));\r\n };\r\n break;\r\n }\r\n case NodeParticleBlockConnectionPointTypes.Color4: {\r\n func = (state) => {\r\n const other = vector.getConnectedValue(state);\r\n const { r, g, b, a } = state.adapt(scalar, vector.type);\r\n\r\n return new Color4(Math.min(other.r, r), Math.min(other.g, g), Math.min(other.b, b), Math.min(other.a, a));\r\n };\r\n break;\r\n }\r\n }\r\n }\r\n break;\r\n }\r\n case ParticleMathBlockOperations.Max: {\r\n if (isScalar) {\r\n func = (state) => {\r\n return Math.max(left.getConnectedValue(state), right.getConnectedValue(state));\r\n };\r\n } else {\r\n const [vector, scalar] = leftIsScalar ? [right, left] : [left, right];\r\n\r\n switch (vector.type) {\r\n case NodeParticleBlockConnectionPointTypes.Vector2: {\r\n func = (state) => {\r\n return Vector2.Maximize(vector.getConnectedValue(state), state.adapt(scalar, vector.type));\r\n };\r\n break;\r\n }\r\n case NodeParticleBlockConnectionPointTypes.Vector3: {\r\n func = (state) => {\r\n return Vector3.Maximize(vector.getConnectedValue(state), state.adapt(scalar, vector.type));\r\n };\r\n break;\r\n }\r\n case NodeParticleBlockConnectionPointTypes.Color4: {\r\n func = (state) => {\r\n const other = vector.getConnectedValue(state);\r\n const { r, g, b, a } = state.adapt(scalar, vector.type);\r\n\r\n return new Color4(Math.max(other.r, r), Math.min(other.g, g), Math.min(other.b, b), Math.min(other.a, a));\r\n };\r\n break;\r\n }\r\n }\r\n break;\r\n }\r\n }\r\n }\r\n\r\n this.output._storedFunction = (state) => {\r\n if (left.type === NodeParticleBlockConnectionPointTypes.Int) {\r\n return func(state) | 0;\r\n }\r\n return func(state);\r\n };\r\n }\r\n\r\n private _updateInputOutputTypes() {\r\n // First update the output type with the initial assumption that we'll base it on the left input.\r\n this.output._typeConnectionSource = this.left;\r\n\r\n if (this.left.isConnected && this.right.isConnected) {\r\n // Both inputs are connected, so we need to determine the output type based on the input types.\r\n if (\r\n this.left.type === NodeParticleBlockConnectionPointTypes.Int ||\r\n (this.left.type === NodeParticleBlockConnectionPointTypes.Float && this.right.type !== NodeParticleBlockConnectionPointTypes.Int)\r\n ) {\r\n this.output._typeConnectionSource = this.right;\r\n }\r\n } else if (this.left.isConnected !== this.right.isConnected) {\r\n // Only one input is connected, so we need to determine the output type based on the connected input.\r\n this.output._typeConnectionSource = this.left.isConnected ? this.left : this.right;\r\n }\r\n\r\n // Next update the accepted connection point types for the inputs based on the current input connection state.\r\n if (this.left.isConnected || this.right.isConnected) {\r\n for (const [first, second] of [\r\n [this.left, this.right],\r\n [this.right, this.left],\r\n ]) {\r\n // Always allow Ints and Floats.\r\n first.acceptedConnectionPointTypes = [NodeParticleBlockConnectionPointTypes.Int, NodeParticleBlockConnectionPointTypes.Float];\r\n\r\n if (second.isConnected) {\r\n // The same types as the connected input are always allowed.\r\n first.acceptedConnectionPointTypes.push(second.type);\r\n\r\n // If the other input is a scalar, then we also allow Vector types.\r\n if (second.type === NodeParticleBlockConnectionPointTypes.Int || second.type === NodeParticleBlockConnectionPointTypes.Float) {\r\n first.acceptedConnectionPointTypes.push(\r\n NodeParticleBlockConnectionPointTypes.Vector2,\r\n NodeParticleBlockConnectionPointTypes.Vector3,\r\n NodeParticleBlockConnectionPointTypes.Color4\r\n );\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Release resources\r\n */\r\n public override dispose() {\r\n super.dispose();\r\n for (const observer of this._connectionObservers) {\r\n observer.remove();\r\n }\r\n this._connectionObservers.length = 0;\r\n }\r\n\r\n /**\r\n * Serializes this block in a JSON representation\r\n * @returns the serialized block object\r\n */\r\n public override serialize(): any {\r\n const serializationObject = super.serialize();\r\n\r\n serializationObject.operation = this.operation;\r\n\r\n return serializationObject;\r\n }\r\n\r\n /**\r\n * Deserializes the block from a JSON object\r\n * @param serializationObject the JSON object to deserialize from\r\n */\r\n public override _deserialize(serializationObject: any) {\r\n super._deserialize(serializationObject);\r\n\r\n this.operation = serializationObject.operation;\r\n }\r\n}\r\n\r\nlet _Registered = false;\r\n/**\r\n * Register side effects for particleMathBlock.\r\n * Safe to call multiple times; only the first call has an effect.\r\n */\r\nexport function RegisterParticleMathBlock(): void {\r\n if (_Registered) {\r\n return;\r\n }\r\n _Registered = true;\r\n\r\n RegisterClass(\"BABYLON.ParticleMathBlock\", ParticleMathBlock);\r\n}\r\n"]}
1
+ {"version":3,"file":"particleMathBlock.pure.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Particles/Node/Blocks/particleMathBlock.pure.ts"],"names":[],"mappings":"AAAA,6DAA6D;;AAE7D,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAA0B,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAEnG,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEzD,OAAO,EAAE,qCAAqC,EAAE,MAAM,gDAAgD,CAAC;AAEvG,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAExD;;GAEG;AACH,MAAM,CAAN,IAAY,2BAaX;AAbD,WAAY,2BAA2B;IACnC,UAAU;IACV,2EAAG,CAAA;IACH,eAAe;IACf,qFAAQ,CAAA;IACR,eAAe;IACf,qFAAQ,CAAA;IACR,aAAa;IACb,iFAAM,CAAA;IACN,UA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,QAAQ,EAAE,KAAK,EAAE,2BAA2B,CAAC,MAAM,EAAE;wBAC9D,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,2BAA2B,CAAC,GAAG,EAAE;wBACxD,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,2BAA2B,CAAC,GAAG,EAAE;qBAC3D;iBACJ,CAAC;YACF,6KAAO,SAAS,6BAAT,SAAS,6FAAmC;;;;;SAhB1C,iBAAiB;AAoU9B,IAAI,WAAW,GAAG,KAAK,CAAC;AACxB;;;GAGG;AACH,MAAM,UAAU,yBAAyB;IACrC,IAAI,WAAW,EAAE,CAAC;QACd,OAAO;IACX,CAAC;IACD,WAAW,GAAG,IAAI,CAAC;IAEnB,aAAa,CAAC,2BAA2B,EAAE,iBAAiB,CAAC,CAAC;AAClE,CAAC","sourcesContent":["/** This file must only contain pure code and pure imports */\r\n\r\nimport { Vector2, Vector3 } from \"core/Maths/math.vector.pure\";\r\nimport { PropertyTypeForEdition, editableInPropertyPage } from \"../../../Decorators/nodeDecorator\";\r\nimport { type Observer } from \"core/Misc/observable.pure\";\r\nimport { NodeParticleBlock } from \"../nodeParticleBlock\";\r\nimport { type NodeParticleConnectionPoint } from \"../nodeParticleBlockConnectionPoint\";\r\nimport { NodeParticleBlockConnectionPointTypes } from \"../Enums/nodeParticleBlockConnectionPointTypes\";\r\nimport { type NodeParticleBuildState } from \"../nodeParticleBuildState\";\r\nimport { Color4 } from \"core/Maths/math.color.pure\";\r\nimport { RegisterClass } from \"../../../Misc/typeStore\";\r\n\r\n/**\r\n * Operations supported by the Math block\r\n */\r\nexport enum ParticleMathBlockOperations {\r\n /** Add */\r\n Add,\r\n /** Subtract */\r\n Subtract,\r\n /** Multiply */\r\n Multiply,\r\n /** Divide */\r\n Divide,\r\n /** Max */\r\n Max,\r\n /** Min */\r\n Min,\r\n}\r\n\r\n/**\r\n * Block used to apply math functions\r\n */\r\nexport class ParticleMathBlock extends NodeParticleBlock {\r\n /**\r\n * Gets or sets the operation applied by the block\r\n */\r\n @editableInPropertyPage(\"Operation\", PropertyTypeForEdition.List, \"ADVANCED\", {\r\n notifiers: { rebuild: true },\r\n embedded: true,\r\n options: [\r\n { label: \"Add\", value: ParticleMathBlockOperations.Add },\r\n { label: \"Subtract\", value: ParticleMathBlockOperations.Subtract },\r\n { label: \"Multiply\", value: ParticleMathBlockOperations.Multiply },\r\n { label: \"Divide\", value: ParticleMathBlockOperations.Divide },\r\n { label: \"Max\", value: ParticleMathBlockOperations.Max },\r\n { label: \"Min\", value: ParticleMathBlockOperations.Min },\r\n ],\r\n })\r\n public operation = ParticleMathBlockOperations.Add;\r\n\r\n private readonly _connectionObservers: Observer<NodeParticleConnectionPoint>[];\r\n\r\n /**\r\n * Create a new ParticleMathBlock\r\n * @param name defines the block name\r\n */\r\n public constructor(name: string) {\r\n super(name);\r\n\r\n this.registerInput(\"left\", NodeParticleBlockConnectionPointTypes.AutoDetect);\r\n this.registerInput(\"right\", NodeParticleBlockConnectionPointTypes.AutoDetect);\r\n\r\n this.registerOutput(\"output\", NodeParticleBlockConnectionPointTypes.BasedOnInput);\r\n\r\n this.output._typeConnectionSource = this.left;\r\n\r\n const excludedConnectionPointTypes = [\r\n NodeParticleBlockConnectionPointTypes.Matrix,\r\n NodeParticleBlockConnectionPointTypes.Particle,\r\n NodeParticleBlockConnectionPointTypes.Texture,\r\n NodeParticleBlockConnectionPointTypes.System,\r\n NodeParticleBlockConnectionPointTypes.FloatGradient,\r\n NodeParticleBlockConnectionPointTypes.Color4Gradient,\r\n NodeParticleBlockConnectionPointTypes.Vector2Gradient,\r\n NodeParticleBlockConnectionPointTypes.Vector3Gradient,\r\n ] as const;\r\n\r\n this.left.excludedConnectionPointTypes.push(...excludedConnectionPointTypes);\r\n this.right.excludedConnectionPointTypes.push(...excludedConnectionPointTypes);\r\n\r\n this._linkConnectionTypes(0, 1);\r\n\r\n this._connectionObservers = [\r\n this.left.onConnectionObservable.add(() => this._updateInputOutputTypes()),\r\n this.left.onDisconnectionObservable.add(() => this._updateInputOutputTypes()),\r\n this.right.onConnectionObservable.add(() => this._updateInputOutputTypes()),\r\n this.right.onDisconnectionObservable.add(() => this._updateInputOutputTypes()),\r\n ];\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 \"ParticleMathBlock\";\r\n }\r\n\r\n /**\r\n * Gets the left input component\r\n */\r\n public get left(): NodeParticleConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the right input component\r\n */\r\n public get right(): NodeParticleConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the geometry 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 let func: (state: NodeParticleBuildState) => any;\r\n const left = this.left;\r\n const right = this.right;\r\n\r\n if (!left.isConnected || !right.isConnected) {\r\n this.output._storedFunction = null;\r\n this.output._storedValue = null;\r\n return;\r\n }\r\n\r\n const leftIsScalar = left.type === NodeParticleBlockConnectionPointTypes.Float || left.type === NodeParticleBlockConnectionPointTypes.Int;\r\n const rightIsScalar = right.type === NodeParticleBlockConnectionPointTypes.Float || right.type === NodeParticleBlockConnectionPointTypes.Int;\r\n\r\n // If both input types are scalars, then this is a scalar operation.\r\n const isScalar = leftIsScalar && rightIsScalar;\r\n\r\n switch (this.operation) {\r\n case ParticleMathBlockOperations.Add: {\r\n if (isScalar) {\r\n func = (state) => {\r\n return left.getConnectedValue(state) + right.getConnectedValue(state);\r\n };\r\n } else if (leftIsScalar) {\r\n func = (state) => {\r\n return state.adapt(left, right.type).add(right.getConnectedValue(state));\r\n };\r\n } else {\r\n func = (state) => {\r\n return left.getConnectedValue(state).add(state.adapt(right, left.type));\r\n };\r\n }\r\n break;\r\n }\r\n case ParticleMathBlockOperations.Subtract: {\r\n if (isScalar) {\r\n func = (state) => {\r\n return left.getConnectedValue(state) - right.getConnectedValue(state);\r\n };\r\n } else if (leftIsScalar) {\r\n func = (state) => {\r\n return state.adapt(left, right.type).subtract(right.getConnectedValue(state));\r\n };\r\n } else {\r\n func = (state) => {\r\n return left.getConnectedValue(state).subtract(state.adapt(right, left.type));\r\n };\r\n }\r\n break;\r\n }\r\n case ParticleMathBlockOperations.Multiply: {\r\n if (isScalar) {\r\n func = (state) => {\r\n return left.getConnectedValue(state) * right.getConnectedValue(state);\r\n };\r\n } else if (leftIsScalar) {\r\n func = (state) => {\r\n return state.adapt(left, right.type).multiply(right.getConnectedValue(state));\r\n };\r\n } else {\r\n func = (state) => {\r\n return left.getConnectedValue(state).multiply(state.adapt(right, left.type));\r\n };\r\n }\r\n break;\r\n }\r\n case ParticleMathBlockOperations.Divide: {\r\n if (isScalar) {\r\n func = (state) => {\r\n return left.getConnectedValue(state) / right.getConnectedValue(state);\r\n };\r\n } else if (leftIsScalar) {\r\n func = (state) => {\r\n return state.adapt(left, right.type).divide(right.getConnectedValue(state));\r\n };\r\n } else {\r\n func = (state) => {\r\n return left.getConnectedValue(state).divide(state.adapt(right, left.type));\r\n };\r\n }\r\n break;\r\n }\r\n case ParticleMathBlockOperations.Min: {\r\n if (isScalar) {\r\n func = (state) => {\r\n return Math.min(left.getConnectedValue(state), right.getConnectedValue(state));\r\n };\r\n } else {\r\n const [vector, scalar] = leftIsScalar ? [right, left] : [left, right];\r\n\r\n switch (vector.type) {\r\n case NodeParticleBlockConnectionPointTypes.Vector2: {\r\n func = (state) => {\r\n return Vector2.Minimize(vector.getConnectedValue(state), state.adapt(scalar, vector.type));\r\n };\r\n break;\r\n }\r\n case NodeParticleBlockConnectionPointTypes.Vector3: {\r\n func = (state) => {\r\n return Vector3.Minimize(vector.getConnectedValue(state), state.adapt(scalar, vector.type));\r\n };\r\n break;\r\n }\r\n case NodeParticleBlockConnectionPointTypes.Color4: {\r\n func = (state) => {\r\n const other = vector.getConnectedValue(state);\r\n const { r, g, b, a } = state.adapt(scalar, vector.type);\r\n\r\n return new Color4(Math.min(other.r, r), Math.min(other.g, g), Math.min(other.b, b), Math.min(other.a, a));\r\n };\r\n break;\r\n }\r\n }\r\n }\r\n break;\r\n }\r\n case ParticleMathBlockOperations.Max: {\r\n if (isScalar) {\r\n func = (state) => {\r\n return Math.max(left.getConnectedValue(state), right.getConnectedValue(state));\r\n };\r\n } else {\r\n const [vector, scalar] = leftIsScalar ? [right, left] : [left, right];\r\n\r\n switch (vector.type) {\r\n case NodeParticleBlockConnectionPointTypes.Vector2: {\r\n func = (state) => {\r\n return Vector2.Maximize(vector.getConnectedValue(state), state.adapt(scalar, vector.type));\r\n };\r\n break;\r\n }\r\n case NodeParticleBlockConnectionPointTypes.Vector3: {\r\n func = (state) => {\r\n return Vector3.Maximize(vector.getConnectedValue(state), state.adapt(scalar, vector.type));\r\n };\r\n break;\r\n }\r\n case NodeParticleBlockConnectionPointTypes.Color4: {\r\n func = (state) => {\r\n const other = vector.getConnectedValue(state);\r\n const { r, g, b, a } = state.adapt(scalar, vector.type);\r\n\r\n return new Color4(Math.max(other.r, r), Math.max(other.g, g), Math.max(other.b, b), Math.max(other.a, a));\r\n };\r\n break;\r\n }\r\n }\r\n break;\r\n }\r\n }\r\n }\r\n\r\n this.output._storedFunction = (state) => {\r\n if (left.type === NodeParticleBlockConnectionPointTypes.Int) {\r\n return func(state) | 0;\r\n }\r\n return func(state);\r\n };\r\n }\r\n\r\n private _updateInputOutputTypes() {\r\n // First update the output type with the initial assumption that we'll base it on the left input.\r\n this.output._typeConnectionSource = this.left;\r\n\r\n if (this.left.isConnected && this.right.isConnected) {\r\n // Both inputs are connected, so we need to determine the output type based on the input types.\r\n if (\r\n this.left.type === NodeParticleBlockConnectionPointTypes.Int ||\r\n (this.left.type === NodeParticleBlockConnectionPointTypes.Float && this.right.type !== NodeParticleBlockConnectionPointTypes.Int)\r\n ) {\r\n this.output._typeConnectionSource = this.right;\r\n }\r\n } else if (this.left.isConnected !== this.right.isConnected) {\r\n // Only one input is connected, so we need to determine the output type based on the connected input.\r\n this.output._typeConnectionSource = this.left.isConnected ? this.left : this.right;\r\n }\r\n\r\n // Next update the accepted connection point types for the inputs based on the current input connection state.\r\n if (this.left.isConnected || this.right.isConnected) {\r\n for (const [first, second] of [\r\n [this.left, this.right],\r\n [this.right, this.left],\r\n ]) {\r\n // Always allow Ints and Floats.\r\n first.acceptedConnectionPointTypes = [NodeParticleBlockConnectionPointTypes.Int, NodeParticleBlockConnectionPointTypes.Float];\r\n\r\n if (second.isConnected) {\r\n // The same types as the connected input are always allowed.\r\n first.acceptedConnectionPointTypes.push(second.type);\r\n\r\n // If the other input is a scalar, then we also allow Vector types.\r\n if (second.type === NodeParticleBlockConnectionPointTypes.Int || second.type === NodeParticleBlockConnectionPointTypes.Float) {\r\n first.acceptedConnectionPointTypes.push(\r\n NodeParticleBlockConnectionPointTypes.Vector2,\r\n NodeParticleBlockConnectionPointTypes.Vector3,\r\n NodeParticleBlockConnectionPointTypes.Color4\r\n );\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Release resources\r\n */\r\n public override dispose() {\r\n super.dispose();\r\n for (const observer of this._connectionObservers) {\r\n observer.remove();\r\n }\r\n this._connectionObservers.length = 0;\r\n }\r\n\r\n /**\r\n * Serializes this block in a JSON representation\r\n * @returns the serialized block object\r\n */\r\n public override serialize(): any {\r\n const serializationObject = super.serialize();\r\n\r\n serializationObject.operation = this.operation;\r\n\r\n return serializationObject;\r\n }\r\n\r\n /**\r\n * Deserializes the block from a JSON object\r\n * @param serializationObject the JSON object to deserialize from\r\n */\r\n public override _deserialize(serializationObject: any) {\r\n super._deserialize(serializationObject);\r\n\r\n this.operation = serializationObject.operation;\r\n }\r\n}\r\n\r\nlet _Registered = false;\r\n/**\r\n * Register side effects for particleMathBlock.\r\n * Safe to call multiple times; only the first call has an effect.\r\n */\r\nexport function RegisterParticleMathBlock(): void {\r\n if (_Registered) {\r\n return;\r\n }\r\n _Registered = true;\r\n\r\n RegisterClass(\"BABYLON.ParticleMathBlock\", ParticleMathBlock);\r\n}\r\n"]}
@@ -1,5 +1,6 @@
1
1
  /** This file must only contain pure code and pure imports */
2
- import { Vector2, Vector3, Vector4 } from "../../../Maths/math.vector.pure.js";
2
+ import { Vector2, Vector3 } from "../../../Maths/math.vector.pure.js";
3
+ import { Color4 } from "../../../Maths/math.color.pure.js";
3
4
  import { NodeParticleBlock } from "../nodeParticleBlock.js";
4
5
  import { NodeParticleBlockConnectionPointTypes } from "../Enums/nodeParticleBlockConnectionPointTypes.js";
5
6
  import { RegisterClass } from "../../../Misc/typeStore.js";
@@ -84,8 +85,12 @@ export class ParticleNLerpBlock extends NodeParticleBlock {
84
85
  return result;
85
86
  }
86
87
  case NodeParticleBlockConnectionPointTypes.Color4: {
87
- const result = new Vector4(func(gradient, left.r, right.r), func(gradient, left.g, right.g), func(gradient, left.b, right.b), func(gradient, left.a, right.a));
88
- result.normalize();
88
+ const result = new Color4(func(gradient, left.r, right.r), func(gradient, left.g, right.g), func(gradient, left.b, right.b), func(gradient, left.a, right.a));
89
+ // Color4 has no normalize(), so normalize in place to match the other cases
90
+ const len = Math.sqrt(result.r * result.r + result.g * result.g + result.b * result.b + result.a * result.a);
91
+ if (len !== 0) {
92
+ result.scaleInPlace(1 / len);
93
+ }
89
94
  return result;
90
95
  }
91
96
  }
@@ -1 +1 @@
1
- {"version":3,"file":"particleNLerpBlock.pure.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Particles/Node/Blocks/particleNLerpBlock.pure.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAE7D,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,qCAAqC,EAAE,MAAM,gDAAgD,CAAC;AAGvG,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAExD;;GAEG;AACH,gEAAgE;AAChE,MAAM,OA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EF,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ;AAED,IAAI,WAAW,GAAG,KAAK,CAAC;AACxB;;;GAGG;AACH,gEAAgE;AAChE,MAAM,UAAU,0BAA0B;IACtC,IAAI,WAAW,EAAE,CAAC;QACd,OAAO;IACX,CAAC;IACD,WAAW,GAAG,IAAI,CAAC;IAEnB,aAAa,CAAC,4BAA4B,EAAE,kBAAkB,CAAC,CAAC;AACpE,CAAC","sourcesContent":["/** This file must only contain pure code and pure imports */\r\n\r\nimport { Vector2, Vector3, Vector4 } from \"core/Maths/math.vector.pure\";\r\nimport { NodeParticleBlock } from \"../nodeParticleBlock\";\r\nimport { NodeParticleBlockConnectionPointTypes } from \"../Enums/nodeParticleBlockConnectionPointTypes\";\r\nimport { type NodeParticleConnectionPoint } from \"../nodeParticleBlockConnectionPoint\";\r\nimport { type NodeParticleBuildState } from \"../nodeParticleBuildState\";\r\nimport { RegisterClass } from \"../../../Misc/typeStore\";\r\n\r\n/**\r\n * Block used to normalize lerp between 2 values\r\n */\r\n// eslint-disable-next-line @typescript-eslint/naming-convention\r\nexport class ParticleNLerpBlock extends NodeParticleBlock {\r\n /**\r\n * Creates a new ParticleNLerpBlock\r\n * @param name defines the block name\r\n */\r\n public constructor(name: string) {\r\n super(name);\r\n\r\n this.registerInput(\"left\", NodeParticleBlockConnectionPointTypes.AutoDetect);\r\n this.registerInput(\"right\", NodeParticleBlockConnectionPointTypes.AutoDetect);\r\n this.registerInput(\"gradient\", NodeParticleBlockConnectionPointTypes.Float, true, 0, 0, 1);\r\n this.registerOutput(\"output\", NodeParticleBlockConnectionPointTypes.BasedOnInput);\r\n\r\n this._outputs[0]._typeConnectionSource = this._inputs[0];\r\n this._linkConnectionTypes(0, 1);\r\n\r\n this._inputs[0].excludedConnectionPointTypes.push(NodeParticleBlockConnectionPointTypes.Matrix);\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 \"ParticleNLerpBlock\";\r\n }\r\n\r\n /**\r\n * Gets the left operand input component\r\n */\r\n public get left(): NodeParticleConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the right operand input component\r\n */\r\n public get right(): NodeParticleConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the gradient operand input component\r\n */\r\n public get gradient(): 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 public override _build(_state: NodeParticleBuildState) {\r\n if (!this.left.isConnected || !this.right.isConnected) {\r\n this.output._storedFunction = null;\r\n this.output._storedValue = null;\r\n return;\r\n }\r\n\r\n const func = (gradient: number, left: number, right: number) => {\r\n return (1 - gradient) * left + gradient * right;\r\n };\r\n\r\n this.output._storedFunction = (state) => {\r\n const left = this.left.getConnectedValue(state);\r\n const right = this.right.getConnectedValue(state);\r\n const gradient = this.gradient.getConnectedValue(state);\r\n switch (this.left.type) {\r\n case NodeParticleBlockConnectionPointTypes.Int:\r\n case NodeParticleBlockConnectionPointTypes.Float: {\r\n return func(gradient, left, right); // NLerp is really lerp in that case\r\n }\r\n case NodeParticleBlockConnectionPointTypes.Vector2: {\r\n const result = new Vector2(func(gradient, left.x, right.x), func(gradient, left.y, right.y));\r\n result.normalize();\r\n\r\n return result;\r\n }\r\n case NodeParticleBlockConnectionPointTypes.Vector3: {\r\n const result = new Vector3(func(gradient, left.x, right.x), func(gradient, left.y, right.y), func(gradient, left.z, right.z));\r\n result.normalize();\r\n\r\n return result;\r\n }\r\n case NodeParticleBlockConnectionPointTypes.Color4: {\r\n const result = new Vector4(func(gradient, left.r, right.r), func(gradient, left.g, right.g), func(gradient, left.b, right.b), func(gradient, left.a, right.a));\r\n result.normalize();\r\n\r\n return result;\r\n }\r\n }\r\n\r\n return 0;\r\n };\r\n\r\n return this;\r\n }\r\n}\r\n\r\nlet _Registered = false;\r\n/**\r\n * Register side effects for particleNLerpBlock.\r\n * Safe to call multiple times; only the first call has an effect.\r\n */\r\n// eslint-disable-next-line @typescript-eslint/naming-convention\r\nexport function RegisterParticleNLerpBlock(): void {\r\n if (_Registered) {\r\n return;\r\n }\r\n _Registered = true;\r\n\r\n RegisterClass(\"BABYLON.ParticleNLerpBlock\", ParticleNLerpBlock);\r\n}\r\n"]}
1
+ {"version":3,"file":"particleNLerpBlock.pure.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Particles/Node/Blocks/particleNLerpBlock.pure.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAE7D,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,MAAM,EAAE,MAAM,gCAAgC,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,qCAAqC,EAAE,MAAM,gDAAgD,CAAC;AAGvG,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAExD;;GAEG;AACH,gEAAgE;AAChE,MAAM,OAAO,kBAAmB,SAAQ,iBAAiB;IACrD;;;OAGG;IACH,YAAmB,IAAY;QAC3B,KAAK,CAAC,IAAI,CAAC,CAAC;QAEZ,IAAI,CAAC,aAAa,CAAC,MAAM,EAAE,qCAAqC,CAAC,UAAU,CAAC,CAAC;QAC7E,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,qCAAqC,CAAC,UAAU,CAAC,CAAC;QAC9E,IAAI,CAAC,aAAa,CAAC,UAAU,EAAE,qCAAqC,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;QAC3F,IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE,qCAAqC,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;GAGG;AACH,gEAAgE;AAChE,MAAM,UAAU,0BAA0B;IACtC,IAAI,WAAW,EAAE,CAAC;QACd,OAAO;IACX,CAAC;IACD,WAAW,GAAG,IAAI,CAAC;IAEnB,aAAa,CAAC,4BAA4B,EAAE,kBAAkB,CAAC,CAAC;AACpE,CAAC","sourcesContent":["/** This file must only contain pure code and pure imports */\r\n\r\nimport { Vector2, Vector3 } from \"core/Maths/math.vector.pure\";\r\nimport { Color4 } from \"../../../Maths/math.color.pure\";\r\nimport { NodeParticleBlock } from \"../nodeParticleBlock\";\r\nimport { NodeParticleBlockConnectionPointTypes } from \"../Enums/nodeParticleBlockConnectionPointTypes\";\r\nimport { type NodeParticleConnectionPoint } from \"../nodeParticleBlockConnectionPoint\";\r\nimport { type NodeParticleBuildState } from \"../nodeParticleBuildState\";\r\nimport { RegisterClass } from \"../../../Misc/typeStore\";\r\n\r\n/**\r\n * Block used to normalize lerp between 2 values\r\n */\r\n// eslint-disable-next-line @typescript-eslint/naming-convention\r\nexport class ParticleNLerpBlock extends NodeParticleBlock {\r\n /**\r\n * Creates a new ParticleNLerpBlock\r\n * @param name defines the block name\r\n */\r\n public constructor(name: string) {\r\n super(name);\r\n\r\n this.registerInput(\"left\", NodeParticleBlockConnectionPointTypes.AutoDetect);\r\n this.registerInput(\"right\", NodeParticleBlockConnectionPointTypes.AutoDetect);\r\n this.registerInput(\"gradient\", NodeParticleBlockConnectionPointTypes.Float, true, 0, 0, 1);\r\n this.registerOutput(\"output\", NodeParticleBlockConnectionPointTypes.BasedOnInput);\r\n\r\n this._outputs[0]._typeConnectionSource = this._inputs[0];\r\n this._linkConnectionTypes(0, 1);\r\n\r\n this._inputs[0].excludedConnectionPointTypes.push(NodeParticleBlockConnectionPointTypes.Matrix);\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 \"ParticleNLerpBlock\";\r\n }\r\n\r\n /**\r\n * Gets the left operand input component\r\n */\r\n public get left(): NodeParticleConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the right operand input component\r\n */\r\n public get right(): NodeParticleConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the gradient operand input component\r\n */\r\n public get gradient(): 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 public override _build(_state: NodeParticleBuildState) {\r\n if (!this.left.isConnected || !this.right.isConnected) {\r\n this.output._storedFunction = null;\r\n this.output._storedValue = null;\r\n return;\r\n }\r\n\r\n const func = (gradient: number, left: number, right: number) => {\r\n return (1 - gradient) * left + gradient * right;\r\n };\r\n\r\n this.output._storedFunction = (state) => {\r\n const left = this.left.getConnectedValue(state);\r\n const right = this.right.getConnectedValue(state);\r\n const gradient = this.gradient.getConnectedValue(state);\r\n switch (this.left.type) {\r\n case NodeParticleBlockConnectionPointTypes.Int:\r\n case NodeParticleBlockConnectionPointTypes.Float: {\r\n return func(gradient, left, right); // NLerp is really lerp in that case\r\n }\r\n case NodeParticleBlockConnectionPointTypes.Vector2: {\r\n const result = new Vector2(func(gradient, left.x, right.x), func(gradient, left.y, right.y));\r\n result.normalize();\r\n\r\n return result;\r\n }\r\n case NodeParticleBlockConnectionPointTypes.Vector3: {\r\n const result = new Vector3(func(gradient, left.x, right.x), func(gradient, left.y, right.y), func(gradient, left.z, right.z));\r\n result.normalize();\r\n\r\n return result;\r\n }\r\n case NodeParticleBlockConnectionPointTypes.Color4: {\r\n const result = new Color4(func(gradient, left.r, right.r), func(gradient, left.g, right.g), func(gradient, left.b, right.b), func(gradient, left.a, right.a));\r\n // Color4 has no normalize(), so normalize in place to match the other cases\r\n const len = Math.sqrt(result.r * result.r + result.g * result.g + result.b * result.b + result.a * result.a);\r\n if (len !== 0) {\r\n result.scaleInPlace(1 / len);\r\n }\r\n\r\n return result;\r\n }\r\n }\r\n\r\n return 0;\r\n };\r\n\r\n return this;\r\n }\r\n}\r\n\r\nlet _Registered = false;\r\n/**\r\n * Register side effects for particleNLerpBlock.\r\n * Safe to call multiple times; only the first call has an effect.\r\n */\r\n// eslint-disable-next-line @typescript-eslint/naming-convention\r\nexport function RegisterParticleNLerpBlock(): void {\r\n if (_Registered) {\r\n return;\r\n }\r\n _Registered = true;\r\n\r\n RegisterClass(\"BABYLON.ParticleNLerpBlock\", ParticleNLerpBlock);\r\n}\r\n"]}
@@ -1,5 +1,6 @@
1
1
  /** This file must only contain pure code and pure imports */
2
- import { Vector2, Vector3, Vector4 } from "../../../Maths/math.vector.pure.js";
2
+ import { Vector2, Vector3 } from "../../../Maths/math.vector.pure.js";
3
+ import { Color4 } from "../../../Maths/math.color.pure.js";
3
4
  import { NodeParticleBlock } from "../nodeParticleBlock.js";
4
5
  import { NodeParticleBlockConnectionPointTypes } from "../Enums/nodeParticleBlockConnectionPointTypes.js";
5
6
  import { RegisterClass } from "../../../Misc/typeStore.js";
@@ -80,7 +81,7 @@ export class ParticleSmoothStepBlock extends NodeParticleBlock {
80
81
  return new Vector3(func(source.x, edge0, edge1), func(source.y, edge0, edge1), func(source.z, edge0, edge1));
81
82
  }
82
83
  case NodeParticleBlockConnectionPointTypes.Color4: {
83
- return new Vector4(func(source.r, edge0, edge1), func(source.g, edge0, edge1), func(source.b, edge0, edge1), func(source.a, edge0, edge1));
84
+ return new Color4(func(source.r, edge0, edge1), func(source.g, edge0, edge1), func(source.b, edge0, edge1), func(source.a, edge0, edge1));
84
85
  }
85
86
  }
86
87
  return 0;
@@ -1 +1 @@
1
- {"version":3,"file":"particleSmoothStepBlock.pure.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Particles/Node/Blocks/particleSmoothStepBlock.pure.ts"],"names":[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AAI,CAAC;IAChB,CAAC;CACJ;AAED,IAAI,WAAW,GAAG,KAAK,CAAC;AACxB;;;GAGG;AACH,MAAM,UAAU,+BAA+B;IAC3C,IAAI,WAAW,EAAE,CAAC;QACd,OAAO;IACX,CAAC;IACD,WAAW,GAAG,IAAI,CAAC;IAEnB,aAAa,CAAC,iCAAiC,EAAE,uBAAuB,CAAC,CAAC;AAC9E,CAAC","sourcesContent":["/** This file must only contain pure code and pure imports */\r\n\r\nimport { Vector2, Vector3, Vector4 } from \"core/Maths/math.vector.pure\";\r\nimport { NodeParticleBlock } from \"../nodeParticleBlock\";\r\nimport { NodeParticleBlockConnectionPointTypes } from \"../Enums/nodeParticleBlockConnectionPointTypes\";\r\nimport { type NodeParticleConnectionPoint } from \"../nodeParticleBlockConnectionPoint\";\r\nimport { RegisterClass } from \"../../../Misc/typeStore\";\r\n\r\n/**\r\n * Block used to smooth step a value\r\n */\r\nexport class ParticleSmoothStepBlock extends NodeParticleBlock {\r\n /**\r\n * Creates a new ParticleSmoothStepBlock\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(\"value\", NodeParticleBlockConnectionPointTypes.AutoDetect);\r\n this.registerInput(\"edge0\", NodeParticleBlockConnectionPointTypes.Float, true, 0);\r\n this.registerInput(\"edge1\", NodeParticleBlockConnectionPointTypes.Float, true, 1);\r\n this.registerOutput(\"output\", NodeParticleBlockConnectionPointTypes.BasedOnInput);\r\n this._outputs[0]._typeConnectionSource = this._inputs[0];\r\n this._inputs[0].excludedConnectionPointTypes.push(NodeParticleBlockConnectionPointTypes.Matrix);\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 \"ParticleSmoothStepBlock\";\r\n }\r\n\r\n /**\r\n * Gets the value operand input component\r\n */\r\n public get value(): NodeParticleConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the first edge operand input component\r\n */\r\n public get edge0(): NodeParticleConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the second edge operand input component\r\n */\r\n public get edge1(): 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 public override _build() {\r\n if (!this.value.isConnected) {\r\n this.output._storedFunction = null;\r\n this.output._storedValue = null;\r\n return;\r\n }\r\n\r\n const func = (value: number, edge0: number, edge1: number) => {\r\n const x = Math.max(0, Math.min((value - edge0) / (edge1 - edge0), 1));\r\n\r\n // Smoothstep formula: 3x^2 - 2x^3\r\n return x * x * (3 - 2 * x);\r\n };\r\n\r\n this.output._storedFunction = (state) => {\r\n const source = this.value.getConnectedValue(state);\r\n const edge0 = this.edge0.getConnectedValue(state);\r\n const edge1 = this.edge1.getConnectedValue(state);\r\n switch (this.value.type) {\r\n case NodeParticleBlockConnectionPointTypes.Int:\r\n case NodeParticleBlockConnectionPointTypes.Float: {\r\n return func(source, edge0, edge1);\r\n }\r\n case NodeParticleBlockConnectionPointTypes.Vector2: {\r\n return new Vector2(func(source.x, edge0, edge1), func(source.y, edge0, edge1));\r\n }\r\n case NodeParticleBlockConnectionPointTypes.Vector3: {\r\n return new Vector3(func(source.x, edge0, edge1), func(source.y, edge0, edge1), func(source.z, edge0, edge1));\r\n }\r\n case NodeParticleBlockConnectionPointTypes.Color4: {\r\n return new Vector4(func(source.r, edge0, edge1), func(source.g, edge0, edge1), func(source.b, edge0, edge1), func(source.a, edge0, edge1));\r\n }\r\n }\r\n\r\n return 0;\r\n };\r\n\r\n return this;\r\n }\r\n}\r\n\r\nlet _Registered = false;\r\n/**\r\n * Register side effects for particleSmoothStepBlock.\r\n * Safe to call multiple times; only the first call has an effect.\r\n */\r\nexport function RegisterParticleSmoothStepBlock(): void {\r\n if (_Registered) {\r\n return;\r\n }\r\n _Registered = true;\r\n\r\n RegisterClass(\"BABYLON.ParticleSmoothStepBlock\", ParticleSmoothStepBlock);\r\n}\r\n"]}
1
+ {"version":3,"file":"particleSmoothStepBlock.pure.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Particles/Node/Blocks/particleSmoothStepBlock.pure.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAE7D,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,MAAM,EAAE,MAAM,gCAAgC,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,qCAAqC,EAAE,MAAM,gDAAgD,CAAC;AAEvG,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAExD;;GAEG;AACH,MAAM,OAAO,uBAAwB,SAAQ,iBAAiB;IAC1D;;;OAGG;IACH,YAAmB,IAAY;QAC3B,KAAK,CAAC,IAAI,CAAC,CAAC;QAEZ,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,qCAAqC,CAAC,UAAU,CAAC,CAAC;QAC9E,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,qCAAqC,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;QAClF,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,qCAAqC,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;QAClF,IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE,qCAAqC,CAAC,YAAY,CAAC,CAAC;QAClF,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,qBAAqB,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;QACzD,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,4BAA4B,CAAC,IAAI,CAAC,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,EAAE,KAAK,EAAE,KAAK,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC;gBAC9I,CAAC;YACL,CAAC;YAED,OAAO,CAAC,CAAC;QACb,CAAC,CAAC;QAEF,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ;AAED,IAAI,WAAW,GAAG,KAAK,CAAC;AACxB;;;GAGG;AACH,MAAM,UAAU,+BAA+B;IAC3C,IAAI,WAAW,EAAE,CAAC;QACd,OAAO;IACX,CAAC;IACD,WAAW,GAAG,IAAI,CAAC;IAEnB,aAAa,CAAC,iCAAiC,EAAE,uBAAuB,CAAC,CAAC;AAC9E,CAAC","sourcesContent":["/** This file must only contain pure code and pure imports */\r\n\r\nimport { Vector2, Vector3 } from \"core/Maths/math.vector.pure\";\r\nimport { Color4 } from \"../../../Maths/math.color.pure\";\r\nimport { NodeParticleBlock } from \"../nodeParticleBlock\";\r\nimport { NodeParticleBlockConnectionPointTypes } from \"../Enums/nodeParticleBlockConnectionPointTypes\";\r\nimport { type NodeParticleConnectionPoint } from \"../nodeParticleBlockConnectionPoint\";\r\nimport { RegisterClass } from \"../../../Misc/typeStore\";\r\n\r\n/**\r\n * Block used to smooth step a value\r\n */\r\nexport class ParticleSmoothStepBlock extends NodeParticleBlock {\r\n /**\r\n * Creates a new ParticleSmoothStepBlock\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(\"value\", NodeParticleBlockConnectionPointTypes.AutoDetect);\r\n this.registerInput(\"edge0\", NodeParticleBlockConnectionPointTypes.Float, true, 0);\r\n this.registerInput(\"edge1\", NodeParticleBlockConnectionPointTypes.Float, true, 1);\r\n this.registerOutput(\"output\", NodeParticleBlockConnectionPointTypes.BasedOnInput);\r\n this._outputs[0]._typeConnectionSource = this._inputs[0];\r\n this._inputs[0].excludedConnectionPointTypes.push(NodeParticleBlockConnectionPointTypes.Matrix);\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 \"ParticleSmoothStepBlock\";\r\n }\r\n\r\n /**\r\n * Gets the value operand input component\r\n */\r\n public get value(): NodeParticleConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the first edge operand input component\r\n */\r\n public get edge0(): NodeParticleConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the second edge operand input component\r\n */\r\n public get edge1(): 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 public override _build() {\r\n if (!this.value.isConnected) {\r\n this.output._storedFunction = null;\r\n this.output._storedValue = null;\r\n return;\r\n }\r\n\r\n const func = (value: number, edge0: number, edge1: number) => {\r\n const x = Math.max(0, Math.min((value - edge0) / (edge1 - edge0), 1));\r\n\r\n // Smoothstep formula: 3x^2 - 2x^3\r\n return x * x * (3 - 2 * x);\r\n };\r\n\r\n this.output._storedFunction = (state) => {\r\n const source = this.value.getConnectedValue(state);\r\n const edge0 = this.edge0.getConnectedValue(state);\r\n const edge1 = this.edge1.getConnectedValue(state);\r\n switch (this.value.type) {\r\n case NodeParticleBlockConnectionPointTypes.Int:\r\n case NodeParticleBlockConnectionPointTypes.Float: {\r\n return func(source, edge0, edge1);\r\n }\r\n case NodeParticleBlockConnectionPointTypes.Vector2: {\r\n return new Vector2(func(source.x, edge0, edge1), func(source.y, edge0, edge1));\r\n }\r\n case NodeParticleBlockConnectionPointTypes.Vector3: {\r\n return new Vector3(func(source.x, edge0, edge1), func(source.y, edge0, edge1), func(source.z, edge0, edge1));\r\n }\r\n case NodeParticleBlockConnectionPointTypes.Color4: {\r\n return new Color4(func(source.r, edge0, edge1), func(source.g, edge0, edge1), func(source.b, edge0, edge1), func(source.a, edge0, edge1));\r\n }\r\n }\r\n\r\n return 0;\r\n };\r\n\r\n return this;\r\n }\r\n}\r\n\r\nlet _Registered = false;\r\n/**\r\n * Register side effects for particleSmoothStepBlock.\r\n * Safe to call multiple times; only the first call has an effect.\r\n */\r\nexport function RegisterParticleSmoothStepBlock(): void {\r\n if (_Registered) {\r\n return;\r\n }\r\n _Registered = true;\r\n\r\n RegisterClass(\"BABYLON.ParticleSmoothStepBlock\", ParticleSmoothStepBlock);\r\n}\r\n"]}
@@ -1,5 +1,6 @@
1
1
  /** This file must only contain pure code and pure imports */
2
- import { Vector2, Vector3, Vector4 } from "../../../Maths/math.vector.pure.js";
2
+ import { Vector2, Vector3 } from "../../../Maths/math.vector.pure.js";
3
+ import { Color4 } from "../../../Maths/math.color.pure.js";
3
4
  import { NodeParticleBlock } from "../nodeParticleBlock.js";
4
5
  import { NodeParticleBlockConnectionPointTypes } from "../Enums/nodeParticleBlockConnectionPointTypes.js";
5
6
  import { RegisterClass } from "../../../Misc/typeStore.js";
@@ -73,7 +74,7 @@ export class ParticleStepBlock extends NodeParticleBlock {
73
74
  return new Vector3(func(source.x, edge), func(source.y, edge), func(source.z, edge));
74
75
  }
75
76
  case NodeParticleBlockConnectionPointTypes.Color4: {
76
- return new Vector4(func(source.r, edge), func(source.g, edge), func(source.b, edge), func(source.a, edge));
77
+ return new Color4(func(source.r, edge), func(source.g, edge), func(source.b, edge), func(source.a, edge));
77
78
  }
78
79
  }
79
80
  return 0;
@@ -1 +1 @@
1
- {"version":3,"file":"particleStepBlock.pure.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Particles/Node/Blocks/particleStepBlock.pure.ts"],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gBACD,KAAK,qCAAqC,CAAC,OAAO,CAAC,CAAC,CAAC;oBACjD,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,EAAE,IAAI,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,EAAE,IAAI,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC;gBACzF,CAAC;gBACD,KAAK,qCAAqC,CAAC,MAAM,CAAC,CAAC,CAAC;oBAChD,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,EAAE,IAAI,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,EAAE,IAAI,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,EAAE,IAAI,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC;gBAC/G,CAAC;YACL,CAAC;YAED,OAAO,CAAC,CAAC;QACb,CAAC,CAAC;QAEF,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ;AAED,IAAI,WAAW,GAAG,KAAK,CAAC;AACxB;;;GAGG;AACH,MAAM,UAAU,yBAAyB;IACrC,IAAI,WAAW,EAAE,CAAC;QACd,OAAO;IACX,CAAC;IACD,WAAW,GAAG,IAAI,CAAC;IAEnB,aAAa,CAAC,2BAA2B,EAAE,iBAAiB,CAAC,CAAC;AAClE,CAAC","sourcesContent":["/** This file must only contain pure code and pure imports */\r\n\r\nimport { Vector2, Vector3, Vector4 } from \"core/Maths/math.vector.pure\";\r\nimport { NodeParticleBlock } from \"../nodeParticleBlock\";\r\nimport { type NodeParticleConnectionPoint } from \"../nodeParticleBlockConnectionPoint\";\r\nimport { NodeParticleBlockConnectionPointTypes } from \"../Enums/nodeParticleBlockConnectionPointTypes\";\r\nimport { RegisterClass } from \"../../../Misc/typeStore\";\r\n\r\n/**\r\n * Block used to step a value\r\n */\r\nexport class ParticleStepBlock extends NodeParticleBlock {\r\n /**\r\n * Creates a new ParticleStepBlock\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(\"value\", NodeParticleBlockConnectionPointTypes.AutoDetect);\r\n this.registerInput(\"edge\", NodeParticleBlockConnectionPointTypes.Float, true, 0);\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.Matrix);\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 \"ParticleStepBlock\";\r\n }\r\n\r\n /**\r\n * Gets the value operand input component\r\n */\r\n public get value(): NodeParticleConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the edge operand input component\r\n */\r\n public get edge(): NodeParticleConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the output component\r\n */\r\n public get output(): NodeParticleConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n public override _build() {\r\n if (!this.value.isConnected) {\r\n this.output._storedFunction = null;\r\n this.output._storedValue = null;\r\n return;\r\n }\r\n const func = (value: number, edge: number) => {\r\n if (value < edge) {\r\n return 0;\r\n }\r\n\r\n return 1;\r\n };\r\n\r\n this.output._storedFunction = (state) => {\r\n const source = this.value.getConnectedValue(state);\r\n const edge = this.edge.getConnectedValue(state);\r\n switch (this.value.type) {\r\n case NodeParticleBlockConnectionPointTypes.Int:\r\n case NodeParticleBlockConnectionPointTypes.Float: {\r\n return func(source, edge);\r\n }\r\n case NodeParticleBlockConnectionPointTypes.Vector2: {\r\n return new Vector2(func(source.x, edge), func(source.y, edge));\r\n }\r\n case NodeParticleBlockConnectionPointTypes.Vector3: {\r\n return new Vector3(func(source.x, edge), func(source.y, edge), func(source.z, edge));\r\n }\r\n case NodeParticleBlockConnectionPointTypes.Color4: {\r\n return new Vector4(func(source.r, edge), func(source.g, edge), func(source.b, edge), func(source.a, edge));\r\n }\r\n }\r\n\r\n return 0;\r\n };\r\n\r\n return this;\r\n }\r\n}\r\n\r\nlet _Registered = false;\r\n/**\r\n * Register side effects for particleStepBlock.\r\n * Safe to call multiple times; only the first call has an effect.\r\n */\r\nexport function RegisterParticleStepBlock(): void {\r\n if (_Registered) {\r\n return;\r\n }\r\n _Registered = true;\r\n\r\n RegisterClass(\"BABYLON.ParticleStepBlock\", ParticleStepBlock);\r\n}\r\n"]}
1
+ {"version":3,"file":"particleStepBlock.pure.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Particles/Node/Blocks/particleStepBlock.pure.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAE7D,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,MAAM,EAAE,MAAM,gCAAgC,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEzD,OAAO,EAAE,qCAAqC,EAAE,MAAM,gDAAgD,CAAC;AACvG,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAExD;;GAEG;AACH,MAAM,OAAO,iBAAkB,SAAQ,iBAAiB;IACpD;;;OAGG;IACH,YAAmB,IAAY;QAC3B,KAAK,CAAC,IAAI,CAAC,CAAC;QAEZ,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,qCAAqC,CAAC,UAAU,CAAC,CAAC;QAC9E,IAAI,CAAC,aAAa,CAAC,MAAM,EAAE,qCAAqC,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;QACjF,IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE,qCAAqC,CAAC,YAAY,CAAC,C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;QAEF,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ;AAED,IAAI,WAAW,GAAG,KAAK,CAAC;AACxB;;;GAGG;AACH,MAAM,UAAU,yBAAyB;IACrC,IAAI,WAAW,EAAE,CAAC;QACd,OAAO;IACX,CAAC;IACD,WAAW,GAAG,IAAI,CAAC;IAEnB,aAAa,CAAC,2BAA2B,EAAE,iBAAiB,CAAC,CAAC;AAClE,CAAC","sourcesContent":["/** This file must only contain pure code and pure imports */\r\n\r\nimport { Vector2, Vector3 } from \"core/Maths/math.vector.pure\";\r\nimport { Color4 } from \"../../../Maths/math.color.pure\";\r\nimport { NodeParticleBlock } from \"../nodeParticleBlock\";\r\nimport { type NodeParticleConnectionPoint } from \"../nodeParticleBlockConnectionPoint\";\r\nimport { NodeParticleBlockConnectionPointTypes } from \"../Enums/nodeParticleBlockConnectionPointTypes\";\r\nimport { RegisterClass } from \"../../../Misc/typeStore\";\r\n\r\n/**\r\n * Block used to step a value\r\n */\r\nexport class ParticleStepBlock extends NodeParticleBlock {\r\n /**\r\n * Creates a new ParticleStepBlock\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(\"value\", NodeParticleBlockConnectionPointTypes.AutoDetect);\r\n this.registerInput(\"edge\", NodeParticleBlockConnectionPointTypes.Float, true, 0);\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.Matrix);\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 \"ParticleStepBlock\";\r\n }\r\n\r\n /**\r\n * Gets the value operand input component\r\n */\r\n public get value(): NodeParticleConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the edge operand input component\r\n */\r\n public get edge(): NodeParticleConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the output component\r\n */\r\n public get output(): NodeParticleConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n public override _build() {\r\n if (!this.value.isConnected) {\r\n this.output._storedFunction = null;\r\n this.output._storedValue = null;\r\n return;\r\n }\r\n const func = (value: number, edge: number) => {\r\n if (value < edge) {\r\n return 0;\r\n }\r\n\r\n return 1;\r\n };\r\n\r\n this.output._storedFunction = (state) => {\r\n const source = this.value.getConnectedValue(state);\r\n const edge = this.edge.getConnectedValue(state);\r\n switch (this.value.type) {\r\n case NodeParticleBlockConnectionPointTypes.Int:\r\n case NodeParticleBlockConnectionPointTypes.Float: {\r\n return func(source, edge);\r\n }\r\n case NodeParticleBlockConnectionPointTypes.Vector2: {\r\n return new Vector2(func(source.x, edge), func(source.y, edge));\r\n }\r\n case NodeParticleBlockConnectionPointTypes.Vector3: {\r\n return new Vector3(func(source.x, edge), func(source.y, edge), func(source.z, edge));\r\n }\r\n case NodeParticleBlockConnectionPointTypes.Color4: {\r\n return new Color4(func(source.r, edge), func(source.g, edge), func(source.b, edge), func(source.a, edge));\r\n }\r\n }\r\n\r\n return 0;\r\n };\r\n\r\n return this;\r\n }\r\n}\r\n\r\nlet _Registered = false;\r\n/**\r\n * Register side effects for particleStepBlock.\r\n * Safe to call multiple times; only the first call has an effect.\r\n */\r\nexport function RegisterParticleStepBlock(): void {\r\n if (_Registered) {\r\n return;\r\n }\r\n _Registered = true;\r\n\r\n RegisterClass(\"BABYLON.ParticleStepBlock\", ParticleStepBlock);\r\n}\r\n"]}
@@ -726,7 +726,7 @@ let _Registered = false;
726
726
  * @returns An instantiated pipeline from the serialized object.
727
727
  */
728
728
  export function DefaultRenderingPipelineParse(source, scene, rootUrl) {
729
- return SerializationHelper.Parse(() => new DefaultRenderingPipeline(source._name, source._name._hdr, scene), source, scene, rootUrl);
729
+ return SerializationHelper.Parse(() => new DefaultRenderingPipeline(source._name, source._hdr, scene), source, scene, rootUrl);
730
730
  }
731
731
  /**
732
732
  * Register side effects for defaultRenderingPipeline.