@babylonjs/core 5.45.2 → 5.46.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 (525) hide show
  1. package/Actions/condition.js +23 -23
  2. package/Actions/condition.js.map +1 -1
  3. package/Animations/animatable.js +48 -48
  4. package/Animations/animatable.js.map +1 -1
  5. package/Animations/animation.js +53 -53
  6. package/Animations/animation.js.map +1 -1
  7. package/Animations/animationGroup.js +53 -53
  8. package/Animations/animationGroup.js.map +1 -1
  9. package/Animations/runtimeAnimation.js +36 -36
  10. package/Animations/runtimeAnimation.js.map +1 -1
  11. package/Audio/audioEngine.js +14 -14
  12. package/Audio/audioEngine.js.map +1 -1
  13. package/Audio/audioSceneComponent.js +14 -14
  14. package/Audio/audioSceneComponent.js.map +1 -1
  15. package/Audio/sound.js +47 -47
  16. package/Audio/sound.js.map +1 -1
  17. package/Behaviors/Meshes/baseSixDofDragBehavior.d.ts +1 -1
  18. package/Behaviors/Meshes/fadeInOutBehavior.js +11 -11
  19. package/Behaviors/Meshes/fadeInOutBehavior.js.map +1 -1
  20. package/Behaviors/Meshes/pointerDragBehavior.js +34 -34
  21. package/Behaviors/Meshes/pointerDragBehavior.js.map +1 -1
  22. package/Bones/bone.js +15 -15
  23. package/Bones/bone.js.map +1 -1
  24. package/Bones/boneIKController.js +9 -9
  25. package/Bones/boneIKController.js.map +1 -1
  26. package/Bones/boneLookController.js +50 -50
  27. package/Bones/boneLookController.js.map +1 -1
  28. package/Bones/skeleton.js +35 -35
  29. package/Bones/skeleton.js.map +1 -1
  30. package/Buffers/buffer.js +14 -14
  31. package/Buffers/buffer.js.map +1 -1
  32. package/Buffers/dataBuffer.js +6 -6
  33. package/Buffers/dataBuffer.js.map +1 -1
  34. package/Cameras/Inputs/freeCameraDeviceOrientationInput.js +42 -42
  35. package/Cameras/Inputs/freeCameraDeviceOrientationInput.js.map +1 -1
  36. package/Cameras/Stereoscopic/stereoscopicScreenUniversalCamera.js +18 -18
  37. package/Cameras/Stereoscopic/stereoscopicScreenUniversalCamera.js.map +1 -1
  38. package/Cameras/VR/vrExperienceHelper.js +178 -178
  39. package/Cameras/VR/vrExperienceHelper.js.map +1 -1
  40. package/Cameras/arcRotateCamera.js +176 -176
  41. package/Cameras/arcRotateCamera.js.map +1 -1
  42. package/Cameras/camera.js +90 -90
  43. package/Cameras/camera.js.map +1 -1
  44. package/Cameras/flyCamera.js +82 -82
  45. package/Cameras/flyCamera.js.map +1 -1
  46. package/Cameras/freeCamera.js +54 -54
  47. package/Cameras/freeCamera.js.map +1 -1
  48. package/Compute/computeShader.js +12 -12
  49. package/Compute/computeShader.js.map +1 -1
  50. package/Culling/ray.d.ts +1 -1
  51. package/Debug/axesViewer.js +12 -12
  52. package/Debug/axesViewer.js.map +1 -1
  53. package/Debug/debugLayer.js +21 -21
  54. package/Debug/debugLayer.js.map +1 -1
  55. package/Debug/directionalLightFrustumViewer.js +20 -20
  56. package/Debug/directionalLightFrustumViewer.js.map +1 -1
  57. package/Debug/rayHelper.js +10 -10
  58. package/Debug/rayHelper.js.map +1 -1
  59. package/Debug/skeletonViewer.js +81 -81
  60. package/Debug/skeletonViewer.js.map +1 -1
  61. package/DeviceInput/InputDevices/deviceSource.d.ts +1 -1
  62. package/DeviceInput/InputDevices/deviceSourceManager.js +31 -31
  63. package/DeviceInput/InputDevices/deviceSourceManager.js.map +1 -1
  64. package/DeviceInput/InputDevices/deviceTypes.d.ts +1 -1
  65. package/DeviceInput/internalDeviceSourceManager.d.ts +2 -2
  66. package/Engines/Extensions/engine.computeShader.d.ts +3 -3
  67. package/Engines/Extensions/engine.multiRender.js +1 -1
  68. package/Engines/Extensions/engine.multiRender.js.map +1 -1
  69. package/Engines/Extensions/engine.query.d.ts +1 -1
  70. package/Engines/Extensions/engine.renderTarget.d.ts +1 -1
  71. package/Engines/Extensions/engine.renderTarget.js +1 -1
  72. package/Engines/Extensions/engine.renderTarget.js.map +1 -1
  73. package/Engines/Native/nativeDataStream.d.ts +1 -1
  74. package/Engines/Native/nativeHardwareTexture.js +3 -3
  75. package/Engines/Native/nativeHardwareTexture.js.map +1 -1
  76. package/Engines/Native/nativeInterfaces.d.ts +5 -5
  77. package/Engines/Native/nativePipelineContext.js +7 -7
  78. package/Engines/Native/nativePipelineContext.js.map +1 -1
  79. package/Engines/Native/nativeRenderTargetWrapper.js +6 -6
  80. package/Engines/Native/nativeRenderTargetWrapper.js.map +1 -1
  81. package/Engines/Processors/shaderCodeInliner.js +4 -4
  82. package/Engines/Processors/shaderCodeInliner.js.map +1 -1
  83. package/Engines/Processors/shaderProcessingOptions.d.ts +1 -1
  84. package/Engines/WebGL/webGLHardwareTexture.js +3 -3
  85. package/Engines/WebGL/webGLHardwareTexture.js.map +1 -1
  86. package/Engines/WebGPU/webgpuBufferManager.js +3 -3
  87. package/Engines/WebGPU/webgpuBufferManager.js.map +1 -1
  88. package/Engines/WebGPU/webgpuCacheBindGroups.js +6 -6
  89. package/Engines/WebGPU/webgpuCacheBindGroups.js.map +1 -1
  90. package/Engines/WebGPU/webgpuCacheRenderPipelineTree.js +5 -5
  91. package/Engines/WebGPU/webgpuCacheRenderPipelineTree.js.map +1 -1
  92. package/Engines/WebGPU/webgpuClearQuad.js +11 -11
  93. package/Engines/WebGPU/webgpuClearQuad.js.map +1 -1
  94. package/Engines/WebGPU/webgpuComputeContext.js +7 -7
  95. package/Engines/WebGPU/webgpuComputeContext.js.map +1 -1
  96. package/Engines/WebGPU/webgpuComputePipelineContext.js +4 -4
  97. package/Engines/WebGPU/webgpuComputePipelineContext.js.map +1 -1
  98. package/Engines/WebGPU/webgpuDrawContext.js +7 -7
  99. package/Engines/WebGPU/webgpuDrawContext.js.map +1 -1
  100. package/Engines/WebGPU/webgpuHardwareTexture.js +9 -9
  101. package/Engines/WebGPU/webgpuHardwareTexture.js.map +1 -1
  102. package/Engines/WebGPU/webgpuMaterialContext.js +5 -5
  103. package/Engines/WebGPU/webgpuMaterialContext.js.map +1 -1
  104. package/Engines/WebGPU/webgpuOcclusionQuery.js +10 -10
  105. package/Engines/WebGPU/webgpuOcclusionQuery.js.map +1 -1
  106. package/Engines/WebGPU/webgpuPipelineContext.js +6 -6
  107. package/Engines/WebGPU/webgpuPipelineContext.js.map +1 -1
  108. package/Engines/WebGPU/webgpuQuerySet.js +3 -3
  109. package/Engines/WebGPU/webgpuQuerySet.js.map +1 -1
  110. package/Engines/WebGPU/webgpuShaderProcessingContext.js +3 -3
  111. package/Engines/WebGPU/webgpuShaderProcessingContext.js.map +1 -1
  112. package/Engines/WebGPU/webgpuTextureHelper.js +3 -3
  113. package/Engines/WebGPU/webgpuTextureHelper.js.map +1 -1
  114. package/Engines/WebGPU/webgpuTimestampQuery.js +3 -3
  115. package/Engines/WebGPU/webgpuTimestampQuery.js.map +1 -1
  116. package/Engines/engine.js +134 -134
  117. package/Engines/engine.js.map +1 -1
  118. package/Engines/nativeEngine.js +6 -6
  119. package/Engines/nativeEngine.js.map +1 -1
  120. package/Engines/nullEngine.js +25 -25
  121. package/Engines/nullEngine.js.map +1 -1
  122. package/Engines/renderTargetWrapper.js +25 -25
  123. package/Engines/renderTargetWrapper.js.map +1 -1
  124. package/Engines/thinEngine.js +243 -243
  125. package/Engines/thinEngine.js.map +1 -1
  126. package/Engines/webgpuEngine.js +132 -132
  127. package/Engines/webgpuEngine.js.map +1 -1
  128. package/Events/keyboardEvents.js +10 -10
  129. package/Events/keyboardEvents.js.map +1 -1
  130. package/Events/pointerEvents.js +9 -9
  131. package/Events/pointerEvents.js.map +1 -1
  132. package/Gamepads/Controllers/poseEnabledController.js +9 -9
  133. package/Gamepads/Controllers/poseEnabledController.js.map +1 -1
  134. package/Gamepads/Controllers/webVRController.js +13 -13
  135. package/Gamepads/Controllers/webVRController.js.map +1 -1
  136. package/Gamepads/gamepad.js +20 -20
  137. package/Gamepads/gamepad.js.map +1 -1
  138. package/Gizmos/axisDragGizmo.js +45 -45
  139. package/Gizmos/axisDragGizmo.js.map +1 -1
  140. package/Gizmos/axisScaleGizmo.js +12 -12
  141. package/Gizmos/axisScaleGizmo.js.map +1 -1
  142. package/Gizmos/boundingBoxGizmo.js +74 -74
  143. package/Gizmos/boundingBoxGizmo.js.map +1 -1
  144. package/Gizmos/gizmo.js +34 -34
  145. package/Gizmos/gizmo.js.map +1 -1
  146. package/Gizmos/gizmoManager.js +40 -40
  147. package/Gizmos/gizmoManager.js.map +1 -1
  148. package/Gizmos/planeDragGizmo.js +23 -23
  149. package/Gizmos/planeDragGizmo.js.map +1 -1
  150. package/Gizmos/planeRotationGizmo.js +12 -12
  151. package/Gizmos/planeRotationGizmo.js.map +1 -1
  152. package/Gizmos/positionGizmo.js +40 -40
  153. package/Gizmos/positionGizmo.js.map +1 -1
  154. package/Gizmos/rotationGizmo.js +47 -47
  155. package/Gizmos/rotationGizmo.js.map +1 -1
  156. package/Gizmos/scaleGizmo.js +41 -41
  157. package/Gizmos/scaleGizmo.js.map +1 -1
  158. package/Helpers/environmentHelper.js +18 -18
  159. package/Helpers/environmentHelper.js.map +1 -1
  160. package/Helpers/textureDome.js +96 -96
  161. package/Helpers/textureDome.js.map +1 -1
  162. package/IAccessibilityTag.d.ts +2 -2
  163. package/Instrumentation/engineInstrumentation.js +21 -21
  164. package/Instrumentation/engineInstrumentation.js.map +1 -1
  165. package/Instrumentation/sceneInstrumentation.js +90 -90
  166. package/Instrumentation/sceneInstrumentation.js.map +1 -1
  167. package/Layers/effectLayer.js +48 -48
  168. package/Layers/effectLayer.js.map +1 -1
  169. package/Layers/glowLayer.js +32 -32
  170. package/Layers/glowLayer.js.map +1 -1
  171. package/Layers/highlightLayer.js +26 -26
  172. package/Layers/highlightLayer.js.map +1 -1
  173. package/Layers/layer.js +40 -40
  174. package/Layers/layer.js.map +1 -1
  175. package/LensFlares/lensFlare.js +15 -15
  176. package/LensFlares/lensFlare.js.map +1 -1
  177. package/LensFlares/lensFlareSystem.js +4 -4
  178. package/LensFlares/lensFlareSystem.js.map +1 -1
  179. package/Lights/Shadows/cascadedShadowGenerator.js +18 -18
  180. package/Lights/Shadows/cascadedShadowGenerator.js.map +1 -1
  181. package/Lights/Shadows/shadowGenerator.js +115 -115
  182. package/Lights/Shadows/shadowGenerator.js.map +1 -1
  183. package/Lights/directionalLight.js +31 -31
  184. package/Lights/directionalLight.js.map +1 -1
  185. package/Lights/light.js +72 -72
  186. package/Lights/light.js.map +1 -1
  187. package/Lights/pointLight.js +18 -18
  188. package/Lights/pointLight.js.map +1 -1
  189. package/Lights/spotLight.js +30 -30
  190. package/Lights/spotLight.js.map +1 -1
  191. package/Loading/sceneLoader.d.ts +1 -1
  192. package/Materials/Background/backgroundMaterial.js +124 -124
  193. package/Materials/Background/backgroundMaterial.js.map +1 -1
  194. package/Materials/Node/Blocks/Dual/imageSourceBlock.js +8 -8
  195. package/Materials/Node/Blocks/Dual/imageSourceBlock.js.map +1 -1
  196. package/Materials/Node/Blocks/Dual/lightBlock.js +14 -14
  197. package/Materials/Node/Blocks/Dual/lightBlock.js.map +1 -1
  198. package/Materials/Node/Blocks/Dual/reflectionTextureBaseBlock.js +9 -9
  199. package/Materials/Node/Blocks/Dual/reflectionTextureBaseBlock.js.map +1 -1
  200. package/Materials/Node/Blocks/Dual/textureBlock.js +26 -26
  201. package/Materials/Node/Blocks/Dual/textureBlock.js.map +1 -1
  202. package/Materials/Node/Blocks/Input/inputBlock.js +34 -34
  203. package/Materials/Node/Blocks/Input/inputBlock.js.map +1 -1
  204. package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.js +14 -14
  205. package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.js.map +1 -1
  206. package/Materials/Node/Blocks/PBR/reflectionBlock.js +16 -16
  207. package/Materials/Node/Blocks/PBR/reflectionBlock.js.map +1 -1
  208. package/Materials/Node/Blocks/customBlock.js +7 -7
  209. package/Materials/Node/Blocks/customBlock.js.map +1 -1
  210. package/Materials/Node/Blocks/gradientBlock.js +13 -13
  211. package/Materials/Node/Blocks/gradientBlock.js.map +1 -1
  212. package/Materials/Node/Blocks/triPlanarBlock.js +30 -30
  213. package/Materials/Node/Blocks/triPlanarBlock.js.map +1 -1
  214. package/Materials/Node/nodeMaterial.d.ts +1 -1
  215. package/Materials/Node/nodeMaterial.js +60 -60
  216. package/Materials/Node/nodeMaterial.js.map +1 -1
  217. package/Materials/Node/nodeMaterialBlock.js +35 -35
  218. package/Materials/Node/nodeMaterialBlock.js.map +1 -1
  219. package/Materials/Node/nodeMaterialBlockConnectionPoint.js +50 -50
  220. package/Materials/Node/nodeMaterialBlockConnectionPoint.js.map +1 -1
  221. package/Materials/PBR/pbrAnisotropicConfiguration.js +5 -5
  222. package/Materials/PBR/pbrAnisotropicConfiguration.js.map +1 -1
  223. package/Materials/PBR/pbrBRDFConfiguration.js +4 -4
  224. package/Materials/PBR/pbrBRDFConfiguration.js.map +1 -1
  225. package/Materials/PBR/pbrBaseMaterial.js +52 -52
  226. package/Materials/PBR/pbrBaseMaterial.js.map +1 -1
  227. package/Materials/PBR/pbrBaseSimpleMaterial.js +17 -17
  228. package/Materials/PBR/pbrBaseSimpleMaterial.js.map +1 -1
  229. package/Materials/PBR/pbrClearCoatConfiguration.js +5 -5
  230. package/Materials/PBR/pbrClearCoatConfiguration.js.map +1 -1
  231. package/Materials/PBR/pbrIridescenceConfiguration.js +5 -5
  232. package/Materials/PBR/pbrIridescenceConfiguration.js.map +1 -1
  233. package/Materials/PBR/pbrMaterial.js +209 -209
  234. package/Materials/PBR/pbrMaterial.js.map +1 -1
  235. package/Materials/PBR/pbrSheenConfiguration.js +5 -5
  236. package/Materials/PBR/pbrSheenConfiguration.js.map +1 -1
  237. package/Materials/PBR/pbrSpecularGlossinessMaterial.js +6 -6
  238. package/Materials/PBR/pbrSpecularGlossinessMaterial.js.map +1 -1
  239. package/Materials/PBR/pbrSubSurfaceConfiguration.js +51 -51
  240. package/Materials/PBR/pbrSubSurfaceConfiguration.js.map +1 -1
  241. package/Materials/Textures/baseTexture.js +99 -99
  242. package/Materials/Textures/baseTexture.js.map +1 -1
  243. package/Materials/Textures/cubeTexture.js +61 -61
  244. package/Materials/Textures/cubeTexture.js.map +1 -1
  245. package/Materials/Textures/externalTexture.js +16 -16
  246. package/Materials/Textures/externalTexture.js.map +1 -1
  247. package/Materials/Textures/hdrCubeTexture.js +44 -44
  248. package/Materials/Textures/hdrCubeTexture.js.map +1 -1
  249. package/Materials/Textures/internalTexture.js +31 -31
  250. package/Materials/Textures/internalTexture.js.map +1 -1
  251. package/Materials/Textures/mirrorTexture.js +73 -73
  252. package/Materials/Textures/mirrorTexture.js.map +1 -1
  253. package/Materials/Textures/multiRenderTarget.js +47 -47
  254. package/Materials/Textures/multiRenderTarget.js.map +1 -1
  255. package/Materials/Textures/rawTexture2DArray.js +6 -6
  256. package/Materials/Textures/rawTexture2DArray.js.map +1 -1
  257. package/Materials/Textures/renderTargetTexture.js +142 -142
  258. package/Materials/Textures/renderTargetTexture.js.map +1 -1
  259. package/Materials/Textures/texture.d.ts +1 -1
  260. package/Materials/Textures/texture.js +26 -26
  261. package/Materials/Textures/texture.js.map +1 -1
  262. package/Materials/Textures/textureCreationOptions.d.ts +1 -1
  263. package/Materials/Textures/textureSampler.js +20 -20
  264. package/Materials/Textures/textureSampler.js.map +1 -1
  265. package/Materials/Textures/thinRenderTargetTexture.js +6 -6
  266. package/Materials/Textures/thinRenderTargetTexture.js.map +1 -1
  267. package/Materials/Textures/thinTexture.js +39 -39
  268. package/Materials/Textures/thinTexture.js.map +1 -1
  269. package/Materials/Textures/videoTexture.js +40 -40
  270. package/Materials/Textures/videoTexture.js.map +1 -1
  271. package/Materials/drawWrapper.js +6 -6
  272. package/Materials/drawWrapper.js.map +1 -1
  273. package/Materials/effect.js +18 -18
  274. package/Materials/effect.js.map +1 -1
  275. package/Materials/effectRenderer.js +9 -9
  276. package/Materials/effectRenderer.js.map +1 -1
  277. package/Materials/fresnelParameters.d.ts +2 -2
  278. package/Materials/fresnelParameters.js +13 -13
  279. package/Materials/fresnelParameters.js.map +1 -1
  280. package/Materials/material.detailMapConfiguration.js +5 -5
  281. package/Materials/material.detailMapConfiguration.js.map +1 -1
  282. package/Materials/material.js +223 -223
  283. package/Materials/material.js.map +1 -1
  284. package/Materials/materialPluginBase.js +5 -5
  285. package/Materials/materialPluginBase.js.map +1 -1
  286. package/Materials/materialPluginEvent.d.ts +14 -14
  287. package/Materials/materialPluginManager.d.ts +1 -1
  288. package/Materials/multiMaterial.js +16 -16
  289. package/Materials/multiMaterial.js.map +1 -1
  290. package/Materials/shadowDepthWrapper.js +14 -14
  291. package/Materials/shadowDepthWrapper.js.map +1 -1
  292. package/Materials/standardMaterial.js +100 -100
  293. package/Materials/standardMaterial.js.map +1 -1
  294. package/Materials/uniformBufferEffectCommonAccessor.js +3 -3
  295. package/Materials/uniformBufferEffectCommonAccessor.js.map +1 -1
  296. package/Maths/math.functions.js +2 -0
  297. package/Maths/math.functions.js.map +1 -1
  298. package/Maths/math.path.js +11 -11
  299. package/Maths/math.path.js.map +1 -1
  300. package/Maths/math.vector.d.ts +6 -7
  301. package/Maths/math.vector.js +48 -48
  302. package/Maths/math.vector.js.map +1 -1
  303. package/Meshes/Builders/goldbergBuilder.d.ts +2 -2
  304. package/Meshes/Compression/dracoCompression.js +23 -23
  305. package/Meshes/Compression/dracoCompression.js.map +1 -1
  306. package/Meshes/Compression/meshoptCompression.js +9 -9
  307. package/Meshes/Compression/meshoptCompression.js.map +1 -1
  308. package/Meshes/abstractMesh.js +179 -179
  309. package/Meshes/abstractMesh.js.map +1 -1
  310. package/Meshes/geometry.js +32 -32
  311. package/Meshes/geometry.js.map +1 -1
  312. package/Meshes/goldbergMesh.d.ts +1 -1
  313. package/Meshes/linesMesh.js +3 -3
  314. package/Meshes/linesMesh.js.map +1 -1
  315. package/Meshes/mesh.js +165 -165
  316. package/Meshes/mesh.js.map +1 -1
  317. package/Meshes/mesh.vertexData.js.map +1 -1
  318. package/Meshes/polygonMesh.js +5 -5
  319. package/Meshes/polygonMesh.js.map +1 -1
  320. package/Meshes/subMesh.js +59 -59
  321. package/Meshes/subMesh.js.map +1 -1
  322. package/Meshes/transformNode.js +52 -52
  323. package/Meshes/transformNode.js.map +1 -1
  324. package/Misc/PerformanceViewer/performanceViewerCollectionStrategies.d.ts +1 -1
  325. package/Misc/PerformanceViewer/performanceViewerCollector.js +12 -12
  326. package/Misc/PerformanceViewer/performanceViewerCollector.js.map +1 -1
  327. package/Misc/arrayTools.d.ts +1 -1
  328. package/Misc/copyTextureToTexture.js +3 -3
  329. package/Misc/copyTextureToTexture.js.map +1 -1
  330. package/Misc/coroutine.d.ts +5 -5
  331. package/Misc/deferred.js +9 -9
  332. package/Misc/deferred.js.map +1 -1
  333. package/Misc/depthReducer.js +7 -7
  334. package/Misc/depthReducer.js.map +1 -1
  335. package/Misc/environmentTextureTools.d.ts +1 -1
  336. package/Misc/error.d.ts +1 -1
  337. package/Misc/fileTools.d.ts +5 -5
  338. package/Misc/filesInput.js +6 -6
  339. package/Misc/filesInput.js.map +1 -1
  340. package/Misc/khronosTextureContainer2.js +9 -9
  341. package/Misc/khronosTextureContainer2.js.map +1 -1
  342. package/Misc/observable.js +12 -12
  343. package/Misc/observable.js.map +1 -1
  344. package/Misc/perfCounter.js +16 -16
  345. package/Misc/perfCounter.js.map +1 -1
  346. package/Misc/sceneOptimizer.js +76 -76
  347. package/Misc/sceneOptimizer.js.map +1 -1
  348. package/Misc/stringDictionary.d.ts +1 -1
  349. package/Misc/trajectoryClassifier.js +67 -67
  350. package/Misc/trajectoryClassifier.js.map +1 -1
  351. package/Misc/videoRecorder.js +15 -15
  352. package/Misc/videoRecorder.js.map +1 -1
  353. package/Misc/virtualJoystick.js +12 -12
  354. package/Misc/virtualJoystick.js.map +1 -1
  355. package/Morph/morphTarget.js +28 -28
  356. package/Morph/morphTarget.js.map +1 -1
  357. package/Morph/morphTargetManager.js +18 -18
  358. package/Morph/morphTargetManager.js.map +1 -1
  359. package/Offline/database.js +12 -12
  360. package/Offline/database.js.map +1 -1
  361. package/Particles/EmitterTypes/coneParticleEmitter.js +25 -25
  362. package/Particles/EmitterTypes/coneParticleEmitter.js.map +1 -1
  363. package/Particles/EmitterTypes/meshParticleEmitter.js +20 -20
  364. package/Particles/EmitterTypes/meshParticleEmitter.js.map +1 -1
  365. package/Particles/baseParticleSystem.js +232 -232
  366. package/Particles/baseParticleSystem.js.map +1 -1
  367. package/Particles/cloudPoint.js +9 -9
  368. package/Particles/cloudPoint.js.map +1 -1
  369. package/Particles/gpuParticleSystem.js +123 -123
  370. package/Particles/gpuParticleSystem.js.map +1 -1
  371. package/Particles/particleSystem.js +102 -102
  372. package/Particles/particleSystem.js.map +1 -1
  373. package/Particles/pointsCloudSystem.js +18 -18
  374. package/Particles/pointsCloudSystem.js.map +1 -1
  375. package/Particles/solidParticle.js +23 -23
  376. package/Particles/solidParticle.js.map +1 -1
  377. package/Physics/v1/physicsEngine.js +14 -14
  378. package/Physics/v1/physicsEngine.js.map +1 -1
  379. package/Physics/v1/physicsImpostor.js +149 -149
  380. package/Physics/v1/physicsImpostor.js.map +1 -1
  381. package/Physics/v2/physicsEngine.js +14 -14
  382. package/Physics/v2/physicsEngine.js.map +1 -1
  383. package/PostProcesses/RenderPipeline/Pipelines/defaultRenderingPipeline.js +129 -129
  384. package/PostProcesses/RenderPipeline/Pipelines/defaultRenderingPipeline.js.map +1 -1
  385. package/PostProcesses/RenderPipeline/Pipelines/ssao2RenderingPipeline.js +68 -68
  386. package/PostProcesses/RenderPipeline/Pipelines/ssao2RenderingPipeline.js.map +1 -1
  387. package/PostProcesses/RenderPipeline/Pipelines/ssaoRenderingPipeline.js +6 -6
  388. package/PostProcesses/RenderPipeline/Pipelines/ssaoRenderingPipeline.js.map +1 -1
  389. package/PostProcesses/RenderPipeline/Pipelines/standardRenderingPipeline.js +226 -225
  390. package/PostProcesses/RenderPipeline/Pipelines/standardRenderingPipeline.js.map +1 -1
  391. package/PostProcesses/RenderPipeline/postProcessRenderPipeline.js +10 -10
  392. package/PostProcesses/RenderPipeline/postProcessRenderPipeline.js.map +1 -1
  393. package/PostProcesses/anaglyphPostProcess.js +7 -7
  394. package/PostProcesses/anaglyphPostProcess.js.map +1 -1
  395. package/PostProcesses/blackAndWhitePostProcess.js +7 -7
  396. package/PostProcesses/blackAndWhitePostProcess.js.map +1 -1
  397. package/PostProcesses/bloomEffect.js +28 -28
  398. package/PostProcesses/bloomEffect.js.map +1 -1
  399. package/PostProcesses/bloomMergePostProcess.js +7 -7
  400. package/PostProcesses/bloomMergePostProcess.js.map +1 -1
  401. package/PostProcesses/blurPostProcess.js +32 -32
  402. package/PostProcesses/blurPostProcess.js.map +1 -1
  403. package/PostProcesses/chromaticAberrationPostProcess.js +7 -7
  404. package/PostProcesses/chromaticAberrationPostProcess.js.map +1 -1
  405. package/PostProcesses/circleOfConfusionPostProcess.js +7 -7
  406. package/PostProcesses/circleOfConfusionPostProcess.js.map +1 -1
  407. package/PostProcesses/colorCorrectionPostProcess.js +7 -7
  408. package/PostProcesses/colorCorrectionPostProcess.js.map +1 -1
  409. package/PostProcesses/convolutionPostProcess.js +7 -7
  410. package/PostProcesses/convolutionPostProcess.js.map +1 -1
  411. package/PostProcesses/depthOfFieldBlurPostProcess.js +7 -7
  412. package/PostProcesses/depthOfFieldBlurPostProcess.js.map +1 -1
  413. package/PostProcesses/depthOfFieldEffect.js +36 -36
  414. package/PostProcesses/depthOfFieldEffect.js.map +1 -1
  415. package/PostProcesses/depthOfFieldMergePostProcess.js +7 -7
  416. package/PostProcesses/depthOfFieldMergePostProcess.js.map +1 -1
  417. package/PostProcesses/extractHighlightsPostProcess.js +7 -7
  418. package/PostProcesses/extractHighlightsPostProcess.js.map +1 -1
  419. package/PostProcesses/filterPostProcess.js +7 -7
  420. package/PostProcesses/filterPostProcess.js.map +1 -1
  421. package/PostProcesses/grainPostProcess.js +7 -7
  422. package/PostProcesses/grainPostProcess.js.map +1 -1
  423. package/PostProcesses/imageProcessingPostProcess.js +42 -42
  424. package/PostProcesses/imageProcessingPostProcess.js.map +1 -1
  425. package/PostProcesses/motionBlurPostProcess.js +41 -41
  426. package/PostProcesses/motionBlurPostProcess.js.map +1 -1
  427. package/PostProcesses/passPostProcess.js +15 -15
  428. package/PostProcesses/passPostProcess.js.map +1 -1
  429. package/PostProcesses/postProcess.d.ts +2 -2
  430. package/PostProcesses/postProcess.js +123 -123
  431. package/PostProcesses/postProcess.js.map +1 -1
  432. package/PostProcesses/refractionPostProcess.js +21 -21
  433. package/PostProcesses/refractionPostProcess.js.map +1 -1
  434. package/PostProcesses/screenSpaceCurvaturePostProcess.js +7 -7
  435. package/PostProcesses/screenSpaceCurvaturePostProcess.js.map +1 -1
  436. package/PostProcesses/screenSpaceReflectionPostProcess.js +19 -19
  437. package/PostProcesses/screenSpaceReflectionPostProcess.js.map +1 -1
  438. package/PostProcesses/sharpenPostProcess.js +7 -7
  439. package/PostProcesses/sharpenPostProcess.js.map +1 -1
  440. package/PostProcesses/stereoscopicInterlacePostProcess.js +14 -14
  441. package/PostProcesses/stereoscopicInterlacePostProcess.js.map +1 -1
  442. package/PostProcesses/tonemapPostProcess.js +7 -7
  443. package/PostProcesses/tonemapPostProcess.js.map +1 -1
  444. package/PostProcesses/volumetricLightScatteringPostProcess.js +11 -11
  445. package/PostProcesses/volumetricLightScatteringPostProcess.js.map +1 -1
  446. package/PostProcesses/vrDistortionCorrectionPostProcess.js +7 -7
  447. package/PostProcesses/vrDistortionCorrectionPostProcess.js.map +1 -1
  448. package/Rendering/depthPeelingRenderer.js +36 -36
  449. package/Rendering/depthPeelingRenderer.js.map +1 -1
  450. package/Rendering/depthRenderer.js +8 -8
  451. package/Rendering/depthRenderer.js.map +1 -1
  452. package/Rendering/edgesRenderer.js +34 -34
  453. package/Rendering/edgesRenderer.js.map +1 -1
  454. package/Rendering/fluidRenderer/fluidRenderer.js +8 -8
  455. package/Rendering/fluidRenderer/fluidRenderer.js.map +1 -1
  456. package/Rendering/fluidRenderer/fluidRenderingDepthTextureCopy.js +3 -3
  457. package/Rendering/fluidRenderer/fluidRenderingDepthTextureCopy.js.map +1 -1
  458. package/Rendering/fluidRenderer/fluidRenderingObject.js +19 -19
  459. package/Rendering/fluidRenderer/fluidRenderingObject.js.map +1 -1
  460. package/Rendering/fluidRenderer/fluidRenderingObjectCustomParticles.js +12 -12
  461. package/Rendering/fluidRenderer/fluidRenderingObjectCustomParticles.js.map +1 -1
  462. package/Rendering/fluidRenderer/fluidRenderingObjectParticleSystem.js +18 -18
  463. package/Rendering/fluidRenderer/fluidRenderingObjectParticleSystem.js.map +1 -1
  464. package/Rendering/fluidRenderer/fluidRenderingTargetRenderer.js +68 -68
  465. package/Rendering/fluidRenderer/fluidRenderingTargetRenderer.js.map +1 -1
  466. package/Rendering/fluidRenderer/fluidRenderingTextures.js +29 -29
  467. package/Rendering/fluidRenderer/fluidRenderingTextures.js.map +1 -1
  468. package/Rendering/geometryBufferRenderer.js +44 -44
  469. package/Rendering/geometryBufferRenderer.js.map +1 -1
  470. package/Rendering/prePassRenderer.js +51 -51
  471. package/Rendering/prePassRenderer.js.map +1 -1
  472. package/Rendering/renderingGroup.js +25 -25
  473. package/Rendering/renderingGroup.js.map +1 -1
  474. package/Rendering/renderingManager.js +21 -21
  475. package/Rendering/renderingManager.js.map +1 -1
  476. package/Rendering/subSurfaceConfiguration.js +18 -18
  477. package/Rendering/subSurfaceConfiguration.js.map +1 -1
  478. package/Rendering/utilityLayerRenderer.js +76 -76
  479. package/Rendering/utilityLayerRenderer.js.map +1 -1
  480. package/Sprites/sprite.js +16 -16
  481. package/Sprites/sprite.js.map +1 -1
  482. package/Sprites/spriteManager.js +81 -81
  483. package/Sprites/spriteManager.js.map +1 -1
  484. package/Sprites/spriteMap.js +32 -32
  485. package/Sprites/spriteMap.js.map +1 -1
  486. package/Sprites/spriteRenderer.js +6 -6
  487. package/Sprites/spriteRenderer.js.map +1 -1
  488. package/Sprites/thinSprite.js +22 -22
  489. package/Sprites/thinSprite.js.map +1 -1
  490. package/States/stencilStateComposer.js +10 -10
  491. package/States/stencilStateComposer.js.map +1 -1
  492. package/XR/features/WebXRAnchorSystem.js +7 -7
  493. package/XR/features/WebXRAnchorSystem.js.map +1 -1
  494. package/XR/features/WebXRControllerMovement.d.ts +3 -3
  495. package/XR/features/WebXRControllerMovement.js +97 -97
  496. package/XR/features/WebXRControllerMovement.js.map +1 -1
  497. package/XR/features/WebXRControllerPhysics.js +24 -24
  498. package/XR/features/WebXRControllerPhysics.js.map +1 -1
  499. package/XR/features/WebXRControllerTeleportation.js +26 -26
  500. package/XR/features/WebXRControllerTeleportation.js.map +1 -1
  501. package/XR/features/WebXRDOMOverlay.d.ts +1 -1
  502. package/XR/features/WebXRFeaturePointSystem.js +6 -6
  503. package/XR/features/WebXRFeaturePointSystem.js.map +1 -1
  504. package/XR/features/WebXRHandTracking.d.ts +1 -1
  505. package/XR/features/WebXRHandTracking.js +95 -95
  506. package/XR/features/WebXRHandTracking.js.map +1 -1
  507. package/XR/features/WebXRWalkingLocomotion.js +21 -21
  508. package/XR/features/WebXRWalkingLocomotion.js.map +1 -1
  509. package/XR/motionController/webXRAbstractMotionController.d.ts +3 -3
  510. package/XR/motionController/webXRMotionControllerManager.d.ts +1 -1
  511. package/XR/native/nativeXRFrame.js +3 -3
  512. package/XR/native/nativeXRFrame.js.map +1 -1
  513. package/XR/webXRFeaturesManager.d.ts +1 -1
  514. package/XR/webXRLayerWrapper.d.ts +2 -2
  515. package/XR/webXRLayerWrapper.js +17 -17
  516. package/XR/webXRLayerWrapper.js.map +1 -1
  517. package/abstractScene.d.ts +2 -2
  518. package/node.d.ts +1 -1
  519. package/node.js +71 -71
  520. package/node.js.map +1 -1
  521. package/package.json +1 -1
  522. package/scene.js +777 -777
  523. package/scene.js.map +1 -1
  524. package/sceneComponent.d.ts +12 -12
  525. package/types.d.ts +11 -11
@@ -1 +1 @@
1
- {"version":3,"file":"baseParticleSystem.js","sourceRoot":"","sources":["../../../../lts/core/generated/Particles/baseParticleSystem.ts"],"names":[],"mappings":"AAEA,OA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mBAAmB,GAAG,eAAe,CAAC;QAC3C,OAAO,eAAe,CAAC;IAC3B,CAAC;IAED;;;;;;;OAOG;IACI,gBAAgB,CAAC,UAAmB,EAAE,UAAmB,EAAE,UAAmB,EAAE,UAAmB;QACtG,MAAM,eAAe,GAAG,IAAI,kBAAkB,EAAE,CAAC;QACjD,IAAI,CAAC,mBAAmB,GAAG,eAAe,CAAC;QAC3C,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,OAAO,eAAe,CAAC;IAC3B,CAAC;;AAhzBD;;GAEG;AACW,mCAAgB,GAAG,CAAC,CAAC;AACnC;;GAEG;AACW,qCAAkB,GAAG,CAAC,CAAC;AACrC;;GAEG;AACW,gCAAa,GAAG,CAAC,CAAC;AAChC;;GAEG;AACW,qCAAkB,GAAG,CAAC,CAAC;AAErC;;GAEG;AACW,wCAAqB,GAAG,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\";\r\nimport type { ColorGradient, FactorGradient, Color3Gradient, IValueGradient } from \"../Misc/gradients\";\r\nimport type { IParticleEmitterType } from \"../Particles/EmitterTypes/index\";\r\nimport {\r\n BoxParticleEmitter,\r\n PointParticleEmitter,\r\n HemisphericParticleEmitter,\r\n SphereParticleEmitter,\r\n SphereDirectedParticleEmitter,\r\n CylinderParticleEmitter,\r\n CylinderDirectedParticleEmitter,\r\n ConeParticleEmitter,\r\n} from \"../Particles/EmitterTypes/index\";\r\nimport { Constants } from \"../Engines/constants\";\r\nimport type { BaseTexture } from \"../Materials/Textures/baseTexture\";\r\nimport { Color4 } from \"../Maths/math.color\";\r\nimport type { ThinEngine } from \"../Engines/thinEngine\";\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\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 /** @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: ThinEngine;\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 * @returns the emitter\r\n */\r\n public createPointEmitter(direction1: Vector3, direction2: Vector3): PointParticleEmitter {\r\n const particleEmitter = new PointParticleEmitter();\r\n particleEmitter.direction1 = direction1;\r\n particleEmitter.direction2 = direction2;\r\n\r\n this.particleEmitterType = particleEmitter;\r\n return particleEmitter;\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 * @returns the emitter\r\n */\r\n public createHemisphericEmitter(radius = 1, radiusRange = 1): HemisphericParticleEmitter {\r\n const particleEmitter = new HemisphericParticleEmitter(radius, radiusRange);\r\n this.particleEmitterType = particleEmitter;\r\n return particleEmitter;\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 * @returns the emitter\r\n */\r\n public createSphereEmitter(radius = 1, radiusRange = 1): SphereParticleEmitter {\r\n const particleEmitter = new SphereParticleEmitter(radius, radiusRange);\r\n this.particleEmitterType = particleEmitter;\r\n return particleEmitter;\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 * @returns the emitter\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 const particleEmitter = new SphereDirectedParticleEmitter(radius, direction1, direction2);\r\n this.particleEmitterType = particleEmitter;\r\n return particleEmitter;\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 * @returns the emitter\r\n */\r\n public createCylinderEmitter(radius = 1, height = 1, radiusRange = 1, directionRandomizer = 0): CylinderParticleEmitter {\r\n const particleEmitter = new CylinderParticleEmitter(radius, height, radiusRange, directionRandomizer);\r\n this.particleEmitterType = particleEmitter;\r\n return particleEmitter;\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 * @returns the emitter\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 const particleEmitter = new CylinderDirectedParticleEmitter(radius, height, radiusRange, direction1, direction2);\r\n this.particleEmitterType = particleEmitter;\r\n return particleEmitter;\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 * @returns the emitter\r\n */\r\n public createConeEmitter(radius = 1, angle = Math.PI / 4): ConeParticleEmitter {\r\n const particleEmitter = new ConeParticleEmitter(radius, angle);\r\n this.particleEmitterType = particleEmitter;\r\n return particleEmitter;\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 * @returns the emitter\r\n */\r\n public createBoxEmitter(direction1: Vector3, direction2: Vector3, minEmitBox: Vector3, maxEmitBox: Vector3): BoxParticleEmitter {\r\n const particleEmitter = new BoxParticleEmitter();\r\n this.particleEmitterType = particleEmitter;\r\n this.direction1 = direction1;\r\n this.direction2 = direction2;\r\n this.minEmitBox = minEmitBox;\r\n this.maxEmitBox = maxEmitBox;\r\n return particleEmitter;\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"baseParticleSystem.js","sourceRoot":"","sources":["../../../../lts/core/generated/Particles/baseParticleSystem.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAGxD,OAAO,EAAE,mCAAmC,EAAE,MAAM,2CAA2C,CAAC;AAGhG,OAAO,EACH,kBAAkB,EAClB,oBAAoB,EACpB,0BAA0B,EAC1B,qBAAqB,EACrB,6BAA6B,EAC7B,uBAAuB,EACvB,+BAA+B,EAC/B,mBAAmB,GACtB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEjD,OAAO,EAAE,MAAM,EAAE,MAAM,qB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,UAAU,CAAC;QAC7B,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,OAAO,eAAe,CAAC;IAC3B,CAAC;;AAhzBD;;GAEG;AACW,mCAAgB,GAAG,CAAC,CAAC;AACnC;;GAEG;AACW,qCAAkB,GAAG,CAAC,CAAC;AACrC;;GAEG;AACW,gCAAa,GAAG,CAAC,CAAC;AAChC;;GAEG;AACW,qCAAkB,GAAG,CAAC,CAAC;AAErC;;GAEG;AACW,wCAAqB,GAAG,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\";\r\nimport type { ColorGradient, FactorGradient, Color3Gradient, IValueGradient } from \"../Misc/gradients\";\r\nimport type { IParticleEmitterType } from \"../Particles/EmitterTypes/index\";\r\nimport {\r\n BoxParticleEmitter,\r\n PointParticleEmitter,\r\n HemisphericParticleEmitter,\r\n SphereParticleEmitter,\r\n SphereDirectedParticleEmitter,\r\n CylinderParticleEmitter,\r\n CylinderDirectedParticleEmitter,\r\n ConeParticleEmitter,\r\n} from \"../Particles/EmitterTypes/index\";\r\nimport { Constants } from \"../Engines/constants\";\r\nimport type { BaseTexture } from \"../Materials/Textures/baseTexture\";\r\nimport { Color4 } from \"../Maths/math.color\";\r\nimport type { ThinEngine } from \"../Engines/thinEngine\";\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\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 /** @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: ThinEngine;\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 * @returns the emitter\r\n */\r\n public createPointEmitter(direction1: Vector3, direction2: Vector3): PointParticleEmitter {\r\n const particleEmitter = new PointParticleEmitter();\r\n particleEmitter.direction1 = direction1;\r\n particleEmitter.direction2 = direction2;\r\n\r\n this.particleEmitterType = particleEmitter;\r\n return particleEmitter;\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 * @returns the emitter\r\n */\r\n public createHemisphericEmitter(radius = 1, radiusRange = 1): HemisphericParticleEmitter {\r\n const particleEmitter = new HemisphericParticleEmitter(radius, radiusRange);\r\n this.particleEmitterType = particleEmitter;\r\n return particleEmitter;\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 * @returns the emitter\r\n */\r\n public createSphereEmitter(radius = 1, radiusRange = 1): SphereParticleEmitter {\r\n const particleEmitter = new SphereParticleEmitter(radius, radiusRange);\r\n this.particleEmitterType = particleEmitter;\r\n return particleEmitter;\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 * @returns the emitter\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 const particleEmitter = new SphereDirectedParticleEmitter(radius, direction1, direction2);\r\n this.particleEmitterType = particleEmitter;\r\n return particleEmitter;\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 * @returns the emitter\r\n */\r\n public createCylinderEmitter(radius = 1, height = 1, radiusRange = 1, directionRandomizer = 0): CylinderParticleEmitter {\r\n const particleEmitter = new CylinderParticleEmitter(radius, height, radiusRange, directionRandomizer);\r\n this.particleEmitterType = particleEmitter;\r\n return particleEmitter;\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 * @returns the emitter\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 const particleEmitter = new CylinderDirectedParticleEmitter(radius, height, radiusRange, direction1, direction2);\r\n this.particleEmitterType = particleEmitter;\r\n return particleEmitter;\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 * @returns the emitter\r\n */\r\n public createConeEmitter(radius = 1, angle = Math.PI / 4): ConeParticleEmitter {\r\n const particleEmitter = new ConeParticleEmitter(radius, angle);\r\n this.particleEmitterType = particleEmitter;\r\n return particleEmitter;\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 * @returns the emitter\r\n */\r\n public createBoxEmitter(direction1: Vector3, direction2: Vector3, minEmitBox: Vector3, maxEmitBox: Vector3): BoxParticleEmitter {\r\n const particleEmitter = new BoxParticleEmitter();\r\n this.particleEmitterType = particleEmitter;\r\n this.direction1 = direction1;\r\n this.direction2 = direction2;\r\n this.minEmitBox = minEmitBox;\r\n this.maxEmitBox = maxEmitBox;\r\n return particleEmitter;\r\n }\r\n}\r\n"]}
@@ -162,15 +162,6 @@ export class CloudPoint {
162
162
  * * PCS internal tool, don't use it manually.
163
163
  */
164
164
  export class PointsGroup {
165
- /**
166
- * Creates a points group object. This is an internal reference to produce particles for the PCS.
167
- * PCS internal tool, don't use it manually.
168
- * @internal
169
- */
170
- constructor(id, posFunction) {
171
- this.groupId = id;
172
- this._positionFunction = posFunction;
173
- }
174
165
  /**
175
166
  * Get or set the groupId
176
167
  * @deprecated Please use groupId instead
@@ -181,5 +172,14 @@ export class PointsGroup {
181
172
  set groupID(groupID) {
182
173
  this.groupId = groupID;
183
174
  }
175
+ /**
176
+ * Creates a points group object. This is an internal reference to produce particles for the PCS.
177
+ * PCS internal tool, don't use it manually.
178
+ * @internal
179
+ */
180
+ constructor(id, posFunction) {
181
+ this.groupId = id;
182
+ this._positionFunction = posFunction;
183
+ }
184
184
  }
185
185
  //# sourceMappingURL=cloudPoint.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"cloudPoint.js","sourceRoot":"","sources":["../../../../lts/core/generated/Particles/cloudPoint.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAIjF;;GAEG;AACH,MAAM,OAAO,UAAU;IAsFnB;;;;;;;;OAQG;IACH,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;OAGG;IACH,IAAW,OAAO;QACd,OAAO,IAAI,CAAC,OAAO,CAAC;IACxB,CAAC;IACD,IAAW,OAAO,CAAC,OAAe;QAC9B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IAC3B,CAAC;CA8CJ","sourcesContent":["import type { Nullable } from \"../types\";\r\nimport type { Matrix } from \"../Maths/math\";\r\nimport { Color4, Vector2, Vector3, TmpVectors, Quaternion } from \"../Maths/math\";\r\nimport type { Mesh } from \"../Meshes/mesh\";\r\nimport type { BoundingInfo } from \"../Culling/boundingInfo\";\r\nimport type { PointsCloudSystem } from \"./pointsCloudSystem\";\r\n/**\r\n * Represents one particle of a points cloud system.\r\n */\r\nexport class CloudPoint {\r\n /**\r\n * particle global index\r\n */\r\n public idx: number = 0;\r\n /**\r\n * The color of the particle\r\n */\r\n public color: Nullable<Color4> = new Color4(1.0, 1.0, 1.0, 1.0);\r\n /**\r\n * The world space position of the particle.\r\n */\r\n public position: Vector3 = Vector3.Zero();\r\n /**\r\n * The world space rotation of the particle. (Not use if rotationQuaternion is set)\r\n */\r\n public rotation: Vector3 = Vector3.Zero();\r\n /**\r\n * The world space rotation quaternion of the particle.\r\n */\r\n public rotationQuaternion: Nullable<Quaternion>;\r\n /**\r\n * The uv of the particle.\r\n */\r\n public uv: Nullable<Vector2> = new Vector2(0.0, 0.0);\r\n /**\r\n * The current speed of the particle.\r\n */\r\n public velocity: Vector3 = Vector3.Zero();\r\n /**\r\n * The pivot point in the particle local space.\r\n */\r\n public pivot: Vector3 = Vector3.Zero();\r\n /**\r\n * Must the particle be translated from its pivot point in its local space ?\r\n * In this case, the pivot point is set at the origin of the particle local space and the particle is translated.\r\n * Default : false\r\n */\r\n public translateFromPivot: boolean = false;\r\n /**\r\n * Index of this particle in the global \"positions\" array (Internal use)\r\n * @internal\r\n */\r\n public _pos: number = 0;\r\n /**\r\n * @internal Index of this particle in the global \"indices\" array (Internal use)\r\n */\r\n public _ind: number = 0;\r\n /**\r\n * Group this particle belongs to\r\n */\r\n public _group: PointsGroup;\r\n /**\r\n * Group id of this particle\r\n */\r\n public groupId: number = 0;\r\n /**\r\n * Index of the particle in its group id (Internal use)\r\n */\r\n public idxInGroup: number = 0;\r\n /**\r\n * @internal Particle BoundingInfo object (Internal use)\r\n */\r\n public _boundingInfo: BoundingInfo;\r\n /**\r\n * @internal Reference to the PCS that the particle belongs to (Internal use)\r\n */\r\n public _pcs: PointsCloudSystem;\r\n /**\r\n * @internal Still set as invisible in order to skip useless computations (Internal use)\r\n */\r\n public _stillInvisible: boolean = false;\r\n /**\r\n * @internal Last computed particle rotation matrix\r\n */\r\n public _rotationMatrix: number[] = [1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0];\r\n /**\r\n * Parent particle Id, if any.\r\n * Default null.\r\n */\r\n public parentId: Nullable<number> = null;\r\n /**\r\n * @internal Internal global position in the PCS.\r\n */\r\n public _globalPosition: Vector3 = Vector3.Zero();\r\n\r\n /**\r\n * Creates a Point Cloud object.\r\n * Don't create particles manually, use instead the PCS internal tools like _addParticle()\r\n * @param particleIndex (integer) is the particle index in the PCS pool. It's also the particle identifier.\r\n * @param group (PointsGroup) is the group the particle belongs to\r\n * @param groupId (integer) is the group identifier in the PCS.\r\n * @param idxInGroup (integer) is the index of the particle in the current point group (ex: the 10th point of addPoints(30))\r\n * @param pcs defines the PCS it is associated to\r\n */\r\n constructor(particleIndex: number, group: PointsGroup, groupId: number, idxInGroup: number, pcs: PointsCloudSystem) {\r\n this.idx = particleIndex;\r\n this._group = group;\r\n this.groupId = groupId;\r\n this.idxInGroup = idxInGroup;\r\n this._pcs = pcs;\r\n }\r\n\r\n /**\r\n * get point size\r\n */\r\n public get size(): Vector3 {\r\n return this.size;\r\n }\r\n\r\n /**\r\n * Set point size\r\n */\r\n public set size(scale: Vector3) {\r\n this.size = scale;\r\n }\r\n\r\n /**\r\n * Legacy support, changed quaternion to rotationQuaternion\r\n */\r\n public get quaternion(): Nullable<Quaternion> {\r\n return this.rotationQuaternion;\r\n }\r\n\r\n /**\r\n * Legacy support, changed quaternion to rotationQuaternion\r\n */\r\n public set quaternion(q: Nullable<Quaternion>) {\r\n this.rotationQuaternion = q;\r\n }\r\n\r\n /**\r\n * Returns a boolean. True if the particle intersects a mesh, else false\r\n * The intersection is computed on the particle position and Axis Aligned Bounding Box (AABB) or Sphere\r\n * @param target is the object (point or mesh) what the intersection is computed against\r\n * @param isSphere is boolean flag when false (default) bounding box of mesh is used, when true the bounding sphere is used\r\n * @returns true if it intersects\r\n */\r\n public intersectsMesh(target: Mesh, isSphere: boolean): boolean {\r\n if (!target.hasBoundingInfo) {\r\n return false;\r\n }\r\n\r\n if (!this._pcs.mesh) {\r\n throw new Error(\"Point Cloud System doesnt contain the Mesh\");\r\n }\r\n\r\n if (isSphere) {\r\n return target.getBoundingInfo().boundingSphere.intersectsPoint(this.position.add(this._pcs.mesh.position));\r\n }\r\n\r\n const bbox = target.getBoundingInfo().boundingBox;\r\n\r\n const maxX = bbox.maximumWorld.x;\r\n const minX = bbox.minimumWorld.x;\r\n const maxY = bbox.maximumWorld.y;\r\n const minY = bbox.minimumWorld.y;\r\n const maxZ = bbox.maximumWorld.z;\r\n const minZ = bbox.minimumWorld.z;\r\n\r\n const x = this.position.x + this._pcs.mesh.position.x;\r\n const y = this.position.y + this._pcs.mesh.position.y;\r\n const z = this.position.z + this._pcs.mesh.position.z;\r\n\r\n return minX <= x && x <= maxX && minY <= y && y <= maxY && minZ <= z && z <= maxZ;\r\n }\r\n\r\n /**\r\n * get the rotation matrix of the particle\r\n * @internal\r\n */\r\n public getRotationMatrix(m: Matrix) {\r\n let quaternion: Quaternion;\r\n if (this.rotationQuaternion) {\r\n quaternion = this.rotationQuaternion;\r\n } else {\r\n quaternion = TmpVectors.Quaternion[0];\r\n const rotation = this.rotation;\r\n Quaternion.RotationYawPitchRollToRef(rotation.y, rotation.x, rotation.z, quaternion);\r\n }\r\n\r\n quaternion.toRotationMatrix(m);\r\n }\r\n}\r\n\r\n/**\r\n * Represents a group of points in a points cloud system\r\n * * PCS internal tool, don't use it manually.\r\n */\r\nexport class PointsGroup {\r\n /**\r\n * Get or set the groupId\r\n * @deprecated Please use groupId instead\r\n */\r\n public get groupID(): number {\r\n return this.groupId;\r\n }\r\n public set groupID(groupID: number) {\r\n this.groupId = groupID;\r\n }\r\n /**\r\n * The group id\r\n * @internal\r\n */\r\n public groupId: number;\r\n /**\r\n * image data for group (internal use)\r\n * @internal\r\n */\r\n public _groupImageData: Nullable<ArrayBufferView>;\r\n /**\r\n * Image Width (internal use)\r\n * @internal\r\n */\r\n public _groupImgWidth: number;\r\n /**\r\n * Image Height (internal use)\r\n * @internal\r\n */\r\n public _groupImgHeight: number;\r\n /**\r\n * Custom position function (internal use)\r\n * @internal\r\n */\r\n public _positionFunction: Nullable<(particle: CloudPoint, i?: number, s?: number) => void>;\r\n /**\r\n * density per facet for surface points\r\n * @internal\r\n */\r\n public _groupDensity: number[];\r\n /**\r\n * Only when points are colored by texture carries pointer to texture list array\r\n * @internal\r\n */\r\n public _textureNb: number;\r\n\r\n /**\r\n * Creates a points group object. This is an internal reference to produce particles for the PCS.\r\n * PCS internal tool, don't use it manually.\r\n * @internal\r\n */\r\n constructor(id: number, posFunction: Nullable<(particle: CloudPoint, i?: number, s?: number) => void>) {\r\n this.groupId = id;\r\n this._positionFunction = posFunction;\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"cloudPoint.js","sourceRoot":"","sources":["../../../../lts/core/generated/Particles/cloudPoint.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAIjF;;GAEG;AACH,MAAM,OAAO,UAAU;IAsFnB;;;;;;;;OAQG;IACH,YAAY,aAAqB,EAAE,KAAkB,EAAE,OAAe,EAAE,UAAkB,EAAE,GAAsB;QA9FlH;;WAEG;QACI,QAAG,GAAW,CAAC,CAAC;QACvB;;W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AAiB,GAAG,WAAW,CAAC;IACzC,CAAC;CACJ","sourcesContent":["import type { Nullable } from \"../types\";\r\nimport type { Matrix } from \"../Maths/math\";\r\nimport { Color4, Vector2, Vector3, TmpVectors, Quaternion } from \"../Maths/math\";\r\nimport type { Mesh } from \"../Meshes/mesh\";\r\nimport type { BoundingInfo } from \"../Culling/boundingInfo\";\r\nimport type { PointsCloudSystem } from \"./pointsCloudSystem\";\r\n/**\r\n * Represents one particle of a points cloud system.\r\n */\r\nexport class CloudPoint {\r\n /**\r\n * particle global index\r\n */\r\n public idx: number = 0;\r\n /**\r\n * The color of the particle\r\n */\r\n public color: Nullable<Color4> = new Color4(1.0, 1.0, 1.0, 1.0);\r\n /**\r\n * The world space position of the particle.\r\n */\r\n public position: Vector3 = Vector3.Zero();\r\n /**\r\n * The world space rotation of the particle. (Not use if rotationQuaternion is set)\r\n */\r\n public rotation: Vector3 = Vector3.Zero();\r\n /**\r\n * The world space rotation quaternion of the particle.\r\n */\r\n public rotationQuaternion: Nullable<Quaternion>;\r\n /**\r\n * The uv of the particle.\r\n */\r\n public uv: Nullable<Vector2> = new Vector2(0.0, 0.0);\r\n /**\r\n * The current speed of the particle.\r\n */\r\n public velocity: Vector3 = Vector3.Zero();\r\n /**\r\n * The pivot point in the particle local space.\r\n */\r\n public pivot: Vector3 = Vector3.Zero();\r\n /**\r\n * Must the particle be translated from its pivot point in its local space ?\r\n * In this case, the pivot point is set at the origin of the particle local space and the particle is translated.\r\n * Default : false\r\n */\r\n public translateFromPivot: boolean = false;\r\n /**\r\n * Index of this particle in the global \"positions\" array (Internal use)\r\n * @internal\r\n */\r\n public _pos: number = 0;\r\n /**\r\n * @internal Index of this particle in the global \"indices\" array (Internal use)\r\n */\r\n public _ind: number = 0;\r\n /**\r\n * Group this particle belongs to\r\n */\r\n public _group: PointsGroup;\r\n /**\r\n * Group id of this particle\r\n */\r\n public groupId: number = 0;\r\n /**\r\n * Index of the particle in its group id (Internal use)\r\n */\r\n public idxInGroup: number = 0;\r\n /**\r\n * @internal Particle BoundingInfo object (Internal use)\r\n */\r\n public _boundingInfo: BoundingInfo;\r\n /**\r\n * @internal Reference to the PCS that the particle belongs to (Internal use)\r\n */\r\n public _pcs: PointsCloudSystem;\r\n /**\r\n * @internal Still set as invisible in order to skip useless computations (Internal use)\r\n */\r\n public _stillInvisible: boolean = false;\r\n /**\r\n * @internal Last computed particle rotation matrix\r\n */\r\n public _rotationMatrix: number[] = [1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0];\r\n /**\r\n * Parent particle Id, if any.\r\n * Default null.\r\n */\r\n public parentId: Nullable<number> = null;\r\n /**\r\n * @internal Internal global position in the PCS.\r\n */\r\n public _globalPosition: Vector3 = Vector3.Zero();\r\n\r\n /**\r\n * Creates a Point Cloud object.\r\n * Don't create particles manually, use instead the PCS internal tools like _addParticle()\r\n * @param particleIndex (integer) is the particle index in the PCS pool. It's also the particle identifier.\r\n * @param group (PointsGroup) is the group the particle belongs to\r\n * @param groupId (integer) is the group identifier in the PCS.\r\n * @param idxInGroup (integer) is the index of the particle in the current point group (ex: the 10th point of addPoints(30))\r\n * @param pcs defines the PCS it is associated to\r\n */\r\n constructor(particleIndex: number, group: PointsGroup, groupId: number, idxInGroup: number, pcs: PointsCloudSystem) {\r\n this.idx = particleIndex;\r\n this._group = group;\r\n this.groupId = groupId;\r\n this.idxInGroup = idxInGroup;\r\n this._pcs = pcs;\r\n }\r\n\r\n /**\r\n * get point size\r\n */\r\n public get size(): Vector3 {\r\n return this.size;\r\n }\r\n\r\n /**\r\n * Set point size\r\n */\r\n public set size(scale: Vector3) {\r\n this.size = scale;\r\n }\r\n\r\n /**\r\n * Legacy support, changed quaternion to rotationQuaternion\r\n */\r\n public get quaternion(): Nullable<Quaternion> {\r\n return this.rotationQuaternion;\r\n }\r\n\r\n /**\r\n * Legacy support, changed quaternion to rotationQuaternion\r\n */\r\n public set quaternion(q: Nullable<Quaternion>) {\r\n this.rotationQuaternion = q;\r\n }\r\n\r\n /**\r\n * Returns a boolean. True if the particle intersects a mesh, else false\r\n * The intersection is computed on the particle position and Axis Aligned Bounding Box (AABB) or Sphere\r\n * @param target is the object (point or mesh) what the intersection is computed against\r\n * @param isSphere is boolean flag when false (default) bounding box of mesh is used, when true the bounding sphere is used\r\n * @returns true if it intersects\r\n */\r\n public intersectsMesh(target: Mesh, isSphere: boolean): boolean {\r\n if (!target.hasBoundingInfo) {\r\n return false;\r\n }\r\n\r\n if (!this._pcs.mesh) {\r\n throw new Error(\"Point Cloud System doesnt contain the Mesh\");\r\n }\r\n\r\n if (isSphere) {\r\n return target.getBoundingInfo().boundingSphere.intersectsPoint(this.position.add(this._pcs.mesh.position));\r\n }\r\n\r\n const bbox = target.getBoundingInfo().boundingBox;\r\n\r\n const maxX = bbox.maximumWorld.x;\r\n const minX = bbox.minimumWorld.x;\r\n const maxY = bbox.maximumWorld.y;\r\n const minY = bbox.minimumWorld.y;\r\n const maxZ = bbox.maximumWorld.z;\r\n const minZ = bbox.minimumWorld.z;\r\n\r\n const x = this.position.x + this._pcs.mesh.position.x;\r\n const y = this.position.y + this._pcs.mesh.position.y;\r\n const z = this.position.z + this._pcs.mesh.position.z;\r\n\r\n return minX <= x && x <= maxX && minY <= y && y <= maxY && minZ <= z && z <= maxZ;\r\n }\r\n\r\n /**\r\n * get the rotation matrix of the particle\r\n * @internal\r\n */\r\n public getRotationMatrix(m: Matrix) {\r\n let quaternion: Quaternion;\r\n if (this.rotationQuaternion) {\r\n quaternion = this.rotationQuaternion;\r\n } else {\r\n quaternion = TmpVectors.Quaternion[0];\r\n const rotation = this.rotation;\r\n Quaternion.RotationYawPitchRollToRef(rotation.y, rotation.x, rotation.z, quaternion);\r\n }\r\n\r\n quaternion.toRotationMatrix(m);\r\n }\r\n}\r\n\r\n/**\r\n * Represents a group of points in a points cloud system\r\n * * PCS internal tool, don't use it manually.\r\n */\r\nexport class PointsGroup {\r\n /**\r\n * Get or set the groupId\r\n * @deprecated Please use groupId instead\r\n */\r\n public get groupID(): number {\r\n return this.groupId;\r\n }\r\n public set groupID(groupID: number) {\r\n this.groupId = groupID;\r\n }\r\n /**\r\n * The group id\r\n * @internal\r\n */\r\n public groupId: number;\r\n /**\r\n * image data for group (internal use)\r\n * @internal\r\n */\r\n public _groupImageData: Nullable<ArrayBufferView>;\r\n /**\r\n * Image Width (internal use)\r\n * @internal\r\n */\r\n public _groupImgWidth: number;\r\n /**\r\n * Image Height (internal use)\r\n * @internal\r\n */\r\n public _groupImgHeight: number;\r\n /**\r\n * Custom position function (internal use)\r\n * @internal\r\n */\r\n public _positionFunction: Nullable<(particle: CloudPoint, i?: number, s?: number) => void>;\r\n /**\r\n * density per facet for surface points\r\n * @internal\r\n */\r\n public _groupDensity: number[];\r\n /**\r\n * Only when points are colored by texture carries pointer to texture list array\r\n * @internal\r\n */\r\n public _textureNb: number;\r\n\r\n /**\r\n * Creates a points group object. This is an internal reference to produce particles for the PCS.\r\n * PCS internal tool, don't use it manually.\r\n * @internal\r\n */\r\n constructor(id: number, posFunction: Nullable<(particle: CloudPoint, i?: number, s?: number) => void>) {\r\n this.groupId = id;\r\n this._positionFunction = posFunction;\r\n }\r\n}\r\n"]}
@@ -25,129 +25,6 @@ import { addClipPlaneUniforms, bindClipPlane, prepareDefinesForClipPlanes } from
25
25
  * @see https://www.babylonjs-playground.com/#PU4WYI#4
26
26
  */
27
27
  export class GPUParticleSystem extends BaseParticleSystem {
28
- /**
29
- * Instantiates a GPU particle system.
30
- * 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.
31
- * @param name The name of the particle system
32
- * @param options The options used to create the system
33
- * @param sceneOrEngine The scene the particle system belongs to or the engine to use if no scene
34
- * @param customEffect a custom effect used to change the way particles are rendered by default
35
- * @param isAnimationSheetEnabled Must be true if using a spritesheet to animate the particles texture
36
- */
37
- constructor(name, options, sceneOrEngine, customEffect = null, isAnimationSheetEnabled = false) {
38
- super(name);
39
- /**
40
- * The layer mask we are rendering the particles through.
41
- */
42
- this.layerMask = 0x0fffffff;
43
- this._accumulatedCount = 0;
44
- this._renderVertexBuffers = [];
45
- this._targetIndex = 0;
46
- this._currentRenderId = -1;
47
- this._currentRenderingCameraUniqueId = -1;
48
- this._started = false;
49
- this._stopped = false;
50
- this._timeDelta = 0;
51
- /** Indicates that the update of particles is done in the animate function (and not in render). Default: false */
52
- this.updateInAnimate = false;
53
- this._actualFrame = 0;
54
- this._rawTextureWidth = 256;
55
- /**
56
- * An event triggered when the system is disposed.
57
- */
58
- this.onDisposeObservable = new Observable();
59
- /**
60
- * An event triggered when the system is stopped
61
- */
62
- this.onStoppedObservable = new Observable();
63
- /**
64
- * Forces the particle to write their depth information to the depth buffer. This can help preventing other draw calls
65
- * to override the particles.
66
- */
67
- this.forceDepthWrite = false;
68
- this._preWarmDone = false;
69
- /**
70
- * Specifies if the particles are updated in emitter local space or world space.
71
- */
72
- this.isLocal = false;
73
- /** Indicates that the particle system is GPU based */
74
- this.isGPU = true;
75
- /** @internal */
76
- this._onBeforeDrawParticlesObservable = null;
77
- if (!sceneOrEngine || sceneOrEngine.getClassName() === "Scene") {
78
- this._scene = sceneOrEngine || EngineStore.LastCreatedScene;
79
- this._engine = this._scene.getEngine();
80
- this.uniqueId = this._scene.getUniqueId();
81
- this._scene.particleSystems.push(this);
82
- }
83
- else {
84
- this._engine = sceneOrEngine;
85
- this.defaultProjectionMatrix = Matrix.PerspectiveFovLH(0.8, 1, 0.1, 100, this._engine.isNDCHalfZRange);
86
- }
87
- if (this._engine.getCaps().supportComputeShaders) {
88
- if (!GetClass("BABYLON.ComputeShaderParticleSystem")) {
89
- throw new Error("The ComputeShaderParticleSystem class is not available! Make sure you have imported it.");
90
- }
91
- this._platform = new (GetClass("BABYLON.ComputeShaderParticleSystem"))(this, this._engine);
92
- }
93
- else {
94
- if (!GetClass("BABYLON.WebGL2ParticleSystem")) {
95
- throw new Error("The WebGL2ParticleSystem class is not available! Make sure you have imported it.");
96
- }
97
- this._platform = new (GetClass("BABYLON.WebGL2ParticleSystem"))(this, this._engine);
98
- }
99
- this._customWrappers = { 0: new DrawWrapper(this._engine) };
100
- this._customWrappers[0].effect = customEffect;
101
- this._drawWrappers = { 0: new DrawWrapper(this._engine) };
102
- if (this._drawWrappers[0].drawContext) {
103
- this._drawWrappers[0].drawContext.useInstancing = true;
104
- }
105
- // Setup the default processing configuration to the scene.
106
- this._attachImageProcessingConfiguration(null);
107
- options = options !== null && options !== void 0 ? options : {};
108
- if (!options.randomTextureSize) {
109
- delete options.randomTextureSize;
110
- }
111
- const fullOptions = {
112
- capacity: 50000,
113
- randomTextureSize: this._engine.getCaps().maxTextureSize,
114
- ...options,
115
- };
116
- const optionsAsNumber = options;
117
- if (isFinite(optionsAsNumber)) {
118
- fullOptions.capacity = optionsAsNumber;
119
- }
120
- this._capacity = fullOptions.capacity;
121
- this._activeCount = fullOptions.capacity;
122
- this._currentActiveCount = 0;
123
- this._isAnimationSheetEnabled = isAnimationSheetEnabled;
124
- this.particleEmitterType = new BoxParticleEmitter();
125
- // Random data
126
- const maxTextureSize = Math.min(this._engine.getCaps().maxTextureSize, fullOptions.randomTextureSize);
127
- let d = [];
128
- for (let i = 0; i < maxTextureSize; ++i) {
129
- d.push(Math.random());
130
- d.push(Math.random());
131
- d.push(Math.random());
132
- d.push(Math.random());
133
- }
134
- this._randomTexture = new RawTexture(new Float32Array(d), maxTextureSize, 1, 5, sceneOrEngine, false, false, 1, 1);
135
- this._randomTexture.name = "GPUParticleSystem_random1";
136
- this._randomTexture.wrapU = 1;
137
- this._randomTexture.wrapV = 1;
138
- d = [];
139
- for (let i = 0; i < maxTextureSize; ++i) {
140
- d.push(Math.random());
141
- d.push(Math.random());
142
- d.push(Math.random());
143
- d.push(Math.random());
144
- }
145
- this._randomTexture2 = new RawTexture(new Float32Array(d), maxTextureSize, 1, 5, sceneOrEngine, false, false, 1, 1);
146
- this._randomTexture2.name = "GPUParticleSystem_random2";
147
- this._randomTexture2.wrapU = 1;
148
- this._randomTexture2.wrapV = 1;
149
- this._randomTextureSize = maxTextureSize;
150
- }
151
28
  /**
152
29
  * Gets a boolean indicating if the GPU particles can be rendered on current browser
153
30
  */
@@ -667,6 +544,129 @@ export class GPUParticleSystem extends BaseParticleSystem {
667
544
  //Not supported by GPUParticleSystem
668
545
  return this;
669
546
  }
547
+ /**
548
+ * Instantiates a GPU particle system.
549
+ * 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.
550
+ * @param name The name of the particle system
551
+ * @param options The options used to create the system
552
+ * @param sceneOrEngine The scene the particle system belongs to or the engine to use if no scene
553
+ * @param customEffect a custom effect used to change the way particles are rendered by default
554
+ * @param isAnimationSheetEnabled Must be true if using a spritesheet to animate the particles texture
555
+ */
556
+ constructor(name, options, sceneOrEngine, customEffect = null, isAnimationSheetEnabled = false) {
557
+ super(name);
558
+ /**
559
+ * The layer mask we are rendering the particles through.
560
+ */
561
+ this.layerMask = 0x0fffffff;
562
+ this._accumulatedCount = 0;
563
+ this._renderVertexBuffers = [];
564
+ this._targetIndex = 0;
565
+ this._currentRenderId = -1;
566
+ this._currentRenderingCameraUniqueId = -1;
567
+ this._started = false;
568
+ this._stopped = false;
569
+ this._timeDelta = 0;
570
+ /** Indicates that the update of particles is done in the animate function (and not in render). Default: false */
571
+ this.updateInAnimate = false;
572
+ this._actualFrame = 0;
573
+ this._rawTextureWidth = 256;
574
+ /**
575
+ * An event triggered when the system is disposed.
576
+ */
577
+ this.onDisposeObservable = new Observable();
578
+ /**
579
+ * An event triggered when the system is stopped
580
+ */
581
+ this.onStoppedObservable = new Observable();
582
+ /**
583
+ * Forces the particle to write their depth information to the depth buffer. This can help preventing other draw calls
584
+ * to override the particles.
585
+ */
586
+ this.forceDepthWrite = false;
587
+ this._preWarmDone = false;
588
+ /**
589
+ * Specifies if the particles are updated in emitter local space or world space.
590
+ */
591
+ this.isLocal = false;
592
+ /** Indicates that the particle system is GPU based */
593
+ this.isGPU = true;
594
+ /** @internal */
595
+ this._onBeforeDrawParticlesObservable = null;
596
+ if (!sceneOrEngine || sceneOrEngine.getClassName() === "Scene") {
597
+ this._scene = sceneOrEngine || EngineStore.LastCreatedScene;
598
+ this._engine = this._scene.getEngine();
599
+ this.uniqueId = this._scene.getUniqueId();
600
+ this._scene.particleSystems.push(this);
601
+ }
602
+ else {
603
+ this._engine = sceneOrEngine;
604
+ this.defaultProjectionMatrix = Matrix.PerspectiveFovLH(0.8, 1, 0.1, 100, this._engine.isNDCHalfZRange);
605
+ }
606
+ if (this._engine.getCaps().supportComputeShaders) {
607
+ if (!GetClass("BABYLON.ComputeShaderParticleSystem")) {
608
+ throw new Error("The ComputeShaderParticleSystem class is not available! Make sure you have imported it.");
609
+ }
610
+ this._platform = new (GetClass("BABYLON.ComputeShaderParticleSystem"))(this, this._engine);
611
+ }
612
+ else {
613
+ if (!GetClass("BABYLON.WebGL2ParticleSystem")) {
614
+ throw new Error("The WebGL2ParticleSystem class is not available! Make sure you have imported it.");
615
+ }
616
+ this._platform = new (GetClass("BABYLON.WebGL2ParticleSystem"))(this, this._engine);
617
+ }
618
+ this._customWrappers = { 0: new DrawWrapper(this._engine) };
619
+ this._customWrappers[0].effect = customEffect;
620
+ this._drawWrappers = { 0: new DrawWrapper(this._engine) };
621
+ if (this._drawWrappers[0].drawContext) {
622
+ this._drawWrappers[0].drawContext.useInstancing = true;
623
+ }
624
+ // Setup the default processing configuration to the scene.
625
+ this._attachImageProcessingConfiguration(null);
626
+ options = options !== null && options !== void 0 ? options : {};
627
+ if (!options.randomTextureSize) {
628
+ delete options.randomTextureSize;
629
+ }
630
+ const fullOptions = {
631
+ capacity: 50000,
632
+ randomTextureSize: this._engine.getCaps().maxTextureSize,
633
+ ...options,
634
+ };
635
+ const optionsAsNumber = options;
636
+ if (isFinite(optionsAsNumber)) {
637
+ fullOptions.capacity = optionsAsNumber;
638
+ }
639
+ this._capacity = fullOptions.capacity;
640
+ this._activeCount = fullOptions.capacity;
641
+ this._currentActiveCount = 0;
642
+ this._isAnimationSheetEnabled = isAnimationSheetEnabled;
643
+ this.particleEmitterType = new BoxParticleEmitter();
644
+ // Random data
645
+ const maxTextureSize = Math.min(this._engine.getCaps().maxTextureSize, fullOptions.randomTextureSize);
646
+ let d = [];
647
+ for (let i = 0; i < maxTextureSize; ++i) {
648
+ d.push(Math.random());
649
+ d.push(Math.random());
650
+ d.push(Math.random());
651
+ d.push(Math.random());
652
+ }
653
+ this._randomTexture = new RawTexture(new Float32Array(d), maxTextureSize, 1, 5, sceneOrEngine, false, false, 1, 1);
654
+ this._randomTexture.name = "GPUParticleSystem_random1";
655
+ this._randomTexture.wrapU = 1;
656
+ this._randomTexture.wrapV = 1;
657
+ d = [];
658
+ for (let i = 0; i < maxTextureSize; ++i) {
659
+ d.push(Math.random());
660
+ d.push(Math.random());
661
+ d.push(Math.random());
662
+ d.push(Math.random());
663
+ }
664
+ this._randomTexture2 = new RawTexture(new Float32Array(d), maxTextureSize, 1, 5, sceneOrEngine, false, false, 1, 1);
665
+ this._randomTexture2.name = "GPUParticleSystem_random2";
666
+ this._randomTexture2.wrapU = 1;
667
+ this._randomTexture2.wrapV = 1;
668
+ this._randomTextureSize = maxTextureSize;
669
+ }
670
670
  _reset() {
671
671
  this._releaseBuffers();
672
672
  }