@babylonjs/core 6.7.0 → 6.8.1

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 (412) hide show
  1. package/Actions/abstractActionManager.js.map +1 -1
  2. package/Actions/action.js.map +1 -1
  3. package/Animations/animation.js.map +1 -1
  4. package/Animations/animationGroup.d.ts +5 -0
  5. package/Animations/animationGroup.js +12 -0
  6. package/Animations/animationGroup.js.map +1 -1
  7. package/Animations/easing.js.map +1 -1
  8. package/Audio/audioSceneComponent.js.map +1 -1
  9. package/Audio/sound.js.map +1 -1
  10. package/BakedVertexAnimation/bakedVertexAnimationManager.js.map +1 -1
  11. package/Behaviors/Cameras/bouncingBehavior.js.map +1 -1
  12. package/Behaviors/Cameras/framingBehavior.js.map +1 -1
  13. package/Behaviors/Meshes/fadeInOutBehavior.js.map +1 -1
  14. package/Behaviors/Meshes/pointerDragBehavior.js.map +1 -1
  15. package/Bones/bone.js.map +1 -1
  16. package/Bones/boneIKController.js.map +1 -1
  17. package/Bones/boneLookController.js.map +1 -1
  18. package/Buffers/dataBuffer.js.map +1 -1
  19. package/Cameras/Inputs/BaseCameraMouseWheelInput.js.map +1 -1
  20. package/Cameras/Inputs/BaseCameraPointersInput.js.map +1 -1
  21. package/Cameras/Inputs/arcRotateCameraGamepadInput.js.map +1 -1
  22. package/Cameras/Inputs/arcRotateCameraKeyboardMoveInput.js.map +1 -1
  23. package/Cameras/Inputs/arcRotateCameraMouseWheelInput.js.map +1 -1
  24. package/Cameras/Inputs/arcRotateCameraPointersInput.js.map +1 -1
  25. package/Cameras/Inputs/flyCameraKeyboardInput.js.map +1 -1
  26. package/Cameras/Inputs/flyCameraMouseInput.js.map +1 -1
  27. package/Cameras/Inputs/followCameraKeyboardMoveInput.js.map +1 -1
  28. package/Cameras/Inputs/followCameraMouseWheelInput.js.map +1 -1
  29. package/Cameras/Inputs/followCameraPointersInput.js.map +1 -1
  30. package/Cameras/Inputs/freeCameraGamepadInput.js.map +1 -1
  31. package/Cameras/Inputs/freeCameraKeyboardMoveInput.js.map +1 -1
  32. package/Cameras/Inputs/freeCameraMouseInput.js.map +1 -1
  33. package/Cameras/Inputs/freeCameraTouchInput.js.map +1 -1
  34. package/Cameras/VR/vrExperienceHelper.js.map +1 -1
  35. package/Cameras/arcRotateCamera.js.map +1 -1
  36. package/Cameras/camera.js.map +1 -1
  37. package/Cameras/flyCamera.js.map +1 -1
  38. package/Cameras/followCamera.js.map +1 -1
  39. package/Cameras/freeCamera.js.map +1 -1
  40. package/Cameras/targetCamera.js.map +1 -1
  41. package/Collisions/collider.js.map +1 -1
  42. package/Compute/computeEffect.js.map +1 -1
  43. package/Compute/computeShader.js +1 -5
  44. package/Compute/computeShader.js.map +1 -1
  45. package/Culling/Octrees/octree.js.map +1 -1
  46. package/Culling/boundingBox.js.map +1 -1
  47. package/Culling/boundingInfo.js.map +1 -1
  48. package/Culling/boundingSphere.js.map +1 -1
  49. package/Culling/ray.d.ts +7 -2
  50. package/Culling/ray.js +8 -3
  51. package/Culling/ray.js.map +1 -1
  52. package/Debug/debugLayer.js +1 -9
  53. package/Debug/debugLayer.js.map +1 -1
  54. package/Debug/skeletonViewer.js.map +1 -1
  55. package/Engines/Extensions/engine.cubeTexture.js +1 -6
  56. package/Engines/Extensions/engine.cubeTexture.js.map +1 -1
  57. package/Engines/Extensions/engine.multiRender.js.map +1 -1
  58. package/Engines/Extensions/engine.multiview.d.ts +6 -1
  59. package/Engines/Extensions/engine.multiview.js +27 -7
  60. package/Engines/Extensions/engine.multiview.js.map +1 -1
  61. package/Engines/Extensions/engine.renderTarget.js +1 -6
  62. package/Engines/Extensions/engine.renderTarget.js.map +1 -1
  63. package/Engines/Extensions/engine.renderTargetCube.js +1 -9
  64. package/Engines/Extensions/engine.renderTargetCube.js.map +1 -1
  65. package/Engines/Extensions/engine.webVR.js +1 -5
  66. package/Engines/Extensions/engine.webVR.js.map +1 -1
  67. package/Engines/Native/nativeInterfaces.d.ts +1 -0
  68. package/Engines/Native/nativeInterfaces.js.map +1 -1
  69. package/Engines/Processors/Expressions/Operators/shaderDefineArithmeticOperator.js +3 -0
  70. package/Engines/Processors/Expressions/Operators/shaderDefineArithmeticOperator.js.map +1 -1
  71. package/Engines/Processors/Expressions/shaderDefineExpression.d.ts +37 -0
  72. package/Engines/Processors/Expressions/shaderDefineExpression.js +57 -0
  73. package/Engines/Processors/Expressions/shaderDefineExpression.js.map +1 -1
  74. package/Engines/Processors/shaderCodeInliner.js.map +1 -1
  75. package/Engines/Processors/shaderProcessor.js +34 -14
  76. package/Engines/Processors/shaderProcessor.js.map +1 -1
  77. package/Engines/WebGL/webGLRenderTargetWrapper.d.ts +19 -0
  78. package/Engines/WebGL/webGLRenderTargetWrapper.js +20 -1
  79. package/Engines/WebGL/webGLRenderTargetWrapper.js.map +1 -1
  80. package/Engines/WebGPU/Extensions/engine.cubeTexture.js +1 -7
  81. package/Engines/WebGPU/Extensions/engine.cubeTexture.js.map +1 -1
  82. package/Engines/WebGPU/Extensions/engine.renderTarget.js +1 -8
  83. package/Engines/WebGPU/Extensions/engine.renderTarget.js.map +1 -1
  84. package/Engines/WebGPU/Extensions/engine.renderTargetCube.js +1 -10
  85. package/Engines/WebGPU/Extensions/engine.renderTargetCube.js.map +1 -1
  86. package/Engines/WebGPU/webgpuCacheBindGroups.js.map +1 -1
  87. package/Engines/WebGPU/webgpuCacheRenderPipeline.js.map +1 -1
  88. package/Engines/WebGPU/webgpuCacheSampler.js +1 -6
  89. package/Engines/WebGPU/webgpuCacheSampler.js.map +1 -1
  90. package/Engines/WebGPU/webgpuShaderProcessor.js.map +1 -1
  91. package/Engines/WebGPU/webgpuTintWASM.js +1 -4
  92. package/Engines/WebGPU/webgpuTintWASM.js.map +1 -1
  93. package/Engines/engine.d.ts +8 -1
  94. package/Engines/engine.js.map +1 -1
  95. package/Engines/engineCapabilities.d.ts +2 -0
  96. package/Engines/engineCapabilities.js.map +1 -1
  97. package/Engines/nativeEngine.d.ts +2 -0
  98. package/Engines/nativeEngine.js +16 -0
  99. package/Engines/nativeEngine.js.map +1 -1
  100. package/Engines/nullEngine.js +1 -9
  101. package/Engines/nullEngine.js.map +1 -1
  102. package/Engines/thinEngine.js +7 -9
  103. package/Engines/thinEngine.js.map +1 -1
  104. package/Engines/webgpuEngine.js +3 -14
  105. package/Engines/webgpuEngine.js.map +1 -1
  106. package/Gamepads/Controllers/gearVRController.js.map +1 -1
  107. package/Gamepads/Controllers/oculusTouchController.js.map +1 -1
  108. package/Gamepads/Controllers/poseEnabledController.js.map +1 -1
  109. package/Gamepads/Controllers/windowsMotionController.js.map +1 -1
  110. package/Gamepads/gamepad.js.map +1 -1
  111. package/Gizmos/cameraGizmo.js.map +1 -1
  112. package/Gizmos/gizmo.js.map +1 -1
  113. package/Gizmos/lightGizmo.js.map +1 -1
  114. package/Gizmos/planeRotationGizmo.js.map +1 -1
  115. package/Helpers/environmentHelper.js +2 -8
  116. package/Helpers/environmentHelper.js.map +1 -1
  117. package/Helpers/textureDome.js.map +1 -1
  118. package/Inputs/scene.inputManager.js +4 -1
  119. package/Inputs/scene.inputManager.js.map +1 -1
  120. package/Layers/effectLayer.js +1 -8
  121. package/Layers/effectLayer.js.map +1 -1
  122. package/Layers/glowLayer.js +1 -12
  123. package/Layers/glowLayer.js.map +1 -1
  124. package/Layers/highlightLayer.js +1 -11
  125. package/Layers/highlightLayer.js.map +1 -1
  126. package/Legacy/legacy.js +1 -1
  127. package/Legacy/legacy.js.map +1 -1
  128. package/LensFlares/lensFlareSystem.js.map +1 -1
  129. package/Lights/Shadows/shadowGenerator.js +1 -4
  130. package/Lights/Shadows/shadowGenerator.js.map +1 -1
  131. package/Lights/directionalLight.js.map +1 -1
  132. package/Lights/hemisphericLight.js.map +1 -1
  133. package/Lights/light.js.map +1 -1
  134. package/Lights/spotLight.js.map +1 -1
  135. package/Loading/loadingScreen.js.map +1 -1
  136. package/Loading/sceneLoader.d.ts +8 -8
  137. package/Loading/sceneLoader.js +35 -19
  138. package/Loading/sceneLoader.js.map +1 -1
  139. package/Materials/Background/backgroundMaterial.js.map +1 -1
  140. package/Materials/Node/Blocks/Dual/currentScreenBlock.d.ts +1 -1
  141. package/Materials/Node/Blocks/Dual/lightBlock.js.map +1 -1
  142. package/Materials/Node/Blocks/Dual/reflectionTextureBaseBlock.js.map +1 -1
  143. package/Materials/Node/Blocks/Dual/sceneDepthBlock.d.ts +1 -1
  144. package/Materials/Node/Blocks/Dual/sceneDepthBlock.js.map +1 -1
  145. package/Materials/Node/Blocks/Fragment/fragmentOutputBlock.js.map +1 -1
  146. package/Materials/Node/Blocks/Fragment/heightToNormalBlock.js.map +1 -1
  147. package/Materials/Node/Blocks/Fragment/imageProcessingBlock.js.map +1 -1
  148. package/Materials/Node/Blocks/Fragment/perturbNormalBlock.js.map +1 -1
  149. package/Materials/Node/Blocks/PBR/clearCoatBlock.js.map +1 -1
  150. package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.js.map +1 -1
  151. package/Materials/Node/Blocks/PBR/reflectionBlock.js.map +1 -1
  152. package/Materials/Node/Blocks/PBR/refractionBlock.js.map +1 -1
  153. package/Materials/Node/Blocks/PBR/sheenBlock.js.map +1 -1
  154. package/Materials/Node/Blocks/addBlock.js +2 -0
  155. package/Materials/Node/Blocks/addBlock.js.map +1 -1
  156. package/Materials/Node/Blocks/clampBlock.js.map +1 -1
  157. package/Materials/Node/Blocks/cloudBlock.js.map +1 -1
  158. package/Materials/Node/Blocks/customBlock.d.ts +1 -0
  159. package/Materials/Node/Blocks/customBlock.js +18 -2
  160. package/Materials/Node/Blocks/customBlock.js.map +1 -1
  161. package/Materials/Node/Blocks/divideBlock.js +2 -0
  162. package/Materials/Node/Blocks/divideBlock.js.map +1 -1
  163. package/Materials/Node/Blocks/meshAttributeExistsBlock.js.map +1 -1
  164. package/Materials/Node/Blocks/multiplyBlock.js +2 -0
  165. package/Materials/Node/Blocks/multiplyBlock.js.map +1 -1
  166. package/Materials/Node/Blocks/remapBlock.js.map +1 -1
  167. package/Materials/Node/Blocks/subtractBlock.js +2 -0
  168. package/Materials/Node/Blocks/subtractBlock.js.map +1 -1
  169. package/Materials/Node/Blocks/triPlanarBlock.js.map +1 -1
  170. package/Materials/Node/Blocks/worleyNoise3DBlock.js.map +1 -1
  171. package/Materials/Node/nodeMaterial.d.ts +6 -1
  172. package/Materials/Node/nodeMaterial.js +6 -10
  173. package/Materials/Node/nodeMaterial.js.map +1 -1
  174. package/Materials/PBR/pbrAnisotropicConfiguration.js.map +1 -1
  175. package/Materials/PBR/pbrBRDFConfiguration.js.map +1 -1
  176. package/Materials/PBR/pbrBaseMaterial.js +1 -5
  177. package/Materials/PBR/pbrBaseMaterial.js.map +1 -1
  178. package/Materials/PBR/pbrBaseSimpleMaterial.js.map +1 -1
  179. package/Materials/PBR/pbrClearCoatConfiguration.js.map +1 -1
  180. package/Materials/PBR/pbrIridescenceConfiguration.js.map +1 -1
  181. package/Materials/PBR/pbrMaterial.d.ts +2 -1
  182. package/Materials/PBR/pbrMaterial.js +6 -13
  183. package/Materials/PBR/pbrMaterial.js.map +1 -1
  184. package/Materials/PBR/pbrMetallicRoughnessMaterial.js.map +1 -1
  185. package/Materials/PBR/pbrSheenConfiguration.js.map +1 -1
  186. package/Materials/PBR/pbrSpecularGlossinessMaterial.js.map +1 -1
  187. package/Materials/PBR/pbrSubSurfaceConfiguration.js.map +1 -1
  188. package/Materials/Textures/Procedurals/proceduralTexture.js.map +1 -1
  189. package/Materials/Textures/baseTexture.js.map +1 -1
  190. package/Materials/Textures/cubeTexture.js.map +1 -1
  191. package/Materials/Textures/equiRectangularCubeTexture.js.map +1 -1
  192. package/Materials/Textures/hdrCubeTexture.js.map +1 -1
  193. package/Materials/Textures/htmlElementTexture.js +1 -4
  194. package/Materials/Textures/htmlElementTexture.js.map +1 -1
  195. package/Materials/Textures/internalTexture.js.map +1 -1
  196. package/Materials/Textures/renderTargetTexture.js.map +1 -1
  197. package/Materials/Textures/texture.js.map +1 -1
  198. package/Materials/Textures/videoTexture.js +9 -22
  199. package/Materials/Textures/videoTexture.js.map +1 -1
  200. package/Materials/colorCurves.js.map +1 -1
  201. package/Materials/effect.js.map +1 -1
  202. package/Materials/greasedLinePluginMaterial.d.ts +307 -0
  203. package/Materials/greasedLinePluginMaterial.js +553 -0
  204. package/Materials/greasedLinePluginMaterial.js.map +1 -0
  205. package/Materials/imageProcessingConfiguration.js.map +1 -1
  206. package/Materials/index.d.ts +1 -0
  207. package/Materials/index.js +1 -0
  208. package/Materials/index.js.map +1 -1
  209. package/Materials/material.d.ts +3 -0
  210. package/Materials/material.decalMapConfiguration.js.map +1 -1
  211. package/Materials/material.detailMapConfiguration.js.map +1 -1
  212. package/Materials/material.js +40 -5
  213. package/Materials/material.js.map +1 -1
  214. package/Materials/materialPluginBase.d.ts +2 -2
  215. package/Materials/materialPluginBase.js +2 -2
  216. package/Materials/materialPluginBase.js.map +1 -1
  217. package/Materials/materialPluginManager.d.ts +3 -2
  218. package/Materials/materialPluginManager.js +3 -1
  219. package/Materials/materialPluginManager.js.map +1 -1
  220. package/Materials/multiMaterial.js +1 -1
  221. package/Materials/multiMaterial.js.map +1 -1
  222. package/Materials/shaderMaterial.d.ts +23 -4
  223. package/Materials/shaderMaterial.js +41 -21
  224. package/Materials/shaderMaterial.js.map +1 -1
  225. package/Materials/standardMaterial.d.ts +2 -1
  226. package/Materials/standardMaterial.js +4 -1
  227. package/Materials/standardMaterial.js.map +1 -1
  228. package/Materials/uniformBuffer.js.map +1 -1
  229. package/Maths/math.vector.d.ts +2 -1
  230. package/Maths/math.vector.js +3 -2
  231. package/Maths/math.vector.js.map +1 -1
  232. package/Meshes/Builders/decalBuilder.js +4 -4
  233. package/Meshes/Builders/decalBuilder.js.map +1 -1
  234. package/Meshes/Builders/greasedLineBuilder.d.ts +105 -0
  235. package/Meshes/Builders/greasedLineBuilder.js +330 -0
  236. package/Meshes/Builders/greasedLineBuilder.js.map +1 -0
  237. package/Meshes/Builders/index.d.ts +1 -0
  238. package/Meshes/Builders/index.js +1 -0
  239. package/Meshes/Builders/index.js.map +1 -1
  240. package/Meshes/abstractMesh.d.ts +3 -2
  241. package/Meshes/abstractMesh.js +5 -3
  242. package/Meshes/abstractMesh.js.map +1 -1
  243. package/Meshes/greasedLineMesh.d.ts +189 -0
  244. package/Meshes/greasedLineMesh.js +437 -0
  245. package/Meshes/greasedLineMesh.js.map +1 -0
  246. package/Meshes/index.d.ts +1 -0
  247. package/Meshes/index.js +1 -0
  248. package/Meshes/index.js.map +1 -1
  249. package/Meshes/mesh.d.ts +4 -0
  250. package/Meshes/mesh.js +20 -10
  251. package/Meshes/mesh.js.map +1 -1
  252. package/Meshes/mesh.vertexData.js.map +1 -1
  253. package/Meshes/meshUVSpaceRenderer.js +1 -8
  254. package/Meshes/meshUVSpaceRenderer.js.map +1 -1
  255. package/Meshes/transformNode.js.map +1 -1
  256. package/Misc/basis.js.map +1 -1
  257. package/Misc/deepCopier.js +8 -2
  258. package/Misc/deepCopier.js.map +1 -1
  259. package/Misc/dumpTools.d.ts +4 -3
  260. package/Misc/dumpTools.js +5 -4
  261. package/Misc/dumpTools.js.map +1 -1
  262. package/Misc/environmentTextureTools.js +1 -1
  263. package/Misc/environmentTextureTools.js.map +1 -1
  264. package/Misc/fileTools.js +10 -10
  265. package/Misc/fileTools.js.map +1 -1
  266. package/Misc/greasedLineTools.d.ts +141 -0
  267. package/Misc/greasedLineTools.js +263 -0
  268. package/Misc/greasedLineTools.js.map +1 -0
  269. package/Misc/index.d.ts +1 -0
  270. package/Misc/index.js +1 -0
  271. package/Misc/index.js.map +1 -1
  272. package/Misc/khronosTextureContainer.js.map +1 -1
  273. package/Misc/observable.d.ts +11 -0
  274. package/Misc/observable.js +26 -1
  275. package/Misc/observable.js.map +1 -1
  276. package/Misc/sceneOptimizer.js.map +1 -1
  277. package/Misc/screenshotTools.d.ts +15 -5
  278. package/Misc/screenshotTools.js +23 -13
  279. package/Misc/screenshotTools.js.map +1 -1
  280. package/Misc/smartArray.js.map +1 -1
  281. package/Misc/tools.d.ts +21 -9
  282. package/Misc/tools.js +21 -9
  283. package/Misc/tools.js.map +1 -1
  284. package/Misc/videoRecorder.js +1 -4
  285. package/Misc/videoRecorder.js.map +1 -1
  286. package/Misc/virtualJoystick.js +1 -4
  287. package/Misc/virtualJoystick.js.map +1 -1
  288. package/Misc/webRequest.js.map +1 -1
  289. package/Morph/morphTarget.js.map +1 -1
  290. package/Morph/morphTargetManager.js.map +1 -1
  291. package/Offline/database.js.map +1 -1
  292. package/Particles/baseParticleSystem.js.map +1 -1
  293. package/Particles/gpuParticleSystem.d.ts +1 -0
  294. package/Particles/gpuParticleSystem.js +5 -8
  295. package/Particles/gpuParticleSystem.js.map +1 -1
  296. package/Particles/particle.js.map +1 -1
  297. package/Particles/particleSystem.js +1 -1
  298. package/Particles/particleSystem.js.map +1 -1
  299. package/Particles/particleSystemSet.js.map +1 -1
  300. package/Physics/physicsHelper.js +4 -4
  301. package/Physics/physicsHelper.js.map +1 -1
  302. package/Physics/physicsRaycastResult.d.ts +3 -1
  303. package/Physics/physicsRaycastResult.js +10 -1
  304. package/Physics/physicsRaycastResult.js.map +1 -1
  305. package/Physics/v1/Plugins/ammoJSPlugin.js.map +1 -1
  306. package/Physics/v1/physicsImpostor.js.map +1 -1
  307. package/Physics/v2/IPhysicsEnginePlugin.d.ts +10 -0
  308. package/Physics/v2/IPhysicsEnginePlugin.js.map +1 -1
  309. package/Physics/v2/Plugins/havokPlugin.d.ts +3 -2
  310. package/Physics/v2/Plugins/havokPlugin.js +9 -6
  311. package/Physics/v2/Plugins/havokPlugin.js.map +1 -1
  312. package/PostProcesses/RenderPipeline/Pipelines/defaultRenderingPipeline.js.map +1 -1
  313. package/PostProcesses/RenderPipeline/Pipelines/ssao2RenderingPipeline.js.map +1 -1
  314. package/PostProcesses/RenderPipeline/Pipelines/ssaoRenderingPipeline.js.map +1 -1
  315. package/PostProcesses/RenderPipeline/Pipelines/ssrRenderingPipeline.js.map +1 -1
  316. package/PostProcesses/RenderPipeline/Pipelines/standardRenderingPipeline.js.map +1 -1
  317. package/PostProcesses/RenderPipeline/postProcessRenderPipeline.js.map +1 -1
  318. package/PostProcesses/blackAndWhitePostProcess.js.map +1 -1
  319. package/PostProcesses/bloomMergePostProcess.js.map +1 -1
  320. package/PostProcesses/blurPostProcess.js.map +1 -1
  321. package/PostProcesses/circleOfConfusionPostProcess.js.map +1 -1
  322. package/PostProcesses/colorCorrectionPostProcess.js.map +1 -1
  323. package/PostProcesses/convolutionPostProcess.js.map +1 -1
  324. package/PostProcesses/depthOfFieldBlurPostProcess.js.map +1 -1
  325. package/PostProcesses/extractHighlightsPostProcess.js.map +1 -1
  326. package/PostProcesses/filterPostProcess.js.map +1 -1
  327. package/PostProcesses/grainPostProcess.js.map +1 -1
  328. package/PostProcesses/imageProcessingPostProcess.js.map +1 -1
  329. package/PostProcesses/motionBlurPostProcess.js.map +1 -1
  330. package/PostProcesses/postProcess.js.map +1 -1
  331. package/PostProcesses/refractionPostProcess.js.map +1 -1
  332. package/PostProcesses/screenSpaceCurvaturePostProcess.js.map +1 -1
  333. package/PostProcesses/screenSpaceReflectionPostProcess.js.map +1 -1
  334. package/PostProcesses/sharpenPostProcess.js.map +1 -1
  335. package/PostProcesses/volumetricLightScatteringPostProcess.js.map +1 -1
  336. package/Probes/reflectionProbe.js.map +1 -1
  337. package/Rendering/boundingBoxRenderer.js +2 -4
  338. package/Rendering/boundingBoxRenderer.js.map +1 -1
  339. package/Rendering/depthPeelingRenderer.js.map +1 -1
  340. package/Rendering/depthRenderer.js.map +1 -1
  341. package/Rendering/geometryBufferRenderer.js.map +1 -1
  342. package/Rendering/outlineRenderer.js.map +1 -1
  343. package/Rendering/prePassRenderer.js.map +1 -1
  344. package/Rendering/renderingGroup.js.map +1 -1
  345. package/Rendering/renderingManager.js.map +1 -1
  346. package/Rendering/subSurfaceConfiguration.js.map +1 -1
  347. package/Rendering/utilityLayerRenderer.js.map +1 -1
  348. package/Shaders/ShadersInclude/pbrBlockAlbedoOpacity.js +4 -2
  349. package/Shaders/ShadersInclude/pbrBlockAlbedoOpacity.js.map +1 -1
  350. package/Shaders/ShadersInclude/pbrDebug.js +11 -2
  351. package/Shaders/ShadersInclude/pbrDebug.js.map +1 -1
  352. package/Shaders/velocity.fragment.d.ts +5 -0
  353. package/Shaders/velocity.fragment.js +13 -0
  354. package/Shaders/velocity.fragment.js.map +1 -0
  355. package/Shaders/velocity.vertex.d.ts +7 -0
  356. package/Shaders/velocity.vertex.js +23 -0
  357. package/Shaders/velocity.vertex.js.map +1 -0
  358. package/Sprites/spriteManager.js.map +1 -1
  359. package/XR/features/WebXRAnchorSystem.js.map +1 -1
  360. package/XR/features/WebXRBackgroundRemover.js.map +1 -1
  361. package/XR/features/WebXRControllerMovement.js.map +1 -1
  362. package/XR/features/WebXRControllerPhysics.js +4 -13
  363. package/XR/features/WebXRControllerPhysics.js.map +1 -1
  364. package/XR/features/WebXRControllerPointerSelection.js.map +1 -1
  365. package/XR/features/WebXRControllerTeleportation.js.map +1 -1
  366. package/XR/features/WebXRDOMOverlay.js.map +1 -1
  367. package/XR/features/WebXRDepthSensing.js.map +1 -1
  368. package/XR/features/WebXREyeTracking.js.map +1 -1
  369. package/XR/features/WebXRFeaturePointSystem.js.map +1 -1
  370. package/XR/features/WebXRHandTracking.js +2 -8
  371. package/XR/features/WebXRHandTracking.js.map +1 -1
  372. package/XR/features/WebXRHitTest.js.map +1 -1
  373. package/XR/features/WebXRHitTestLegacy.js.map +1 -1
  374. package/XR/features/WebXRImageTracking.js.map +1 -1
  375. package/XR/features/WebXRLayers.js +18 -8
  376. package/XR/features/WebXRLayers.js.map +1 -1
  377. package/XR/features/WebXRLightEstimation.js.map +1 -1
  378. package/XR/features/WebXRMeshDetector.js.map +1 -1
  379. package/XR/features/WebXRNearInteraction.js.map +1 -1
  380. package/XR/features/WebXRPlaneDetector.js.map +1 -1
  381. package/XR/features/WebXRSpaceWarp.d.ts +138 -0
  382. package/XR/features/WebXRSpaceWarp.js +290 -0
  383. package/XR/features/WebXRSpaceWarp.js.map +1 -0
  384. package/XR/features/index.d.ts +1 -0
  385. package/XR/features/index.js +1 -0
  386. package/XR/features/index.js.map +1 -1
  387. package/XR/motionController/webXRAbstractMotionController.js +1 -4
  388. package/XR/motionController/webXRAbstractMotionController.js.map +1 -1
  389. package/XR/motionController/webXRControllerComponent.js.map +1 -1
  390. package/XR/motionController/webXRGenericMotionController.js.map +1 -1
  391. package/XR/motionController/webXRHTCViveMotionController.js.map +1 -1
  392. package/XR/motionController/webXRMicrosoftMixedRealityController.js.map +1 -1
  393. package/XR/motionController/webXROculusTouchMotionController.js.map +1 -1
  394. package/XR/webXRCamera.js.map +1 -1
  395. package/XR/webXRDefaultExperience.js +6 -28
  396. package/XR/webXRDefaultExperience.js.map +1 -1
  397. package/XR/webXRFeaturesManager.d.ts +4 -0
  398. package/XR/webXRFeaturesManager.js +5 -4
  399. package/XR/webXRFeaturesManager.js.map +1 -1
  400. package/XR/webXRInput.js +1 -6
  401. package/XR/webXRInput.js.map +1 -1
  402. package/XR/webXRSessionManager.d.ts +4 -0
  403. package/XR/webXRSessionManager.js +6 -0
  404. package/XR/webXRSessionManager.js.map +1 -1
  405. package/abstractScene.js.map +1 -1
  406. package/assetContainer.js +1 -4
  407. package/assetContainer.js.map +1 -1
  408. package/node.js.map +1 -1
  409. package/package.json +2 -4
  410. package/scene.d.ts +5 -2
  411. package/scene.js +9 -12
  412. package/scene.js.map +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"database.js","sourceRoot":"","sources":["../../../../lts/core/generated/Offline/database.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAE3C,OAAO,EAAE,UAAU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AEjD;;GAEG;AACI,0BAAiB,GAAG,KAAK,CAAC;AA+ClB,kBAAS,GAAG,CAAC,GAAW,EAAE,EAAE;IACvC,MAAM,CAAC,GAAG,QAAQ,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;IACtC,CAAC,CAAC,IAAI,GAAG,GAAG,CAAC;IACb,MAAM,cAAc,GAAG,GAAG,CAAC,SAAS,CAAC,CAAC,EAAE,GAAG,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC;IAC9D,MAAM,QAAQ,GAAG,GAAG,CAAC,SAAS,CAAC,cAAc,CAAC,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAChF,MAAM,WAAW,GAAG,GAAG,CAAC,SAAS,CAAC,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,CAAC;IAC/D,OAAO,WAAW,CAAC;AACvB,CAAC,CAAC;AAEa,+BAAsB,GAAG,CAAC,GAAW,EAAU,EAAE;IAC5D,IAAI,GAAG,CAAC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,IAAI,GAAG,CAAC,OAAO,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;QAChG,OAAO,QAAQ,CAAC,SAAS,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC;KACzD;SAAM;QACH,OAAO,GAAG,CAAC;KACd;AACL,CAAC,CAAC","sourcesContent":["import type { Nullable } from \"../types\";\r\nimport { Tools } from \"../Misc/tools\";\r\nimport { Logger } from \"../Misc/logger\";\r\nimport { GetTGAHeader } from \"../Misc/tga\";\r\nimport { Engine } from \"../Engines/engine\";\r\nimport type { IOfflineProvider } from \"./IOfflineProvider\";\r\nimport { WebRequest } from \"../Misc/webRequest\";\r\n\r\n// Sets the default offline provider to Babylon.js\r\nEngine.OfflineProviderFactory = (urlToScene: string, callbackManifestChecked: (checked: boolean) => any, disableManifestCheck = false) => {\r\n return new Database(urlToScene, callbackManifestChecked, disableManifestCheck);\r\n};\r\n\r\n/**\r\n * Class used to enable access to IndexedDB\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/scene/optimizeCached\r\n */\r\nexport class Database implements IOfflineProvider {\r\n private _currentSceneUrl: string;\r\n private _db: Nullable<IDBDatabase>;\r\n private _enableSceneOffline: boolean;\r\n private _enableTexturesOffline: boolean;\r\n private _manifestVersionFound: number;\r\n private _mustUpdateRessources: boolean;\r\n private _hasReachedQuota: boolean;\r\n private _isSupported: boolean;\r\n\r\n // Handling various flavors of prefixed version of IndexedDB\r\n private _idbFactory = <IDBFactory>(typeof indexedDB !== \"undefined\" ? indexedDB : undefined);\r\n\r\n /** Gets a boolean indicating if the user agent supports blob storage (this value will be updated after creating the first Database object) */\r\n private static _IsUASupportingBlobStorage = true;\r\n\r\n /**\r\n * Gets a boolean indicating if Database storage is enabled (off by default)\r\n */\r\n static IDBStorageEnabled = false;\r\n\r\n /**\r\n * Gets a boolean indicating if scene must be saved in the database\r\n */\r\n public get enableSceneOffline(): boolean {\r\n return this._enableSceneOffline;\r\n }\r\n\r\n /**\r\n * Gets a boolean indicating if textures must be saved in the database\r\n */\r\n public get enableTexturesOffline(): boolean {\r\n return this._enableTexturesOffline;\r\n }\r\n\r\n /**\r\n * Creates a new Database\r\n * @param urlToScene defines the url to load the scene\r\n * @param callbackManifestChecked defines the callback to use when manifest is checked\r\n * @param disableManifestCheck defines a boolean indicating that we want to skip the manifest validation (it will be considered validated and up to date)\r\n */\r\n constructor(urlToScene: string, callbackManifestChecked: (checked: boolean) => any, disableManifestCheck = false) {\r\n this._currentSceneUrl = Database._ReturnFullUrlLocation(urlToScene);\r\n this._db = null;\r\n this._enableSceneOffline = false;\r\n this._enableTexturesOffline = false;\r\n this._manifestVersionFound = 0;\r\n this._mustUpdateRessources = false;\r\n this._hasReachedQuota = false;\r\n\r\n if (!Database.IDBStorageEnabled) {\r\n callbackManifestChecked(true);\r\n } else {\r\n if (disableManifestCheck) {\r\n this._enableSceneOffline = true;\r\n this._enableTexturesOffline = true;\r\n this._manifestVersionFound = 1;\r\n Tools.SetImmediate(() => {\r\n callbackManifestChecked(true);\r\n });\r\n } else {\r\n this._checkManifestFile(callbackManifestChecked);\r\n }\r\n }\r\n }\r\n\r\n private static _ParseURL = (url: string) => {\r\n const a = document.createElement(\"a\");\r\n a.href = url;\r\n const urlWithoutHash = url.substring(0, url.lastIndexOf(\"#\"));\r\n const fileName = url.substring(urlWithoutHash.lastIndexOf(\"/\") + 1, url.length);\r\n const absLocation = url.substring(0, url.indexOf(fileName, 0));\r\n return absLocation;\r\n };\r\n\r\n private static _ReturnFullUrlLocation = (url: string): string => {\r\n if (url.indexOf(\"http:/\") === -1 && url.indexOf(\"https:/\") === -1 && typeof window !== \"undefined\") {\r\n return Database._ParseURL(window.location.href) + url;\r\n } else {\r\n return url;\r\n }\r\n };\r\n\r\n private _checkManifestFile(callbackManifestChecked: (checked: boolean) => any) {\r\n const noManifestFile = () => {\r\n this._enableSceneOffline = false;\r\n this._enableTexturesOffline = false;\r\n callbackManifestChecked(false);\r\n };\r\n\r\n const createManifestURL = (): string => {\r\n try {\r\n // make sure we have a valid URL.\r\n if (typeof URL === \"function\" && this._currentSceneUrl.indexOf(\"http\") === 0) {\r\n // we don't have the base url, so the URL string must have a protocol\r\n const url = new URL(this._currentSceneUrl);\r\n url.pathname += \".manifest\";\r\n return url.toString();\r\n }\r\n } catch (e) {\r\n // defensive - if this fails for any reason, fall back to the older method\r\n }\r\n\r\n return `${this._currentSceneUrl}.manifest`;\r\n };\r\n\r\n let timeStampUsed = false;\r\n let manifestURL = createManifestURL();\r\n\r\n const xhr = new WebRequest();\r\n\r\n if (navigator.onLine) {\r\n // Adding a timestamp to by-pass browsers' cache\r\n timeStampUsed = true;\r\n manifestURL = manifestURL + (manifestURL.match(/\\?/) == null ? \"?\" : \"&\") + Date.now();\r\n }\r\n xhr.open(\"GET\", manifestURL);\r\n\r\n xhr.addEventListener(\r\n \"load\",\r\n () => {\r\n if (xhr.status === 200 || Database._ValidateXHRData(xhr, 1)) {\r\n try {\r\n const manifestFile = JSON.parse(xhr.response);\r\n this._enableSceneOffline = manifestFile.enableSceneOffline;\r\n this._enableTexturesOffline = manifestFile.enableTexturesOffline && Database._IsUASupportingBlobStorage;\r\n if (manifestFile.version && !isNaN(parseInt(manifestFile.version))) {\r\n this._manifestVersionFound = manifestFile.version;\r\n }\r\n callbackManifestChecked(true);\r\n } catch (ex) {\r\n noManifestFile();\r\n }\r\n } else {\r\n noManifestFile();\r\n }\r\n },\r\n false\r\n );\r\n\r\n xhr.addEventListener(\r\n \"error\",\r\n () => {\r\n if (timeStampUsed) {\r\n timeStampUsed = false;\r\n // Let's retry without the timeStamp\r\n // It could fail when coupled with HTML5 Offline API\r\n const retryManifestURL = createManifestURL();\r\n xhr.open(\"GET\", retryManifestURL);\r\n xhr.send();\r\n } else {\r\n noManifestFile();\r\n }\r\n },\r\n false\r\n );\r\n\r\n try {\r\n xhr.send();\r\n } catch (ex) {\r\n Logger.Error(\"Error on XHR send request.\");\r\n callbackManifestChecked(false);\r\n }\r\n }\r\n\r\n /**\r\n * Open the database and make it available\r\n * @param successCallback defines the callback to call on success\r\n * @param errorCallback defines the callback to call on error\r\n */\r\n public open(successCallback: () => void, errorCallback: () => void): void {\r\n const handleError = () => {\r\n this._isSupported = false;\r\n if (errorCallback) {\r\n errorCallback();\r\n }\r\n };\r\n\r\n if (!this._idbFactory || !(this._enableSceneOffline || this._enableTexturesOffline)) {\r\n // Your browser doesn't support IndexedDB\r\n this._isSupported = false;\r\n if (errorCallback) {\r\n errorCallback();\r\n }\r\n } else {\r\n // If the DB hasn't been opened or created yet\r\n if (!this._db) {\r\n this._hasReachedQuota = false;\r\n this._isSupported = true;\r\n\r\n const request: IDBOpenDBRequest = this._idbFactory.open(\"babylonjs\", 1);\r\n\r\n // Could occur if user is blocking the quota for the DB and/or doesn't grant access to IndexedDB\r\n request.onerror = () => {\r\n handleError();\r\n };\r\n\r\n // executes when a version change transaction cannot complete due to other active transactions\r\n request.onblocked = () => {\r\n Logger.Error(\"IDB request blocked. Please reload the page.\");\r\n handleError();\r\n };\r\n\r\n // DB has been opened successfully\r\n request.onsuccess = () => {\r\n this._db = request.result;\r\n successCallback();\r\n };\r\n\r\n // Initialization of the DB. Creating Scenes & Textures stores\r\n request.onupgradeneeded = (event: IDBVersionChangeEvent) => {\r\n this._db = (<any>event.target).result;\r\n if (this._db) {\r\n try {\r\n this._db.createObjectStore(\"scenes\", { keyPath: \"sceneUrl\" });\r\n this._db.createObjectStore(\"versions\", { keyPath: \"sceneUrl\" });\r\n this._db.createObjectStore(\"textures\", { keyPath: \"textureUrl\" });\r\n } catch (ex) {\r\n Logger.Error(\"Error while creating object stores. Exception: \" + ex.message);\r\n handleError();\r\n }\r\n }\r\n };\r\n }\r\n // DB has already been created and opened\r\n else {\r\n if (successCallback) {\r\n successCallback();\r\n }\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Loads an image from the database\r\n * @param url defines the url to load from\r\n * @param image defines the target DOM image\r\n */\r\n public loadImage(url: string, image: HTMLImageElement) {\r\n const completeURL = Database._ReturnFullUrlLocation(url);\r\n\r\n const saveAndLoadImage = () => {\r\n if (!this._hasReachedQuota && this._db !== null) {\r\n // the texture is not yet in the DB, let's try to save it\r\n this._saveImageIntoDBAsync(completeURL, image);\r\n }\r\n // If the texture is not in the DB and we've reached the DB quota limit\r\n // let's load it directly from the web\r\n else {\r\n image.src = url;\r\n }\r\n };\r\n\r\n if (!this._mustUpdateRessources) {\r\n this._loadImageFromDBAsync(completeURL, image, saveAndLoadImage);\r\n }\r\n // First time we're download the images or update requested in the manifest file by a version change\r\n else {\r\n saveAndLoadImage();\r\n }\r\n }\r\n\r\n private _loadImageFromDBAsync(url: string, image: HTMLImageElement, notInDBCallback: () => any) {\r\n if (this._isSupported && this._db !== null) {\r\n let texture: any;\r\n const transaction: IDBTransaction = this._db.transaction([\"textures\"]);\r\n\r\n transaction.onabort = () => {\r\n image.src = url;\r\n };\r\n\r\n transaction.oncomplete = () => {\r\n let blobTextureURL: string;\r\n if (texture && typeof URL === \"function\") {\r\n blobTextureURL = URL.createObjectURL(texture.data);\r\n image.onerror = () => {\r\n Logger.Error(\"Error loading image from blob URL: \" + blobTextureURL + \" switching back to web url: \" + url);\r\n image.src = url;\r\n };\r\n image.src = blobTextureURL;\r\n } else {\r\n notInDBCallback();\r\n }\r\n };\r\n\r\n const getRequest: IDBRequest = transaction.objectStore(\"textures\").get(url);\r\n\r\n getRequest.onsuccess = (event) => {\r\n texture = (<any>event.target).result;\r\n };\r\n getRequest.onerror = () => {\r\n Logger.Error(\"Error loading texture \" + url + \" from DB.\");\r\n image.src = url;\r\n };\r\n } else {\r\n Logger.Error(\"Error: IndexedDB not supported by your browser or BabylonJS Database is not open.\");\r\n image.src = url;\r\n }\r\n }\r\n\r\n private _saveImageIntoDBAsync(url: string, image: HTMLImageElement) {\r\n let blob: Blob;\r\n\r\n if (this._isSupported) {\r\n // In case of error (type not supported or quota exceeded), we're at least sending back XHR data to allow texture loading later on\r\n const generateBlobUrl = () => {\r\n let blobTextureURL;\r\n\r\n if (blob && typeof URL === \"function\") {\r\n try {\r\n blobTextureURL = URL.createObjectURL(blob);\r\n } catch (ex) {\r\n // Chrome is raising a type error if we're setting the oneTimeOnly parameter\r\n blobTextureURL = URL.createObjectURL(blob);\r\n }\r\n }\r\n\r\n if (blobTextureURL) {\r\n image.src = blobTextureURL;\r\n }\r\n };\r\n\r\n if (Database._IsUASupportingBlobStorage) {\r\n // Create XHR\r\n const xhr = new WebRequest();\r\n\r\n xhr.open(\"GET\", url);\r\n xhr.responseType = \"blob\";\r\n\r\n xhr.addEventListener(\r\n \"load\",\r\n () => {\r\n if (xhr.status === 200 && this._db) {\r\n // Blob as response\r\n blob = xhr.response;\r\n\r\n const transaction = this._db.transaction([\"textures\"], \"readwrite\");\r\n\r\n // the transaction could abort because of a QuotaExceededError error\r\n transaction.onabort = (event) => {\r\n try {\r\n //backwards compatibility with ts 1.0, srcElement doesn't have an \"error\" according to ts 1.3\r\n const srcElement = <any>event.target;\r\n const error = srcElement.error;\r\n if (error && error.name === \"QuotaExceededError\") {\r\n this._hasReachedQuota = true;\r\n }\r\n } catch (ex) {}\r\n generateBlobUrl();\r\n };\r\n\r\n transaction.oncomplete = () => {\r\n generateBlobUrl();\r\n };\r\n\r\n const newTexture = { textureUrl: url, data: blob };\r\n\r\n try {\r\n // Put the blob into the dabase\r\n const addRequest = transaction.objectStore(\"textures\").put(newTexture);\r\n addRequest.onsuccess = () => {};\r\n addRequest.onerror = () => {\r\n generateBlobUrl();\r\n };\r\n } catch (ex) {\r\n // \"DataCloneError\" generated by Chrome when you try to inject blob into IndexedDB\r\n if (ex.code === 25) {\r\n Database._IsUASupportingBlobStorage = false;\r\n this._enableTexturesOffline = false;\r\n }\r\n image.src = url;\r\n }\r\n } else {\r\n image.src = url;\r\n }\r\n },\r\n false\r\n );\r\n\r\n xhr.addEventListener(\r\n \"error\",\r\n () => {\r\n Logger.Error(\"Error in XHR request in BABYLON.Database.\");\r\n image.src = url;\r\n },\r\n false\r\n );\r\n\r\n xhr.send();\r\n } else {\r\n image.src = url;\r\n }\r\n } else {\r\n Logger.Error(\"Error: IndexedDB not supported by your browser or Babylon.js database is not open.\");\r\n image.src = url;\r\n }\r\n }\r\n\r\n private _checkVersionFromDB(url: string, versionLoaded: (version: number) => void) {\r\n const updateVersion = () => {\r\n // the version is not yet in the DB or we need to update it\r\n this._saveVersionIntoDBAsync(url, versionLoaded);\r\n };\r\n this._loadVersionFromDBAsync(url, versionLoaded, updateVersion);\r\n }\r\n\r\n private _loadVersionFromDBAsync(url: string, callback: (version: number) => void, updateInDBCallback: () => void) {\r\n if (this._isSupported && this._db) {\r\n let version: any;\r\n try {\r\n const transaction = this._db.transaction([\"versions\"]);\r\n\r\n transaction.oncomplete = () => {\r\n if (version) {\r\n // If the version in the JSON file is different from the version in DB\r\n if (this._manifestVersionFound !== version.data) {\r\n this._mustUpdateRessources = true;\r\n updateInDBCallback();\r\n } else {\r\n callback(version.data);\r\n }\r\n }\r\n // version was not found in DB\r\n else {\r\n this._mustUpdateRessources = true;\r\n updateInDBCallback();\r\n }\r\n };\r\n\r\n transaction.onabort = () => {\r\n callback(-1);\r\n };\r\n\r\n const getRequest = transaction.objectStore(\"versions\").get(url);\r\n\r\n getRequest.onsuccess = (event) => {\r\n version = (<any>event.target).result;\r\n };\r\n getRequest.onerror = () => {\r\n Logger.Error(\"Error loading version for scene \" + url + \" from DB.\");\r\n callback(-1);\r\n };\r\n } catch (ex) {\r\n Logger.Error(\"Error while accessing 'versions' object store (READ OP). Exception: \" + ex.message);\r\n callback(-1);\r\n }\r\n } else {\r\n Logger.Error(\"Error: IndexedDB not supported by your browser or Babylon.js database is not open.\");\r\n callback(-1);\r\n }\r\n }\r\n\r\n private _saveVersionIntoDBAsync(url: string, callback: (version: number) => void) {\r\n if (this._isSupported && !this._hasReachedQuota && this._db) {\r\n try {\r\n // Open a transaction to the database\r\n const transaction = this._db.transaction([\"versions\"], \"readwrite\");\r\n\r\n // the transaction could abort because of a QuotaExceededError error\r\n transaction.onabort = (event) => {\r\n try {\r\n //backwards compatibility with ts 1.0, srcElement doesn't have an \"error\" according to ts 1.3\r\n const error = (<any>event.target)[\"error\"];\r\n if (error && error.name === \"QuotaExceededError\") {\r\n this._hasReachedQuota = true;\r\n }\r\n } catch (ex) {}\r\n callback(-1);\r\n };\r\n\r\n transaction.oncomplete = () => {\r\n callback(this._manifestVersionFound);\r\n };\r\n\r\n const newVersion = { sceneUrl: url, data: this._manifestVersionFound };\r\n\r\n // Put the scene into the database\r\n const addRequest = transaction.objectStore(\"versions\").put(newVersion);\r\n addRequest.onsuccess = () => {};\r\n addRequest.onerror = () => {\r\n Logger.Error(\"Error in DB add version request in BABYLON.Database.\");\r\n };\r\n } catch (ex) {\r\n Logger.Error(\"Error while accessing 'versions' object store (WRITE OP). Exception: \" + ex.message);\r\n callback(-1);\r\n }\r\n } else {\r\n callback(-1);\r\n }\r\n }\r\n\r\n /**\r\n * Loads a file from database\r\n * @param url defines the URL to load from\r\n * @param sceneLoaded defines a callback to call on success\r\n * @param progressCallBack defines a callback to call when progress changed\r\n * @param errorCallback defines a callback to call on error\r\n * @param useArrayBuffer defines a boolean to use array buffer instead of text string\r\n */\r\n public loadFile(url: string, sceneLoaded: (data: any) => void, progressCallBack?: (data: any) => void, errorCallback?: () => void, useArrayBuffer?: boolean): void {\r\n const completeUrl = Database._ReturnFullUrlLocation(url);\r\n\r\n const saveAndLoadFile = () => {\r\n // the scene is not yet in the DB, let's try to save it\r\n this._saveFileAsync(completeUrl, sceneLoaded, progressCallBack, useArrayBuffer, errorCallback);\r\n };\r\n\r\n this._checkVersionFromDB(completeUrl, (version) => {\r\n if (version !== -1) {\r\n if (!this._mustUpdateRessources) {\r\n this._loadFileAsync(completeUrl, sceneLoaded, saveAndLoadFile);\r\n } else {\r\n this._saveFileAsync(completeUrl, sceneLoaded, progressCallBack, useArrayBuffer, errorCallback);\r\n }\r\n } else {\r\n if (errorCallback) {\r\n errorCallback();\r\n }\r\n }\r\n });\r\n }\r\n\r\n private _loadFileAsync(url: string, callback: (data?: any) => void, notInDBCallback: () => void) {\r\n if (this._isSupported && this._db) {\r\n let targetStore: string;\r\n if (url.indexOf(\".babylon\") !== -1) {\r\n targetStore = \"scenes\";\r\n } else {\r\n targetStore = \"textures\";\r\n }\r\n\r\n let file: any;\r\n const transaction = this._db.transaction([targetStore]);\r\n\r\n transaction.oncomplete = () => {\r\n if (file) {\r\n callback(file.data);\r\n }\r\n // file was not found in DB\r\n else {\r\n notInDBCallback();\r\n }\r\n };\r\n\r\n transaction.onabort = () => {\r\n notInDBCallback();\r\n };\r\n\r\n const getRequest = transaction.objectStore(targetStore).get(url);\r\n\r\n getRequest.onsuccess = (event) => {\r\n file = (<any>event.target).result;\r\n };\r\n getRequest.onerror = () => {\r\n Logger.Error(\"Error loading file \" + url + \" from DB.\");\r\n notInDBCallback();\r\n };\r\n } else {\r\n Logger.Error(\"Error: IndexedDB not supported by your browser or BabylonJS Database is not open.\");\r\n callback();\r\n }\r\n }\r\n\r\n private _saveFileAsync(\r\n url: string,\r\n callback: (data?: any) => void,\r\n progressCallback?: (this: XMLHttpRequestEventTarget, ev: ProgressEvent) => any,\r\n useArrayBuffer?: boolean,\r\n errorCallback?: (data?: any) => void\r\n ) {\r\n if (this._isSupported) {\r\n let targetStore: string;\r\n if (url.indexOf(\".babylon\") !== -1) {\r\n targetStore = \"scenes\";\r\n } else {\r\n targetStore = \"textures\";\r\n }\r\n\r\n // Create XHR\r\n const xhr = new WebRequest();\r\n let fileData: any;\r\n xhr.open(\"GET\", url + (url.match(/\\?/) == null ? \"?\" : \"&\") + Date.now());\r\n\r\n if (useArrayBuffer) {\r\n xhr.responseType = \"arraybuffer\";\r\n }\r\n\r\n if (progressCallback) {\r\n xhr.onprogress = progressCallback;\r\n }\r\n\r\n xhr.addEventListener(\r\n \"load\",\r\n () => {\r\n if (xhr.status === 200 || (xhr.status < 400 && Database._ValidateXHRData(xhr, !useArrayBuffer ? 1 : 6))) {\r\n // Blob as response\r\n fileData = !useArrayBuffer ? xhr.responseText : xhr.response;\r\n\r\n if (!this._hasReachedQuota && this._db) {\r\n // Open a transaction to the database\r\n const transaction = this._db.transaction([targetStore], \"readwrite\");\r\n\r\n // the transaction could abort because of a QuotaExceededError error\r\n transaction.onabort = (event) => {\r\n try {\r\n //backwards compatibility with ts 1.0, srcElement doesn't have an \"error\" according to ts 1.3\r\n const error = (<any>event.target)[\"error\"];\r\n if (error && error.name === \"QuotaExceededError\") {\r\n this._hasReachedQuota = true;\r\n }\r\n } catch (ex) {}\r\n callback(fileData);\r\n };\r\n\r\n transaction.oncomplete = () => {\r\n callback(fileData);\r\n };\r\n\r\n let newFile;\r\n if (targetStore === \"scenes\") {\r\n newFile = { sceneUrl: url, data: fileData, version: this._manifestVersionFound };\r\n } else {\r\n newFile = { textureUrl: url, data: fileData };\r\n }\r\n\r\n try {\r\n // Put the scene into the database\r\n const addRequest = transaction.objectStore(targetStore).put(newFile);\r\n addRequest.onsuccess = () => {};\r\n addRequest.onerror = () => {\r\n Logger.Error(\"Error in DB add file request in BABYLON.Database.\");\r\n };\r\n } catch (ex) {\r\n callback(fileData);\r\n }\r\n } else {\r\n callback(fileData);\r\n }\r\n } else {\r\n if (xhr.status >= 400 && errorCallback) {\r\n errorCallback(xhr);\r\n } else {\r\n callback();\r\n }\r\n }\r\n },\r\n false\r\n );\r\n\r\n xhr.addEventListener(\r\n \"error\",\r\n () => {\r\n Logger.Error(\"error on XHR request.\");\r\n errorCallback && errorCallback();\r\n },\r\n false\r\n );\r\n\r\n xhr.send();\r\n } else {\r\n Logger.Error(\"Error: IndexedDB not supported by your browser or Babylon.js database is not open.\");\r\n errorCallback && errorCallback();\r\n }\r\n }\r\n\r\n /**\r\n * Validates if xhr data is correct\r\n * @param xhr defines the request to validate\r\n * @param dataType defines the expected data type\r\n * @returns true if data is correct\r\n */\r\n private static _ValidateXHRData(xhr: WebRequest, dataType = 7): boolean {\r\n // 1 for text (.babylon, manifest and shaders), 2 for TGA, 4 for DDS, 7 for all\r\n\r\n try {\r\n if (dataType & 1) {\r\n if (xhr.responseText && xhr.responseText.length > 0) {\r\n return true;\r\n } else if (dataType === 1) {\r\n return false;\r\n }\r\n }\r\n\r\n if (dataType & 2) {\r\n // Check header width and height since there is no \"TGA\" magic number\r\n const tgaHeader = GetTGAHeader(xhr.response);\r\n\r\n if (tgaHeader.width && tgaHeader.height && tgaHeader.width > 0 && tgaHeader.height > 0) {\r\n return true;\r\n } else if (dataType === 2) {\r\n return false;\r\n }\r\n }\r\n\r\n if (dataType & 4) {\r\n // Check for the \"DDS\" magic number\r\n const ddsHeader = new Uint8Array(xhr.response, 0, 3);\r\n\r\n if (ddsHeader[0] === 68 && ddsHeader[1] === 68 && ddsHeader[2] === 83) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n }\r\n } catch (e) {\r\n // Global protection\r\n }\r\n\r\n return false;\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"database.js","sourceRoot":"","sources":["../../../../lts/core/generated/Offline/database.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAE3C,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAEhD,kDAAkD;AAClD,MAAM,CAAC,sBAAsB,GAAG,CAAC,UAAkB,EAAE,uBAAkD,EAAE,oBAAoB,GAAG,KAAK,EAAE,EAAE;IACrI,OAAO,IAAI,QAAQ,CAAC,UAAU,EAAE,uBAAuB,EAAE,oBAAoB,CAAC,CAAC;AACnF,CAAC,CAAC;AAEF;;;GAGG;AACH,MAAM,OAAO,QAAQ;IAqBjB;;OAEG;IACH,IAAW,kBAAkB;QACzB,OAAO,IAAI,CAAC,mBAAmB,CAAC;IACpC,CAAC;IAED;;OAEG;IACH,IAAW,qBAAqB;QAC5B,OAAO,IAAI,CAAC,sBAAsB,CAAC;IACvC,CAAC;IAED;;;;;OAKG;IACH,YAAY,UAAkB,EAAE,uBAAkD,EAAE,oBAAoB,GAAG,KAAK;QA/BhH,4DAA4D;QACpD,gBAAW,GAAe,CAAC,OAAO,SAAS,KAAK,WAAW,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;QA+BzF,IAAI,CAAC,gBAAgB,GAAG,QAAQ,CAAC,sBAAsB,CAAC,UAAU,CAAC,CAAC;QACpE,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC;QAChB,IAAI,CAAC,mBAAmB,GAAG,KAAK,CAAC;QACjC,IAAI,CAAC,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EAAE;QAChG,OAAO,QAAQ,CAAC,SAAS,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC;KACzD;SAAM;QACH,OAAO,GAAG,CAAC;KACd;AACL,CAAC,AANoC,CAMnC","sourcesContent":["import type { Nullable } from \"../types\";\r\nimport { Tools } from \"../Misc/tools\";\r\nimport { Logger } from \"../Misc/logger\";\r\nimport { GetTGAHeader } from \"../Misc/tga\";\r\nimport { Engine } from \"../Engines/engine\";\r\nimport type { IOfflineProvider } from \"./IOfflineProvider\";\r\nimport { WebRequest } from \"../Misc/webRequest\";\r\n\r\n// Sets the default offline provider to Babylon.js\r\nEngine.OfflineProviderFactory = (urlToScene: string, callbackManifestChecked: (checked: boolean) => any, disableManifestCheck = false) => {\r\n return new Database(urlToScene, callbackManifestChecked, disableManifestCheck);\r\n};\r\n\r\n/**\r\n * Class used to enable access to IndexedDB\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/scene/optimizeCached\r\n */\r\nexport class Database implements IOfflineProvider {\r\n private _currentSceneUrl: string;\r\n private _db: Nullable<IDBDatabase>;\r\n private _enableSceneOffline: boolean;\r\n private _enableTexturesOffline: boolean;\r\n private _manifestVersionFound: number;\r\n private _mustUpdateRessources: boolean;\r\n private _hasReachedQuota: boolean;\r\n private _isSupported: boolean;\r\n\r\n // Handling various flavors of prefixed version of IndexedDB\r\n private _idbFactory = <IDBFactory>(typeof indexedDB !== \"undefined\" ? indexedDB : undefined);\r\n\r\n /** Gets a boolean indicating if the user agent supports blob storage (this value will be updated after creating the first Database object) */\r\n private static _IsUASupportingBlobStorage = true;\r\n\r\n /**\r\n * Gets a boolean indicating if Database storage is enabled (off by default)\r\n */\r\n static IDBStorageEnabled = false;\r\n\r\n /**\r\n * Gets a boolean indicating if scene must be saved in the database\r\n */\r\n public get enableSceneOffline(): boolean {\r\n return this._enableSceneOffline;\r\n }\r\n\r\n /**\r\n * Gets a boolean indicating if textures must be saved in the database\r\n */\r\n public get enableTexturesOffline(): boolean {\r\n return this._enableTexturesOffline;\r\n }\r\n\r\n /**\r\n * Creates a new Database\r\n * @param urlToScene defines the url to load the scene\r\n * @param callbackManifestChecked defines the callback to use when manifest is checked\r\n * @param disableManifestCheck defines a boolean indicating that we want to skip the manifest validation (it will be considered validated and up to date)\r\n */\r\n constructor(urlToScene: string, callbackManifestChecked: (checked: boolean) => any, disableManifestCheck = false) {\r\n this._currentSceneUrl = Database._ReturnFullUrlLocation(urlToScene);\r\n this._db = null;\r\n this._enableSceneOffline = false;\r\n this._enableTexturesOffline = false;\r\n this._manifestVersionFound = 0;\r\n this._mustUpdateRessources = false;\r\n this._hasReachedQuota = false;\r\n\r\n if (!Database.IDBStorageEnabled) {\r\n callbackManifestChecked(true);\r\n } else {\r\n if (disableManifestCheck) {\r\n this._enableSceneOffline = true;\r\n this._enableTexturesOffline = true;\r\n this._manifestVersionFound = 1;\r\n Tools.SetImmediate(() => {\r\n callbackManifestChecked(true);\r\n });\r\n } else {\r\n this._checkManifestFile(callbackManifestChecked);\r\n }\r\n }\r\n }\r\n\r\n private static _ParseURL = (url: string) => {\r\n const a = document.createElement(\"a\");\r\n a.href = url;\r\n const urlWithoutHash = url.substring(0, url.lastIndexOf(\"#\"));\r\n const fileName = url.substring(urlWithoutHash.lastIndexOf(\"/\") + 1, url.length);\r\n const absLocation = url.substring(0, url.indexOf(fileName, 0));\r\n return absLocation;\r\n };\r\n\r\n private static _ReturnFullUrlLocation = (url: string): string => {\r\n if (url.indexOf(\"http:/\") === -1 && url.indexOf(\"https:/\") === -1 && typeof window !== \"undefined\") {\r\n return Database._ParseURL(window.location.href) + url;\r\n } else {\r\n return url;\r\n }\r\n };\r\n\r\n private _checkManifestFile(callbackManifestChecked: (checked: boolean) => any) {\r\n const noManifestFile = () => {\r\n this._enableSceneOffline = false;\r\n this._enableTexturesOffline = false;\r\n callbackManifestChecked(false);\r\n };\r\n\r\n const createManifestURL = (): string => {\r\n try {\r\n // make sure we have a valid URL.\r\n if (typeof URL === \"function\" && this._currentSceneUrl.indexOf(\"http\") === 0) {\r\n // we don't have the base url, so the URL string must have a protocol\r\n const url = new URL(this._currentSceneUrl);\r\n url.pathname += \".manifest\";\r\n return url.toString();\r\n }\r\n } catch (e) {\r\n // defensive - if this fails for any reason, fall back to the older method\r\n }\r\n\r\n return `${this._currentSceneUrl}.manifest`;\r\n };\r\n\r\n let timeStampUsed = false;\r\n let manifestURL = createManifestURL();\r\n\r\n const xhr = new WebRequest();\r\n\r\n if (navigator.onLine) {\r\n // Adding a timestamp to by-pass browsers' cache\r\n timeStampUsed = true;\r\n manifestURL = manifestURL + (manifestURL.match(/\\?/) == null ? \"?\" : \"&\") + Date.now();\r\n }\r\n xhr.open(\"GET\", manifestURL);\r\n\r\n xhr.addEventListener(\r\n \"load\",\r\n () => {\r\n if (xhr.status === 200 || Database._ValidateXHRData(xhr, 1)) {\r\n try {\r\n const manifestFile = JSON.parse(xhr.response);\r\n this._enableSceneOffline = manifestFile.enableSceneOffline;\r\n this._enableTexturesOffline = manifestFile.enableTexturesOffline && Database._IsUASupportingBlobStorage;\r\n if (manifestFile.version && !isNaN(parseInt(manifestFile.version))) {\r\n this._manifestVersionFound = manifestFile.version;\r\n }\r\n callbackManifestChecked(true);\r\n } catch (ex) {\r\n noManifestFile();\r\n }\r\n } else {\r\n noManifestFile();\r\n }\r\n },\r\n false\r\n );\r\n\r\n xhr.addEventListener(\r\n \"error\",\r\n () => {\r\n if (timeStampUsed) {\r\n timeStampUsed = false;\r\n // Let's retry without the timeStamp\r\n // It could fail when coupled with HTML5 Offline API\r\n const retryManifestURL = createManifestURL();\r\n xhr.open(\"GET\", retryManifestURL);\r\n xhr.send();\r\n } else {\r\n noManifestFile();\r\n }\r\n },\r\n false\r\n );\r\n\r\n try {\r\n xhr.send();\r\n } catch (ex) {\r\n Logger.Error(\"Error on XHR send request.\");\r\n callbackManifestChecked(false);\r\n }\r\n }\r\n\r\n /**\r\n * Open the database and make it available\r\n * @param successCallback defines the callback to call on success\r\n * @param errorCallback defines the callback to call on error\r\n */\r\n public open(successCallback: () => void, errorCallback: () => void): void {\r\n const handleError = () => {\r\n this._isSupported = false;\r\n if (errorCallback) {\r\n errorCallback();\r\n }\r\n };\r\n\r\n if (!this._idbFactory || !(this._enableSceneOffline || this._enableTexturesOffline)) {\r\n // Your browser doesn't support IndexedDB\r\n this._isSupported = false;\r\n if (errorCallback) {\r\n errorCallback();\r\n }\r\n } else {\r\n // If the DB hasn't been opened or created yet\r\n if (!this._db) {\r\n this._hasReachedQuota = false;\r\n this._isSupported = true;\r\n\r\n const request: IDBOpenDBRequest = this._idbFactory.open(\"babylonjs\", 1);\r\n\r\n // Could occur if user is blocking the quota for the DB and/or doesn't grant access to IndexedDB\r\n request.onerror = () => {\r\n handleError();\r\n };\r\n\r\n // executes when a version change transaction cannot complete due to other active transactions\r\n request.onblocked = () => {\r\n Logger.Error(\"IDB request blocked. Please reload the page.\");\r\n handleError();\r\n };\r\n\r\n // DB has been opened successfully\r\n request.onsuccess = () => {\r\n this._db = request.result;\r\n successCallback();\r\n };\r\n\r\n // Initialization of the DB. Creating Scenes & Textures stores\r\n request.onupgradeneeded = (event: IDBVersionChangeEvent) => {\r\n this._db = (<any>event.target).result;\r\n if (this._db) {\r\n try {\r\n this._db.createObjectStore(\"scenes\", { keyPath: \"sceneUrl\" });\r\n this._db.createObjectStore(\"versions\", { keyPath: \"sceneUrl\" });\r\n this._db.createObjectStore(\"textures\", { keyPath: \"textureUrl\" });\r\n } catch (ex) {\r\n Logger.Error(\"Error while creating object stores. Exception: \" + ex.message);\r\n handleError();\r\n }\r\n }\r\n };\r\n }\r\n // DB has already been created and opened\r\n else {\r\n if (successCallback) {\r\n successCallback();\r\n }\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Loads an image from the database\r\n * @param url defines the url to load from\r\n * @param image defines the target DOM image\r\n */\r\n public loadImage(url: string, image: HTMLImageElement) {\r\n const completeURL = Database._ReturnFullUrlLocation(url);\r\n\r\n const saveAndLoadImage = () => {\r\n if (!this._hasReachedQuota && this._db !== null) {\r\n // the texture is not yet in the DB, let's try to save it\r\n this._saveImageIntoDBAsync(completeURL, image);\r\n }\r\n // If the texture is not in the DB and we've reached the DB quota limit\r\n // let's load it directly from the web\r\n else {\r\n image.src = url;\r\n }\r\n };\r\n\r\n if (!this._mustUpdateRessources) {\r\n this._loadImageFromDBAsync(completeURL, image, saveAndLoadImage);\r\n }\r\n // First time we're download the images or update requested in the manifest file by a version change\r\n else {\r\n saveAndLoadImage();\r\n }\r\n }\r\n\r\n private _loadImageFromDBAsync(url: string, image: HTMLImageElement, notInDBCallback: () => any) {\r\n if (this._isSupported && this._db !== null) {\r\n let texture: any;\r\n const transaction: IDBTransaction = this._db.transaction([\"textures\"]);\r\n\r\n transaction.onabort = () => {\r\n image.src = url;\r\n };\r\n\r\n transaction.oncomplete = () => {\r\n let blobTextureURL: string;\r\n if (texture && typeof URL === \"function\") {\r\n blobTextureURL = URL.createObjectURL(texture.data);\r\n image.onerror = () => {\r\n Logger.Error(\"Error loading image from blob URL: \" + blobTextureURL + \" switching back to web url: \" + url);\r\n image.src = url;\r\n };\r\n image.src = blobTextureURL;\r\n } else {\r\n notInDBCallback();\r\n }\r\n };\r\n\r\n const getRequest: IDBRequest = transaction.objectStore(\"textures\").get(url);\r\n\r\n getRequest.onsuccess = (event) => {\r\n texture = (<any>event.target).result;\r\n };\r\n getRequest.onerror = () => {\r\n Logger.Error(\"Error loading texture \" + url + \" from DB.\");\r\n image.src = url;\r\n };\r\n } else {\r\n Logger.Error(\"Error: IndexedDB not supported by your browser or BabylonJS Database is not open.\");\r\n image.src = url;\r\n }\r\n }\r\n\r\n private _saveImageIntoDBAsync(url: string, image: HTMLImageElement) {\r\n let blob: Blob;\r\n\r\n if (this._isSupported) {\r\n // In case of error (type not supported or quota exceeded), we're at least sending back XHR data to allow texture loading later on\r\n const generateBlobUrl = () => {\r\n let blobTextureURL;\r\n\r\n if (blob && typeof URL === \"function\") {\r\n try {\r\n blobTextureURL = URL.createObjectURL(blob);\r\n } catch (ex) {\r\n // Chrome is raising a type error if we're setting the oneTimeOnly parameter\r\n blobTextureURL = URL.createObjectURL(blob);\r\n }\r\n }\r\n\r\n if (blobTextureURL) {\r\n image.src = blobTextureURL;\r\n }\r\n };\r\n\r\n if (Database._IsUASupportingBlobStorage) {\r\n // Create XHR\r\n const xhr = new WebRequest();\r\n\r\n xhr.open(\"GET\", url);\r\n xhr.responseType = \"blob\";\r\n\r\n xhr.addEventListener(\r\n \"load\",\r\n () => {\r\n if (xhr.status === 200 && this._db) {\r\n // Blob as response\r\n blob = xhr.response;\r\n\r\n const transaction = this._db.transaction([\"textures\"], \"readwrite\");\r\n\r\n // the transaction could abort because of a QuotaExceededError error\r\n transaction.onabort = (event) => {\r\n try {\r\n //backwards compatibility with ts 1.0, srcElement doesn't have an \"error\" according to ts 1.3\r\n const srcElement = <any>event.target;\r\n const error = srcElement.error;\r\n if (error && error.name === \"QuotaExceededError\") {\r\n this._hasReachedQuota = true;\r\n }\r\n } catch (ex) {}\r\n generateBlobUrl();\r\n };\r\n\r\n transaction.oncomplete = () => {\r\n generateBlobUrl();\r\n };\r\n\r\n const newTexture = { textureUrl: url, data: blob };\r\n\r\n try {\r\n // Put the blob into the dabase\r\n const addRequest = transaction.objectStore(\"textures\").put(newTexture);\r\n addRequest.onsuccess = () => {};\r\n addRequest.onerror = () => {\r\n generateBlobUrl();\r\n };\r\n } catch (ex) {\r\n // \"DataCloneError\" generated by Chrome when you try to inject blob into IndexedDB\r\n if (ex.code === 25) {\r\n Database._IsUASupportingBlobStorage = false;\r\n this._enableTexturesOffline = false;\r\n }\r\n image.src = url;\r\n }\r\n } else {\r\n image.src = url;\r\n }\r\n },\r\n false\r\n );\r\n\r\n xhr.addEventListener(\r\n \"error\",\r\n () => {\r\n Logger.Error(\"Error in XHR request in BABYLON.Database.\");\r\n image.src = url;\r\n },\r\n false\r\n );\r\n\r\n xhr.send();\r\n } else {\r\n image.src = url;\r\n }\r\n } else {\r\n Logger.Error(\"Error: IndexedDB not supported by your browser or Babylon.js database is not open.\");\r\n image.src = url;\r\n }\r\n }\r\n\r\n private _checkVersionFromDB(url: string, versionLoaded: (version: number) => void) {\r\n const updateVersion = () => {\r\n // the version is not yet in the DB or we need to update it\r\n this._saveVersionIntoDBAsync(url, versionLoaded);\r\n };\r\n this._loadVersionFromDBAsync(url, versionLoaded, updateVersion);\r\n }\r\n\r\n private _loadVersionFromDBAsync(url: string, callback: (version: number) => void, updateInDBCallback: () => void) {\r\n if (this._isSupported && this._db) {\r\n let version: any;\r\n try {\r\n const transaction = this._db.transaction([\"versions\"]);\r\n\r\n transaction.oncomplete = () => {\r\n if (version) {\r\n // If the version in the JSON file is different from the version in DB\r\n if (this._manifestVersionFound !== version.data) {\r\n this._mustUpdateRessources = true;\r\n updateInDBCallback();\r\n } else {\r\n callback(version.data);\r\n }\r\n }\r\n // version was not found in DB\r\n else {\r\n this._mustUpdateRessources = true;\r\n updateInDBCallback();\r\n }\r\n };\r\n\r\n transaction.onabort = () => {\r\n callback(-1);\r\n };\r\n\r\n const getRequest = transaction.objectStore(\"versions\").get(url);\r\n\r\n getRequest.onsuccess = (event) => {\r\n version = (<any>event.target).result;\r\n };\r\n getRequest.onerror = () => {\r\n Logger.Error(\"Error loading version for scene \" + url + \" from DB.\");\r\n callback(-1);\r\n };\r\n } catch (ex) {\r\n Logger.Error(\"Error while accessing 'versions' object store (READ OP). Exception: \" + ex.message);\r\n callback(-1);\r\n }\r\n } else {\r\n Logger.Error(\"Error: IndexedDB not supported by your browser or Babylon.js database is not open.\");\r\n callback(-1);\r\n }\r\n }\r\n\r\n private _saveVersionIntoDBAsync(url: string, callback: (version: number) => void) {\r\n if (this._isSupported && !this._hasReachedQuota && this._db) {\r\n try {\r\n // Open a transaction to the database\r\n const transaction = this._db.transaction([\"versions\"], \"readwrite\");\r\n\r\n // the transaction could abort because of a QuotaExceededError error\r\n transaction.onabort = (event) => {\r\n try {\r\n //backwards compatibility with ts 1.0, srcElement doesn't have an \"error\" according to ts 1.3\r\n const error = (<any>event.target)[\"error\"];\r\n if (error && error.name === \"QuotaExceededError\") {\r\n this._hasReachedQuota = true;\r\n }\r\n } catch (ex) {}\r\n callback(-1);\r\n };\r\n\r\n transaction.oncomplete = () => {\r\n callback(this._manifestVersionFound);\r\n };\r\n\r\n const newVersion = { sceneUrl: url, data: this._manifestVersionFound };\r\n\r\n // Put the scene into the database\r\n const addRequest = transaction.objectStore(\"versions\").put(newVersion);\r\n addRequest.onsuccess = () => {};\r\n addRequest.onerror = () => {\r\n Logger.Error(\"Error in DB add version request in BABYLON.Database.\");\r\n };\r\n } catch (ex) {\r\n Logger.Error(\"Error while accessing 'versions' object store (WRITE OP). Exception: \" + ex.message);\r\n callback(-1);\r\n }\r\n } else {\r\n callback(-1);\r\n }\r\n }\r\n\r\n /**\r\n * Loads a file from database\r\n * @param url defines the URL to load from\r\n * @param sceneLoaded defines a callback to call on success\r\n * @param progressCallBack defines a callback to call when progress changed\r\n * @param errorCallback defines a callback to call on error\r\n * @param useArrayBuffer defines a boolean to use array buffer instead of text string\r\n */\r\n public loadFile(url: string, sceneLoaded: (data: any) => void, progressCallBack?: (data: any) => void, errorCallback?: () => void, useArrayBuffer?: boolean): void {\r\n const completeUrl = Database._ReturnFullUrlLocation(url);\r\n\r\n const saveAndLoadFile = () => {\r\n // the scene is not yet in the DB, let's try to save it\r\n this._saveFileAsync(completeUrl, sceneLoaded, progressCallBack, useArrayBuffer, errorCallback);\r\n };\r\n\r\n this._checkVersionFromDB(completeUrl, (version) => {\r\n if (version !== -1) {\r\n if (!this._mustUpdateRessources) {\r\n this._loadFileAsync(completeUrl, sceneLoaded, saveAndLoadFile);\r\n } else {\r\n this._saveFileAsync(completeUrl, sceneLoaded, progressCallBack, useArrayBuffer, errorCallback);\r\n }\r\n } else {\r\n if (errorCallback) {\r\n errorCallback();\r\n }\r\n }\r\n });\r\n }\r\n\r\n private _loadFileAsync(url: string, callback: (data?: any) => void, notInDBCallback: () => void) {\r\n if (this._isSupported && this._db) {\r\n let targetStore: string;\r\n if (url.indexOf(\".babylon\") !== -1) {\r\n targetStore = \"scenes\";\r\n } else {\r\n targetStore = \"textures\";\r\n }\r\n\r\n let file: any;\r\n const transaction = this._db.transaction([targetStore]);\r\n\r\n transaction.oncomplete = () => {\r\n if (file) {\r\n callback(file.data);\r\n }\r\n // file was not found in DB\r\n else {\r\n notInDBCallback();\r\n }\r\n };\r\n\r\n transaction.onabort = () => {\r\n notInDBCallback();\r\n };\r\n\r\n const getRequest = transaction.objectStore(targetStore).get(url);\r\n\r\n getRequest.onsuccess = (event) => {\r\n file = (<any>event.target).result;\r\n };\r\n getRequest.onerror = () => {\r\n Logger.Error(\"Error loading file \" + url + \" from DB.\");\r\n notInDBCallback();\r\n };\r\n } else {\r\n Logger.Error(\"Error: IndexedDB not supported by your browser or BabylonJS Database is not open.\");\r\n callback();\r\n }\r\n }\r\n\r\n private _saveFileAsync(\r\n url: string,\r\n callback: (data?: any) => void,\r\n progressCallback?: (this: XMLHttpRequestEventTarget, ev: ProgressEvent) => any,\r\n useArrayBuffer?: boolean,\r\n errorCallback?: (data?: any) => void\r\n ) {\r\n if (this._isSupported) {\r\n let targetStore: string;\r\n if (url.indexOf(\".babylon\") !== -1) {\r\n targetStore = \"scenes\";\r\n } else {\r\n targetStore = \"textures\";\r\n }\r\n\r\n // Create XHR\r\n const xhr = new WebRequest();\r\n let fileData: any;\r\n xhr.open(\"GET\", url + (url.match(/\\?/) == null ? \"?\" : \"&\") + Date.now());\r\n\r\n if (useArrayBuffer) {\r\n xhr.responseType = \"arraybuffer\";\r\n }\r\n\r\n if (progressCallback) {\r\n xhr.onprogress = progressCallback;\r\n }\r\n\r\n xhr.addEventListener(\r\n \"load\",\r\n () => {\r\n if (xhr.status === 200 || (xhr.status < 400 && Database._ValidateXHRData(xhr, !useArrayBuffer ? 1 : 6))) {\r\n // Blob as response\r\n fileData = !useArrayBuffer ? xhr.responseText : xhr.response;\r\n\r\n if (!this._hasReachedQuota && this._db) {\r\n // Open a transaction to the database\r\n const transaction = this._db.transaction([targetStore], \"readwrite\");\r\n\r\n // the transaction could abort because of a QuotaExceededError error\r\n transaction.onabort = (event) => {\r\n try {\r\n //backwards compatibility with ts 1.0, srcElement doesn't have an \"error\" according to ts 1.3\r\n const error = (<any>event.target)[\"error\"];\r\n if (error && error.name === \"QuotaExceededError\") {\r\n this._hasReachedQuota = true;\r\n }\r\n } catch (ex) {}\r\n callback(fileData);\r\n };\r\n\r\n transaction.oncomplete = () => {\r\n callback(fileData);\r\n };\r\n\r\n let newFile;\r\n if (targetStore === \"scenes\") {\r\n newFile = { sceneUrl: url, data: fileData, version: this._manifestVersionFound };\r\n } else {\r\n newFile = { textureUrl: url, data: fileData };\r\n }\r\n\r\n try {\r\n // Put the scene into the database\r\n const addRequest = transaction.objectStore(targetStore).put(newFile);\r\n addRequest.onsuccess = () => {};\r\n addRequest.onerror = () => {\r\n Logger.Error(\"Error in DB add file request in BABYLON.Database.\");\r\n };\r\n } catch (ex) {\r\n callback(fileData);\r\n }\r\n } else {\r\n callback(fileData);\r\n }\r\n } else {\r\n if (xhr.status >= 400 && errorCallback) {\r\n errorCallback(xhr);\r\n } else {\r\n callback();\r\n }\r\n }\r\n },\r\n false\r\n );\r\n\r\n xhr.addEventListener(\r\n \"error\",\r\n () => {\r\n Logger.Error(\"error on XHR request.\");\r\n errorCallback && errorCallback();\r\n },\r\n false\r\n );\r\n\r\n xhr.send();\r\n } else {\r\n Logger.Error(\"Error: IndexedDB not supported by your browser or Babylon.js database is not open.\");\r\n errorCallback && errorCallback();\r\n }\r\n }\r\n\r\n /**\r\n * Validates if xhr data is correct\r\n * @param xhr defines the request to validate\r\n * @param dataType defines the expected data type\r\n * @returns true if data is correct\r\n */\r\n private static _ValidateXHRData(xhr: WebRequest, dataType = 7): boolean {\r\n // 1 for text (.babylon, manifest and shaders), 2 for TGA, 4 for DDS, 7 for all\r\n\r\n try {\r\n if (dataType & 1) {\r\n if (xhr.responseText && xhr.responseText.length > 0) {\r\n return true;\r\n } else if (dataType === 1) {\r\n return false;\r\n }\r\n }\r\n\r\n if (dataType & 2) {\r\n // Check header width and height since there is no \"TGA\" magic number\r\n const tgaHeader = GetTGAHeader(xhr.response);\r\n\r\n if (tgaHeader.width && tgaHeader.height && tgaHeader.width > 0 && tgaHeader.height > 0) {\r\n return true;\r\n } else if (dataType === 2) {\r\n return false;\r\n }\r\n }\r\n\r\n if (dataType & 4) {\r\n // Check for the \"DDS\" magic number\r\n const ddsHeader = new Uint8Array(xhr.response, 0, 3);\r\n\r\n if (ddsHeader[0] === 68 && ddsHeader[1] === 68 && ddsHeader[2] === 83) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n }\r\n } catch (e) {\r\n // Global protection\r\n }\r\n\r\n return false;\r\n }\r\n}\r\n"]}
@@ -1 +1 @@
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,qBAAqB,CAAC;AAG7C,OAAO,4CAA4C,CAAC;AAQpD;;;;;GAKG;AACH,MAAM,OAAO,kBAAkB;IA8K3B;;OAEG;IACH,IAAW,YAAY;QACnB,OAAO,IAAI,CAAC,aAAa,CAAC;IAC9B,CAAC;IAED,IAAW,YAAY,CAAC,KAAkC;QACtD,IAAI,IAAI,CAAC,aAAa,KAA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C;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,qBAAqB,CAAC;AAG7C,OAAO,4CAA4C,CAAC;AAQpD;;;;;GAKG;AACH,MAAM,OAAO,kBAAkB;IA8K3B;;OAEG;IACH,IAAW,YAAY;QACnB,OAAO,IAAI,CAAC,aAAa,CAAC;IAC9B,CAAC;IAED,IAAW,YAAY,CAAC,KAAkC;QACtD,IAAI,IAAI,CAAC,aAAa,KAAK,KAAK,EAAE;YAC9B,OAAO;SACV;QAED,IAAI,CAAC,aAAa,GAAG,KAAK,CAAC;QAC3B,IAAI,CAAC,MAAM,EAAE,CAAC;IAClB,CAAC;IAqHD;;OAEG;IACH,IAAW,uBAAuB;QAC9B,OAAO,IAAI,CAAC,wBAAwB,CAAC;IACzC,CAAC;IAED,IAAW,uBAAuB,CAAC,KAAc;QAC7C,IAAI,IAAI,CAAC,wBAAwB,IAAI,KAAK,EAAE;YACxC,OAAO;SACV;QAED,IAAI,CAAC,wBAAwB,GAAG,KAAK,CAAC;QAEtC,IA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AC;QACjH,IAAI,CAAC,mBAAmB,GAAG,eAAe,CAAC;QAC3C,OAAO,eAAe,CAAC;IAC3B,CAAC;IAED;;;;;OAKG;IACI,iBAAiB,CAAC,MAAM,GAAG,CAAC,EAAE,KAAK,GAAG,IAAI,CAAC,EAAE,GAAG,CAAC;QACpD,MAAM,eAAe,GAAG,IAAI,mBAAmB,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;QAC/D,IAAI,CAAC,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,AAAJ,CAAK;AACnC;;GAEG;AACW,qCAAkB,GAAG,CAAC,AAAJ,CAAK;AACrC;;GAEG;AACW,gCAAa,GAAG,CAAC,AAAJ,CAAK;AAChC;;GAEG;AACW,qCAAkB,GAAG,CAAC,AAAJ,CAAK;AAErC;;GAEG;AACW,wCAAqB,GAAG,CAAC,AAAJ,CAAK","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"]}
@@ -14,6 +14,7 @@ import { ThinEngine } from "../Engines/thinEngine";
14
14
  import type { DataBuffer } from "../Buffers/dataBuffer";
15
15
  import { DrawWrapper } from "../Materials/drawWrapper";
16
16
  declare type Scene = import("../scene").Scene;
17
+ import "../Engines/Extensions/engine.transformFeedback";
17
18
  import "../Shaders/gpuRenderParticles.fragment";
18
19
  import "../Shaders/gpuRenderParticles.vertex";
19
20
  /**
@@ -15,10 +15,11 @@ import { EngineStore } from "../Engines/engineStore.js";
15
15
  import { CustomParticleEmitter } from "./EmitterTypes/customParticleEmitter.js";
16
16
  import { ThinEngine } from "../Engines/thinEngine.js";
17
17
  import { DrawWrapper } from "../Materials/drawWrapper.js";
18
- import "../Shaders/gpuRenderParticles.fragment.js";
19
- import "../Shaders/gpuRenderParticles.vertex.js";
20
18
  import { GetClass } from "../Misc/typeStore.js";
21
19
  import { addClipPlaneUniforms, bindClipPlane, prepareStringDefinesForClipPlanes } from "../Materials/clipPlaneMaterialHelper.js";
20
+ import "../Engines/Extensions/engine.transformFeedback.js";
21
+ import "../Shaders/gpuRenderParticles.fragment.js";
22
+ import "../Shaders/gpuRenderParticles.vertex.js";
22
23
  /**
23
24
  * This represents a GPU particle system in Babylon
24
25
  * This is the fastest particle system in Babylon as it uses the GPU to update the individual particle data
@@ -627,11 +628,7 @@ export class GPUParticleSystem extends BaseParticleSystem {
627
628
  if (!options.randomTextureSize) {
628
629
  delete options.randomTextureSize;
629
630
  }
630
- const fullOptions = {
631
- capacity: 50000,
632
- randomTextureSize: this._engine.getCaps().maxTextureSize,
633
- ...options,
634
- };
631
+ const fullOptions = Object.assign({ capacity: 50000, randomTextureSize: this._engine.getCaps().maxTextureSize }, options);
635
632
  const optionsAsNumber = options;
636
633
  if (isFinite(optionsAsNumber)) {
637
634
  fullOptions.capacity = optionsAsNumber;
@@ -1442,7 +1439,7 @@ export class GPUParticleSystem extends BaseParticleSystem {
1442
1439
  * @returns the cloned particle system
1443
1440
  */
1444
1441
  clone(name, newEmitter, cloneTexture = false) {
1445
- const custom = { ...this._customWrappers };
1442
+ const custom = Object.assign({}, this._customWrappers);
1446
1443
  let program = null;
1447
1444
  const engine = this._engine;
1448
1445
  if (engine.createEffectForParticles) {