@babylonjs/core 8.3.1 → 8.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (327) hide show
  1. package/Animations/animation.d.ts +4 -0
  2. package/Animations/animation.js +22 -13
  3. package/Animations/animation.js.map +1 -1
  4. package/Animations/animation.optimizations.d.ts +31 -0
  5. package/Animations/animation.optimizations.js +41 -0
  6. package/Animations/animation.optimizations.js.map +1 -0
  7. package/Animations/index.d.ts +1 -0
  8. package/Animations/index.js +1 -0
  9. package/Animations/index.js.map +1 -1
  10. package/Animations/pathCursor.js +3 -1
  11. package/Animations/pathCursor.js.map +1 -1
  12. package/Animations/runtimeAnimation.d.ts +3 -1
  13. package/Animations/runtimeAnimation.js +127 -116
  14. package/Animations/runtimeAnimation.js.map +1 -1
  15. package/Audio/audioSceneComponent.js +4 -4
  16. package/Audio/audioSceneComponent.js.map +1 -1
  17. package/Behaviors/Meshes/attachToBoxBehavior.js +6 -6
  18. package/Behaviors/Meshes/attachToBoxBehavior.js.map +1 -1
  19. package/Behaviors/Meshes/fadeInOutBehavior.js +3 -2
  20. package/Behaviors/Meshes/fadeInOutBehavior.js.map +1 -1
  21. package/Behaviors/Meshes/multiPointerScaleBehavior.js +6 -4
  22. package/Behaviors/Meshes/multiPointerScaleBehavior.js.map +1 -1
  23. package/Behaviors/Meshes/sixDofDragBehavior.js +3 -2
  24. package/Behaviors/Meshes/sixDofDragBehavior.js.map +1 -1
  25. package/Bones/skeleton.js +6 -6
  26. package/Bones/skeleton.js.map +1 -1
  27. package/Cameras/Inputs/followCameraKeyboardMoveInput.js +2 -2
  28. package/Cameras/Inputs/followCameraKeyboardMoveInput.js.map +1 -1
  29. package/Cameras/VR/vrExperienceHelper.js +2 -2
  30. package/Cameras/VR/vrExperienceHelper.js.map +1 -1
  31. package/Cameras/arcRotateCamera.js +6 -2
  32. package/Cameras/arcRotateCamera.js.map +1 -1
  33. package/Cameras/camera.js +2 -2
  34. package/Cameras/camera.js.map +1 -1
  35. package/Cameras/deviceOrientationCamera.js +3 -2
  36. package/Cameras/deviceOrientationCamera.js.map +1 -1
  37. package/Collisions/gpuPicker.d.ts +1 -0
  38. package/Collisions/gpuPicker.js +9 -0
  39. package/Collisions/gpuPicker.js.map +1 -1
  40. package/Debug/axesViewer.js +3 -2
  41. package/Debug/axesViewer.js.map +1 -1
  42. package/Debug/directionalLightFrustumViewer.js +4 -4
  43. package/Debug/directionalLightFrustumViewer.js.map +1 -1
  44. package/Debug/physicsViewer.js +7 -6
  45. package/Debug/physicsViewer.js.map +1 -1
  46. package/Debug/skeletonViewer.js +4 -4
  47. package/Debug/skeletonViewer.js.map +1 -1
  48. package/Engines/Processors/shaderCodeNode.js +2 -2
  49. package/Engines/Processors/shaderCodeNode.js.map +1 -1
  50. package/Engines/abstractEngine.d.ts +1 -0
  51. package/Engines/abstractEngine.js +14 -8
  52. package/Engines/abstractEngine.js.map +1 -1
  53. package/Engines/constants.d.ts +27 -5
  54. package/Engines/constants.js +27 -5
  55. package/Engines/constants.js.map +1 -1
  56. package/Engines/engine.js +8 -8
  57. package/Engines/engine.js.map +1 -1
  58. package/Engines/webgpuEngine.js +6 -2
  59. package/Engines/webgpuEngine.js.map +1 -1
  60. package/FlowGraph/Blocks/Data/Transformers/flowGraphJsonPointerParserBlock.js +2 -2
  61. package/FlowGraph/Blocks/Data/Transformers/flowGraphJsonPointerParserBlock.js.map +1 -1
  62. package/FlowGraph/Blocks/Data/flowGraphDataSwitchBlock.js +3 -2
  63. package/FlowGraph/Blocks/Data/flowGraphDataSwitchBlock.js.map +1 -1
  64. package/FlowGraph/Blocks/Event/flowGraphReceiveCustomEventBlock.js +3 -2
  65. package/FlowGraph/Blocks/Event/flowGraphReceiveCustomEventBlock.js.map +1 -1
  66. package/FlowGraph/Blocks/Event/flowGraphSendCustomEventBlock.js +2 -2
  67. package/FlowGraph/Blocks/Event/flowGraphSendCustomEventBlock.js.map +1 -1
  68. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphSwitchBlock.js +3 -2
  69. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphSwitchBlock.js.map +1 -1
  70. package/FlowGraph/flowGraphAsyncExecutionBlock.js +5 -3
  71. package/FlowGraph/flowGraphAsyncExecutionBlock.js.map +1 -1
  72. package/FlowGraph/flowGraphBlock.js +3 -2
  73. package/FlowGraph/flowGraphBlock.js.map +1 -1
  74. package/FlowGraph/flowGraphCoordinator.js +10 -6
  75. package/FlowGraph/flowGraphCoordinator.js.map +1 -1
  76. package/FrameGraph/Node/Blocks/Rendering/baseObjectRendererBlock.js +2 -2
  77. package/FrameGraph/Node/Blocks/Rendering/baseObjectRendererBlock.js.map +1 -1
  78. package/FrameGraph/Node/nodeRenderGraphBlock.js +5 -4
  79. package/FrameGraph/Node/nodeRenderGraphBlock.js.map +1 -1
  80. package/FrameGraph/Tasks/PostProcesses/depthOfFieldMergeTask.js +4 -3
  81. package/FrameGraph/Tasks/PostProcesses/depthOfFieldMergeTask.js.map +1 -1
  82. package/Gamepads/gamepadManager.js +2 -2
  83. package/Gamepads/gamepadManager.js.map +1 -1
  84. package/Gizmos/axisDragGizmo.js +3 -2
  85. package/Gizmos/axisDragGizmo.js.map +1 -1
  86. package/Gizmos/axisScaleGizmo.js +6 -4
  87. package/Gizmos/axisScaleGizmo.js.map +1 -1
  88. package/Gizmos/boundingBoxGizmo.js +28 -26
  89. package/Gizmos/boundingBoxGizmo.js.map +1 -1
  90. package/Gizmos/cameraGizmo.js +6 -3
  91. package/Gizmos/cameraGizmo.js.map +1 -1
  92. package/Gizmos/gizmo.js +11 -10
  93. package/Gizmos/gizmo.js.map +1 -1
  94. package/Gizmos/gizmoManager.js +16 -12
  95. package/Gizmos/gizmoManager.js.map +1 -1
  96. package/Gizmos/lightGizmo.js +3 -2
  97. package/Gizmos/lightGizmo.js.map +1 -1
  98. package/Gizmos/planeDragGizmo.js +3 -2
  99. package/Gizmos/planeDragGizmo.js.map +1 -1
  100. package/Gizmos/planeRotationGizmo.js +3 -2
  101. package/Gizmos/planeRotationGizmo.js.map +1 -1
  102. package/Gizmos/positionGizmo.js +41 -28
  103. package/Gizmos/positionGizmo.js.map +1 -1
  104. package/Gizmos/rotationGizmo.js +26 -18
  105. package/Gizmos/rotationGizmo.js.map +1 -1
  106. package/Gizmos/scaleGizmo.js +47 -32
  107. package/Gizmos/scaleGizmo.js.map +1 -1
  108. package/Layers/effectLayerSceneComponent.js +4 -4
  109. package/Layers/effectLayerSceneComponent.js.map +1 -1
  110. package/Layers/layerSceneComponent.js +4 -4
  111. package/Layers/layerSceneComponent.js.map +1 -1
  112. package/LensFlares/lensFlareSystemSceneComponent.js +4 -4
  113. package/LensFlares/lensFlareSystemSceneComponent.js.map +1 -1
  114. package/Lights/Shadows/shadowGenerator.js +3 -3
  115. package/Lights/Shadows/shadowGenerator.js.map +1 -1
  116. package/Lights/light.js +4 -4
  117. package/Lights/light.js.map +1 -1
  118. package/Loading/Plugins/babylonFileLoader.js +54 -46
  119. package/Loading/Plugins/babylonFileLoader.js.map +1 -1
  120. package/Loading/loadingScreen.js +4 -3
  121. package/Loading/loadingScreen.js.map +1 -1
  122. package/Loading/sceneLoader.js +15 -12
  123. package/Loading/sceneLoader.js.map +1 -1
  124. package/Materials/Node/Blocks/Dual/currentScreenBlock.js +9 -3
  125. package/Materials/Node/Blocks/Dual/currentScreenBlock.js.map +1 -1
  126. package/Materials/Node/Blocks/Fragment/fragmentOutputBlock.js +11 -0
  127. package/Materials/Node/Blocks/Fragment/fragmentOutputBlock.js.map +1 -1
  128. package/Materials/Node/Blocks/Input/inputBlock.js +18 -31
  129. package/Materials/Node/Blocks/Input/inputBlock.js.map +1 -1
  130. package/Materials/Node/Blocks/baseMathBlock.js +3 -1
  131. package/Materials/Node/Blocks/baseMathBlock.js.map +1 -1
  132. package/Materials/Node/Blocks/customBlock.js +53 -43
  133. package/Materials/Node/Blocks/customBlock.js.map +1 -1
  134. package/Materials/Node/Enums/nodeMaterialModes.d.ts +3 -1
  135. package/Materials/Node/Enums/nodeMaterialModes.js +2 -0
  136. package/Materials/Node/Enums/nodeMaterialModes.js.map +1 -1
  137. package/Materials/Node/nodeMaterial.d.ts +5 -0
  138. package/Materials/Node/nodeMaterial.js +33 -20
  139. package/Materials/Node/nodeMaterial.js.map +1 -1
  140. package/Materials/Node/nodeMaterialBlock.js +7 -4
  141. package/Materials/Node/nodeMaterialBlock.js.map +1 -1
  142. package/Materials/Node/nodeMaterialBuildState.d.ts +13 -2
  143. package/Materials/Node/nodeMaterialBuildState.js +72 -7
  144. package/Materials/Node/nodeMaterialBuildState.js.map +1 -1
  145. package/Materials/Node/nodeMaterialDefault.d.ts +5 -0
  146. package/Materials/Node/nodeMaterialDefault.js +28 -0
  147. package/Materials/Node/nodeMaterialDefault.js.map +1 -1
  148. package/Materials/Textures/cubeTexture.js +3 -1
  149. package/Materials/Textures/cubeTexture.js.map +1 -1
  150. package/Materials/Textures/videoTexture.js +5 -4
  151. package/Materials/Textures/videoTexture.js.map +1 -1
  152. package/Materials/materialDefines.js +3 -1
  153. package/Materials/materialDefines.js.map +1 -1
  154. package/Materials/multiMaterial.js +3 -1
  155. package/Materials/multiMaterial.js.map +1 -1
  156. package/Materials/shaderMaterial.js +3 -2
  157. package/Materials/shaderMaterial.js.map +1 -1
  158. package/Meshes/Compression/dracoEncoder.js +2 -2
  159. package/Meshes/Compression/dracoEncoder.js.map +1 -1
  160. package/Meshes/GaussianSplatting/gaussianSplattingMesh.js +8 -8
  161. package/Meshes/GaussianSplatting/gaussianSplattingMesh.js.map +1 -1
  162. package/Meshes/GreasedLine/greasedLineMesh.js +6 -6
  163. package/Meshes/GreasedLine/greasedLineMesh.js.map +1 -1
  164. package/Meshes/GreasedLine/greasedLineRibbonMesh.js +4 -3
  165. package/Meshes/GreasedLine/greasedLineRibbonMesh.js.map +1 -1
  166. package/Meshes/Node/Blocks/mathBlock.js +3 -1
  167. package/Meshes/Node/Blocks/mathBlock.js.map +1 -1
  168. package/Meshes/Node/nodeGeometryBlock.js +8 -5
  169. package/Meshes/Node/nodeGeometryBlock.js.map +1 -1
  170. package/Meshes/abstractMesh.js +2 -2
  171. package/Meshes/abstractMesh.js.map +1 -1
  172. package/Meshes/geodesicMesh.js +2 -2
  173. package/Meshes/geodesicMesh.js.map +1 -1
  174. package/Meshes/mesh.js +6 -6
  175. package/Meshes/mesh.js.map +1 -1
  176. package/Meshes/mesh.vertexData.functions.js +11 -10
  177. package/Meshes/mesh.vertexData.functions.js.map +1 -1
  178. package/Meshes/mesh.vertexData.subdivide.js +10 -10
  179. package/Meshes/mesh.vertexData.subdivide.js.map +1 -1
  180. package/Meshes/meshSimplification.js +10 -10
  181. package/Meshes/meshSimplification.js.map +1 -1
  182. package/Meshes/meshUtils.js +6 -3
  183. package/Meshes/meshUtils.js.map +1 -1
  184. package/Meshes/polygonMesh.js +10 -10
  185. package/Meshes/polygonMesh.js.map +1 -1
  186. package/Misc/PerformanceViewer/performanceViewerCollector.js +4 -4
  187. package/Misc/PerformanceViewer/performanceViewerCollector.js.map +1 -1
  188. package/Misc/arrayTools.js +2 -2
  189. package/Misc/arrayTools.js.map +1 -1
  190. package/Misc/asyncLock.js +9 -9
  191. package/Misc/asyncLock.js.map +1 -1
  192. package/Misc/basis.js +4 -2
  193. package/Misc/basis.js.map +1 -1
  194. package/Misc/deepCopier.js +3 -2
  195. package/Misc/deepCopier.js.map +1 -1
  196. package/Misc/deepMerger.js +3 -2
  197. package/Misc/deepMerger.js.map +1 -1
  198. package/Misc/fileTools.js +4 -4
  199. package/Misc/fileTools.js.map +1 -1
  200. package/Misc/greasedLineTools.js +14 -13
  201. package/Misc/greasedLineTools.js.map +1 -1
  202. package/Misc/logger.js +3 -2
  203. package/Misc/logger.js.map +1 -1
  204. package/Misc/observable.extensions.js +4 -4
  205. package/Misc/observable.extensions.js.map +1 -1
  206. package/Misc/sceneSerializer.js +5 -4
  207. package/Misc/sceneSerializer.js.map +1 -1
  208. package/Misc/snapshotRenderingHelper.js +3 -1
  209. package/Misc/snapshotRenderingHelper.js.map +1 -1
  210. package/Misc/tags.js +2 -2
  211. package/Misc/tags.js.map +1 -1
  212. package/Misc/trajectoryClassifier.js +8 -8
  213. package/Misc/trajectoryClassifier.js.map +1 -1
  214. package/Particles/IParticleSystem.d.ts +1 -1
  215. package/Particles/IParticleSystem.js.map +1 -1
  216. package/Particles/baseParticleSystem.d.ts +11 -3
  217. package/Particles/baseParticleSystem.js +37 -3
  218. package/Particles/baseParticleSystem.js.map +1 -1
  219. package/Particles/gpuParticleSystem.js +1 -14
  220. package/Particles/gpuParticleSystem.js.map +1 -1
  221. package/Particles/particle.js +2 -2
  222. package/Particles/particle.js.map +1 -1
  223. package/Particles/particleSystem.js +15 -13
  224. package/Particles/particleSystem.js.map +1 -1
  225. package/Particles/thinParticleSystem.js +3 -16
  226. package/Particles/thinParticleSystem.js.map +1 -1
  227. package/Physics/physicsHelper.js +18 -14
  228. package/Physics/physicsHelper.js.map +1 -1
  229. package/Physics/v1/Plugins/ammoJSPlugin.js +10 -8
  230. package/Physics/v1/Plugins/ammoJSPlugin.js.map +1 -1
  231. package/Physics/v1/Plugins/cannonJSPlugin.js +13 -8
  232. package/Physics/v1/Plugins/cannonJSPlugin.js.map +1 -1
  233. package/Physics/v1/Plugins/oimoJSPlugin.js +9 -8
  234. package/Physics/v1/Plugins/oimoJSPlugin.js.map +1 -1
  235. package/Physics/v1/physicsEngine.js +4 -4
  236. package/Physics/v1/physicsEngine.js.map +1 -1
  237. package/Physics/v1/physicsImpostor.js +10 -21
  238. package/Physics/v1/physicsImpostor.js.map +1 -1
  239. package/Physics/v2/Plugins/havokPlugin.js +12 -10
  240. package/Physics/v2/Plugins/havokPlugin.js.map +1 -1
  241. package/Physics/v2/ragdoll.js +4 -4
  242. package/Physics/v2/ragdoll.js.map +1 -1
  243. package/PostProcesses/RenderPipeline/Pipelines/standardRenderingPipeline.js +3 -2
  244. package/PostProcesses/RenderPipeline/Pipelines/standardRenderingPipeline.js.map +1 -1
  245. package/PostProcesses/RenderPipeline/postProcessRenderEffect.js +8 -6
  246. package/PostProcesses/RenderPipeline/postProcessRenderEffect.js.map +1 -1
  247. package/PostProcesses/depthOfFieldMergePostProcess.js +4 -3
  248. package/PostProcesses/depthOfFieldMergePostProcess.js.map +1 -1
  249. package/Rendering/GlobalIllumination/giRSMManager.js +6 -6
  250. package/Rendering/GlobalIllumination/giRSMManager.js.map +1 -1
  251. package/Rendering/IBLShadows/iblShadowsRenderPipeline.js +14 -14
  252. package/Rendering/IBLShadows/iblShadowsRenderPipeline.js.map +1 -1
  253. package/Rendering/IBLShadows/iblShadowsVoxelRenderer.js +14 -12
  254. package/Rendering/IBLShadows/iblShadowsVoxelRenderer.js.map +1 -1
  255. package/Rendering/iblCdfGenerator.js +4 -4
  256. package/Rendering/iblCdfGenerator.js.map +1 -1
  257. package/Rendering/objectRenderer.js +2 -2
  258. package/Rendering/objectRenderer.js.map +1 -1
  259. package/Rendering/reflectiveShadowMap.js +7 -5
  260. package/Rendering/reflectiveShadowMap.js.map +1 -1
  261. package/Sprites/spriteMap.js +2 -2
  262. package/Sprites/spriteMap.js.map +1 -1
  263. package/XR/features/WebXRAbstractFeature.js +2 -2
  264. package/XR/features/WebXRAbstractFeature.js.map +1 -1
  265. package/XR/features/WebXRAnchorSystem.js +4 -4
  266. package/XR/features/WebXRAnchorSystem.js.map +1 -1
  267. package/XR/features/WebXRBackgroundRemover.js +3 -1
  268. package/XR/features/WebXRBackgroundRemover.js.map +1 -1
  269. package/XR/features/WebXRControllerMovement.js +6 -3
  270. package/XR/features/WebXRControllerMovement.js.map +1 -1
  271. package/XR/features/WebXRControllerPhysics.js +12 -7
  272. package/XR/features/WebXRControllerPhysics.js.map +1 -1
  273. package/XR/features/WebXRControllerPointerSelection.js +12 -7
  274. package/XR/features/WebXRControllerPointerSelection.js.map +1 -1
  275. package/XR/features/WebXRControllerTeleportation.js +11 -7
  276. package/XR/features/WebXRControllerTeleportation.js.map +1 -1
  277. package/XR/features/WebXRDepthSensing.js +6 -6
  278. package/XR/features/WebXRDepthSensing.js.map +1 -1
  279. package/XR/features/WebXRHandTracking.js +60 -24
  280. package/XR/features/WebXRHandTracking.js.map +1 -1
  281. package/XR/features/WebXRHitTest.js +4 -4
  282. package/XR/features/WebXRHitTest.js.map +1 -1
  283. package/XR/features/WebXRImageTracking.js +2 -2
  284. package/XR/features/WebXRImageTracking.js.map +1 -1
  285. package/XR/features/WebXRLayers.js +2 -2
  286. package/XR/features/WebXRLayers.js.map +1 -1
  287. package/XR/features/WebXRNearInteraction.js +12 -7
  288. package/XR/features/WebXRNearInteraction.js.map +1 -1
  289. package/XR/features/WebXRRawCameraAccess.js +9 -4
  290. package/XR/features/WebXRRawCameraAccess.js.map +1 -1
  291. package/XR/features/WebXRSpaceWarp.js +2 -2
  292. package/XR/features/WebXRSpaceWarp.js.map +1 -1
  293. package/XR/motionController/webXRAbstractMotionController.js +19 -8
  294. package/XR/motionController/webXRAbstractMotionController.js.map +1 -1
  295. package/XR/motionController/webXRGenericMotionController.js +2 -2
  296. package/XR/motionController/webXRGenericMotionController.js.map +1 -1
  297. package/XR/motionController/webXRHTCViveMotionController.js +5 -4
  298. package/XR/motionController/webXRHTCViveMotionController.js.map +1 -1
  299. package/XR/motionController/webXRMicrosoftMixedRealityController.js +9 -6
  300. package/XR/motionController/webXRMicrosoftMixedRealityController.js.map +1 -1
  301. package/XR/motionController/webXRMotionControllerManager.js +4 -4
  302. package/XR/motionController/webXRMotionControllerManager.js.map +1 -1
  303. package/XR/motionController/webXROculusTouchMotionController.js +5 -4
  304. package/XR/motionController/webXROculusTouchMotionController.js.map +1 -1
  305. package/XR/motionController/webXRProfiledMotionController.js +15 -10
  306. package/XR/motionController/webXRProfiledMotionController.js.map +1 -1
  307. package/XR/webXRCamera.js +3 -2
  308. package/XR/webXRCamera.js.map +1 -1
  309. package/XR/webXREnterExitUI.js +5 -4
  310. package/XR/webXREnterExitUI.js.map +1 -1
  311. package/XR/webXRExperienceHelper.js +2 -2
  312. package/XR/webXRExperienceHelper.js.map +1 -1
  313. package/XR/webXRFeaturesManager.js +10 -7
  314. package/XR/webXRFeaturesManager.js.map +1 -1
  315. package/XR/webXRInput.js +8 -8
  316. package/XR/webXRInput.js.map +1 -1
  317. package/XR/webXRInputSource.js +4 -1
  318. package/XR/webXRInputSource.js.map +1 -1
  319. package/XR/webXRRenderTargetTextureProvider.js +3 -1
  320. package/XR/webXRRenderTargetTextureProvider.js.map +1 -1
  321. package/assetContainer.js +156 -135
  322. package/assetContainer.js.map +1 -1
  323. package/node.js +2 -2
  324. package/node.js.map +1 -1
  325. package/package.json +1 -1
  326. package/scene.js +18 -11
  327. package/scene.js.map +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"IParticleSystem.js","sourceRoot":"","sources":["../../../../dev/core/src/Particles/IParticleSystem.ts"],"names":[],"mappings":"","sourcesContent":["import type { Immutable, Nullable } from \"../types\";\r\nimport type { Vector2, Vector3, Matrix } from \"../Maths/math.vector\";\r\nimport type { Color3, Color4 } from \"../Maths/math.color\";\r\nimport type { BaseTexture } from \"../Materials/Textures/baseTexture\";\r\nimport type {\r\n BoxParticleEmitter,\r\n IParticleEmitterType,\r\n PointParticleEmitter,\r\n HemisphericParticleEmitter,\r\n SphereParticleEmitter,\r\n SphereDirectedParticleEmitter,\r\n CylinderParticleEmitter,\r\n CylinderDirectedParticleEmitter,\r\n ConeParticleEmitter,\r\n ConeDirectedParticleEmitter,\r\n // eslint-disable-next-line import/no-internal-modules\r\n} from \"../Particles/EmitterTypes/index\";\r\nimport type { Scene } from \"../scene\";\r\nimport type { ColorGradient, FactorGradient, Color3Gradient } from \"../Misc/gradients\";\r\nimport type { Effect } from \"../Materials/effect\";\r\nimport type { Observable } from \"../Misc/observable\";\r\nimport type { VertexBuffer } from \"../Buffers/buffer\";\r\nimport type { DataBuffer } from \"../Buffers/dataBuffer\";\r\n\r\nimport type { Animation } from \"../Animations/animation\";\r\nimport type { AbstractMesh } from \"../Meshes/abstractMesh\";\r\n\r\n/**\r\n * Interface representing a particle system in Babylon.js.\r\n * This groups the common functionalities that needs to be implemented in order to create a particle system.\r\n * A particle system represents a way to manage particles from their emission to their animation and rendering.\r\n */\r\nexport interface IParticleSystem {\r\n /**\r\n * List of animations used by the particle system.\r\n */\r\n animations: Animation[];\r\n /**\r\n * The id of the Particle system.\r\n */\r\n id: string;\r\n /**\r\n * The name of the Particle system.\r\n */\r\n name: string;\r\n /**\r\n * The emitter represents the Mesh or position we are attaching the particle system to.\r\n */\r\n emitter: Nullable<AbstractMesh | Vector3>;\r\n /**\r\n * Gets or sets a boolean indicating if the particles must be rendered as billboard or aligned with the direction\r\n */\r\n isBillboardBased: boolean;\r\n /**\r\n * The rendering group used by the Particle system to chose when to render.\r\n */\r\n renderingGroupId: number;\r\n /**\r\n * The layer mask we are rendering the particles through.\r\n */\r\n layerMask: number;\r\n\r\n /**\r\n * The overall motion speed (0.01 is default update speed, faster updates = faster animation)\r\n */\r\n updateSpeed: number;\r\n\r\n /**\r\n * The amount of time the particle system is running (depends of the overall update speed).\r\n */\r\n targetStopDuration: number;\r\n\r\n /**\r\n * The texture used to render each particle. (this can be a spritesheet)\r\n */\r\n particleTexture: Nullable<BaseTexture>;\r\n\r\n /**\r\n * Blend mode use to render the particle, it can be either ParticleSystem.BLENDMODE_ONEONE, ParticleSystem.BLENDMODE_STANDARD or ParticleSystem.BLENDMODE_ADD.\r\n */\r\n blendMode: number;\r\n\r\n /**\r\n * Minimum life time of emitting particles.\r\n */\r\n minLifeTime: number;\r\n /**\r\n * Maximum life time of emitting particles.\r\n */\r\n maxLifeTime: number;\r\n\r\n /**\r\n * Minimum Size of emitting particles.\r\n */\r\n minSize: number;\r\n /**\r\n * Maximum Size of emitting particles.\r\n */\r\n maxSize: number;\r\n\r\n /**\r\n * Minimum scale of emitting particles on X axis.\r\n */\r\n minScaleX: number;\r\n /**\r\n * Maximum scale of emitting particles on X axis.\r\n */\r\n maxScaleX: number;\r\n\r\n /**\r\n * Minimum scale of emitting particles on Y axis.\r\n */\r\n minScaleY: number;\r\n /**\r\n * Maximum scale of emitting particles on Y axis.\r\n */\r\n maxScaleY: number;\r\n\r\n /**\r\n * Random color of each particle after it has been emitted, between color1 and color2 vectors.\r\n */\r\n color1: Color4;\r\n /**\r\n * Random color of each particle after it has been emitted, between color1 and color2 vectors.\r\n */\r\n color2: Color4;\r\n\r\n /**\r\n * Color the particle will have at the end of its lifetime.\r\n */\r\n colorDead: Color4;\r\n\r\n /**\r\n * The maximum number of particles to emit per frame until we reach the activeParticleCount value\r\n */\r\n emitRate: number;\r\n\r\n /**\r\n * You can use gravity if you want to give an orientation to your particles.\r\n */\r\n gravity: Vector3;\r\n\r\n /**\r\n * Minimum power of emitting particles.\r\n */\r\n minEmitPower: number;\r\n /**\r\n * Maximum power of emitting particles.\r\n */\r\n maxEmitPower: number;\r\n /**\r\n * Minimum angular speed of emitting particles (Z-axis rotation for each particle).\r\n */\r\n minAngularSpeed: number;\r\n /**\r\n * Maximum angular speed of emitting particles (Z-axis rotation for each particle).\r\n */\r\n maxAngularSpeed: number;\r\n /**\r\n * Gets or sets the minimal initial rotation in radians.\r\n */\r\n minInitialRotation: number;\r\n /**\r\n * Gets or sets the maximal initial rotation in radians.\r\n */\r\n maxInitialRotation: number;\r\n /**\r\n * The particle emitter type defines the emitter used by the particle system.\r\n * It can be for example box, sphere, or cone...\r\n */\r\n particleEmitterType: Nullable<IParticleEmitterType>;\r\n /**\r\n * Defines the delay in milliseconds before starting the system (0 by default)\r\n */\r\n startDelay: number;\r\n /**\r\n * Gets or sets a value indicating how many cycles (or frames) must be executed before first rendering (this value has to be set before starting the system). Default is 0\r\n */\r\n preWarmCycles: number;\r\n /**\r\n * Gets or sets a value indicating the time step multiplier to use in pre-warm mode (default is 1)\r\n */\r\n preWarmStepOffset: number;\r\n\r\n /**\r\n * If using a spritesheet (isAnimationSheetEnabled) defines the speed of the sprite loop (default is 1 meaning the animation will play once during the entire particle lifetime)\r\n */\r\n spriteCellChangeSpeed: number;\r\n /**\r\n * If using a spritesheet (isAnimationSheetEnabled) defines the first sprite cell to display\r\n */\r\n startSpriteCellID: number;\r\n /**\r\n * If using a spritesheet (isAnimationSheetEnabled) defines the last sprite cell to display\r\n */\r\n endSpriteCellID: number;\r\n /**\r\n * If using a spritesheet (isAnimationSheetEnabled), defines whether the sprite animation is looping\r\n */\r\n spriteCellLoop: boolean;\r\n /**\r\n * If using a spritesheet (isAnimationSheetEnabled), defines the sprite cell width to use\r\n */\r\n spriteCellWidth: number;\r\n /**\r\n * If using a spritesheet (isAnimationSheetEnabled), defines the sprite cell height to use\r\n */\r\n spriteCellHeight: number;\r\n /**\r\n * This allows the system to random pick the start cell ID between startSpriteCellID and endSpriteCellID\r\n */\r\n spriteRandomStartCell: boolean;\r\n\r\n /**\r\n * Gets or sets a boolean indicating if a spritesheet is used to animate the particles texture\r\n */\r\n isAnimationSheetEnabled: boolean;\r\n\r\n /** Gets or sets a Vector2 used to move the pivot (by default (0,0)) */\r\n translationPivot: Vector2;\r\n\r\n /**\r\n * Gets or sets a texture used to add random noise to particle positions\r\n */\r\n noiseTexture: Nullable<BaseTexture>;\r\n\r\n /** Gets or sets the strength to apply to the noise value (default is (10, 10, 10)) */\r\n noiseStrength: Vector3;\r\n\r\n /**\r\n * Gets or sets the billboard mode to use when isBillboardBased = true.\r\n * Value can be: ParticleSystem.BILLBOARDMODE_ALL, ParticleSystem.BILLBOARDMODE_Y, ParticleSystem.BILLBOARDMODE_STRETCHED\r\n */\r\n billboardMode: number;\r\n\r\n /**\r\n * Gets or sets a boolean enabling the use of logarithmic depth buffers, which is good for wide depth buffers.\r\n */\r\n useLogarithmicDepth: boolean;\r\n\r\n /** Gets or sets a value indicating the damping to apply if the limit velocity factor is reached */\r\n limitVelocityDamping: number;\r\n\r\n /**\r\n * Gets or sets a boolean indicating that hosted animations (in the system.animations array) must be started when system.start() is called\r\n */\r\n beginAnimationOnStart: boolean;\r\n\r\n /**\r\n * Gets or sets the frame to start the animation from when beginAnimationOnStart is true\r\n */\r\n beginAnimationFrom: number;\r\n\r\n /**\r\n * Gets or sets the frame to end the animation on when beginAnimationOnStart is true\r\n */\r\n beginAnimationTo: number;\r\n\r\n /**\r\n * Gets or sets a boolean indicating if animations must loop when beginAnimationOnStart is true\r\n */\r\n beginAnimationLoop: boolean;\r\n\r\n /**\r\n * Specifies whether the particle system will be disposed once it reaches the end of the animation.\r\n */\r\n disposeOnStop: boolean;\r\n\r\n /**\r\n * If you want to launch only a few particles at once, that can be done, as well.\r\n */\r\n manualEmitCount: number;\r\n\r\n /**\r\n * Specifies if the particles are updated in emitter local space or world space\r\n */\r\n isLocal: boolean;\r\n\r\n /** Snippet ID if the particle system was created from the snippet server */\r\n snippetId: string;\r\n\r\n /** Gets or sets a matrix to use to compute projection */\r\n defaultProjectionMatrix: Matrix;\r\n\r\n /** Indicates that the update of particles is done in the animate function (and not in render) */\r\n updateInAnimate: boolean;\r\n\r\n /** @internal */\r\n _wasDispatched: boolean;\r\n\r\n /**\r\n * Gets the maximum number of particles active at the same time.\r\n * @returns The max number of active particles.\r\n */\r\n getCapacity(): number;\r\n\r\n /**\r\n * Gets the number of particles active at the same time.\r\n * @returns The number of active particles.\r\n */\r\n getActiveCount(): number;\r\n\r\n /**\r\n * Gets if the system has been started. (Note: this will still be true after stop is called)\r\n * @returns True if it has been started, otherwise false.\r\n */\r\n isStarted(): boolean;\r\n\r\n /**\r\n * Animates the particle system for this frame.\r\n */\r\n animate(): void;\r\n /**\r\n * Renders the particle system in its current state.\r\n * @returns the current number of particles\r\n */\r\n render(): number;\r\n /**\r\n * Dispose the particle system and frees its associated resources.\r\n * @param disposeTexture defines if the particle texture must be disposed as well (true by default)\r\n * @param disposeAttachedSubEmitters defines if the attached sub-emitters must be disposed as well (false by default)\r\n * @param disposeEndSubEmitters defines if the end type sub-emitters must be disposed as well (false by default)\r\n */\r\n dispose(disposeTexture?: boolean, disposeAttachedSubEmitters?: boolean, disposeEndSubEmitters?: boolean): void;\r\n /**\r\n * An event triggered when the system is disposed\r\n */\r\n onDisposeObservable: Observable<IParticleSystem>;\r\n /**\r\n * An event triggered when the system is stopped\r\n */\r\n onStoppedObservable: Observable<IParticleSystem>;\r\n /**\r\n * Clones the particle system.\r\n * @param name The name of the cloned object\r\n * @param newEmitter The new emitter to use\r\n * @returns the cloned particle system\r\n */\r\n clone(name: string, newEmitter: any): Nullable<IParticleSystem>;\r\n /**\r\n * Serializes the particle system to a JSON object\r\n * @param serializeTexture defines if the texture must be serialized as well\r\n * @returns the JSON object\r\n */\r\n serialize(serializeTexture: boolean): any;\r\n /**\r\n * Rebuild the particle system\r\n */\r\n rebuild(): void;\r\n\r\n /** Force the system to rebuild all gradients that need to be resync */\r\n forceRefreshGradients(): void;\r\n\r\n /**\r\n * Starts the particle system and begins to emit\r\n * @param delay defines the delay in milliseconds before starting the system (0 by default)\r\n */\r\n start(delay?: number): void;\r\n\r\n /**\r\n * Stops the particle system.\r\n */\r\n stop(): void;\r\n\r\n /**\r\n * Remove all active particles\r\n */\r\n reset(): void;\r\n\r\n /**\r\n * Gets a boolean indicating that the system is stopping\r\n * @returns true if the system is currently stopping\r\n */\r\n isStopping(): boolean;\r\n\r\n /**\r\n * Is this system ready to be used/rendered\r\n * @returns true if the system is ready\r\n */\r\n isReady(): boolean;\r\n /**\r\n * Returns the string \"ParticleSystem\"\r\n * @returns a string containing the class name\r\n */\r\n getClassName(): string;\r\n /**\r\n * Gets the custom effect used to render the particles\r\n * @param blendMode Blend mode for which the effect should be retrieved\r\n * @returns The effect\r\n */\r\n getCustomEffect(blendMode: number): Nullable<Effect>;\r\n /**\r\n * Sets the custom effect used to render the particles\r\n * @param effect The effect to set\r\n * @param blendMode Blend mode for which the effect should be set\r\n */\r\n setCustomEffect(effect: Nullable<Effect>, blendMode: number): void;\r\n\r\n /**\r\n * Fill the defines array according to the current settings of the particle system\r\n * @param defines Array to be updated\r\n * @param blendMode blend mode to take into account when updating the array\r\n * @param fillImageProcessing fills the image processing defines\r\n */\r\n fillDefines(defines: Array<string>, blendMode: number, fillImageProcessing?: boolean): void;\r\n /**\r\n * Fill the uniforms, attributes and samplers arrays according to the current settings of the particle system\r\n * @param uniforms Uniforms array to fill\r\n * @param attributes Attributes array to fill\r\n * @param samplers Samplers array to fill\r\n */\r\n fillUniformsAttributesAndSamplerNames(uniforms: Array<string>, attributes: Array<string>, samplers: Array<string>): void;\r\n /**\r\n * Observable that will be called just before the particles are drawn\r\n */\r\n onBeforeDrawParticlesObservable: Observable<Nullable<Effect>>;\r\n /**\r\n * Gets the name of the particle vertex shader\r\n */\r\n vertexShaderName: string;\r\n\r\n /**\r\n * Gets the vertex buffers used by the particle system\r\n */\r\n vertexBuffers: Immutable<{ [key: string]: VertexBuffer }>;\r\n /**\r\n * Gets the index buffer used by the particle system (or null if no index buffer is used)\r\n */\r\n indexBuffer: Nullable<DataBuffer>;\r\n\r\n /**\r\n * Adds a new color gradient\r\n * @param gradient defines the gradient to use (between 0 and 1)\r\n * @param color1 defines the color to affect to the specified gradient\r\n * @param color2 defines an additional color used to define a range ([color, color2]) with main color to pick the final color from\r\n * @returns the current particle system\r\n */\r\n addColorGradient(gradient: number, color1: Color4, color2?: Color4): IParticleSystem;\r\n /**\r\n * Remove a specific color gradient\r\n * @param gradient defines the gradient to remove\r\n * @returns the current particle system\r\n */\r\n removeColorGradient(gradient: number): IParticleSystem;\r\n /**\r\n * Adds a new size gradient\r\n * @param gradient defines the gradient to use (between 0 and 1)\r\n * @param factor defines the size factor to affect to the specified gradient\r\n * @param factor2 defines an additional factor used to define a range ([factor, factor2]) with main value to pick the final value from\r\n * @returns the current particle system\r\n */\r\n addSizeGradient(gradient: number, factor: number, factor2?: number): IParticleSystem;\r\n /**\r\n * Remove a specific size gradient\r\n * @param gradient defines the gradient to remove\r\n * @returns the current particle system\r\n */\r\n removeSizeGradient(gradient: number): IParticleSystem;\r\n /**\r\n * Gets the current list of color gradients.\r\n * You must use addColorGradient and removeColorGradient to update this list\r\n * @returns the list of color gradients\r\n */\r\n getColorGradients(): Nullable<Array<ColorGradient>>;\r\n /**\r\n * Gets the current list of size gradients.\r\n * You must use addSizeGradient and removeSizeGradient to update this list\r\n * @returns the list of size gradients\r\n */\r\n getSizeGradients(): Nullable<Array<FactorGradient>>;\r\n /**\r\n * Gets the current list of angular speed gradients.\r\n * You must use addAngularSpeedGradient and removeAngularSpeedGradient to update this list\r\n * @returns the list of angular speed gradients\r\n */\r\n getAngularSpeedGradients(): Nullable<Array<FactorGradient>>;\r\n /**\r\n * Adds a new angular speed gradient\r\n * @param gradient defines the gradient to use (between 0 and 1)\r\n * @param factor defines the angular speed to affect to the specified gradient\r\n * @param factor2 defines an additional factor used to define a range ([factor, factor2]) with main value to pick the final value from\r\n * @returns the current particle system\r\n */\r\n addAngularSpeedGradient(gradient: number, factor: number, factor2?: number): IParticleSystem;\r\n /**\r\n * Remove a specific angular speed gradient\r\n * @param gradient defines the gradient to remove\r\n * @returns the current particle system\r\n */\r\n removeAngularSpeedGradient(gradient: number): IParticleSystem;\r\n /**\r\n * Gets the current list of velocity gradients.\r\n * You must use addVelocityGradient and removeVelocityGradient to update this list\r\n * @returns the list of velocity gradients\r\n */\r\n getVelocityGradients(): Nullable<Array<FactorGradient>>;\r\n /**\r\n * Adds a new velocity gradient\r\n * @param gradient defines the gradient to use (between 0 and 1)\r\n * @param factor defines the velocity to affect to the specified gradient\r\n * @param factor2 defines an additional factor used to define a range ([factor, factor2]) with main value to pick the final value from\r\n * @returns the current particle system\r\n */\r\n addVelocityGradient(gradient: number, factor: number, factor2?: number): IParticleSystem;\r\n /**\r\n * Remove a specific velocity gradient\r\n * @param gradient defines the gradient to remove\r\n * @returns the current particle system\r\n */\r\n removeVelocityGradient(gradient: number): IParticleSystem;\r\n /**\r\n * Gets the current list of limit velocity gradients.\r\n * You must use addLimitVelocityGradient and removeLimitVelocityGradient to update this list\r\n * @returns the list of limit velocity gradients\r\n */\r\n getLimitVelocityGradients(): Nullable<Array<FactorGradient>>;\r\n /**\r\n * Adds a new limit velocity gradient\r\n * @param gradient defines the gradient to use (between 0 and 1)\r\n * @param factor defines the limit velocity to affect to the specified gradient\r\n * @param factor2 defines an additional factor used to define a range ([factor, factor2]) with main value to pick the final value from\r\n * @returns the current particle system\r\n */\r\n addLimitVelocityGradient(gradient: number, factor: number, factor2?: number): IParticleSystem;\r\n /**\r\n * Remove a specific limit velocity gradient\r\n * @param gradient defines the gradient to remove\r\n * @returns the current particle system\r\n */\r\n removeLimitVelocityGradient(gradient: number): IParticleSystem;\r\n /**\r\n * Adds a new drag gradient\r\n * @param gradient defines the gradient to use (between 0 and 1)\r\n * @param factor defines the drag to affect to the specified gradient\r\n * @param factor2 defines an additional factor used to define a range ([factor, factor2]) with main value to pick the final value from\r\n * @returns the current particle system\r\n */\r\n addDragGradient(gradient: number, factor: number, factor2?: number): IParticleSystem;\r\n /**\r\n * Remove a specific drag gradient\r\n * @param gradient defines the gradient to remove\r\n * @returns the current particle system\r\n */\r\n removeDragGradient(gradient: number): IParticleSystem;\r\n /**\r\n * Gets the current list of drag gradients.\r\n * You must use addDragGradient and removeDragGradient to update this list\r\n * @returns the list of drag gradients\r\n */\r\n getDragGradients(): Nullable<Array<FactorGradient>>;\r\n /**\r\n * Adds a new emit rate gradient (please note that this will only work if you set the targetStopDuration property)\r\n * @param gradient defines the gradient to use (between 0 and 1)\r\n * @param factor defines the emit rate to affect to the specified gradient\r\n * @param factor2 defines an additional factor used to define a range ([factor, factor2]) with main value to pick the final value from\r\n * @returns the current particle system\r\n */\r\n addEmitRateGradient(gradient: number, factor: number, factor2?: number): IParticleSystem;\r\n /**\r\n * Remove a specific emit rate gradient\r\n * @param gradient defines the gradient to remove\r\n * @returns the current particle system\r\n */\r\n removeEmitRateGradient(gradient: number): IParticleSystem;\r\n /**\r\n * Gets the current list of emit rate gradients.\r\n * You must use addEmitRateGradient and removeEmitRateGradient to update this list\r\n * @returns the list of emit rate gradients\r\n */\r\n getEmitRateGradients(): Nullable<Array<FactorGradient>>;\r\n\r\n /**\r\n * Adds a new start size gradient (please note that this will only work if you set the targetStopDuration property)\r\n * @param gradient defines the gradient to use (between 0 and 1)\r\n * @param factor defines the start size to affect to the specified gradient\r\n * @param factor2 defines an additional factor used to define a range ([factor, factor2]) with main value to pick the final value from\r\n * @returns the current particle system\r\n */\r\n addStartSizeGradient(gradient: number, factor: number, factor2?: number): IParticleSystem;\r\n /**\r\n * Remove a specific start size gradient\r\n * @param gradient defines the gradient to remove\r\n * @returns the current particle system\r\n */\r\n removeStartSizeGradient(gradient: number): IParticleSystem;\r\n /**\r\n * Gets the current list of start size gradients.\r\n * You must use addStartSizeGradient and removeStartSizeGradient to update this list\r\n * @returns the list of start size gradients\r\n */\r\n getStartSizeGradients(): Nullable<Array<FactorGradient>>;\r\n\r\n /**\r\n * Adds a new life time gradient\r\n * @param gradient defines the gradient to use (between 0 and 1)\r\n * @param factor defines the life time factor to affect to the specified gradient\r\n * @param factor2 defines an additional factor used to define a range ([factor, factor2]) with main value to pick the final value from\r\n * @returns the current particle system\r\n */\r\n addLifeTimeGradient(gradient: number, factor: number, factor2?: number): IParticleSystem;\r\n /**\r\n * Remove a specific life time gradient\r\n * @param gradient defines the gradient to remove\r\n * @returns the current particle system\r\n */\r\n removeLifeTimeGradient(gradient: number): IParticleSystem;\r\n /**\r\n * Gets the current list of life time gradients.\r\n * You must use addLifeTimeGradient and removeLifeTimeGradient to update this list\r\n * @returns the list of life time gradients\r\n */\r\n getLifeTimeGradients(): Nullable<Array<FactorGradient>>;\r\n\r\n /**\r\n * Gets the current list of color gradients.\r\n * You must use addColorGradient and removeColorGradient to update this list\r\n * @returns the list of color gradients\r\n */\r\n getColorGradients(): Nullable<Array<ColorGradient>>;\r\n\r\n /**\r\n * Adds a new ramp gradient used to remap particle colors\r\n * @param gradient defines the gradient to use (between 0 and 1)\r\n * @param color defines the color to affect to the specified gradient\r\n * @returns the current particle system\r\n */\r\n addRampGradient(gradient: number, color: Color3): IParticleSystem;\r\n /**\r\n * Gets the current list of ramp gradients.\r\n * You must use addRampGradient and removeRampGradient to update this list\r\n * @returns the list of ramp gradients\r\n */\r\n getRampGradients(): Nullable<Array<Color3Gradient>>;\r\n\r\n /** Gets or sets a boolean indicating that ramp gradients must be used\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/particles/particle_system/ramps_and_blends\r\n */\r\n useRampGradients: boolean;\r\n\r\n /**\r\n * Adds a new color remap gradient\r\n * @param gradient defines the gradient to use (between 0 and 1)\r\n * @param min defines the color remap minimal range\r\n * @param max defines the color remap maximal range\r\n * @returns the current particle system\r\n */\r\n addColorRemapGradient(gradient: number, min: number, max: number): IParticleSystem;\r\n /**\r\n * Gets the current list of color remap gradients.\r\n * You must use addColorRemapGradient and removeColorRemapGradient to update this list\r\n * @returns the list of color remap gradients\r\n */\r\n getColorRemapGradients(): Nullable<Array<FactorGradient>>;\r\n\r\n /**\r\n * Adds a new alpha remap gradient\r\n * @param gradient defines the gradient to use (between 0 and 1)\r\n * @param min defines the alpha remap minimal range\r\n * @param max defines the alpha remap maximal range\r\n * @returns the current particle system\r\n */\r\n addAlphaRemapGradient(gradient: number, min: number, max: number): IParticleSystem;\r\n /**\r\n * Gets the current list of alpha remap gradients.\r\n * You must use addAlphaRemapGradient and removeAlphaRemapGradient to update this list\r\n * @returns the list of alpha remap gradients\r\n */\r\n getAlphaRemapGradients(): Nullable<Array<FactorGradient>>;\r\n\r\n /**\r\n * Creates a Point Emitter for the particle system (emits directly from the emitter position)\r\n * @param direction1 Particles are emitted between the direction1 and direction2 from within the box\r\n * @param direction2 Particles are emitted between the direction1 and direction2 from within the box\r\n * @returns the emitter\r\n */\r\n createPointEmitter(direction1: Vector3, direction2: Vector3): PointParticleEmitter;\r\n\r\n /**\r\n * Creates a Hemisphere Emitter for the particle system (emits along the hemisphere radius)\r\n * @param radius The radius of the hemisphere to emit from\r\n * @param radiusRange The range of the hemisphere to emit from [0-1] 0 Surface Only, 1 Entire Radius\r\n * @returns the emitter\r\n */\r\n createHemisphericEmitter(radius: number, radiusRange: number): HemisphericParticleEmitter;\r\n\r\n /**\r\n * Creates a Sphere Emitter for the particle system (emits along the sphere radius)\r\n * @param radius The radius of the sphere to emit from\r\n * @param radiusRange The range of the sphere to emit from [0-1] 0 Surface Only, 1 Entire Radius\r\n * @returns the emitter\r\n */\r\n createSphereEmitter(radius: number, radiusRange: number): SphereParticleEmitter;\r\n\r\n /**\r\n * Creates a Directed Sphere Emitter for the particle system (emits between direction1 and direction2)\r\n * @param radius The radius of the sphere to emit from\r\n * @param direction1 Particles are emitted between the direction1 and direction2 from within the sphere\r\n * @param direction2 Particles are emitted between the direction1 and direction2 from within the sphere\r\n * @returns the emitter\r\n */\r\n createDirectedSphereEmitter(radius: number, direction1: Vector3, direction2: Vector3): SphereDirectedParticleEmitter;\r\n\r\n /**\r\n * Creates a Cylinder Emitter for the particle system (emits from the cylinder to the particle position)\r\n * @param radius The radius of the emission cylinder\r\n * @param height The height of the emission cylinder\r\n * @param radiusRange The range of emission [0-1] 0 Surface only, 1 Entire Radius\r\n * @param directionRandomizer How much to randomize the particle direction [0-1]\r\n * @returns the emitter\r\n */\r\n createCylinderEmitter(radius: number, height: number, radiusRange: number, directionRandomizer: number): CylinderParticleEmitter;\r\n\r\n /**\r\n * Creates a Directed Cylinder Emitter for the particle system (emits between direction1 and direction2)\r\n * @param radius The radius of the cylinder to emit from\r\n * @param height The height of the emission cylinder\r\n * @param radiusRange the range of the emission cylinder [0-1] 0 Surface only, 1 Entire Radius (1 by default)\r\n * @param direction1 Particles are emitted between the direction1 and direction2 from within the cylinder\r\n * @param direction2 Particles are emitted between the direction1 and direction2 from within the cylinder\r\n * @returns the emitter\r\n */\r\n createDirectedCylinderEmitter(radius: number, height: number, radiusRange: number, direction1: Vector3, direction2: Vector3): CylinderDirectedParticleEmitter;\r\n\r\n /**\r\n * Creates a Cone Emitter for the particle system (emits from the cone to the particle position)\r\n * @param radius The radius of the cone to emit from\r\n * @param angle The base angle of the cone\r\n * @returns the emitter\r\n */\r\n createConeEmitter(radius: number, angle: number): ConeParticleEmitter;\r\n\r\n createDirectedConeEmitter(radius: number, angle: number, direction1: Vector3, direction2: Vector3): ConeDirectedParticleEmitter;\r\n\r\n /**\r\n * Creates a Box Emitter for the particle system. (emits between direction1 and direction2 from withing the box defined by minEmitBox and maxEmitBox)\r\n * @param direction1 Particles are emitted between the direction1 and direction2 from within the box\r\n * @param direction2 Particles are emitted between the direction1 and direction2 from within the box\r\n * @param minEmitBox Particles are emitted from the box between minEmitBox and maxEmitBox\r\n * @param maxEmitBox Particles are emitted from the box between minEmitBox and maxEmitBox\r\n * @returns the emitter\r\n */\r\n createBoxEmitter(direction1: Vector3, direction2: Vector3, minEmitBox: Vector3, maxEmitBox: Vector3): BoxParticleEmitter;\r\n\r\n /**\r\n * Get hosting scene\r\n * @returns the scene\r\n */\r\n getScene(): Nullable<Scene>;\r\n}\r\n"]}
1
+ {"version":3,"file":"IParticleSystem.js","sourceRoot":"","sources":["../../../../dev/core/src/Particles/IParticleSystem.ts"],"names":[],"mappings":"","sourcesContent":["import type { Immutable, Nullable } from \"../types\";\r\nimport type { Vector2, Vector3, Matrix } from \"../Maths/math.vector\";\r\nimport type { Color3, Color4 } from \"../Maths/math.color\";\r\nimport type { BaseTexture } from \"../Materials/Textures/baseTexture\";\r\nimport type {\r\n BoxParticleEmitter,\r\n IParticleEmitterType,\r\n PointParticleEmitter,\r\n HemisphericParticleEmitter,\r\n SphereParticleEmitter,\r\n SphereDirectedParticleEmitter,\r\n CylinderParticleEmitter,\r\n CylinderDirectedParticleEmitter,\r\n ConeParticleEmitter,\r\n ConeDirectedParticleEmitter,\r\n // eslint-disable-next-line import/no-internal-modules\r\n} from \"../Particles/EmitterTypes/index\";\r\nimport type { Scene } from \"../scene\";\r\nimport type { ColorGradient, FactorGradient, Color3Gradient } from \"../Misc/gradients\";\r\nimport type { Effect } from \"../Materials/effect\";\r\nimport type { Observable } from \"../Misc/observable\";\r\nimport type { VertexBuffer } from \"../Buffers/buffer\";\r\nimport type { DataBuffer } from \"../Buffers/dataBuffer\";\r\n\r\nimport type { Animation } from \"../Animations/animation\";\r\nimport type { AbstractMesh } from \"../Meshes/abstractMesh\";\r\n\r\n/**\r\n * Interface representing a particle system in Babylon.js.\r\n * This groups the common functionalities that needs to be implemented in order to create a particle system.\r\n * A particle system represents a way to manage particles from their emission to their animation and rendering.\r\n */\r\nexport interface IParticleSystem {\r\n /**\r\n * List of animations used by the particle system.\r\n */\r\n animations: Animation[];\r\n /**\r\n * The id of the Particle system.\r\n */\r\n id: string;\r\n /**\r\n * The name of the Particle system.\r\n */\r\n name: string;\r\n /**\r\n * The emitter represents the Mesh or position we are attaching the particle system to.\r\n */\r\n emitter: Nullable<AbstractMesh | Vector3>;\r\n /**\r\n * Gets or sets a boolean indicating if the particles must be rendered as billboard or aligned with the direction\r\n */\r\n isBillboardBased: boolean;\r\n /**\r\n * The rendering group used by the Particle system to chose when to render.\r\n */\r\n renderingGroupId: number;\r\n /**\r\n * The layer mask we are rendering the particles through.\r\n */\r\n layerMask: number;\r\n\r\n /**\r\n * The overall motion speed (0.01 is default update speed, faster updates = faster animation)\r\n */\r\n updateSpeed: number;\r\n\r\n /**\r\n * The amount of time the particle system is running (depends of the overall update speed).\r\n */\r\n targetStopDuration: number;\r\n\r\n /**\r\n * The texture used to render each particle. (this can be a spritesheet)\r\n */\r\n particleTexture: Nullable<BaseTexture>;\r\n\r\n /**\r\n * Blend mode use to render the particle. It can be any of the ParticleSystem.BLENDMODE_* constants\r\n */\r\n blendMode: number;\r\n\r\n /**\r\n * Minimum life time of emitting particles.\r\n */\r\n minLifeTime: number;\r\n /**\r\n * Maximum life time of emitting particles.\r\n */\r\n maxLifeTime: number;\r\n\r\n /**\r\n * Minimum Size of emitting particles.\r\n */\r\n minSize: number;\r\n /**\r\n * Maximum Size of emitting particles.\r\n */\r\n maxSize: number;\r\n\r\n /**\r\n * Minimum scale of emitting particles on X axis.\r\n */\r\n minScaleX: number;\r\n /**\r\n * Maximum scale of emitting particles on X axis.\r\n */\r\n maxScaleX: number;\r\n\r\n /**\r\n * Minimum scale of emitting particles on Y axis.\r\n */\r\n minScaleY: number;\r\n /**\r\n * Maximum scale of emitting particles on Y axis.\r\n */\r\n maxScaleY: number;\r\n\r\n /**\r\n * Random color of each particle after it has been emitted, between color1 and color2 vectors.\r\n */\r\n color1: Color4;\r\n /**\r\n * Random color of each particle after it has been emitted, between color1 and color2 vectors.\r\n */\r\n color2: Color4;\r\n\r\n /**\r\n * Color the particle will have at the end of its lifetime.\r\n */\r\n colorDead: Color4;\r\n\r\n /**\r\n * The maximum number of particles to emit per frame until we reach the activeParticleCount value\r\n */\r\n emitRate: number;\r\n\r\n /**\r\n * You can use gravity if you want to give an orientation to your particles.\r\n */\r\n gravity: Vector3;\r\n\r\n /**\r\n * Minimum power of emitting particles.\r\n */\r\n minEmitPower: number;\r\n /**\r\n * Maximum power of emitting particles.\r\n */\r\n maxEmitPower: number;\r\n /**\r\n * Minimum angular speed of emitting particles (Z-axis rotation for each particle).\r\n */\r\n minAngularSpeed: number;\r\n /**\r\n * Maximum angular speed of emitting particles (Z-axis rotation for each particle).\r\n */\r\n maxAngularSpeed: number;\r\n /**\r\n * Gets or sets the minimal initial rotation in radians.\r\n */\r\n minInitialRotation: number;\r\n /**\r\n * Gets or sets the maximal initial rotation in radians.\r\n */\r\n maxInitialRotation: number;\r\n /**\r\n * The particle emitter type defines the emitter used by the particle system.\r\n * It can be for example box, sphere, or cone...\r\n */\r\n particleEmitterType: Nullable<IParticleEmitterType>;\r\n /**\r\n * Defines the delay in milliseconds before starting the system (0 by default)\r\n */\r\n startDelay: number;\r\n /**\r\n * Gets or sets a value indicating how many cycles (or frames) must be executed before first rendering (this value has to be set before starting the system). Default is 0\r\n */\r\n preWarmCycles: number;\r\n /**\r\n * Gets or sets a value indicating the time step multiplier to use in pre-warm mode (default is 1)\r\n */\r\n preWarmStepOffset: number;\r\n\r\n /**\r\n * If using a spritesheet (isAnimationSheetEnabled) defines the speed of the sprite loop (default is 1 meaning the animation will play once during the entire particle lifetime)\r\n */\r\n spriteCellChangeSpeed: number;\r\n /**\r\n * If using a spritesheet (isAnimationSheetEnabled) defines the first sprite cell to display\r\n */\r\n startSpriteCellID: number;\r\n /**\r\n * If using a spritesheet (isAnimationSheetEnabled) defines the last sprite cell to display\r\n */\r\n endSpriteCellID: number;\r\n /**\r\n * If using a spritesheet (isAnimationSheetEnabled), defines whether the sprite animation is looping\r\n */\r\n spriteCellLoop: boolean;\r\n /**\r\n * If using a spritesheet (isAnimationSheetEnabled), defines the sprite cell width to use\r\n */\r\n spriteCellWidth: number;\r\n /**\r\n * If using a spritesheet (isAnimationSheetEnabled), defines the sprite cell height to use\r\n */\r\n spriteCellHeight: number;\r\n /**\r\n * This allows the system to random pick the start cell ID between startSpriteCellID and endSpriteCellID\r\n */\r\n spriteRandomStartCell: boolean;\r\n\r\n /**\r\n * Gets or sets a boolean indicating if a spritesheet is used to animate the particles texture\r\n */\r\n isAnimationSheetEnabled: boolean;\r\n\r\n /** Gets or sets a Vector2 used to move the pivot (by default (0,0)) */\r\n translationPivot: Vector2;\r\n\r\n /**\r\n * Gets or sets a texture used to add random noise to particle positions\r\n */\r\n noiseTexture: Nullable<BaseTexture>;\r\n\r\n /** Gets or sets the strength to apply to the noise value (default is (10, 10, 10)) */\r\n noiseStrength: Vector3;\r\n\r\n /**\r\n * Gets or sets the billboard mode to use when isBillboardBased = true.\r\n * Value can be: ParticleSystem.BILLBOARDMODE_ALL, ParticleSystem.BILLBOARDMODE_Y, ParticleSystem.BILLBOARDMODE_STRETCHED\r\n */\r\n billboardMode: number;\r\n\r\n /**\r\n * Gets or sets a boolean enabling the use of logarithmic depth buffers, which is good for wide depth buffers.\r\n */\r\n useLogarithmicDepth: boolean;\r\n\r\n /** Gets or sets a value indicating the damping to apply if the limit velocity factor is reached */\r\n limitVelocityDamping: number;\r\n\r\n /**\r\n * Gets or sets a boolean indicating that hosted animations (in the system.animations array) must be started when system.start() is called\r\n */\r\n beginAnimationOnStart: boolean;\r\n\r\n /**\r\n * Gets or sets the frame to start the animation from when beginAnimationOnStart is true\r\n */\r\n beginAnimationFrom: number;\r\n\r\n /**\r\n * Gets or sets the frame to end the animation on when beginAnimationOnStart is true\r\n */\r\n beginAnimationTo: number;\r\n\r\n /**\r\n * Gets or sets a boolean indicating if animations must loop when beginAnimationOnStart is true\r\n */\r\n beginAnimationLoop: boolean;\r\n\r\n /**\r\n * Specifies whether the particle system will be disposed once it reaches the end of the animation.\r\n */\r\n disposeOnStop: boolean;\r\n\r\n /**\r\n * If you want to launch only a few particles at once, that can be done, as well.\r\n */\r\n manualEmitCount: number;\r\n\r\n /**\r\n * Specifies if the particles are updated in emitter local space or world space\r\n */\r\n isLocal: boolean;\r\n\r\n /** Snippet ID if the particle system was created from the snippet server */\r\n snippetId: string;\r\n\r\n /** Gets or sets a matrix to use to compute projection */\r\n defaultProjectionMatrix: Matrix;\r\n\r\n /** Indicates that the update of particles is done in the animate function (and not in render) */\r\n updateInAnimate: boolean;\r\n\r\n /** @internal */\r\n _wasDispatched: boolean;\r\n\r\n /**\r\n * Gets the maximum number of particles active at the same time.\r\n * @returns The max number of active particles.\r\n */\r\n getCapacity(): number;\r\n\r\n /**\r\n * Gets the number of particles active at the same time.\r\n * @returns The number of active particles.\r\n */\r\n getActiveCount(): number;\r\n\r\n /**\r\n * Gets if the system has been started. (Note: this will still be true after stop is called)\r\n * @returns True if it has been started, otherwise false.\r\n */\r\n isStarted(): boolean;\r\n\r\n /**\r\n * Animates the particle system for this frame.\r\n */\r\n animate(): void;\r\n /**\r\n * Renders the particle system in its current state.\r\n * @returns the current number of particles\r\n */\r\n render(): number;\r\n /**\r\n * Dispose the particle system and frees its associated resources.\r\n * @param disposeTexture defines if the particle texture must be disposed as well (true by default)\r\n * @param disposeAttachedSubEmitters defines if the attached sub-emitters must be disposed as well (false by default)\r\n * @param disposeEndSubEmitters defines if the end type sub-emitters must be disposed as well (false by default)\r\n */\r\n dispose(disposeTexture?: boolean, disposeAttachedSubEmitters?: boolean, disposeEndSubEmitters?: boolean): void;\r\n /**\r\n * An event triggered when the system is disposed\r\n */\r\n onDisposeObservable: Observable<IParticleSystem>;\r\n /**\r\n * An event triggered when the system is stopped\r\n */\r\n onStoppedObservable: Observable<IParticleSystem>;\r\n /**\r\n * Clones the particle system.\r\n * @param name The name of the cloned object\r\n * @param newEmitter The new emitter to use\r\n * @returns the cloned particle system\r\n */\r\n clone(name: string, newEmitter: any): Nullable<IParticleSystem>;\r\n /**\r\n * Serializes the particle system to a JSON object\r\n * @param serializeTexture defines if the texture must be serialized as well\r\n * @returns the JSON object\r\n */\r\n serialize(serializeTexture: boolean): any;\r\n /**\r\n * Rebuild the particle system\r\n */\r\n rebuild(): void;\r\n\r\n /** Force the system to rebuild all gradients that need to be resync */\r\n forceRefreshGradients(): void;\r\n\r\n /**\r\n * Starts the particle system and begins to emit\r\n * @param delay defines the delay in milliseconds before starting the system (0 by default)\r\n */\r\n start(delay?: number): void;\r\n\r\n /**\r\n * Stops the particle system.\r\n */\r\n stop(): void;\r\n\r\n /**\r\n * Remove all active particles\r\n */\r\n reset(): void;\r\n\r\n /**\r\n * Gets a boolean indicating that the system is stopping\r\n * @returns true if the system is currently stopping\r\n */\r\n isStopping(): boolean;\r\n\r\n /**\r\n * Is this system ready to be used/rendered\r\n * @returns true if the system is ready\r\n */\r\n isReady(): boolean;\r\n /**\r\n * Returns the string \"ParticleSystem\"\r\n * @returns a string containing the class name\r\n */\r\n getClassName(): string;\r\n /**\r\n * Gets the custom effect used to render the particles\r\n * @param blendMode Blend mode for which the effect should be retrieved\r\n * @returns The effect\r\n */\r\n getCustomEffect(blendMode: number): Nullable<Effect>;\r\n /**\r\n * Sets the custom effect used to render the particles\r\n * @param effect The effect to set\r\n * @param blendMode Blend mode for which the effect should be set\r\n */\r\n setCustomEffect(effect: Nullable<Effect>, blendMode: number): void;\r\n\r\n /**\r\n * Fill the defines array according to the current settings of the particle system\r\n * @param defines Array to be updated\r\n * @param blendMode blend mode to take into account when updating the array\r\n * @param fillImageProcessing fills the image processing defines\r\n */\r\n fillDefines(defines: Array<string>, blendMode: number, fillImageProcessing?: boolean): void;\r\n /**\r\n * Fill the uniforms, attributes and samplers arrays according to the current settings of the particle system\r\n * @param uniforms Uniforms array to fill\r\n * @param attributes Attributes array to fill\r\n * @param samplers Samplers array to fill\r\n */\r\n fillUniformsAttributesAndSamplerNames(uniforms: Array<string>, attributes: Array<string>, samplers: Array<string>): void;\r\n /**\r\n * Observable that will be called just before the particles are drawn\r\n */\r\n onBeforeDrawParticlesObservable: Observable<Nullable<Effect>>;\r\n /**\r\n * Gets the name of the particle vertex shader\r\n */\r\n vertexShaderName: string;\r\n\r\n /**\r\n * Gets the vertex buffers used by the particle system\r\n */\r\n vertexBuffers: Immutable<{ [key: string]: VertexBuffer }>;\r\n /**\r\n * Gets the index buffer used by the particle system (or null if no index buffer is used)\r\n */\r\n indexBuffer: Nullable<DataBuffer>;\r\n\r\n /**\r\n * Adds a new color gradient\r\n * @param gradient defines the gradient to use (between 0 and 1)\r\n * @param color1 defines the color to affect to the specified gradient\r\n * @param color2 defines an additional color used to define a range ([color, color2]) with main color to pick the final color from\r\n * @returns the current particle system\r\n */\r\n addColorGradient(gradient: number, color1: Color4, color2?: Color4): IParticleSystem;\r\n /**\r\n * Remove a specific color gradient\r\n * @param gradient defines the gradient to remove\r\n * @returns the current particle system\r\n */\r\n removeColorGradient(gradient: number): IParticleSystem;\r\n /**\r\n * Adds a new size gradient\r\n * @param gradient defines the gradient to use (between 0 and 1)\r\n * @param factor defines the size factor to affect to the specified gradient\r\n * @param factor2 defines an additional factor used to define a range ([factor, factor2]) with main value to pick the final value from\r\n * @returns the current particle system\r\n */\r\n addSizeGradient(gradient: number, factor: number, factor2?: number): IParticleSystem;\r\n /**\r\n * Remove a specific size gradient\r\n * @param gradient defines the gradient to remove\r\n * @returns the current particle system\r\n */\r\n removeSizeGradient(gradient: number): IParticleSystem;\r\n /**\r\n * Gets the current list of color gradients.\r\n * You must use addColorGradient and removeColorGradient to update this list\r\n * @returns the list of color gradients\r\n */\r\n getColorGradients(): Nullable<Array<ColorGradient>>;\r\n /**\r\n * Gets the current list of size gradients.\r\n * You must use addSizeGradient and removeSizeGradient to update this list\r\n * @returns the list of size gradients\r\n */\r\n getSizeGradients(): Nullable<Array<FactorGradient>>;\r\n /**\r\n * Gets the current list of angular speed gradients.\r\n * You must use addAngularSpeedGradient and removeAngularSpeedGradient to update this list\r\n * @returns the list of angular speed gradients\r\n */\r\n getAngularSpeedGradients(): Nullable<Array<FactorGradient>>;\r\n /**\r\n * Adds a new angular speed gradient\r\n * @param gradient defines the gradient to use (between 0 and 1)\r\n * @param factor defines the angular speed to affect to the specified gradient\r\n * @param factor2 defines an additional factor used to define a range ([factor, factor2]) with main value to pick the final value from\r\n * @returns the current particle system\r\n */\r\n addAngularSpeedGradient(gradient: number, factor: number, factor2?: number): IParticleSystem;\r\n /**\r\n * Remove a specific angular speed gradient\r\n * @param gradient defines the gradient to remove\r\n * @returns the current particle system\r\n */\r\n removeAngularSpeedGradient(gradient: number): IParticleSystem;\r\n /**\r\n * Gets the current list of velocity gradients.\r\n * You must use addVelocityGradient and removeVelocityGradient to update this list\r\n * @returns the list of velocity gradients\r\n */\r\n getVelocityGradients(): Nullable<Array<FactorGradient>>;\r\n /**\r\n * Adds a new velocity gradient\r\n * @param gradient defines the gradient to use (between 0 and 1)\r\n * @param factor defines the velocity to affect to the specified gradient\r\n * @param factor2 defines an additional factor used to define a range ([factor, factor2]) with main value to pick the final value from\r\n * @returns the current particle system\r\n */\r\n addVelocityGradient(gradient: number, factor: number, factor2?: number): IParticleSystem;\r\n /**\r\n * Remove a specific velocity gradient\r\n * @param gradient defines the gradient to remove\r\n * @returns the current particle system\r\n */\r\n removeVelocityGradient(gradient: number): IParticleSystem;\r\n /**\r\n * Gets the current list of limit velocity gradients.\r\n * You must use addLimitVelocityGradient and removeLimitVelocityGradient to update this list\r\n * @returns the list of limit velocity gradients\r\n */\r\n getLimitVelocityGradients(): Nullable<Array<FactorGradient>>;\r\n /**\r\n * Adds a new limit velocity gradient\r\n * @param gradient defines the gradient to use (between 0 and 1)\r\n * @param factor defines the limit velocity to affect to the specified gradient\r\n * @param factor2 defines an additional factor used to define a range ([factor, factor2]) with main value to pick the final value from\r\n * @returns the current particle system\r\n */\r\n addLimitVelocityGradient(gradient: number, factor: number, factor2?: number): IParticleSystem;\r\n /**\r\n * Remove a specific limit velocity gradient\r\n * @param gradient defines the gradient to remove\r\n * @returns the current particle system\r\n */\r\n removeLimitVelocityGradient(gradient: number): IParticleSystem;\r\n /**\r\n * Adds a new drag gradient\r\n * @param gradient defines the gradient to use (between 0 and 1)\r\n * @param factor defines the drag to affect to the specified gradient\r\n * @param factor2 defines an additional factor used to define a range ([factor, factor2]) with main value to pick the final value from\r\n * @returns the current particle system\r\n */\r\n addDragGradient(gradient: number, factor: number, factor2?: number): IParticleSystem;\r\n /**\r\n * Remove a specific drag gradient\r\n * @param gradient defines the gradient to remove\r\n * @returns the current particle system\r\n */\r\n removeDragGradient(gradient: number): IParticleSystem;\r\n /**\r\n * Gets the current list of drag gradients.\r\n * You must use addDragGradient and removeDragGradient to update this list\r\n * @returns the list of drag gradients\r\n */\r\n getDragGradients(): Nullable<Array<FactorGradient>>;\r\n /**\r\n * Adds a new emit rate gradient (please note that this will only work if you set the targetStopDuration property)\r\n * @param gradient defines the gradient to use (between 0 and 1)\r\n * @param factor defines the emit rate to affect to the specified gradient\r\n * @param factor2 defines an additional factor used to define a range ([factor, factor2]) with main value to pick the final value from\r\n * @returns the current particle system\r\n */\r\n addEmitRateGradient(gradient: number, factor: number, factor2?: number): IParticleSystem;\r\n /**\r\n * Remove a specific emit rate gradient\r\n * @param gradient defines the gradient to remove\r\n * @returns the current particle system\r\n */\r\n removeEmitRateGradient(gradient: number): IParticleSystem;\r\n /**\r\n * Gets the current list of emit rate gradients.\r\n * You must use addEmitRateGradient and removeEmitRateGradient to update this list\r\n * @returns the list of emit rate gradients\r\n */\r\n getEmitRateGradients(): Nullable<Array<FactorGradient>>;\r\n\r\n /**\r\n * Adds a new start size gradient (please note that this will only work if you set the targetStopDuration property)\r\n * @param gradient defines the gradient to use (between 0 and 1)\r\n * @param factor defines the start size to affect to the specified gradient\r\n * @param factor2 defines an additional factor used to define a range ([factor, factor2]) with main value to pick the final value from\r\n * @returns the current particle system\r\n */\r\n addStartSizeGradient(gradient: number, factor: number, factor2?: number): IParticleSystem;\r\n /**\r\n * Remove a specific start size gradient\r\n * @param gradient defines the gradient to remove\r\n * @returns the current particle system\r\n */\r\n removeStartSizeGradient(gradient: number): IParticleSystem;\r\n /**\r\n * Gets the current list of start size gradients.\r\n * You must use addStartSizeGradient and removeStartSizeGradient to update this list\r\n * @returns the list of start size gradients\r\n */\r\n getStartSizeGradients(): Nullable<Array<FactorGradient>>;\r\n\r\n /**\r\n * Adds a new life time gradient\r\n * @param gradient defines the gradient to use (between 0 and 1)\r\n * @param factor defines the life time factor to affect to the specified gradient\r\n * @param factor2 defines an additional factor used to define a range ([factor, factor2]) with main value to pick the final value from\r\n * @returns the current particle system\r\n */\r\n addLifeTimeGradient(gradient: number, factor: number, factor2?: number): IParticleSystem;\r\n /**\r\n * Remove a specific life time gradient\r\n * @param gradient defines the gradient to remove\r\n * @returns the current particle system\r\n */\r\n removeLifeTimeGradient(gradient: number): IParticleSystem;\r\n /**\r\n * Gets the current list of life time gradients.\r\n * You must use addLifeTimeGradient and removeLifeTimeGradient to update this list\r\n * @returns the list of life time gradients\r\n */\r\n getLifeTimeGradients(): Nullable<Array<FactorGradient>>;\r\n\r\n /**\r\n * Gets the current list of color gradients.\r\n * You must use addColorGradient and removeColorGradient to update this list\r\n * @returns the list of color gradients\r\n */\r\n getColorGradients(): Nullable<Array<ColorGradient>>;\r\n\r\n /**\r\n * Adds a new ramp gradient used to remap particle colors\r\n * @param gradient defines the gradient to use (between 0 and 1)\r\n * @param color defines the color to affect to the specified gradient\r\n * @returns the current particle system\r\n */\r\n addRampGradient(gradient: number, color: Color3): IParticleSystem;\r\n /**\r\n * Gets the current list of ramp gradients.\r\n * You must use addRampGradient and removeRampGradient to update this list\r\n * @returns the list of ramp gradients\r\n */\r\n getRampGradients(): Nullable<Array<Color3Gradient>>;\r\n\r\n /** Gets or sets a boolean indicating that ramp gradients must be used\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/particles/particle_system/ramps_and_blends\r\n */\r\n useRampGradients: boolean;\r\n\r\n /**\r\n * Adds a new color remap gradient\r\n * @param gradient defines the gradient to use (between 0 and 1)\r\n * @param min defines the color remap minimal range\r\n * @param max defines the color remap maximal range\r\n * @returns the current particle system\r\n */\r\n addColorRemapGradient(gradient: number, min: number, max: number): IParticleSystem;\r\n /**\r\n * Gets the current list of color remap gradients.\r\n * You must use addColorRemapGradient and removeColorRemapGradient to update this list\r\n * @returns the list of color remap gradients\r\n */\r\n getColorRemapGradients(): Nullable<Array<FactorGradient>>;\r\n\r\n /**\r\n * Adds a new alpha remap gradient\r\n * @param gradient defines the gradient to use (between 0 and 1)\r\n * @param min defines the alpha remap minimal range\r\n * @param max defines the alpha remap maximal range\r\n * @returns the current particle system\r\n */\r\n addAlphaRemapGradient(gradient: number, min: number, max: number): IParticleSystem;\r\n /**\r\n * Gets the current list of alpha remap gradients.\r\n * You must use addAlphaRemapGradient and removeAlphaRemapGradient to update this list\r\n * @returns the list of alpha remap gradients\r\n */\r\n getAlphaRemapGradients(): Nullable<Array<FactorGradient>>;\r\n\r\n /**\r\n * Creates a Point Emitter for the particle system (emits directly from the emitter position)\r\n * @param direction1 Particles are emitted between the direction1 and direction2 from within the box\r\n * @param direction2 Particles are emitted between the direction1 and direction2 from within the box\r\n * @returns the emitter\r\n */\r\n createPointEmitter(direction1: Vector3, direction2: Vector3): PointParticleEmitter;\r\n\r\n /**\r\n * Creates a Hemisphere Emitter for the particle system (emits along the hemisphere radius)\r\n * @param radius The radius of the hemisphere to emit from\r\n * @param radiusRange The range of the hemisphere to emit from [0-1] 0 Surface Only, 1 Entire Radius\r\n * @returns the emitter\r\n */\r\n createHemisphericEmitter(radius: number, radiusRange: number): HemisphericParticleEmitter;\r\n\r\n /**\r\n * Creates a Sphere Emitter for the particle system (emits along the sphere radius)\r\n * @param radius The radius of the sphere to emit from\r\n * @param radiusRange The range of the sphere to emit from [0-1] 0 Surface Only, 1 Entire Radius\r\n * @returns the emitter\r\n */\r\n createSphereEmitter(radius: number, radiusRange: number): SphereParticleEmitter;\r\n\r\n /**\r\n * Creates a Directed Sphere Emitter for the particle system (emits between direction1 and direction2)\r\n * @param radius The radius of the sphere to emit from\r\n * @param direction1 Particles are emitted between the direction1 and direction2 from within the sphere\r\n * @param direction2 Particles are emitted between the direction1 and direction2 from within the sphere\r\n * @returns the emitter\r\n */\r\n createDirectedSphereEmitter(radius: number, direction1: Vector3, direction2: Vector3): SphereDirectedParticleEmitter;\r\n\r\n /**\r\n * Creates a Cylinder Emitter for the particle system (emits from the cylinder to the particle position)\r\n * @param radius The radius of the emission cylinder\r\n * @param height The height of the emission cylinder\r\n * @param radiusRange The range of emission [0-1] 0 Surface only, 1 Entire Radius\r\n * @param directionRandomizer How much to randomize the particle direction [0-1]\r\n * @returns the emitter\r\n */\r\n createCylinderEmitter(radius: number, height: number, radiusRange: number, directionRandomizer: number): CylinderParticleEmitter;\r\n\r\n /**\r\n * Creates a Directed Cylinder Emitter for the particle system (emits between direction1 and direction2)\r\n * @param radius The radius of the cylinder to emit from\r\n * @param height The height of the emission cylinder\r\n * @param radiusRange the range of the emission cylinder [0-1] 0 Surface only, 1 Entire Radius (1 by default)\r\n * @param direction1 Particles are emitted between the direction1 and direction2 from within the cylinder\r\n * @param direction2 Particles are emitted between the direction1 and direction2 from within the cylinder\r\n * @returns the emitter\r\n */\r\n createDirectedCylinderEmitter(radius: number, height: number, radiusRange: number, direction1: Vector3, direction2: Vector3): CylinderDirectedParticleEmitter;\r\n\r\n /**\r\n * Creates a Cone Emitter for the particle system (emits from the cone to the particle position)\r\n * @param radius The radius of the cone to emit from\r\n * @param angle The base angle of the cone\r\n * @returns the emitter\r\n */\r\n createConeEmitter(radius: number, angle: number): ConeParticleEmitter;\r\n\r\n createDirectedConeEmitter(radius: number, angle: number, direction1: Vector3, direction2: Vector3): ConeDirectedParticleEmitter;\r\n\r\n /**\r\n * Creates a Box Emitter for the particle system. (emits between direction1 and direction2 from withing the box defined by minEmitBox and maxEmitBox)\r\n * @param direction1 Particles are emitted between the direction1 and direction2 from within the box\r\n * @param direction2 Particles are emitted between the direction1 and direction2 from within the box\r\n * @param minEmitBox Particles are emitted from the box between minEmitBox and maxEmitBox\r\n * @param maxEmitBox Particles are emitted from the box between minEmitBox and maxEmitBox\r\n * @returns the emitter\r\n */\r\n createBoxEmitter(direction1: Vector3, direction2: Vector3, minEmitBox: Vector3, maxEmitBox: Vector3): BoxParticleEmitter;\r\n\r\n /**\r\n * Get hosting scene\r\n * @returns the scene\r\n */\r\n getScene(): Nullable<Scene>;\r\n}\r\n"]}
@@ -29,11 +29,11 @@ import type { ConeDirectedParticleEmitter, ConeParticleEmitter } from "./Emitter
29
29
  */
30
30
  export declare class BaseParticleSystem implements IClipPlanesHolder {
31
31
  /**
32
- * Source color is added to the destination color without alpha affecting the result
32
+ * Source color is added to the destination color without alpha affecting the result. Great for additive glow effects (fire, magic, lasers)
33
33
  */
34
34
  static BLENDMODE_ONEONE: number;
35
35
  /**
36
- * Blend current color and particle color using particle’s alpha
36
+ * Blend current color and particle color using particle’s alpha. Same as Constants.ALPHA_COMBINE, the go-to for transparency. 100% alpha means source, 0% alpha means background. Glass, UI fade, smoke
37
37
  */
38
38
  static BLENDMODE_STANDARD: number;
39
39
  /**
@@ -48,6 +48,11 @@ export declare class BaseParticleSystem implements IClipPlanesHolder {
48
48
  * Multiply current color with particle color then add current color and particle color multiplied by particle’s alpha
49
49
  */
50
50
  static BLENDMODE_MULTIPLYADD: number;
51
+ /**
52
+ * Subtracts source (particle) from destination (current color), leading to darker results
53
+ * - NOTE: Init as -1 so we can properly map all modes to Engine Const's (otherwise ALPHA_SUBTRACT will conflict with BLENDMODE_MULTIPLY since both use 3)
54
+ */
55
+ static BLENDMODE_SUBTRACT: number;
51
56
  /**
52
57
  * List of animations used by the particle system.
53
58
  */
@@ -190,7 +195,9 @@ export declare class BaseParticleSystem implements IClipPlanesHolder {
190
195
  */
191
196
  onAnimationEnd: Nullable<() => void>;
192
197
  /**
193
- * Blend mode use to render the particle, it can be either ParticleSystem.BLENDMODE_ONEONE or ParticleSystem.BLENDMODE_STANDARD.
198
+ * Blend mode use to render the particle
199
+ * For original blend modes which are exposed from ParticleSystem (OneOne, Standard, Add, Multiply, MultiplyAdd, and Subtract), use ParticleSystem.BLENDMODE_FOO
200
+ * For all other blend modes, use Engine Constants.ALPHA_FOO blend modes
194
201
  */
195
202
  blendMode: number;
196
203
  /**
@@ -311,6 +318,7 @@ export declare class BaseParticleSystem implements IClipPlanesHolder {
311
318
  protected _colorRemapGradients: Nullable<Array<FactorGradient>>;
312
319
  protected _alphaRemapGradients: Nullable<Array<FactorGradient>>;
313
320
  protected _hasTargetStopDurationDependantGradient(): boolean | null;
321
+ protected _setEngineBasedOnBlendMode(blendMode: number): void;
314
322
  /**
315
323
  * Defines the delay in milliseconds before starting the system (0 by default)
316
324
  */
@@ -58,6 +58,33 @@ export class BaseParticleSystem {
58
58
  (this._emitRateGradients && this._emitRateGradients.length > 0) ||
59
59
  (this._lifeTimeGradients && this._lifeTimeGradients.length > 0));
60
60
  }
61
+ _setEngineBasedOnBlendMode(blendMode) {
62
+ switch (blendMode) {
63
+ case BaseParticleSystem.BLENDMODE_MULTIPLYADD:
64
+ // Don't want to update engine since there is no equivalent engine alpha mode, instead it gets handled within particleSystem
65
+ return;
66
+ case BaseParticleSystem.BLENDMODE_ADD:
67
+ blendMode = 1;
68
+ break;
69
+ case BaseParticleSystem.BLENDMODE_ONEONE:
70
+ blendMode = 6;
71
+ break;
72
+ case BaseParticleSystem.BLENDMODE_STANDARD:
73
+ blendMode = 2;
74
+ break;
75
+ case BaseParticleSystem.BLENDMODE_MULTIPLY:
76
+ blendMode = 4;
77
+ break;
78
+ case BaseParticleSystem.BLENDMODE_SUBTRACT:
79
+ blendMode = 3;
80
+ break;
81
+ default:
82
+ // For all other blend modes that were added after the initial particleSystem implementation,
83
+ // the ParticleSystem.BLENDMODE_FOO are already mapped to the underlying undefined
84
+ break;
85
+ }
86
+ this._engine.setAlphaMode(blendMode);
87
+ }
61
88
  /**
62
89
  * Gets the current list of drag gradients.
63
90
  * You must use addDragGradient and removeDragGradient to update this list
@@ -407,7 +434,9 @@ export class BaseParticleSystem {
407
434
  */
408
435
  this.onAnimationEnd = null;
409
436
  /**
410
- * Blend mode use to render the particle, it can be either ParticleSystem.BLENDMODE_ONEONE or ParticleSystem.BLENDMODE_STANDARD.
437
+ * Blend mode use to render the particle
438
+ * For original blend modes which are exposed from ParticleSystem (OneOne, Standard, Add, Multiply, MultiplyAdd, and Subtract), use ParticleSystem.BLENDMODE_FOO
439
+ * For all other blend modes, use Engine undefined blend modes
411
440
  */
412
441
  this.blendMode = BaseParticleSystem.BLENDMODE_ONEONE;
413
442
  /**
@@ -598,11 +627,11 @@ export class BaseParticleSystem {
598
627
  }
599
628
  }
600
629
  /**
601
- * Source color is added to the destination color without alpha affecting the result
630
+ * Source color is added to the destination color without alpha affecting the result. Great for additive glow effects (fire, magic, lasers)
602
631
  */
603
632
  BaseParticleSystem.BLENDMODE_ONEONE = 0;
604
633
  /**
605
- * Blend current color and particle color using particle’s alpha
634
+ * Blend current color and particle color using particle’s alpha. Same as 2, the go-to for transparency. 100% alpha means source, 0% alpha means background. Glass, UI fade, smoke
606
635
  */
607
636
  BaseParticleSystem.BLENDMODE_STANDARD = 1;
608
637
  /**
@@ -617,6 +646,11 @@ BaseParticleSystem.BLENDMODE_MULTIPLY = 3;
617
646
  * Multiply current color with particle color then add current color and particle color multiplied by particle’s alpha
618
647
  */
619
648
  BaseParticleSystem.BLENDMODE_MULTIPLYADD = 4;
649
+ /**
650
+ * Subtracts source (particle) from destination (current color), leading to darker results
651
+ * - NOTE: Init as -1 so we can properly map all modes to Engine Const's (otherwise ALPHA_SUBTRACT will conflict with BLENDMODE_MULTIPLY since both use 3)
652
+ */
653
+ BaseParticleSystem.BLENDMODE_SUBTRACT = -1;
620
654
  // Register Class Name
621
655
  RegisterClass("BABYLON.BaseParticleSystem", BaseParticleSystem);
622
656
  //# sourceMappingURL=baseParticleSystem.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"baseParticleSystem.js","sourceRoot":"","sources":["../../../../dev/core/src/Particles/baseParticleSystem.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAGxD,OAAO,EAAE,mCAAmC,EAAE,MAAM,mDAAmD,CAAC;AAGxG,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEjD,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAG7C,OAAO,4CAA4C,CAAC;AAapD,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAElD;;;;;GAKG;AACH,MAAM,OAAO,kBAAkB;IAmL3B;;OAEG;IACH,IAAW,YAAY;QACnB,OAAO,IAAI,CAAC,aAAa,CAAC;IAC9B,CAAC;IAED,IAAW,YAAY,CAAC,KAAkC;QACtD,IAAI,IAAI,CAAC,aAAa,KAAK,KAAK,EAAE,CAAC;YAC/B,OAAO;QACX,CAAC;QAED,IAAI,CAAC,aAAa,GAAG,KAAK,CAAC;QAC3B,IAAI,CAAC,MAAM,EAAE,CAAC;IAClB,CAAC;IAqHD;;OAEG;IACH,IAAW,uBAAuB;QAC9B,OAAO,IAAI,CAAC,wBAAwB,CAAC;IACzC,CAAC;IAED,IAAW,uBAAuB,CAAC,KAAc;QAC7C,IAAI,IAAI,CAAC,wBAAwB,IAAI,KAAK,EAAE,CAAC;YACzC,OAAO;QACX,CAAC;QAED,I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E,UAAU,GAAG,IAAI,OAAO,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC;QACtI,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;IAC/C,CAAC;IAED;;;;;;OAMG;IACI,gBAAgB,CAAC,UAAmB,EAAE,UAAmB,EAAE,UAAmB,EAAE,UAAmB;QACtG,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;IAC/C,CAAC;;AA1xBD;;GAEG;AACW,mCAAgB,GAAG,CAAC,AAAJ,CAAK;AACnC;;GAEG;AACW,qCAAkB,GAAG,CAAC,AAAJ,CAAK;AACrC;;GAEG;AACW,gCAAa,GAAG,CAAC,AAAJ,CAAK;AAChC;;GAEG;AACW,qCAAkB,GAAG,CAAC,AAAJ,CAAK;AAErC;;GAEG;AACW,wCAAqB,GAAG,CAAC,AAAJ,CAAK;AAywB5C,sBAAsB;AACtB,aAAa,CAAC,4BAA4B,EAAE,kBAAkB,CAAC,CAAC","sourcesContent":["/* eslint-disable import/no-internal-modules */\r\nimport type { Nullable } from \"../types\";\r\nimport { Vector2, Vector3 } from \"../Maths/math.vector\";\r\nimport type { AbstractMesh } from \"../Meshes/abstractMesh\";\r\nimport type { ImageProcessingConfiguration } from \"../Materials/imageProcessingConfiguration\";\r\nimport { ImageProcessingConfigurationDefines } from \"../Materials/imageProcessingConfiguration.defines\";\r\nimport type { ColorGradient, FactorGradient, Color3Gradient, IValueGradient } from \"../Misc/gradients\";\r\nimport type { BoxParticleEmitter } from \"../Particles/EmitterTypes/boxParticleEmitter\";\r\nimport { Constants } from \"../Engines/constants\";\r\nimport type { BaseTexture } from \"../Materials/Textures/baseTexture\";\r\nimport { Color4 } from \"../Maths/math.color\";\r\nimport type { AbstractEngine } from \"../Engines/abstractEngine\";\r\n\r\nimport \"../Engines/Extensions/engine.dynamicBuffer\";\r\nimport type { IClipPlanesHolder } from \"../Misc/interfaces/iClipPlanesHolder\";\r\nimport type { Plane } from \"../Maths/math.plane\";\r\nimport type { Animation } from \"../Animations/animation\";\r\nimport type { Scene } from \"../scene\";\r\nimport type { ProceduralTexture } from \"../Materials/Textures/Procedurals/proceduralTexture\";\r\nimport type { RawTexture } from \"../Materials/Textures/rawTexture\";\r\nimport type { IParticleEmitterType } from \"./EmitterTypes/IParticleEmitterType\";\r\nimport type { PointParticleEmitter } from \"./EmitterTypes/pointParticleEmitter\";\r\nimport type { HemisphericParticleEmitter } from \"./EmitterTypes/hemisphericParticleEmitter\";\r\nimport type { SphereDirectedParticleEmitter, SphereParticleEmitter } from \"./EmitterTypes/sphereParticleEmitter\";\r\nimport type { CylinderDirectedParticleEmitter, CylinderParticleEmitter } from \"./EmitterTypes/cylinderParticleEmitter\";\r\nimport type { ConeDirectedParticleEmitter, ConeParticleEmitter } from \"./EmitterTypes/coneParticleEmitter\";\r\nimport { RegisterClass } from \"../Misc/typeStore\";\r\n\r\n/**\r\n * This represents the base class for particle system in Babylon.\r\n * Particles are often small sprites used to simulate hard-to-reproduce phenomena like fire, smoke, water, or abstract visual effects like magic glitter and faery dust.\r\n * Particles can take different shapes while emitted like box, sphere, cone or you can write your custom function.\r\n * @example https://doc.babylonjs.com/features/featuresDeepDive/particles/particle_system/particle_system_intro\r\n */\r\nexport class BaseParticleSystem implements IClipPlanesHolder {\r\n /**\r\n * Source color is added to the destination color without alpha affecting the result\r\n */\r\n public static BLENDMODE_ONEONE = 0;\r\n /**\r\n * Blend current color and particle color using particle’s alpha\r\n */\r\n public static BLENDMODE_STANDARD = 1;\r\n /**\r\n * Add current color and particle color multiplied by particle’s alpha\r\n */\r\n public static BLENDMODE_ADD = 2;\r\n /**\r\n * Multiply current color with particle color\r\n */\r\n public static BLENDMODE_MULTIPLY = 3;\r\n\r\n /**\r\n * Multiply current color with particle color then add current color and particle color multiplied by particle’s alpha\r\n */\r\n public static BLENDMODE_MULTIPLYADD = 4;\r\n\r\n /**\r\n * List of animations used by the particle system.\r\n */\r\n public animations: Animation[] = [];\r\n\r\n /**\r\n * Gets or sets the unique id of the particle system\r\n */\r\n public uniqueId: number;\r\n\r\n /**\r\n * The id of the Particle system.\r\n */\r\n public id: string;\r\n\r\n /**\r\n * The friendly name of the Particle system.\r\n */\r\n public name: string;\r\n\r\n /**\r\n * Snippet ID if the particle system was created from the snippet server\r\n */\r\n public snippetId: string;\r\n\r\n /**\r\n * The rendering group used by the Particle system to chose when to render.\r\n */\r\n public renderingGroupId = 0;\r\n\r\n /**\r\n * The emitter represents the Mesh or position we are attaching the particle system to.\r\n */\r\n public emitter: Nullable<AbstractMesh | Vector3> = Vector3.Zero();\r\n\r\n /**\r\n * The maximum number of particles to emit per frame\r\n */\r\n public emitRate = 10;\r\n\r\n /**\r\n * If you want to launch only a few particles at once, that can be done, as well.\r\n */\r\n public manualEmitCount = -1;\r\n\r\n /**\r\n * The overall motion speed (0.01 is default update speed, faster updates = faster animation)\r\n */\r\n public updateSpeed = 0.01;\r\n\r\n /**\r\n * The amount of time the particle system is running (depends of the overall update speed).\r\n */\r\n public targetStopDuration = 0;\r\n\r\n /**\r\n * Specifies whether the particle system will be disposed once it reaches the end of the animation.\r\n */\r\n public disposeOnStop = false;\r\n\r\n /**\r\n * Minimum power of emitting particles.\r\n */\r\n public minEmitPower = 1;\r\n /**\r\n * Maximum power of emitting particles.\r\n */\r\n public maxEmitPower = 1;\r\n\r\n /**\r\n * Minimum life time of emitting particles.\r\n */\r\n public minLifeTime = 1;\r\n /**\r\n * Maximum life time of emitting particles.\r\n */\r\n public maxLifeTime = 1;\r\n\r\n /**\r\n * Minimum Size of emitting particles.\r\n */\r\n public minSize = 1;\r\n /**\r\n * Maximum Size of emitting particles.\r\n */\r\n public maxSize = 1;\r\n\r\n /**\r\n * Minimum scale of emitting particles on X axis.\r\n */\r\n public minScaleX = 1;\r\n /**\r\n * Maximum scale of emitting particles on X axis.\r\n */\r\n public maxScaleX = 1;\r\n\r\n /**\r\n * Minimum scale of emitting particles on Y axis.\r\n */\r\n public minScaleY = 1;\r\n /**\r\n * Maximum scale of emitting particles on Y axis.\r\n */\r\n public maxScaleY = 1;\r\n\r\n /**\r\n * Gets or sets the minimal initial rotation in radians.\r\n */\r\n public minInitialRotation = 0;\r\n /**\r\n * Gets or sets the maximal initial rotation in radians.\r\n */\r\n public maxInitialRotation = 0;\r\n\r\n /**\r\n * Minimum angular speed of emitting particles (Z-axis rotation for each particle).\r\n */\r\n public minAngularSpeed = 0;\r\n /**\r\n * Maximum angular speed of emitting particles (Z-axis rotation for each particle).\r\n */\r\n public maxAngularSpeed = 0;\r\n\r\n /**\r\n * The texture used to render each particle. (this can be a spritesheet)\r\n */\r\n public particleTexture: Nullable<BaseTexture>;\r\n\r\n /**\r\n * The layer mask we are rendering the particles through.\r\n */\r\n public layerMask: number = 0x0fffffff;\r\n\r\n /**\r\n * This can help using your own shader to render the particle system.\r\n * The according effect will be created\r\n */\r\n public customShader: any = null;\r\n\r\n /**\r\n * By default particle system starts as soon as they are created. This prevents the\r\n * automatic start to happen and let you decide when to start emitting particles.\r\n */\r\n public preventAutoStart: boolean = false;\r\n\r\n /**\r\n * Gets or sets a boolean indicating that this particle system will allow fog to be rendered on it (false by default)\r\n */\r\n public applyFog = false;\r\n\r\n /** @internal */\r\n _wasDispatched = false;\r\n\r\n protected _rootUrl = \"\";\r\n private _noiseTexture: Nullable<ProceduralTexture>;\r\n\r\n /**\r\n * Gets or sets a texture used to add random noise to particle positions\r\n */\r\n public get noiseTexture(): Nullable<ProceduralTexture> {\r\n return this._noiseTexture;\r\n }\r\n\r\n public set noiseTexture(value: Nullable<ProceduralTexture>) {\r\n if (this._noiseTexture === value) {\r\n return;\r\n }\r\n\r\n this._noiseTexture = value;\r\n this._reset();\r\n }\r\n\r\n /** Gets or sets the strength to apply to the noise value (default is (10, 10, 10)) */\r\n public noiseStrength = new Vector3(10, 10, 10);\r\n\r\n /**\r\n * Callback triggered when the particle animation is ending.\r\n */\r\n public onAnimationEnd: Nullable<() => void> = null;\r\n\r\n /**\r\n * Blend mode use to render the particle, it can be either ParticleSystem.BLENDMODE_ONEONE or ParticleSystem.BLENDMODE_STANDARD.\r\n */\r\n public blendMode = BaseParticleSystem.BLENDMODE_ONEONE;\r\n\r\n /**\r\n * Forces the particle to write their depth information to the depth buffer. This can help preventing other draw calls\r\n * to override the particles.\r\n */\r\n public forceDepthWrite = false;\r\n\r\n /** Gets or sets a value indicating how many cycles (or frames) must be executed before first rendering (this value has to be set before starting the system). Default is 0 */\r\n public preWarmCycles = 0;\r\n\r\n /** Gets or sets a value indicating the time step multiplier to use in pre-warm mode (default is 1) */\r\n public preWarmStepOffset = 1;\r\n\r\n /**\r\n * If using a spritesheet (isAnimationSheetEnabled) defines the speed of the sprite loop (default is 1 meaning the animation will play once during the entire particle lifetime)\r\n */\r\n public spriteCellChangeSpeed = 1;\r\n /**\r\n * If using a spritesheet (isAnimationSheetEnabled) defines the first sprite cell to display\r\n */\r\n public startSpriteCellID = 0;\r\n /**\r\n * If using a spritesheet (isAnimationSheetEnabled) defines the last sprite cell to display\r\n */\r\n public endSpriteCellID = 0;\r\n /**\r\n * If using a spritesheet (isAnimationSheetEnabled), defines the sprite cell width to use\r\n */\r\n public spriteCellWidth = 0;\r\n /**\r\n * If using a spritesheet (isAnimationSheetEnabled), defines the sprite cell height to use\r\n */\r\n public spriteCellHeight = 0;\r\n /**\r\n * If using a spritesheet (isAnimationSheetEnabled), defines wether the sprite animation is looping\r\n */\r\n public spriteCellLoop = true;\r\n /**\r\n * This allows the system to random pick the start cell ID between startSpriteCellID and endSpriteCellID\r\n */\r\n public spriteRandomStartCell = false;\r\n\r\n /** Gets or sets a Vector2 used to move the pivot (by default (0,0)) */\r\n public translationPivot = new Vector2(0, 0);\r\n\r\n /** @internal */\r\n public _isAnimationSheetEnabled: boolean;\r\n\r\n /**\r\n * Gets or sets a boolean indicating that hosted animations (in the system.animations array) must be started when system.start() is called\r\n */\r\n public beginAnimationOnStart = false;\r\n\r\n /**\r\n * Gets or sets the frame to start the animation from when beginAnimationOnStart is true\r\n */\r\n public beginAnimationFrom = 0;\r\n\r\n /**\r\n * Gets or sets the frame to end the animation on when beginAnimationOnStart is true\r\n */\r\n public beginAnimationTo = 60;\r\n\r\n /**\r\n * Gets or sets a boolean indicating if animations must loop when beginAnimationOnStart is true\r\n */\r\n public beginAnimationLoop = false;\r\n\r\n /**\r\n * Gets or sets a world offset applied to all particles\r\n */\r\n public worldOffset = new Vector3(0, 0, 0);\r\n\r\n /**\r\n * Gets or sets the active clipplane 1\r\n */\r\n public clipPlane: Nullable<Plane>;\r\n\r\n /**\r\n * Gets or sets the active clipplane 2\r\n */\r\n public clipPlane2: Nullable<Plane>;\r\n\r\n /**\r\n * Gets or sets the active clipplane 3\r\n */\r\n public clipPlane3: Nullable<Plane>;\r\n\r\n /**\r\n * Gets or sets the active clipplane 4\r\n */\r\n public clipPlane4: Nullable<Plane>;\r\n\r\n /**\r\n * Gets or sets the active clipplane 5\r\n */\r\n public clipPlane5: Nullable<Plane>;\r\n\r\n /**\r\n * Gets or sets the active clipplane 6\r\n */\r\n public clipPlane6: Nullable<Plane>;\r\n\r\n /**\r\n * Gets or sets whether an animation sprite sheet is enabled or not on the particle system\r\n */\r\n public get isAnimationSheetEnabled(): boolean {\r\n return this._isAnimationSheetEnabled;\r\n }\r\n\r\n public set isAnimationSheetEnabled(value: boolean) {\r\n if (this._isAnimationSheetEnabled == value) {\r\n return;\r\n }\r\n\r\n this._isAnimationSheetEnabled = value;\r\n\r\n this._reset();\r\n }\r\n\r\n private _useLogarithmicDepth: boolean = false;\r\n\r\n /**\r\n * Gets or sets a boolean enabling the use of logarithmic depth buffers, which is good for wide depth buffers.\r\n */\r\n public get useLogarithmicDepth(): boolean {\r\n return this._useLogarithmicDepth;\r\n }\r\n\r\n public set useLogarithmicDepth(value: boolean) {\r\n this._useLogarithmicDepth = value && this.getScene()!.getEngine().getCaps().fragmentDepthSupported;\r\n }\r\n\r\n /**\r\n * Get hosting scene\r\n * @returns the scene\r\n */\r\n public getScene(): Nullable<Scene> {\r\n return this._scene;\r\n }\r\n\r\n /**\r\n * You can use gravity if you want to give an orientation to your particles.\r\n */\r\n public gravity = Vector3.Zero();\r\n\r\n protected _colorGradients: Nullable<Array<ColorGradient>> = null;\r\n protected _sizeGradients: Nullable<Array<FactorGradient>> = null;\r\n protected _lifeTimeGradients: Nullable<Array<FactorGradient>> = null;\r\n protected _angularSpeedGradients: Nullable<Array<FactorGradient>> = null;\r\n protected _velocityGradients: Nullable<Array<FactorGradient>> = null;\r\n protected _limitVelocityGradients: Nullable<Array<FactorGradient>> = null;\r\n protected _dragGradients: Nullable<Array<FactorGradient>> = null;\r\n protected _emitRateGradients: Nullable<Array<FactorGradient>> = null;\r\n protected _startSizeGradients: Nullable<Array<FactorGradient>> = null;\r\n protected _rampGradients: Nullable<Array<Color3Gradient>> = null;\r\n protected _colorRemapGradients: Nullable<Array<FactorGradient>> = null;\r\n protected _alphaRemapGradients: Nullable<Array<FactorGradient>> = null;\r\n\r\n protected _hasTargetStopDurationDependantGradient() {\r\n return (\r\n (this._startSizeGradients && this._startSizeGradients.length > 0) ||\r\n (this._emitRateGradients && this._emitRateGradients.length > 0) ||\r\n (this._lifeTimeGradients && this._lifeTimeGradients.length > 0)\r\n );\r\n }\r\n\r\n /**\r\n * Defines the delay in milliseconds before starting the system (0 by default)\r\n */\r\n public startDelay = 0;\r\n\r\n /**\r\n * Gets the current list of drag gradients.\r\n * You must use addDragGradient and removeDragGradient to update this list\r\n * @returns the list of drag gradients\r\n */\r\n public getDragGradients(): Nullable<Array<FactorGradient>> {\r\n return this._dragGradients;\r\n }\r\n\r\n /** Gets or sets a value indicating the damping to apply if the limit velocity factor is reached */\r\n public limitVelocityDamping = 0.4;\r\n\r\n /**\r\n * Gets the current list of limit velocity gradients.\r\n * You must use addLimitVelocityGradient and removeLimitVelocityGradient to update this list\r\n * @returns the list of limit velocity gradients\r\n */\r\n public getLimitVelocityGradients(): Nullable<Array<FactorGradient>> {\r\n return this._limitVelocityGradients;\r\n }\r\n\r\n /**\r\n * Gets the current list of color gradients.\r\n * You must use addColorGradient and removeColorGradient to update this list\r\n * @returns the list of color gradients\r\n */\r\n public getColorGradients(): Nullable<Array<ColorGradient>> {\r\n return this._colorGradients;\r\n }\r\n\r\n /**\r\n * Gets the current list of size gradients.\r\n * You must use addSizeGradient and removeSizeGradient to update this list\r\n * @returns the list of size gradients\r\n */\r\n public getSizeGradients(): Nullable<Array<FactorGradient>> {\r\n return this._sizeGradients;\r\n }\r\n\r\n /**\r\n * Gets the current list of color remap gradients.\r\n * You must use addColorRemapGradient and removeColorRemapGradient to update this list\r\n * @returns the list of color remap gradients\r\n */\r\n public getColorRemapGradients(): Nullable<Array<FactorGradient>> {\r\n return this._colorRemapGradients;\r\n }\r\n\r\n /**\r\n * Gets the current list of alpha remap gradients.\r\n * You must use addAlphaRemapGradient and removeAlphaRemapGradient to update this list\r\n * @returns the list of alpha remap gradients\r\n */\r\n public getAlphaRemapGradients(): Nullable<Array<FactorGradient>> {\r\n return this._alphaRemapGradients;\r\n }\r\n\r\n /**\r\n * Gets the current list of life time gradients.\r\n * You must use addLifeTimeGradient and removeLifeTimeGradient to update this list\r\n * @returns the list of life time gradients\r\n */\r\n public getLifeTimeGradients(): Nullable<Array<FactorGradient>> {\r\n return this._lifeTimeGradients;\r\n }\r\n\r\n /**\r\n * Gets the current list of angular speed gradients.\r\n * You must use addAngularSpeedGradient and removeAngularSpeedGradient to update this list\r\n * @returns the list of angular speed gradients\r\n */\r\n public getAngularSpeedGradients(): Nullable<Array<FactorGradient>> {\r\n return this._angularSpeedGradients;\r\n }\r\n\r\n /**\r\n * Gets the current list of velocity gradients.\r\n * You must use addVelocityGradient and removeVelocityGradient to update this list\r\n * @returns the list of velocity gradients\r\n */\r\n public getVelocityGradients(): Nullable<Array<FactorGradient>> {\r\n return this._velocityGradients;\r\n }\r\n\r\n /**\r\n * Gets the current list of start size gradients.\r\n * You must use addStartSizeGradient and removeStartSizeGradient to update this list\r\n * @returns the list of start size gradients\r\n */\r\n public getStartSizeGradients(): Nullable<Array<FactorGradient>> {\r\n return this._startSizeGradients;\r\n }\r\n\r\n /**\r\n * Gets the current list of emit rate gradients.\r\n * You must use addEmitRateGradient and removeEmitRateGradient to update this list\r\n * @returns the list of emit rate gradients\r\n */\r\n public getEmitRateGradients(): Nullable<Array<FactorGradient>> {\r\n return this._emitRateGradients;\r\n }\r\n\r\n /**\r\n * Random direction of each particle after it has been emitted, between direction1 and direction2 vectors.\r\n * This only works when particleEmitterTyps is a BoxParticleEmitter\r\n */\r\n public get direction1(): Vector3 {\r\n if ((<BoxParticleEmitter>this.particleEmitterType).direction1) {\r\n return (<BoxParticleEmitter>this.particleEmitterType).direction1;\r\n }\r\n\r\n return Vector3.Zero();\r\n }\r\n\r\n public set direction1(value: Vector3) {\r\n if ((<BoxParticleEmitter>this.particleEmitterType).direction1) {\r\n (<BoxParticleEmitter>this.particleEmitterType).direction1 = value;\r\n }\r\n }\r\n\r\n /**\r\n * Random direction of each particle after it has been emitted, between direction1 and direction2 vectors.\r\n * This only works when particleEmitterTyps is a BoxParticleEmitter\r\n */\r\n public get direction2(): Vector3 {\r\n if ((<BoxParticleEmitter>this.particleEmitterType).direction2) {\r\n return (<BoxParticleEmitter>this.particleEmitterType).direction2;\r\n }\r\n\r\n return Vector3.Zero();\r\n }\r\n\r\n public set direction2(value: Vector3) {\r\n if ((<BoxParticleEmitter>this.particleEmitterType).direction2) {\r\n (<BoxParticleEmitter>this.particleEmitterType).direction2 = value;\r\n }\r\n }\r\n\r\n /**\r\n * Minimum box point around our emitter. Our emitter is the center of particles source, but if you want your particles to emit from more than one point, then you can tell it to do so.\r\n * This only works when particleEmitterTyps is a BoxParticleEmitter\r\n */\r\n public get minEmitBox(): Vector3 {\r\n if ((<BoxParticleEmitter>this.particleEmitterType).minEmitBox) {\r\n return (<BoxParticleEmitter>this.particleEmitterType).minEmitBox;\r\n }\r\n\r\n return Vector3.Zero();\r\n }\r\n\r\n public set minEmitBox(value: Vector3) {\r\n if ((<BoxParticleEmitter>this.particleEmitterType).minEmitBox) {\r\n (<BoxParticleEmitter>this.particleEmitterType).minEmitBox = value;\r\n }\r\n }\r\n\r\n /**\r\n * Maximum box point around our emitter. Our emitter is the center of particles source, but if you want your particles to emit from more than one point, then you can tell it to do so.\r\n * This only works when particleEmitterTyps is a BoxParticleEmitter\r\n */\r\n public get maxEmitBox(): Vector3 {\r\n if ((<BoxParticleEmitter>this.particleEmitterType).maxEmitBox) {\r\n return (<BoxParticleEmitter>this.particleEmitterType).maxEmitBox;\r\n }\r\n\r\n return Vector3.Zero();\r\n }\r\n\r\n public set maxEmitBox(value: Vector3) {\r\n if ((<BoxParticleEmitter>this.particleEmitterType).maxEmitBox) {\r\n (<BoxParticleEmitter>this.particleEmitterType).maxEmitBox = value;\r\n }\r\n }\r\n\r\n /**\r\n * Random color of each particle after it has been emitted, between color1 and color2 vectors\r\n */\r\n public color1 = new Color4(1.0, 1.0, 1.0, 1.0);\r\n /**\r\n * Random color of each particle after it has been emitted, between color1 and color2 vectors\r\n */\r\n public color2 = new Color4(1.0, 1.0, 1.0, 1.0);\r\n /**\r\n * Color the particle will have at the end of its lifetime\r\n */\r\n public colorDead = new Color4(0, 0, 0, 1.0);\r\n\r\n /**\r\n * An optional mask to filter some colors out of the texture, or filter a part of the alpha channel\r\n */\r\n public textureMask = new Color4(1.0, 1.0, 1.0, 1.0);\r\n\r\n /**\r\n * The particle emitter type defines the emitter used by the particle system.\r\n * It can be for example box, sphere, or cone...\r\n */\r\n public particleEmitterType: IParticleEmitterType;\r\n\r\n /** @internal */\r\n public _isSubEmitter = false;\r\n\r\n /** @internal */\r\n public _billboardMode = Constants.PARTICLES_BILLBOARDMODE_ALL;\r\n /**\r\n * Gets or sets the billboard mode to use when isBillboardBased = true.\r\n * Value can be: ParticleSystem.BILLBOARDMODE_ALL, ParticleSystem.BILLBOARDMODE_Y, ParticleSystem.BILLBOARDMODE_STRETCHED\r\n */\r\n public get billboardMode(): number {\r\n return this._billboardMode;\r\n }\r\n\r\n public set billboardMode(value: number) {\r\n if (this._billboardMode === value) {\r\n return;\r\n }\r\n\r\n this._billboardMode = value;\r\n this._reset();\r\n }\r\n\r\n /** @internal */\r\n public _isBillboardBased = true;\r\n /**\r\n * Gets or sets a boolean indicating if the particles must be rendered as billboard or aligned with the direction\r\n */\r\n public get isBillboardBased(): boolean {\r\n return this._isBillboardBased;\r\n }\r\n\r\n public set isBillboardBased(value: boolean) {\r\n if (this._isBillboardBased === value) {\r\n return;\r\n }\r\n\r\n this._isBillboardBased = value;\r\n this._reset();\r\n }\r\n\r\n /**\r\n * The scene the particle system belongs to.\r\n */\r\n protected _scene: Nullable<Scene>;\r\n\r\n /**\r\n * The engine the particle system belongs to.\r\n */\r\n protected _engine: AbstractEngine;\r\n\r\n /**\r\n * Local cache of defines for image processing.\r\n */\r\n protected _imageProcessingConfigurationDefines = new ImageProcessingConfigurationDefines();\r\n\r\n /**\r\n * Default configuration related to image processing available in the standard Material.\r\n */\r\n protected _imageProcessingConfiguration: Nullable<ImageProcessingConfiguration>;\r\n\r\n /**\r\n * Gets the image processing configuration used either in this material.\r\n */\r\n public get imageProcessingConfiguration(): Nullable<ImageProcessingConfiguration> {\r\n return this._imageProcessingConfiguration;\r\n }\r\n\r\n /**\r\n * Sets the Default image processing configuration used either in the this material.\r\n *\r\n * If sets to null, the scene one is in use.\r\n */\r\n public set imageProcessingConfiguration(value: Nullable<ImageProcessingConfiguration>) {\r\n this._attachImageProcessingConfiguration(value);\r\n }\r\n\r\n /**\r\n * Attaches a new image processing configuration to the Standard Material.\r\n * @param configuration\r\n */\r\n protected _attachImageProcessingConfiguration(configuration: Nullable<ImageProcessingConfiguration>): void {\r\n if (configuration === this._imageProcessingConfiguration) {\r\n return;\r\n }\r\n\r\n // Pick the scene configuration if needed.\r\n if (!configuration && this._scene) {\r\n this._imageProcessingConfiguration = this._scene.imageProcessingConfiguration;\r\n } else {\r\n this._imageProcessingConfiguration = configuration;\r\n }\r\n }\r\n\r\n /** @internal */\r\n protected _reset() {}\r\n\r\n /**\r\n * @internal\r\n */\r\n protected _removeGradientAndTexture(gradient: number, gradients: Nullable<IValueGradient[]>, texture: Nullable<RawTexture>): BaseParticleSystem {\r\n if (!gradients) {\r\n return this;\r\n }\r\n\r\n let index = 0;\r\n for (const valueGradient of gradients) {\r\n if (valueGradient.gradient === gradient) {\r\n gradients.splice(index, 1);\r\n break;\r\n }\r\n index++;\r\n }\r\n\r\n if (texture) {\r\n texture.dispose();\r\n }\r\n\r\n return this;\r\n }\r\n\r\n /**\r\n * Instantiates a particle system.\r\n * Particles are often small sprites used to simulate hard-to-reproduce phenomena like fire, smoke, water, or abstract visual effects like magic glitter and faery dust.\r\n * @param name The name of the particle system\r\n */\r\n public constructor(name: string) {\r\n this.id = name;\r\n this.name = name;\r\n }\r\n\r\n /**\r\n * Creates a Point Emitter for the particle system (emits directly from the emitter position)\r\n * @param direction1 Particles are emitted between the direction1 and direction2 from within the box\r\n * @param direction2 Particles are emitted between the direction1 and direction2 from within the box\r\n */\r\n public createPointEmitter(direction1: Vector3, direction2: Vector3): PointParticleEmitter {\r\n throw new Error(\"Method not implemented.\");\r\n }\r\n\r\n /**\r\n * Creates a Hemisphere Emitter for the particle system (emits along the hemisphere radius)\r\n * @param radius The radius of the hemisphere to emit from\r\n * @param radiusRange The range of the hemisphere to emit from [0-1] 0 Surface Only, 1 Entire Radius\r\n */\r\n public createHemisphericEmitter(radius = 1, radiusRange = 1): HemisphericParticleEmitter {\r\n throw new Error(\"Method not implemented.\");\r\n }\r\n\r\n /**\r\n * Creates a Sphere Emitter for the particle system (emits along the sphere radius)\r\n * @param radius The radius of the sphere to emit from\r\n * @param radiusRange The range of the sphere to emit from [0-1] 0 Surface Only, 1 Entire Radius\r\n */\r\n public createSphereEmitter(radius = 1, radiusRange = 1): SphereParticleEmitter {\r\n throw new Error(\"Method not implemented.\");\r\n }\r\n\r\n /**\r\n * Creates a Directed Sphere Emitter for the particle system (emits between direction1 and direction2)\r\n * @param radius The radius of the sphere to emit from\r\n * @param direction1 Particles are emitted between the direction1 and direction2 from within the sphere\r\n * @param direction2 Particles are emitted between the direction1 and direction2 from within the sphere\r\n */\r\n public createDirectedSphereEmitter(radius = 1, direction1 = new Vector3(0, 1.0, 0), direction2 = new Vector3(0, 1.0, 0)): SphereDirectedParticleEmitter {\r\n throw new Error(\"Method not implemented.\");\r\n }\r\n\r\n /**\r\n * Creates a Cylinder Emitter for the particle system (emits from the cylinder to the particle position)\r\n * @param radius The radius of the emission cylinder\r\n * @param height The height of the emission cylinder\r\n * @param radiusRange The range of emission [0-1] 0 Surface only, 1 Entire Radius\r\n * @param directionRandomizer How much to randomize the particle direction [0-1]\r\n */\r\n public createCylinderEmitter(radius = 1, height = 1, radiusRange = 1, directionRandomizer = 0): CylinderParticleEmitter {\r\n throw new Error(\"Method not implemented.\");\r\n }\r\n\r\n /**\r\n * Creates a Directed Cylinder Emitter for the particle system (emits between direction1 and direction2)\r\n * @param radius The radius of the cylinder to emit from\r\n * @param height The height of the emission cylinder\r\n * @param radiusRange the range of the emission cylinder [0-1] 0 Surface only, 1 Entire Radius (1 by default)\r\n * @param direction1 Particles are emitted between the direction1 and direction2 from within the cylinder\r\n * @param direction2 Particles are emitted between the direction1 and direction2 from within the cylinder\r\n */\r\n public createDirectedCylinderEmitter(\r\n radius = 1,\r\n height = 1,\r\n radiusRange = 1,\r\n direction1 = new Vector3(0, 1.0, 0),\r\n direction2 = new Vector3(0, 1.0, 0)\r\n ): CylinderDirectedParticleEmitter {\r\n throw new Error(\"Method not implemented.\");\r\n }\r\n\r\n /**\r\n * Creates a Cone Emitter for the particle system (emits from the cone to the particle position)\r\n * @param radius The radius of the cone to emit from\r\n * @param angle The base angle of the cone\r\n */\r\n public createConeEmitter(radius = 1, angle = Math.PI / 4): ConeParticleEmitter {\r\n throw new Error(\"Method not implemented.\");\r\n }\r\n\r\n public createDirectedConeEmitter(radius = 1, angle = Math.PI / 4, direction1 = new Vector3(0, 1.0, 0), direction2 = new Vector3(0, 1.0, 0)): ConeDirectedParticleEmitter {\r\n throw new Error(\"Method not implemented.\");\r\n }\r\n\r\n /**\r\n * Creates a Box Emitter for the particle system. (emits between direction1 and direction2 from withing the box defined by minEmitBox and maxEmitBox)\r\n * @param direction1 Particles are emitted between the direction1 and direction2 from within the box\r\n * @param direction2 Particles are emitted between the direction1 and direction2 from within the box\r\n * @param minEmitBox Particles are emitted from the box between minEmitBox and maxEmitBox\r\n * @param maxEmitBox Particles are emitted from the box between minEmitBox and maxEmitBox\r\n */\r\n public createBoxEmitter(direction1: Vector3, direction2: Vector3, minEmitBox: Vector3, maxEmitBox: Vector3): BoxParticleEmitter {\r\n throw new Error(\"Method not implemented.\");\r\n }\r\n}\r\n\r\n// Register Class Name\r\nRegisterClass(\"BABYLON.BaseParticleSystem\", BaseParticleSystem);\r\n"]}
1
+ {"version":3,"file":"baseParticleSystem.js","sourceRoot":"","sources":["../../../../dev/core/src/Particles/baseParticleSystem.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAGxD,OAAO,EAAE,mCAAmC,EAAE,MAAM,mDAAmD,CAAC;AAGxG,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEjD,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAG7C,OAAO,4CAA4C,CAAC;AAapD,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAElD;;;;;GAKG;AACH,MAAM,OAAO,kBAAkB;IAuL3B;;OAEG;IACH,IAAW,YAAY;QACnB,OAAO,IAAI,CAAC,aAAa,CAAC;IAC9B,CAAC;IAED,IAAW,YAAY,CAAC,KAAkC;QACtD,IAAI,IAAI,CAAC,aAAa,KAAK,KAAK,EAAE,CAAC;YAC/B,OAAO;QACX,CAAC;QAED,IAAI,CAAC,aAAa,GAAG,KAAK,CAAC;QAC3B,IAAI,CAAC,MAAM,EAAE,CAAC;IAClB,CAAC;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AAJ,CAAK;AACnC;;GAEG;AACW,qCAAkB,GAAG,CAAC,AAAJ,CAAK;AACrC;;GAEG;AACW,gCAAa,GAAG,CAAC,AAAJ,CAAK;AAChC;;GAEG;AACW,qCAAkB,GAAG,CAAC,AAAJ,CAAK;AACrC;;GAEG;AACW,wCAAqB,GAAG,CAAC,AAAJ,CAAK;AACxC;;;GAGG;AACW,qCAAkB,GAAG,CAAC,CAAC,AAAL,CAAM;AAuyB1C,sBAAsB;AACtB,aAAa,CAAC,4BAA4B,EAAE,kBAAkB,CAAC,CAAC","sourcesContent":["/* eslint-disable import/no-internal-modules */\r\nimport type { Nullable } from \"../types\";\r\nimport { Vector2, Vector3 } from \"../Maths/math.vector\";\r\nimport type { AbstractMesh } from \"../Meshes/abstractMesh\";\r\nimport type { ImageProcessingConfiguration } from \"../Materials/imageProcessingConfiguration\";\r\nimport { ImageProcessingConfigurationDefines } from \"../Materials/imageProcessingConfiguration.defines\";\r\nimport type { ColorGradient, FactorGradient, Color3Gradient, IValueGradient } from \"../Misc/gradients\";\r\nimport type { BoxParticleEmitter } from \"../Particles/EmitterTypes/boxParticleEmitter\";\r\nimport { Constants } from \"../Engines/constants\";\r\nimport type { BaseTexture } from \"../Materials/Textures/baseTexture\";\r\nimport { Color4 } from \"../Maths/math.color\";\r\nimport type { AbstractEngine } from \"../Engines/abstractEngine\";\r\n\r\nimport \"../Engines/Extensions/engine.dynamicBuffer\";\r\nimport type { IClipPlanesHolder } from \"../Misc/interfaces/iClipPlanesHolder\";\r\nimport type { Plane } from \"../Maths/math.plane\";\r\nimport type { Animation } from \"../Animations/animation\";\r\nimport type { Scene } from \"../scene\";\r\nimport type { ProceduralTexture } from \"../Materials/Textures/Procedurals/proceduralTexture\";\r\nimport type { RawTexture } from \"../Materials/Textures/rawTexture\";\r\nimport type { IParticleEmitterType } from \"./EmitterTypes/IParticleEmitterType\";\r\nimport type { PointParticleEmitter } from \"./EmitterTypes/pointParticleEmitter\";\r\nimport type { HemisphericParticleEmitter } from \"./EmitterTypes/hemisphericParticleEmitter\";\r\nimport type { SphereDirectedParticleEmitter, SphereParticleEmitter } from \"./EmitterTypes/sphereParticleEmitter\";\r\nimport type { CylinderDirectedParticleEmitter, CylinderParticleEmitter } from \"./EmitterTypes/cylinderParticleEmitter\";\r\nimport type { ConeDirectedParticleEmitter, ConeParticleEmitter } from \"./EmitterTypes/coneParticleEmitter\";\r\nimport { RegisterClass } from \"../Misc/typeStore\";\r\n\r\n/**\r\n * This represents the base class for particle system in Babylon.\r\n * Particles are often small sprites used to simulate hard-to-reproduce phenomena like fire, smoke, water, or abstract visual effects like magic glitter and faery dust.\r\n * Particles can take different shapes while emitted like box, sphere, cone or you can write your custom function.\r\n * @example https://doc.babylonjs.com/features/featuresDeepDive/particles/particle_system/particle_system_intro\r\n */\r\nexport class BaseParticleSystem implements IClipPlanesHolder {\r\n /**\r\n * Source color is added to the destination color without alpha affecting the result. Great for additive glow effects (fire, magic, lasers)\r\n */\r\n public static BLENDMODE_ONEONE = 0;\r\n /**\r\n * Blend current color and particle color using particle’s alpha. Same as Constants.ALPHA_COMBINE, the go-to for transparency. 100% alpha means source, 0% alpha means background. Glass, UI fade, smoke\r\n */\r\n public static BLENDMODE_STANDARD = 1;\r\n /**\r\n * Add current color and particle color multiplied by particle’s alpha\r\n */\r\n public static BLENDMODE_ADD = 2;\r\n /**\r\n * Multiply current color with particle color\r\n */\r\n public static BLENDMODE_MULTIPLY = 3;\r\n /**\r\n * Multiply current color with particle color then add current color and particle color multiplied by particle’s alpha\r\n */\r\n public static BLENDMODE_MULTIPLYADD = 4;\r\n /**\r\n * Subtracts source (particle) from destination (current color), leading to darker results\r\n * - NOTE: Init as -1 so we can properly map all modes to Engine Const's (otherwise ALPHA_SUBTRACT will conflict with BLENDMODE_MULTIPLY since both use 3)\r\n */\r\n public static BLENDMODE_SUBTRACT = -1;\r\n\r\n /**\r\n * List of animations used by the particle system.\r\n */\r\n public animations: Animation[] = [];\r\n\r\n /**\r\n * Gets or sets the unique id of the particle system\r\n */\r\n public uniqueId: number;\r\n\r\n /**\r\n * The id of the Particle system.\r\n */\r\n public id: string;\r\n\r\n /**\r\n * The friendly name of the Particle system.\r\n */\r\n public name: string;\r\n\r\n /**\r\n * Snippet ID if the particle system was created from the snippet server\r\n */\r\n public snippetId: string;\r\n\r\n /**\r\n * The rendering group used by the Particle system to chose when to render.\r\n */\r\n public renderingGroupId = 0;\r\n\r\n /**\r\n * The emitter represents the Mesh or position we are attaching the particle system to.\r\n */\r\n public emitter: Nullable<AbstractMesh | Vector3> = Vector3.Zero();\r\n\r\n /**\r\n * The maximum number of particles to emit per frame\r\n */\r\n public emitRate = 10;\r\n\r\n /**\r\n * If you want to launch only a few particles at once, that can be done, as well.\r\n */\r\n public manualEmitCount = -1;\r\n\r\n /**\r\n * The overall motion speed (0.01 is default update speed, faster updates = faster animation)\r\n */\r\n public updateSpeed = 0.01;\r\n\r\n /**\r\n * The amount of time the particle system is running (depends of the overall update speed).\r\n */\r\n public targetStopDuration = 0;\r\n\r\n /**\r\n * Specifies whether the particle system will be disposed once it reaches the end of the animation.\r\n */\r\n public disposeOnStop = false;\r\n\r\n /**\r\n * Minimum power of emitting particles.\r\n */\r\n public minEmitPower = 1;\r\n /**\r\n * Maximum power of emitting particles.\r\n */\r\n public maxEmitPower = 1;\r\n\r\n /**\r\n * Minimum life time of emitting particles.\r\n */\r\n public minLifeTime = 1;\r\n /**\r\n * Maximum life time of emitting particles.\r\n */\r\n public maxLifeTime = 1;\r\n\r\n /**\r\n * Minimum Size of emitting particles.\r\n */\r\n public minSize = 1;\r\n /**\r\n * Maximum Size of emitting particles.\r\n */\r\n public maxSize = 1;\r\n\r\n /**\r\n * Minimum scale of emitting particles on X axis.\r\n */\r\n public minScaleX = 1;\r\n /**\r\n * Maximum scale of emitting particles on X axis.\r\n */\r\n public maxScaleX = 1;\r\n\r\n /**\r\n * Minimum scale of emitting particles on Y axis.\r\n */\r\n public minScaleY = 1;\r\n /**\r\n * Maximum scale of emitting particles on Y axis.\r\n */\r\n public maxScaleY = 1;\r\n\r\n /**\r\n * Gets or sets the minimal initial rotation in radians.\r\n */\r\n public minInitialRotation = 0;\r\n /**\r\n * Gets or sets the maximal initial rotation in radians.\r\n */\r\n public maxInitialRotation = 0;\r\n\r\n /**\r\n * Minimum angular speed of emitting particles (Z-axis rotation for each particle).\r\n */\r\n public minAngularSpeed = 0;\r\n /**\r\n * Maximum angular speed of emitting particles (Z-axis rotation for each particle).\r\n */\r\n public maxAngularSpeed = 0;\r\n\r\n /**\r\n * The texture used to render each particle. (this can be a spritesheet)\r\n */\r\n public particleTexture: Nullable<BaseTexture>;\r\n\r\n /**\r\n * The layer mask we are rendering the particles through.\r\n */\r\n public layerMask: number = 0x0fffffff;\r\n\r\n /**\r\n * This can help using your own shader to render the particle system.\r\n * The according effect will be created\r\n */\r\n public customShader: any = null;\r\n\r\n /**\r\n * By default particle system starts as soon as they are created. This prevents the\r\n * automatic start to happen and let you decide when to start emitting particles.\r\n */\r\n public preventAutoStart: boolean = false;\r\n\r\n /**\r\n * Gets or sets a boolean indicating that this particle system will allow fog to be rendered on it (false by default)\r\n */\r\n public applyFog = false;\r\n\r\n /** @internal */\r\n _wasDispatched = false;\r\n\r\n protected _rootUrl = \"\";\r\n private _noiseTexture: Nullable<ProceduralTexture>;\r\n\r\n /**\r\n * Gets or sets a texture used to add random noise to particle positions\r\n */\r\n public get noiseTexture(): Nullable<ProceduralTexture> {\r\n return this._noiseTexture;\r\n }\r\n\r\n public set noiseTexture(value: Nullable<ProceduralTexture>) {\r\n if (this._noiseTexture === value) {\r\n return;\r\n }\r\n\r\n this._noiseTexture = value;\r\n this._reset();\r\n }\r\n\r\n /** Gets or sets the strength to apply to the noise value (default is (10, 10, 10)) */\r\n public noiseStrength = new Vector3(10, 10, 10);\r\n\r\n /**\r\n * Callback triggered when the particle animation is ending.\r\n */\r\n public onAnimationEnd: Nullable<() => void> = null;\r\n\r\n /**\r\n * Blend mode use to render the particle\r\n * For original blend modes which are exposed from ParticleSystem (OneOne, Standard, Add, Multiply, MultiplyAdd, and Subtract), use ParticleSystem.BLENDMODE_FOO\r\n * For all other blend modes, use Engine Constants.ALPHA_FOO blend modes\r\n */\r\n public blendMode = BaseParticleSystem.BLENDMODE_ONEONE;\r\n\r\n /**\r\n * Forces the particle to write their depth information to the depth buffer. This can help preventing other draw calls\r\n * to override the particles.\r\n */\r\n public forceDepthWrite = false;\r\n\r\n /** Gets or sets a value indicating how many cycles (or frames) must be executed before first rendering (this value has to be set before starting the system). Default is 0 */\r\n public preWarmCycles = 0;\r\n\r\n /** Gets or sets a value indicating the time step multiplier to use in pre-warm mode (default is 1) */\r\n public preWarmStepOffset = 1;\r\n\r\n /**\r\n * If using a spritesheet (isAnimationSheetEnabled) defines the speed of the sprite loop (default is 1 meaning the animation will play once during the entire particle lifetime)\r\n */\r\n public spriteCellChangeSpeed = 1;\r\n /**\r\n * If using a spritesheet (isAnimationSheetEnabled) defines the first sprite cell to display\r\n */\r\n public startSpriteCellID = 0;\r\n /**\r\n * If using a spritesheet (isAnimationSheetEnabled) defines the last sprite cell to display\r\n */\r\n public endSpriteCellID = 0;\r\n /**\r\n * If using a spritesheet (isAnimationSheetEnabled), defines the sprite cell width to use\r\n */\r\n public spriteCellWidth = 0;\r\n /**\r\n * If using a spritesheet (isAnimationSheetEnabled), defines the sprite cell height to use\r\n */\r\n public spriteCellHeight = 0;\r\n /**\r\n * If using a spritesheet (isAnimationSheetEnabled), defines wether the sprite animation is looping\r\n */\r\n public spriteCellLoop = true;\r\n /**\r\n * This allows the system to random pick the start cell ID between startSpriteCellID and endSpriteCellID\r\n */\r\n public spriteRandomStartCell = false;\r\n\r\n /** Gets or sets a Vector2 used to move the pivot (by default (0,0)) */\r\n public translationPivot = new Vector2(0, 0);\r\n\r\n /** @internal */\r\n public _isAnimationSheetEnabled: boolean;\r\n\r\n /**\r\n * Gets or sets a boolean indicating that hosted animations (in the system.animations array) must be started when system.start() is called\r\n */\r\n public beginAnimationOnStart = false;\r\n\r\n /**\r\n * Gets or sets the frame to start the animation from when beginAnimationOnStart is true\r\n */\r\n public beginAnimationFrom = 0;\r\n\r\n /**\r\n * Gets or sets the frame to end the animation on when beginAnimationOnStart is true\r\n */\r\n public beginAnimationTo = 60;\r\n\r\n /**\r\n * Gets or sets a boolean indicating if animations must loop when beginAnimationOnStart is true\r\n */\r\n public beginAnimationLoop = false;\r\n\r\n /**\r\n * Gets or sets a world offset applied to all particles\r\n */\r\n public worldOffset = new Vector3(0, 0, 0);\r\n\r\n /**\r\n * Gets or sets the active clipplane 1\r\n */\r\n public clipPlane: Nullable<Plane>;\r\n\r\n /**\r\n * Gets or sets the active clipplane 2\r\n */\r\n public clipPlane2: Nullable<Plane>;\r\n\r\n /**\r\n * Gets or sets the active clipplane 3\r\n */\r\n public clipPlane3: Nullable<Plane>;\r\n\r\n /**\r\n * Gets or sets the active clipplane 4\r\n */\r\n public clipPlane4: Nullable<Plane>;\r\n\r\n /**\r\n * Gets or sets the active clipplane 5\r\n */\r\n public clipPlane5: Nullable<Plane>;\r\n\r\n /**\r\n * Gets or sets the active clipplane 6\r\n */\r\n public clipPlane6: Nullable<Plane>;\r\n\r\n /**\r\n * Gets or sets whether an animation sprite sheet is enabled or not on the particle system\r\n */\r\n public get isAnimationSheetEnabled(): boolean {\r\n return this._isAnimationSheetEnabled;\r\n }\r\n\r\n public set isAnimationSheetEnabled(value: boolean) {\r\n if (this._isAnimationSheetEnabled == value) {\r\n return;\r\n }\r\n\r\n this._isAnimationSheetEnabled = value;\r\n\r\n this._reset();\r\n }\r\n\r\n private _useLogarithmicDepth: boolean = false;\r\n\r\n /**\r\n * Gets or sets a boolean enabling the use of logarithmic depth buffers, which is good for wide depth buffers.\r\n */\r\n public get useLogarithmicDepth(): boolean {\r\n return this._useLogarithmicDepth;\r\n }\r\n\r\n public set useLogarithmicDepth(value: boolean) {\r\n this._useLogarithmicDepth = value && this.getScene()!.getEngine().getCaps().fragmentDepthSupported;\r\n }\r\n\r\n /**\r\n * Get hosting scene\r\n * @returns the scene\r\n */\r\n public getScene(): Nullable<Scene> {\r\n return this._scene;\r\n }\r\n\r\n /**\r\n * You can use gravity if you want to give an orientation to your particles.\r\n */\r\n public gravity = Vector3.Zero();\r\n\r\n protected _colorGradients: Nullable<Array<ColorGradient>> = null;\r\n protected _sizeGradients: Nullable<Array<FactorGradient>> = null;\r\n protected _lifeTimeGradients: Nullable<Array<FactorGradient>> = null;\r\n protected _angularSpeedGradients: Nullable<Array<FactorGradient>> = null;\r\n protected _velocityGradients: Nullable<Array<FactorGradient>> = null;\r\n protected _limitVelocityGradients: Nullable<Array<FactorGradient>> = null;\r\n protected _dragGradients: Nullable<Array<FactorGradient>> = null;\r\n protected _emitRateGradients: Nullable<Array<FactorGradient>> = null;\r\n protected _startSizeGradients: Nullable<Array<FactorGradient>> = null;\r\n protected _rampGradients: Nullable<Array<Color3Gradient>> = null;\r\n protected _colorRemapGradients: Nullable<Array<FactorGradient>> = null;\r\n protected _alphaRemapGradients: Nullable<Array<FactorGradient>> = null;\r\n\r\n protected _hasTargetStopDurationDependantGradient() {\r\n return (\r\n (this._startSizeGradients && this._startSizeGradients.length > 0) ||\r\n (this._emitRateGradients && this._emitRateGradients.length > 0) ||\r\n (this._lifeTimeGradients && this._lifeTimeGradients.length > 0)\r\n );\r\n }\r\n\r\n protected _setEngineBasedOnBlendMode(blendMode: number): void {\r\n switch (blendMode) {\r\n case BaseParticleSystem.BLENDMODE_MULTIPLYADD:\r\n // Don't want to update engine since there is no equivalent engine alpha mode, instead it gets handled within particleSystem\r\n return;\r\n case BaseParticleSystem.BLENDMODE_ADD:\r\n blendMode = Constants.ALPHA_ADD;\r\n break;\r\n case BaseParticleSystem.BLENDMODE_ONEONE:\r\n blendMode = Constants.ALPHA_ONEONE;\r\n break;\r\n case BaseParticleSystem.BLENDMODE_STANDARD:\r\n blendMode = Constants.ALPHA_COMBINE;\r\n break;\r\n case BaseParticleSystem.BLENDMODE_MULTIPLY:\r\n blendMode = Constants.ALPHA_MULTIPLY;\r\n break;\r\n case BaseParticleSystem.BLENDMODE_SUBTRACT:\r\n blendMode = Constants.ALPHA_SUBTRACT;\r\n break;\r\n default:\r\n // For all other blend modes that were added after the initial particleSystem implementation,\r\n // the ParticleSystem.BLENDMODE_FOO are already mapped to the underlying Constants.ALPHA_FOO\r\n break;\r\n }\r\n this._engine.setAlphaMode(blendMode);\r\n }\r\n\r\n /**\r\n * Defines the delay in milliseconds before starting the system (0 by default)\r\n */\r\n public startDelay = 0;\r\n\r\n /**\r\n * Gets the current list of drag gradients.\r\n * You must use addDragGradient and removeDragGradient to update this list\r\n * @returns the list of drag gradients\r\n */\r\n public getDragGradients(): Nullable<Array<FactorGradient>> {\r\n return this._dragGradients;\r\n }\r\n\r\n /** Gets or sets a value indicating the damping to apply if the limit velocity factor is reached */\r\n public limitVelocityDamping = 0.4;\r\n\r\n /**\r\n * Gets the current list of limit velocity gradients.\r\n * You must use addLimitVelocityGradient and removeLimitVelocityGradient to update this list\r\n * @returns the list of limit velocity gradients\r\n */\r\n public getLimitVelocityGradients(): Nullable<Array<FactorGradient>> {\r\n return this._limitVelocityGradients;\r\n }\r\n\r\n /**\r\n * Gets the current list of color gradients.\r\n * You must use addColorGradient and removeColorGradient to update this list\r\n * @returns the list of color gradients\r\n */\r\n public getColorGradients(): Nullable<Array<ColorGradient>> {\r\n return this._colorGradients;\r\n }\r\n\r\n /**\r\n * Gets the current list of size gradients.\r\n * You must use addSizeGradient and removeSizeGradient to update this list\r\n * @returns the list of size gradients\r\n */\r\n public getSizeGradients(): Nullable<Array<FactorGradient>> {\r\n return this._sizeGradients;\r\n }\r\n\r\n /**\r\n * Gets the current list of color remap gradients.\r\n * You must use addColorRemapGradient and removeColorRemapGradient to update this list\r\n * @returns the list of color remap gradients\r\n */\r\n public getColorRemapGradients(): Nullable<Array<FactorGradient>> {\r\n return this._colorRemapGradients;\r\n }\r\n\r\n /**\r\n * Gets the current list of alpha remap gradients.\r\n * You must use addAlphaRemapGradient and removeAlphaRemapGradient to update this list\r\n * @returns the list of alpha remap gradients\r\n */\r\n public getAlphaRemapGradients(): Nullable<Array<FactorGradient>> {\r\n return this._alphaRemapGradients;\r\n }\r\n\r\n /**\r\n * Gets the current list of life time gradients.\r\n * You must use addLifeTimeGradient and removeLifeTimeGradient to update this list\r\n * @returns the list of life time gradients\r\n */\r\n public getLifeTimeGradients(): Nullable<Array<FactorGradient>> {\r\n return this._lifeTimeGradients;\r\n }\r\n\r\n /**\r\n * Gets the current list of angular speed gradients.\r\n * You must use addAngularSpeedGradient and removeAngularSpeedGradient to update this list\r\n * @returns the list of angular speed gradients\r\n */\r\n public getAngularSpeedGradients(): Nullable<Array<FactorGradient>> {\r\n return this._angularSpeedGradients;\r\n }\r\n\r\n /**\r\n * Gets the current list of velocity gradients.\r\n * You must use addVelocityGradient and removeVelocityGradient to update this list\r\n * @returns the list of velocity gradients\r\n */\r\n public getVelocityGradients(): Nullable<Array<FactorGradient>> {\r\n return this._velocityGradients;\r\n }\r\n\r\n /**\r\n * Gets the current list of start size gradients.\r\n * You must use addStartSizeGradient and removeStartSizeGradient to update this list\r\n * @returns the list of start size gradients\r\n */\r\n public getStartSizeGradients(): Nullable<Array<FactorGradient>> {\r\n return this._startSizeGradients;\r\n }\r\n\r\n /**\r\n * Gets the current list of emit rate gradients.\r\n * You must use addEmitRateGradient and removeEmitRateGradient to update this list\r\n * @returns the list of emit rate gradients\r\n */\r\n public getEmitRateGradients(): Nullable<Array<FactorGradient>> {\r\n return this._emitRateGradients;\r\n }\r\n\r\n /**\r\n * Random direction of each particle after it has been emitted, between direction1 and direction2 vectors.\r\n * This only works when particleEmitterTyps is a BoxParticleEmitter\r\n */\r\n public get direction1(): Vector3 {\r\n if ((<BoxParticleEmitter>this.particleEmitterType).direction1) {\r\n return (<BoxParticleEmitter>this.particleEmitterType).direction1;\r\n }\r\n\r\n return Vector3.Zero();\r\n }\r\n\r\n public set direction1(value: Vector3) {\r\n if ((<BoxParticleEmitter>this.particleEmitterType).direction1) {\r\n (<BoxParticleEmitter>this.particleEmitterType).direction1 = value;\r\n }\r\n }\r\n\r\n /**\r\n * Random direction of each particle after it has been emitted, between direction1 and direction2 vectors.\r\n * This only works when particleEmitterTyps is a BoxParticleEmitter\r\n */\r\n public get direction2(): Vector3 {\r\n if ((<BoxParticleEmitter>this.particleEmitterType).direction2) {\r\n return (<BoxParticleEmitter>this.particleEmitterType).direction2;\r\n }\r\n\r\n return Vector3.Zero();\r\n }\r\n\r\n public set direction2(value: Vector3) {\r\n if ((<BoxParticleEmitter>this.particleEmitterType).direction2) {\r\n (<BoxParticleEmitter>this.particleEmitterType).direction2 = value;\r\n }\r\n }\r\n\r\n /**\r\n * Minimum box point around our emitter. Our emitter is the center of particles source, but if you want your particles to emit from more than one point, then you can tell it to do so.\r\n * This only works when particleEmitterTyps is a BoxParticleEmitter\r\n */\r\n public get minEmitBox(): Vector3 {\r\n if ((<BoxParticleEmitter>this.particleEmitterType).minEmitBox) {\r\n return (<BoxParticleEmitter>this.particleEmitterType).minEmitBox;\r\n }\r\n\r\n return Vector3.Zero();\r\n }\r\n\r\n public set minEmitBox(value: Vector3) {\r\n if ((<BoxParticleEmitter>this.particleEmitterType).minEmitBox) {\r\n (<BoxParticleEmitter>this.particleEmitterType).minEmitBox = value;\r\n }\r\n }\r\n\r\n /**\r\n * Maximum box point around our emitter. Our emitter is the center of particles source, but if you want your particles to emit from more than one point, then you can tell it to do so.\r\n * This only works when particleEmitterTyps is a BoxParticleEmitter\r\n */\r\n public get maxEmitBox(): Vector3 {\r\n if ((<BoxParticleEmitter>this.particleEmitterType).maxEmitBox) {\r\n return (<BoxParticleEmitter>this.particleEmitterType).maxEmitBox;\r\n }\r\n\r\n return Vector3.Zero();\r\n }\r\n\r\n public set maxEmitBox(value: Vector3) {\r\n if ((<BoxParticleEmitter>this.particleEmitterType).maxEmitBox) {\r\n (<BoxParticleEmitter>this.particleEmitterType).maxEmitBox = value;\r\n }\r\n }\r\n\r\n /**\r\n * Random color of each particle after it has been emitted, between color1 and color2 vectors\r\n */\r\n public color1 = new Color4(1.0, 1.0, 1.0, 1.0);\r\n /**\r\n * Random color of each particle after it has been emitted, between color1 and color2 vectors\r\n */\r\n public color2 = new Color4(1.0, 1.0, 1.0, 1.0);\r\n /**\r\n * Color the particle will have at the end of its lifetime\r\n */\r\n public colorDead = new Color4(0, 0, 0, 1.0);\r\n\r\n /**\r\n * An optional mask to filter some colors out of the texture, or filter a part of the alpha channel\r\n */\r\n public textureMask = new Color4(1.0, 1.0, 1.0, 1.0);\r\n\r\n /**\r\n * The particle emitter type defines the emitter used by the particle system.\r\n * It can be for example box, sphere, or cone...\r\n */\r\n public particleEmitterType: IParticleEmitterType;\r\n\r\n /** @internal */\r\n public _isSubEmitter = false;\r\n\r\n /** @internal */\r\n public _billboardMode = Constants.PARTICLES_BILLBOARDMODE_ALL;\r\n /**\r\n * Gets or sets the billboard mode to use when isBillboardBased = true.\r\n * Value can be: ParticleSystem.BILLBOARDMODE_ALL, ParticleSystem.BILLBOARDMODE_Y, ParticleSystem.BILLBOARDMODE_STRETCHED\r\n */\r\n public get billboardMode(): number {\r\n return this._billboardMode;\r\n }\r\n\r\n public set billboardMode(value: number) {\r\n if (this._billboardMode === value) {\r\n return;\r\n }\r\n\r\n this._billboardMode = value;\r\n this._reset();\r\n }\r\n\r\n /** @internal */\r\n public _isBillboardBased = true;\r\n /**\r\n * Gets or sets a boolean indicating if the particles must be rendered as billboard or aligned with the direction\r\n */\r\n public get isBillboardBased(): boolean {\r\n return this._isBillboardBased;\r\n }\r\n\r\n public set isBillboardBased(value: boolean) {\r\n if (this._isBillboardBased === value) {\r\n return;\r\n }\r\n\r\n this._isBillboardBased = value;\r\n this._reset();\r\n }\r\n\r\n /**\r\n * The scene the particle system belongs to.\r\n */\r\n protected _scene: Nullable<Scene>;\r\n\r\n /**\r\n * The engine the particle system belongs to.\r\n */\r\n protected _engine: AbstractEngine;\r\n\r\n /**\r\n * Local cache of defines for image processing.\r\n */\r\n protected _imageProcessingConfigurationDefines = new ImageProcessingConfigurationDefines();\r\n\r\n /**\r\n * Default configuration related to image processing available in the standard Material.\r\n */\r\n protected _imageProcessingConfiguration: Nullable<ImageProcessingConfiguration>;\r\n\r\n /**\r\n * Gets the image processing configuration used either in this material.\r\n */\r\n public get imageProcessingConfiguration(): Nullable<ImageProcessingConfiguration> {\r\n return this._imageProcessingConfiguration;\r\n }\r\n\r\n /**\r\n * Sets the Default image processing configuration used either in the this material.\r\n *\r\n * If sets to null, the scene one is in use.\r\n */\r\n public set imageProcessingConfiguration(value: Nullable<ImageProcessingConfiguration>) {\r\n this._attachImageProcessingConfiguration(value);\r\n }\r\n\r\n /**\r\n * Attaches a new image processing configuration to the Standard Material.\r\n * @param configuration\r\n */\r\n protected _attachImageProcessingConfiguration(configuration: Nullable<ImageProcessingConfiguration>): void {\r\n if (configuration === this._imageProcessingConfiguration) {\r\n return;\r\n }\r\n\r\n // Pick the scene configuration if needed.\r\n if (!configuration && this._scene) {\r\n this._imageProcessingConfiguration = this._scene.imageProcessingConfiguration;\r\n } else {\r\n this._imageProcessingConfiguration = configuration;\r\n }\r\n }\r\n\r\n /** @internal */\r\n protected _reset() {}\r\n\r\n /**\r\n * @internal\r\n */\r\n protected _removeGradientAndTexture(gradient: number, gradients: Nullable<IValueGradient[]>, texture: Nullable<RawTexture>): BaseParticleSystem {\r\n if (!gradients) {\r\n return this;\r\n }\r\n\r\n let index = 0;\r\n for (const valueGradient of gradients) {\r\n if (valueGradient.gradient === gradient) {\r\n gradients.splice(index, 1);\r\n break;\r\n }\r\n index++;\r\n }\r\n\r\n if (texture) {\r\n texture.dispose();\r\n }\r\n\r\n return this;\r\n }\r\n\r\n /**\r\n * Instantiates a particle system.\r\n * Particles are often small sprites used to simulate hard-to-reproduce phenomena like fire, smoke, water, or abstract visual effects like magic glitter and faery dust.\r\n * @param name The name of the particle system\r\n */\r\n public constructor(name: string) {\r\n this.id = name;\r\n this.name = name;\r\n }\r\n\r\n /**\r\n * Creates a Point Emitter for the particle system (emits directly from the emitter position)\r\n * @param direction1 Particles are emitted between the direction1 and direction2 from within the box\r\n * @param direction2 Particles are emitted between the direction1 and direction2 from within the box\r\n */\r\n public createPointEmitter(direction1: Vector3, direction2: Vector3): PointParticleEmitter {\r\n throw new Error(\"Method not implemented.\");\r\n }\r\n\r\n /**\r\n * Creates a Hemisphere Emitter for the particle system (emits along the hemisphere radius)\r\n * @param radius The radius of the hemisphere to emit from\r\n * @param radiusRange The range of the hemisphere to emit from [0-1] 0 Surface Only, 1 Entire Radius\r\n */\r\n public createHemisphericEmitter(radius = 1, radiusRange = 1): HemisphericParticleEmitter {\r\n throw new Error(\"Method not implemented.\");\r\n }\r\n\r\n /**\r\n * Creates a Sphere Emitter for the particle system (emits along the sphere radius)\r\n * @param radius The radius of the sphere to emit from\r\n * @param radiusRange The range of the sphere to emit from [0-1] 0 Surface Only, 1 Entire Radius\r\n */\r\n public createSphereEmitter(radius = 1, radiusRange = 1): SphereParticleEmitter {\r\n throw new Error(\"Method not implemented.\");\r\n }\r\n\r\n /**\r\n * Creates a Directed Sphere Emitter for the particle system (emits between direction1 and direction2)\r\n * @param radius The radius of the sphere to emit from\r\n * @param direction1 Particles are emitted between the direction1 and direction2 from within the sphere\r\n * @param direction2 Particles are emitted between the direction1 and direction2 from within the sphere\r\n */\r\n public createDirectedSphereEmitter(radius = 1, direction1 = new Vector3(0, 1.0, 0), direction2 = new Vector3(0, 1.0, 0)): SphereDirectedParticleEmitter {\r\n throw new Error(\"Method not implemented.\");\r\n }\r\n\r\n /**\r\n * Creates a Cylinder Emitter for the particle system (emits from the cylinder to the particle position)\r\n * @param radius The radius of the emission cylinder\r\n * @param height The height of the emission cylinder\r\n * @param radiusRange The range of emission [0-1] 0 Surface only, 1 Entire Radius\r\n * @param directionRandomizer How much to randomize the particle direction [0-1]\r\n */\r\n public createCylinderEmitter(radius = 1, height = 1, radiusRange = 1, directionRandomizer = 0): CylinderParticleEmitter {\r\n throw new Error(\"Method not implemented.\");\r\n }\r\n\r\n /**\r\n * Creates a Directed Cylinder Emitter for the particle system (emits between direction1 and direction2)\r\n * @param radius The radius of the cylinder to emit from\r\n * @param height The height of the emission cylinder\r\n * @param radiusRange the range of the emission cylinder [0-1] 0 Surface only, 1 Entire Radius (1 by default)\r\n * @param direction1 Particles are emitted between the direction1 and direction2 from within the cylinder\r\n * @param direction2 Particles are emitted between the direction1 and direction2 from within the cylinder\r\n */\r\n public createDirectedCylinderEmitter(\r\n radius = 1,\r\n height = 1,\r\n radiusRange = 1,\r\n direction1 = new Vector3(0, 1.0, 0),\r\n direction2 = new Vector3(0, 1.0, 0)\r\n ): CylinderDirectedParticleEmitter {\r\n throw new Error(\"Method not implemented.\");\r\n }\r\n\r\n /**\r\n * Creates a Cone Emitter for the particle system (emits from the cone to the particle position)\r\n * @param radius The radius of the cone to emit from\r\n * @param angle The base angle of the cone\r\n */\r\n public createConeEmitter(radius = 1, angle = Math.PI / 4): ConeParticleEmitter {\r\n throw new Error(\"Method not implemented.\");\r\n }\r\n\r\n public createDirectedConeEmitter(radius = 1, angle = Math.PI / 4, direction1 = new Vector3(0, 1.0, 0), direction2 = new Vector3(0, 1.0, 0)): ConeDirectedParticleEmitter {\r\n throw new Error(\"Method not implemented.\");\r\n }\r\n\r\n /**\r\n * Creates a Box Emitter for the particle system. (emits between direction1 and direction2 from withing the box defined by minEmitBox and maxEmitBox)\r\n * @param direction1 Particles are emitted between the direction1 and direction2 from within the box\r\n * @param direction2 Particles are emitted between the direction1 and direction2 from within the box\r\n * @param minEmitBox Particles are emitted from the box between minEmitBox and maxEmitBox\r\n * @param maxEmitBox Particles are emitted from the box between minEmitBox and maxEmitBox\r\n */\r\n public createBoxEmitter(direction1: Vector3, direction2: Vector3, minEmitBox: Vector3, maxEmitBox: Vector3): BoxParticleEmitter {\r\n throw new Error(\"Method not implemented.\");\r\n }\r\n}\r\n\r\n// Register Class Name\r\nRegisterClass(\"BABYLON.BaseParticleSystem\", BaseParticleSystem);\r\n"]}
@@ -1323,20 +1323,7 @@ export class GPUParticleSystem extends BaseParticleSystem {
1323
1323
  this._imageProcessingConfiguration.bind(effect);
1324
1324
  }
1325
1325
  // Draw order
1326
- switch (blendMode) {
1327
- case ParticleSystem.BLENDMODE_ADD:
1328
- this._engine.setAlphaMode(1);
1329
- break;
1330
- case ParticleSystem.BLENDMODE_ONEONE:
1331
- this._engine.setAlphaMode(6);
1332
- break;
1333
- case ParticleSystem.BLENDMODE_STANDARD:
1334
- this._engine.setAlphaMode(2);
1335
- break;
1336
- case ParticleSystem.BLENDMODE_MULTIPLY:
1337
- this._engine.setAlphaMode(4);
1338
- break;
1339
- }
1326
+ this._setEngineBasedOnBlendMode(blendMode);
1340
1327
  // Bind source VAO
1341
1328
  this._platform.bindDrawBuffers(this._targetIndex, effect, this._scene?.forceWireframe ? this._linesIndexBufferUseInstancing : null);
1342
1329
  if (this._onBeforeDrawParticlesObservable) {