@babylonjs/core 9.10.1 → 9.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1065) hide show
  1. package/Actions/actionManager.d.ts +1 -1
  2. package/Actions/actionManager.js +8 -5
  3. package/Actions/actionManager.js.map +1 -1
  4. package/Animations/animatable.core.d.ts +1 -1
  5. package/Animations/animatable.core.js +2 -2
  6. package/Animations/animatable.core.js.map +1 -1
  7. package/Animations/animationPropertiesOverride.js +1 -1
  8. package/Animations/animationPropertiesOverride.js.map +1 -1
  9. package/Animations/animatorAvatar.d.ts +2 -2
  10. package/Animations/animatorAvatar.js +3 -3
  11. package/Animations/animatorAvatar.js.map +1 -1
  12. package/Animations/pathCursor.d.ts +1 -1
  13. package/Animations/pathCursor.js +1 -1
  14. package/Animations/pathCursor.js.map +1 -1
  15. package/Animations/runtimeAnimation.d.ts +1 -1
  16. package/Animations/runtimeAnimation.js +2 -2
  17. package/Animations/runtimeAnimation.js.map +1 -1
  18. package/Audio/analyser.js +1 -1
  19. package/Audio/analyser.js.map +1 -1
  20. package/AudioV2/abstractAudio/components/spatialAudioAttacherComponent.js +1 -1
  21. package/AudioV2/abstractAudio/components/spatialAudioAttacherComponent.js.map +1 -1
  22. package/AudioV2/abstractAudio/subNodes/audioAnalyzerSubNode.d.ts +2 -0
  23. package/AudioV2/abstractAudio/subNodes/audioAnalyzerSubNode.js.map +1 -1
  24. package/AudioV2/abstractAudio/subProperties/abstractAudioAnalyzer.d.ts +13 -3
  25. package/AudioV2/abstractAudio/subProperties/abstractAudioAnalyzer.js +16 -0
  26. package/AudioV2/abstractAudio/subProperties/abstractAudioAnalyzer.js.map +1 -1
  27. package/AudioV2/abstractAudio/subProperties/abstractSpatialAudio.d.ts +1 -1
  28. package/AudioV2/abstractAudio/subProperties/abstractSpatialAudio.js +1 -1
  29. package/AudioV2/abstractAudio/subProperties/abstractSpatialAudio.js.map +1 -1
  30. package/AudioV2/abstractAudio/subProperties/abstractSpatialAudioListener.d.ts +1 -1
  31. package/AudioV2/abstractAudio/subProperties/abstractSpatialAudioListener.js +1 -1
  32. package/AudioV2/abstractAudio/subProperties/abstractSpatialAudioListener.js.map +1 -1
  33. package/AudioV2/abstractAudio/subProperties/audioAnalyzer.d.ts +4 -0
  34. package/AudioV2/abstractAudio/subProperties/audioAnalyzer.js +22 -0
  35. package/AudioV2/abstractAudio/subProperties/audioAnalyzer.js.map +1 -1
  36. package/AudioV2/webAudio/subNodes/spatialWebAudioSubNode.d.ts +1 -1
  37. package/AudioV2/webAudio/subNodes/spatialWebAudioSubNode.js +1 -1
  38. package/AudioV2/webAudio/subNodes/spatialWebAudioSubNode.js.map +1 -1
  39. package/AudioV2/webAudio/subNodes/webAudioAnalyzerSubNode.d.ts +6 -0
  40. package/AudioV2/webAudio/subNodes/webAudioAnalyzerSubNode.js +22 -5
  41. package/AudioV2/webAudio/subNodes/webAudioAnalyzerSubNode.js.map +1 -1
  42. package/AudioV2/webAudio/subProperties/spatialWebAudioListener.js +1 -1
  43. package/AudioV2/webAudio/subProperties/spatialWebAudioListener.js.map +1 -1
  44. package/AudioV2/webAudio/webAudioStreamingSound.js +1 -1
  45. package/AudioV2/webAudio/webAudioStreamingSound.js.map +1 -1
  46. package/BakedVertexAnimation/bakedVertexAnimationManager.d.ts +1 -1
  47. package/BakedVertexAnimation/bakedVertexAnimationManager.js +1 -1
  48. package/BakedVertexAnimation/bakedVertexAnimationManager.js.map +1 -1
  49. package/BakedVertexAnimation/vertexAnimationBaker.js +1 -1
  50. package/BakedVertexAnimation/vertexAnimationBaker.js.map +1 -1
  51. package/Behaviors/Cameras/bouncingBehavior.js +1 -1
  52. package/Behaviors/Cameras/bouncingBehavior.js.map +1 -1
  53. package/Behaviors/Cameras/framingBehavior.d.ts +1 -1
  54. package/Behaviors/Cameras/framingBehavior.js +2 -2
  55. package/Behaviors/Cameras/framingBehavior.js.map +1 -1
  56. package/Behaviors/Cameras/interpolatingBehavior.d.ts +13 -1
  57. package/Behaviors/Cameras/interpolatingBehavior.js +13 -1
  58. package/Behaviors/Cameras/interpolatingBehavior.js.map +1 -1
  59. package/Behaviors/Meshes/attachToBoxBehavior.js +1 -1
  60. package/Behaviors/Meshes/attachToBoxBehavior.js.map +1 -1
  61. package/Behaviors/Meshes/baseSixDofDragBehavior.d.ts +3 -3
  62. package/Behaviors/Meshes/baseSixDofDragBehavior.js +4 -4
  63. package/Behaviors/Meshes/baseSixDofDragBehavior.js.map +1 -1
  64. package/Behaviors/Meshes/followBehavior.js +1 -1
  65. package/Behaviors/Meshes/followBehavior.js.map +1 -1
  66. package/Behaviors/Meshes/handConstraintBehavior.js +2 -2
  67. package/Behaviors/Meshes/handConstraintBehavior.js.map +1 -1
  68. package/Behaviors/Meshes/multiPointerScaleBehavior.js +1 -1
  69. package/Behaviors/Meshes/multiPointerScaleBehavior.js.map +1 -1
  70. package/Behaviors/Meshes/pointerDragBehavior.d.ts +3 -3
  71. package/Behaviors/Meshes/pointerDragBehavior.js +5 -5
  72. package/Behaviors/Meshes/pointerDragBehavior.js.map +1 -1
  73. package/Behaviors/Meshes/sixDofDragBehavior.d.ts +1 -1
  74. package/Behaviors/Meshes/sixDofDragBehavior.js +2 -2
  75. package/Behaviors/Meshes/sixDofDragBehavior.js.map +1 -1
  76. package/Behaviors/Meshes/surfaceMagnetismBehavior.js +1 -1
  77. package/Behaviors/Meshes/surfaceMagnetismBehavior.js.map +1 -1
  78. package/Bones/boneIKController.d.ts +1 -1
  79. package/Bones/boneIKController.js +1 -1
  80. package/Bones/boneIKController.js.map +1 -1
  81. package/Bones/boneLookController.d.ts +1 -1
  82. package/Bones/boneLookController.js +1 -1
  83. package/Bones/boneLookController.js.map +1 -1
  84. package/Bones/skeleton.d.ts +2 -2
  85. package/Bones/skeleton.functions.d.ts +1 -1
  86. package/Bones/skeleton.functions.js +3 -3
  87. package/Bones/skeleton.functions.js.map +1 -1
  88. package/Bones/skeleton.js +3 -4
  89. package/Bones/skeleton.js.map +1 -1
  90. package/Buffers/buffer.align.pure.js +6 -0
  91. package/Buffers/buffer.align.pure.js.map +1 -1
  92. package/Buffers/buffer.nonFloatVertexBuffers.js +2 -1
  93. package/Buffers/buffer.nonFloatVertexBuffers.js.map +1 -1
  94. package/Buffers/buffer.pure.d.ts +8 -0
  95. package/Buffers/buffer.pure.js +31 -2
  96. package/Buffers/buffer.pure.js.map +1 -1
  97. package/Buffers/bufferUtils.js +17 -5
  98. package/Buffers/bufferUtils.js.map +1 -1
  99. package/Cameras/Inputs/BaseCameraMouseWheelInput.js +1 -1
  100. package/Cameras/Inputs/BaseCameraMouseWheelInput.js.map +1 -1
  101. package/Cameras/Inputs/BaseCameraPointersInput.js +1 -1
  102. package/Cameras/Inputs/BaseCameraPointersInput.js.map +1 -1
  103. package/Cameras/Inputs/arcRotateCameraKeyboardMoveInput.js +1 -1
  104. package/Cameras/Inputs/arcRotateCameraKeyboardMoveInput.js.map +1 -1
  105. package/Cameras/Inputs/arcRotateCameraMouseWheelInput.js +2 -2
  106. package/Cameras/Inputs/arcRotateCameraMouseWheelInput.js.map +1 -1
  107. package/Cameras/Inputs/flyCameraKeyboardInput.js +2 -2
  108. package/Cameras/Inputs/flyCameraKeyboardInput.js.map +1 -1
  109. package/Cameras/Inputs/flyCameraMouseInput.js +2 -2
  110. package/Cameras/Inputs/flyCameraMouseInput.js.map +1 -1
  111. package/Cameras/Inputs/followCameraKeyboardMoveInput.js +1 -1
  112. package/Cameras/Inputs/followCameraKeyboardMoveInput.js.map +1 -1
  113. package/Cameras/Inputs/followCameraMouseWheelInput.js +1 -1
  114. package/Cameras/Inputs/followCameraMouseWheelInput.js.map +1 -1
  115. package/Cameras/Inputs/freeCameraGamepadInput.js +1 -1
  116. package/Cameras/Inputs/freeCameraGamepadInput.js.map +1 -1
  117. package/Cameras/Inputs/freeCameraKeyboardMoveInput.js +2 -2
  118. package/Cameras/Inputs/freeCameraKeyboardMoveInput.js.map +1 -1
  119. package/Cameras/Inputs/freeCameraMouseInput.js +1 -1
  120. package/Cameras/Inputs/freeCameraMouseInput.js.map +1 -1
  121. package/Cameras/Inputs/freeCameraMouseWheelInput.js +1 -1
  122. package/Cameras/Inputs/freeCameraMouseWheelInput.js.map +1 -1
  123. package/Cameras/Inputs/freeCameraTouchInput.js +2 -2
  124. package/Cameras/Inputs/freeCameraTouchInput.js.map +1 -1
  125. package/Cameras/Inputs/geospatialCameraKeyboardInput.js +1 -1
  126. package/Cameras/Inputs/geospatialCameraKeyboardInput.js.map +1 -1
  127. package/Cameras/Limits/geospatialLimits.d.ts +1 -1
  128. package/Cameras/Limits/geospatialLimits.js +1 -1
  129. package/Cameras/Limits/geospatialLimits.js.map +1 -1
  130. package/Cameras/RigModes/stereoscopicAnaglyphRigMode.js +2 -2
  131. package/Cameras/RigModes/stereoscopicAnaglyphRigMode.js.map +1 -1
  132. package/Cameras/RigModes/stereoscopicRigMode.d.ts +1 -1
  133. package/Cameras/RigModes/stereoscopicRigMode.js +3 -3
  134. package/Cameras/RigModes/stereoscopicRigMode.js.map +1 -1
  135. package/Cameras/RigModes/vrRigMode.js +2 -2
  136. package/Cameras/RigModes/vrRigMode.js.map +1 -1
  137. package/Cameras/Stereoscopic/stereoscopicScreenUniversalCamera.d.ts +3 -3
  138. package/Cameras/Stereoscopic/stereoscopicScreenUniversalCamera.js +5 -5
  139. package/Cameras/Stereoscopic/stereoscopicScreenUniversalCamera.js.map +1 -1
  140. package/Cameras/VR/vrCameraMetrics.d.ts +1 -1
  141. package/Cameras/VR/vrCameraMetrics.js +1 -1
  142. package/Cameras/VR/vrCameraMetrics.js.map +1 -1
  143. package/Cameras/cameraInputsManager.d.ts +1 -1
  144. package/Cameras/cameraInputsManager.js +1 -1
  145. package/Cameras/cameraInputsManager.js.map +1 -1
  146. package/Collisions/collider.d.ts +1 -1
  147. package/Collisions/collider.js +1 -1
  148. package/Collisions/collider.js.map +1 -1
  149. package/Collisions/gpuPicker.d.ts +1 -1
  150. package/Collisions/gpuPicker.js +5 -5
  151. package/Collisions/gpuPicker.js.map +1 -1
  152. package/Collisions/meshCollisionData.d.ts +1 -1
  153. package/Collisions/meshCollisionData.js +1 -1
  154. package/Collisions/meshCollisionData.js.map +1 -1
  155. package/Collisions/pickingInfo.d.ts +1 -1
  156. package/Collisions/pickingInfo.js +2 -2
  157. package/Collisions/pickingInfo.js.map +1 -1
  158. package/Compute/computeEffect.d.ts +6 -0
  159. package/Compute/computeEffect.js +3 -0
  160. package/Compute/computeEffect.js.map +1 -1
  161. package/Compute/computeShader.pure.d.ts +4 -0
  162. package/Compute/computeShader.pure.js +1 -0
  163. package/Compute/computeShader.pure.js.map +1 -1
  164. package/Culling/Octrees/octreeBlock.d.ts +1 -1
  165. package/Culling/Octrees/octreeBlock.js +1 -1
  166. package/Culling/Octrees/octreeBlock.js.map +1 -1
  167. package/Culling/boundingBox.d.ts +1 -1
  168. package/Culling/boundingBox.js +1 -1
  169. package/Culling/boundingBox.js.map +1 -1
  170. package/Culling/boundingInfo.d.ts +1 -1
  171. package/Culling/boundingInfo.js +1 -1
  172. package/Culling/boundingInfo.js.map +1 -1
  173. package/Culling/boundingSphere.d.ts +1 -1
  174. package/Culling/boundingSphere.js +1 -1
  175. package/Culling/boundingSphere.js.map +1 -1
  176. package/Culling/ray.core.d.ts +1 -1
  177. package/Culling/ray.core.js +1 -1
  178. package/Culling/ray.core.js.map +1 -1
  179. package/Debug/axesViewer.d.ts +1 -1
  180. package/Debug/axesViewer.js +3 -3
  181. package/Debug/axesViewer.js.map +1 -1
  182. package/Debug/boneAxesViewer.d.ts +1 -1
  183. package/Debug/boneAxesViewer.js +1 -1
  184. package/Debug/boneAxesViewer.js.map +1 -1
  185. package/Debug/directionalLightFrustumViewer.d.ts +1 -1
  186. package/Debug/directionalLightFrustumViewer.js +6 -6
  187. package/Debug/directionalLightFrustumViewer.js.map +1 -1
  188. package/Debug/rayHelper.d.ts +1 -1
  189. package/Debug/rayHelper.js +2 -2
  190. package/Debug/rayHelper.js.map +1 -1
  191. package/Debug/skeletonViewer.d.ts +2 -2
  192. package/Debug/skeletonViewer.js +10 -10
  193. package/Debug/skeletonViewer.js.map +1 -1
  194. package/DeviceInput/internalDeviceSourceManager.d.ts +1 -1
  195. package/DeviceInput/internalDeviceSourceManager.js +0 -1
  196. package/DeviceInput/internalDeviceSourceManager.js.map +1 -1
  197. package/DeviceInput/webDeviceInputSystem.js +1 -1
  198. package/DeviceInput/webDeviceInputSystem.js.map +1 -1
  199. package/Engines/Extensions/engine.views.d.ts +1 -1
  200. package/Engines/Extensions/engine.views.js +1 -1
  201. package/Engines/Extensions/engine.views.js.map +1 -1
  202. package/Engines/Native/nativeHelpers.js +4 -1
  203. package/Engines/Native/nativeHelpers.js.map +1 -1
  204. package/Engines/Native/nativeInterfaces.d.ts +10 -1
  205. package/Engines/Native/nativeInterfaces.js.map +1 -1
  206. package/Engines/WebGPU/Extensions/engine.computeShader.pure.js +154 -2
  207. package/Engines/WebGPU/Extensions/engine.computeShader.pure.js.map +1 -1
  208. package/Engines/WebGPU/webgpuCacheRenderPipeline.d.ts +1 -1
  209. package/Engines/WebGPU/webgpuCacheRenderPipeline.js +11 -1
  210. package/Engines/WebGPU/webgpuCacheRenderPipeline.js.map +1 -1
  211. package/Engines/WebGPU/webgpuComputeContext.d.ts +1 -1
  212. package/Engines/WebGPU/webgpuComputeContext.js.map +1 -1
  213. package/Engines/WebGPU/webgpuTintWASM.js +1 -1
  214. package/Engines/WebGPU/webgpuTintWASM.js.map +1 -1
  215. package/Engines/abstractEngine.pure.d.ts +7 -1
  216. package/Engines/abstractEngine.pure.js +34 -4
  217. package/Engines/abstractEngine.pure.js.map +1 -1
  218. package/Engines/constants.d.ts +4 -0
  219. package/Engines/constants.js +4 -0
  220. package/Engines/constants.js.map +1 -1
  221. package/Engines/engine.pure.d.ts +0 -7
  222. package/Engines/engine.pure.js +0 -34
  223. package/Engines/engine.pure.js.map +1 -1
  224. package/Engines/engineFactory.d.ts +2 -2
  225. package/Engines/engineFactory.js +3 -3
  226. package/Engines/engineFactory.js.map +1 -1
  227. package/Engines/thinNativeEngine.pure.js +15 -8
  228. package/Engines/thinNativeEngine.pure.js.map +1 -1
  229. package/Events/pointerEvents.d.ts +1 -1
  230. package/Events/pointerEvents.js +1 -1
  231. package/Events/pointerEvents.js.map +1 -1
  232. package/FlowGraph/Blocks/Data/Utils/flowGraphCodeExecutionBlock.js +1 -1
  233. package/FlowGraph/Blocks/Data/Utils/flowGraphCodeExecutionBlock.js.map +1 -1
  234. package/FlowGraph/Blocks/Data/flowGraphCachedOperationBlock.d.ts +1 -1
  235. package/FlowGraph/Blocks/Data/flowGraphCachedOperationBlock.js +1 -1
  236. package/FlowGraph/Blocks/Data/flowGraphCachedOperationBlock.js.map +1 -1
  237. package/FlowGraph/Blocks/Event/flowGraphKeyboardEventBlock.js +1 -1
  238. package/FlowGraph/Blocks/Event/flowGraphKeyboardEventBlock.js.map +1 -1
  239. package/FlowGraph/Blocks/Execution/Animation/flowGraphInterpolationBlock.pure.d.ts +1 -1
  240. package/FlowGraph/Blocks/Execution/Animation/flowGraphInterpolationBlock.pure.js +3 -3
  241. package/FlowGraph/Blocks/Execution/Animation/flowGraphInterpolationBlock.pure.js.map +1 -1
  242. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphCancelDelayBlock.pure.js +1 -1
  243. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphCancelDelayBlock.pure.js.map +1 -1
  244. package/FlowGraph/CustomTypes/flowGraphMatrix.d.ts +1 -1
  245. package/FlowGraph/CustomTypes/flowGraphMatrix.js +1 -1
  246. package/FlowGraph/CustomTypes/flowGraphMatrix.js.map +1 -1
  247. package/FlowGraph/flowGraphBlock.d.ts +1 -1
  248. package/FlowGraph/flowGraphBlock.js +1 -1
  249. package/FlowGraph/flowGraphBlock.js.map +1 -1
  250. package/FlowGraph/flowGraphExecutionBlock.d.ts +1 -1
  251. package/FlowGraph/flowGraphExecutionBlock.js +1 -1
  252. package/FlowGraph/flowGraphExecutionBlock.js.map +1 -1
  253. package/FlowGraph/flowGraphMath.d.ts +1 -1
  254. package/FlowGraph/flowGraphMath.js +1 -1
  255. package/FlowGraph/flowGraphMath.js.map +1 -1
  256. package/FlowGraph/flowGraphParser.js +1 -1
  257. package/FlowGraph/flowGraphParser.js.map +1 -1
  258. package/FlowGraph/flowGraphPathConverterComponent.d.ts +1 -1
  259. package/FlowGraph/flowGraphPathConverterComponent.js +2 -2
  260. package/FlowGraph/flowGraphPathConverterComponent.js.map +1 -1
  261. package/FlowGraph/flowGraphValidator.js.map +1 -1
  262. package/FlowGraph/serialization.js +4 -4
  263. package/FlowGraph/serialization.js.map +1 -1
  264. package/FlowGraph/utils.js.map +1 -1
  265. package/FrameGraph/Node/nodeRenderGraph.d.ts +2 -2
  266. package/FrameGraph/Node/nodeRenderGraph.js +7 -7
  267. package/FrameGraph/Node/nodeRenderGraph.js.map +1 -1
  268. package/FrameGraph/Tasks/Layers/baseLayerTask.d.ts +30 -0
  269. package/FrameGraph/Tasks/Layers/baseLayerTask.js +28 -1
  270. package/FrameGraph/Tasks/Layers/baseLayerTask.js.map +1 -1
  271. package/FrameGraph/Tasks/Misc/computeShaderTask.d.ts +2 -2
  272. package/FrameGraph/Tasks/Misc/computeShaderTask.js +2 -2
  273. package/FrameGraph/Tasks/Misc/computeShaderTask.js.map +1 -1
  274. package/FrameGraph/Tasks/Misc/lightingVolumeTask.d.ts +1 -1
  275. package/FrameGraph/Tasks/Misc/lightingVolumeTask.js +2 -2
  276. package/FrameGraph/Tasks/Misc/lightingVolumeTask.js.map +1 -1
  277. package/FrameGraph/Tasks/PostProcesses/blurTask.d.ts +7 -0
  278. package/FrameGraph/Tasks/PostProcesses/blurTask.js +8 -1
  279. package/FrameGraph/Tasks/PostProcesses/blurTask.js.map +1 -1
  280. package/FrameGraph/Tasks/PostProcesses/depthOfFieldBlurTask.js +1 -1
  281. package/FrameGraph/Tasks/PostProcesses/depthOfFieldBlurTask.js.map +1 -1
  282. package/FrameGraph/Tasks/PostProcesses/ssrBlurTask.js +1 -1
  283. package/FrameGraph/Tasks/PostProcesses/ssrBlurTask.js.map +1 -1
  284. package/FrameGraph/Tasks/PostProcesses/volumetricLightingBlendVolumeTask.d.ts +1 -1
  285. package/FrameGraph/Tasks/PostProcesses/volumetricLightingBlendVolumeTask.js +1 -1
  286. package/FrameGraph/Tasks/PostProcesses/volumetricLightingBlendVolumeTask.js.map +1 -1
  287. package/FrameGraph/Tasks/PostProcesses/volumetricLightingTask.d.ts +2 -2
  288. package/FrameGraph/Tasks/PostProcesses/volumetricLightingTask.js +3 -3
  289. package/FrameGraph/Tasks/PostProcesses/volumetricLightingTask.js.map +1 -1
  290. package/FrameGraph/Tasks/Rendering/csmShadowGeneratorTask.d.ts +1 -1
  291. package/FrameGraph/Tasks/Rendering/csmShadowGeneratorTask.js +2 -2
  292. package/FrameGraph/Tasks/Rendering/csmShadowGeneratorTask.js.map +1 -1
  293. package/FrameGraph/Tasks/Rendering/geometryRendererTask.d.ts +6 -0
  294. package/FrameGraph/Tasks/Rendering/geometryRendererTask.js +14 -5
  295. package/FrameGraph/Tasks/Rendering/geometryRendererTask.js.map +1 -1
  296. package/FrameGraph/Tasks/Rendering/iblShadows/iblShadowsAccumulationTask.d.ts +1 -1
  297. package/FrameGraph/Tasks/Rendering/iblShadows/iblShadowsAccumulationTask.js +1 -1
  298. package/FrameGraph/Tasks/Rendering/iblShadows/iblShadowsAccumulationTask.js.map +1 -1
  299. package/FrameGraph/Tasks/Rendering/iblShadows/iblShadowsSpatialBlurTask.d.ts +1 -1
  300. package/FrameGraph/Tasks/Rendering/iblShadows/iblShadowsSpatialBlurTask.js +1 -1
  301. package/FrameGraph/Tasks/Rendering/iblShadows/iblShadowsSpatialBlurTask.js.map +1 -1
  302. package/FrameGraph/Tasks/Rendering/iblShadows/iblShadowsTracingTask.d.ts +1 -1
  303. package/FrameGraph/Tasks/Rendering/iblShadows/iblShadowsTracingTask.js +2 -2
  304. package/FrameGraph/Tasks/Rendering/iblShadows/iblShadowsTracingTask.js.map +1 -1
  305. package/FrameGraph/Tasks/Rendering/iblShadows/iblShadowsVoxelizationTask.d.ts +1 -1
  306. package/FrameGraph/Tasks/Rendering/iblShadows/iblShadowsVoxelizationTask.js +2 -2
  307. package/FrameGraph/Tasks/Rendering/iblShadows/iblShadowsVoxelizationTask.js.map +1 -1
  308. package/FrameGraph/Tasks/Rendering/objectRendererTask.d.ts +7 -1
  309. package/FrameGraph/Tasks/Rendering/objectRendererTask.js +7 -1
  310. package/FrameGraph/Tasks/Rendering/objectRendererTask.js.map +1 -1
  311. package/FrameGraph/Tasks/Texture/clearTextureTask.d.ts +1 -1
  312. package/FrameGraph/Tasks/Texture/clearTextureTask.js +1 -1
  313. package/FrameGraph/Tasks/Texture/clearTextureTask.js.map +1 -1
  314. package/FrameGraph/frameGraphRenderContext.js +1 -1
  315. package/FrameGraph/frameGraphRenderContext.js.map +1 -1
  316. package/FrameGraph/frameGraphTextureManager.d.ts +1 -1
  317. package/FrameGraph/frameGraphTextureManager.js +1 -1
  318. package/FrameGraph/frameGraphTextureManager.js.map +1 -1
  319. package/Gamepads/gamepadManager.js +1 -1
  320. package/Gamepads/gamepadManager.js.map +1 -1
  321. package/Gizmos/axisDragGizmo.d.ts +5 -5
  322. package/Gizmos/axisDragGizmo.js +6 -6
  323. package/Gizmos/axisDragGizmo.js.map +1 -1
  324. package/Gizmos/axisScaleGizmo.d.ts +4 -4
  325. package/Gizmos/axisScaleGizmo.js +6 -6
  326. package/Gizmos/axisScaleGizmo.js.map +1 -1
  327. package/Gizmos/boundingBoxGizmo.d.ts +5 -5
  328. package/Gizmos/boundingBoxGizmo.js +7 -7
  329. package/Gizmos/boundingBoxGizmo.js.map +1 -1
  330. package/Gizmos/cameraGizmo.d.ts +3 -3
  331. package/Gizmos/cameraGizmo.js +7 -7
  332. package/Gizmos/cameraGizmo.js.map +1 -1
  333. package/Gizmos/gizmo.d.ts +2 -2
  334. package/Gizmos/gizmo.js +3 -3
  335. package/Gizmos/gizmo.js.map +1 -1
  336. package/Gizmos/gizmoManager.d.ts +2 -2
  337. package/Gizmos/gizmoManager.js +2 -2
  338. package/Gizmos/gizmoManager.js.map +1 -1
  339. package/Gizmos/lightGizmo.d.ts +4 -4
  340. package/Gizmos/lightGizmo.js +11 -11
  341. package/Gizmos/lightGizmo.js.map +1 -1
  342. package/Gizmos/planeDragGizmo.d.ts +4 -4
  343. package/Gizmos/planeDragGizmo.js +5 -5
  344. package/Gizmos/planeDragGizmo.js.map +1 -1
  345. package/Gizmos/positionGizmo.d.ts +1 -1
  346. package/Gizmos/positionGizmo.js +2 -2
  347. package/Gizmos/positionGizmo.js.map +1 -1
  348. package/Gizmos/rotationGizmo.d.ts +3 -3
  349. package/Gizmos/rotationGizmo.js +3 -3
  350. package/Gizmos/rotationGizmo.js.map +1 -1
  351. package/Gizmos/scaleGizmo.d.ts +2 -2
  352. package/Gizmos/scaleGizmo.js +4 -4
  353. package/Gizmos/scaleGizmo.js.map +1 -1
  354. package/Gizmos/spatialAudioGizmo.d.ts +2 -2
  355. package/Gizmos/spatialAudioGizmo.js +6 -6
  356. package/Gizmos/spatialAudioGizmo.js.map +1 -1
  357. package/Helpers/environmentHelper.d.ts +6 -6
  358. package/Helpers/environmentHelper.js +12 -12
  359. package/Helpers/environmentHelper.js.map +1 -1
  360. package/Helpers/materialConversionHelper.d.ts +1 -1
  361. package/Helpers/materialConversionHelper.js +1 -1
  362. package/Helpers/materialConversionHelper.js.map +1 -1
  363. package/Helpers/photoDome.d.ts +1 -1
  364. package/Helpers/photoDome.js +1 -1
  365. package/Helpers/photoDome.js.map +1 -1
  366. package/Helpers/textureDome.d.ts +4 -4
  367. package/Helpers/textureDome.js +6 -6
  368. package/Helpers/textureDome.js.map +1 -1
  369. package/Helpers/videoDome.d.ts +1 -1
  370. package/Helpers/videoDome.js +2 -2
  371. package/Helpers/videoDome.js.map +1 -1
  372. package/Inputs/scene.inputManager.d.ts +1 -1
  373. package/Inputs/scene.inputManager.js +1 -1
  374. package/Inputs/scene.inputManager.js.map +1 -1
  375. package/Instrumentation/sceneInstrumentation.js +1 -1
  376. package/Instrumentation/sceneInstrumentation.js.map +1 -1
  377. package/Layers/effectLayer.d.ts +1 -1
  378. package/Layers/effectLayer.js +3 -3
  379. package/Layers/effectLayer.js.map +1 -1
  380. package/Layers/layer.d.ts +2 -2
  381. package/Layers/layer.js +4 -4
  382. package/Layers/layer.js.map +1 -1
  383. package/Layers/thinEffectLayer.d.ts +2 -2
  384. package/Layers/thinEffectLayer.js +3 -3
  385. package/Layers/thinEffectLayer.js.map +1 -1
  386. package/Layers/thinGlowLayer.d.ts +1 -1
  387. package/Layers/thinGlowLayer.js +3 -3
  388. package/Layers/thinGlowLayer.js.map +1 -1
  389. package/Layers/thinHighlightLayer.d.ts +1 -1
  390. package/Layers/thinHighlightLayer.js +3 -3
  391. package/Layers/thinHighlightLayer.js.map +1 -1
  392. package/Layers/thinSelectionOutlineLayer.d.ts +1 -1
  393. package/Layers/thinSelectionOutlineLayer.js +3 -3
  394. package/Layers/thinSelectionOutlineLayer.js.map +1 -1
  395. package/Legacy/legacy.js +12 -1
  396. package/Legacy/legacy.js.map +1 -1
  397. package/LensFlares/lensFlare.d.ts +2 -2
  398. package/LensFlares/lensFlare.js +3 -3
  399. package/LensFlares/lensFlare.js.map +1 -1
  400. package/LensFlares/lensFlareSystem.d.ts +1 -1
  401. package/LensFlares/lensFlareSystem.js +6 -6
  402. package/LensFlares/lensFlareSystem.js.map +1 -1
  403. package/Lights/LTC/ltcTextureTool.js +1 -1
  404. package/Lights/LTC/ltcTextureTool.js.map +1 -1
  405. package/Lights/Shadows/cascadedShadowGenerator.d.ts +1 -285
  406. package/Lights/Shadows/cascadedShadowGenerator.js +3 -857
  407. package/Lights/Shadows/cascadedShadowGenerator.js.map +1 -1
  408. package/Lights/Shadows/cascadedShadowGenerator.pure.d.ts +290 -0
  409. package/Lights/Shadows/cascadedShadowGenerator.pure.js +868 -0
  410. package/Lights/Shadows/cascadedShadowGenerator.pure.js.map +1 -0
  411. package/Lights/Shadows/pure.d.ts +1 -0
  412. package/Lights/Shadows/pure.js +1 -0
  413. package/Lights/Shadows/pure.js.map +1 -1
  414. package/Lights/Shadows/shadowGenerator.d.ts +3 -3
  415. package/Lights/Shadows/shadowGenerator.js +7 -7
  416. package/Lights/Shadows/shadowGenerator.js.map +1 -1
  417. package/Lights/areaLight.d.ts +1 -1
  418. package/Lights/areaLight.js +0 -1
  419. package/Lights/areaLight.js.map +1 -1
  420. package/Lights/light.d.ts +2 -2
  421. package/Lights/light.js +2 -2
  422. package/Lights/light.js.map +1 -1
  423. package/Lights/shadowLight.d.ts +1 -1
  424. package/Lights/shadowLight.js +1 -1
  425. package/Lights/shadowLight.js.map +1 -1
  426. package/Loading/sceneLoader.d.ts +2 -2
  427. package/Loading/sceneLoader.js +3 -3
  428. package/Loading/sceneLoader.js.map +1 -1
  429. package/Materials/GreasedLine/greasedLineMaterialDefaults.d.ts +1 -1
  430. package/Materials/GreasedLine/greasedLineMaterialDefaults.js +1 -1
  431. package/Materials/GreasedLine/greasedLineMaterialDefaults.js.map +1 -1
  432. package/Materials/GreasedLine/greasedLineSimpleMaterial.d.ts +3 -3
  433. package/Materials/GreasedLine/greasedLineSimpleMaterial.js +3 -3
  434. package/Materials/GreasedLine/greasedLineSimpleMaterial.js.map +1 -1
  435. package/Materials/Node/Blocks/Fragment/prePassOutputBlock.pure.js +6 -6
  436. package/Materials/Node/Blocks/Fragment/prePassOutputBlock.pure.js.map +1 -1
  437. package/Materials/Node/nodeMaterial.pure.d.ts +12 -0
  438. package/Materials/Node/nodeMaterial.pure.js +68 -13
  439. package/Materials/Node/nodeMaterial.pure.js.map +1 -1
  440. package/Materials/Node/nodeMaterialDefault.js +14 -14
  441. package/Materials/Node/nodeMaterialDefault.js.map +1 -1
  442. package/Materials/PBR/openpbrMaterial.pure.js +19 -4
  443. package/Materials/PBR/openpbrMaterial.pure.js.map +1 -1
  444. package/Materials/PBR/pbrAnisotropicConfiguration.d.ts +40 -2
  445. package/Materials/PBR/pbrAnisotropicConfiguration.js +41 -3
  446. package/Materials/PBR/pbrAnisotropicConfiguration.js.map +1 -1
  447. package/Materials/PBR/pbrBRDFConfiguration.d.ts +5 -1
  448. package/Materials/PBR/pbrBRDFConfiguration.js +5 -1
  449. package/Materials/PBR/pbrBRDFConfiguration.js.map +1 -1
  450. package/Materials/PBR/pbrBaseSimpleMaterial.d.ts +2 -2
  451. package/Materials/PBR/pbrBaseSimpleMaterial.js +2 -2
  452. package/Materials/PBR/pbrBaseSimpleMaterial.js.map +1 -1
  453. package/Materials/PBR/pbrClearCoatConfiguration.d.ts +42 -2
  454. package/Materials/PBR/pbrClearCoatConfiguration.js +42 -2
  455. package/Materials/PBR/pbrClearCoatConfiguration.js.map +1 -1
  456. package/Materials/PBR/pbrIridescenceConfiguration.d.ts +38 -1
  457. package/Materials/PBR/pbrIridescenceConfiguration.js +38 -1
  458. package/Materials/PBR/pbrIridescenceConfiguration.js.map +1 -1
  459. package/Materials/PBR/pbrMaterial.pure.d.ts +6 -0
  460. package/Materials/PBR/pbrMaterial.pure.js +8 -0
  461. package/Materials/PBR/pbrMaterial.pure.js.map +1 -1
  462. package/Materials/PBR/pbrSheenConfiguration.d.ts +41 -2
  463. package/Materials/PBR/pbrSheenConfiguration.js +41 -2
  464. package/Materials/PBR/pbrSheenConfiguration.js.map +1 -1
  465. package/Materials/PBR/pbrSubSurfaceConfiguration.d.ts +41 -2
  466. package/Materials/PBR/pbrSubSurfaceConfiguration.js +42 -3
  467. package/Materials/PBR/pbrSubSurfaceConfiguration.js.map +1 -1
  468. package/Materials/Textures/Filtering/hdrFiltering.js +1 -1
  469. package/Materials/Textures/Filtering/hdrFiltering.js.map +1 -1
  470. package/Materials/Textures/Filtering/hdrIrradianceFiltering.d.ts +1 -1
  471. package/Materials/Textures/Filtering/hdrIrradianceFiltering.js +2 -2
  472. package/Materials/Textures/Filtering/hdrIrradianceFiltering.js.map +1 -1
  473. package/Materials/Textures/Loaders/EXR/exrLoader.core.d.ts +1 -1
  474. package/Materials/Textures/Loaders/EXR/exrLoader.core.js +5 -109
  475. package/Materials/Textures/Loaders/EXR/exrLoader.core.js.map +1 -1
  476. package/Materials/Textures/Loaders/EXR/exrLoader.decoder.js +1 -1
  477. package/Materials/Textures/Loaders/EXR/exrLoader.decoder.js.map +1 -1
  478. package/Materials/Textures/Loaders/basisTextureLoader.js +2 -2
  479. package/Materials/Textures/Loaders/basisTextureLoader.js.map +1 -1
  480. package/Materials/Textures/Loaders/ddsTextureLoader.js +1 -1
  481. package/Materials/Textures/Loaders/ddsTextureLoader.js.map +1 -1
  482. package/Materials/Textures/Loaders/envTextureLoader.js +3 -1
  483. package/Materials/Textures/Loaders/envTextureLoader.js.map +1 -1
  484. package/Materials/Textures/Loaders/ktxTextureLoader.js +11 -2
  485. package/Materials/Textures/Loaders/ktxTextureLoader.js.map +1 -1
  486. package/Materials/Textures/MultiviewRenderTarget.d.ts +1 -1
  487. package/Materials/Textures/MultiviewRenderTarget.js +1 -1
  488. package/Materials/Textures/MultiviewRenderTarget.js.map +1 -1
  489. package/Materials/Textures/Packer/packer.d.ts +1 -1
  490. package/Materials/Textures/Packer/packer.js +6 -6
  491. package/Materials/Textures/Packer/packer.js.map +1 -1
  492. package/Materials/Textures/Procedurals/customProceduralTexture.d.ts +2 -2
  493. package/Materials/Textures/Procedurals/customProceduralTexture.js +4 -4
  494. package/Materials/Textures/Procedurals/customProceduralTexture.js.map +1 -1
  495. package/Materials/Textures/Procedurals/noiseProceduralTexture.pure.js +17 -5
  496. package/Materials/Textures/Procedurals/noiseProceduralTexture.pure.js.map +1 -1
  497. package/Materials/Textures/Procedurals/proceduralTexture.pure.js +4 -1
  498. package/Materials/Textures/Procedurals/proceduralTexture.pure.js.map +1 -1
  499. package/Materials/Textures/Procedurals/proceduralTextureSceneComponent.js +1 -1
  500. package/Materials/Textures/Procedurals/proceduralTextureSceneComponent.js.map +1 -1
  501. package/Materials/Textures/prePassRenderTarget.d.ts +1 -1
  502. package/Materials/Textures/prePassRenderTarget.js +1 -1
  503. package/Materials/Textures/prePassRenderTarget.js.map +1 -1
  504. package/Materials/Textures/rawCubeTexture.d.ts +1 -1
  505. package/Materials/Textures/rawCubeTexture.js +2 -2
  506. package/Materials/Textures/rawCubeTexture.js.map +1 -1
  507. package/Materials/Textures/rawTexture.d.ts +1 -1
  508. package/Materials/Textures/rawTexture.js +1 -1
  509. package/Materials/Textures/rawTexture.js.map +1 -1
  510. package/Materials/Textures/rawTexture2DArray.d.ts +1 -1
  511. package/Materials/Textures/rawTexture2DArray.js +1 -1
  512. package/Materials/Textures/rawTexture2DArray.js.map +1 -1
  513. package/Materials/Textures/rawTexture3D.d.ts +1 -1
  514. package/Materials/Textures/rawTexture3D.js +1 -1
  515. package/Materials/Textures/rawTexture3D.js.map +1 -1
  516. package/Materials/Textures/refractionTexture.d.ts +1 -1
  517. package/Materials/Textures/refractionTexture.js +1 -1
  518. package/Materials/Textures/refractionTexture.js.map +1 -1
  519. package/Materials/Textures/textureMerger.d.ts +1 -1
  520. package/Materials/Textures/textureMerger.js +1 -1
  521. package/Materials/Textures/textureMerger.js.map +1 -1
  522. package/Materials/Textures/textureProcessor.d.ts +1 -1
  523. package/Materials/Textures/textureProcessor.js +2 -2
  524. package/Materials/Textures/textureProcessor.js.map +1 -1
  525. package/Materials/Textures/thinRenderTargetTexture.d.ts +4 -4
  526. package/Materials/Textures/thinRenderTargetTexture.js +2 -2
  527. package/Materials/Textures/thinRenderTargetTexture.js.map +1 -1
  528. package/Materials/clipPlaneMaterialHelper.js +1 -1
  529. package/Materials/clipPlaneMaterialHelper.js.map +1 -1
  530. package/Materials/effect.pure.d.ts +2 -2
  531. package/Materials/effect.pure.js +12 -6
  532. package/Materials/effect.pure.js.map +1 -1
  533. package/Materials/effectRenderer.pure.js +4 -2
  534. package/Materials/effectRenderer.pure.js.map +1 -1
  535. package/Materials/floatingOriginMatrixOverrides.d.ts +1 -1
  536. package/Materials/floatingOriginMatrixOverrides.js +1 -1
  537. package/Materials/floatingOriginMatrixOverrides.js.map +1 -1
  538. package/Materials/material.detailMapConfiguration.d.ts +39 -1
  539. package/Materials/material.detailMapConfiguration.js +39 -1
  540. package/Materials/material.detailMapConfiguration.js.map +1 -1
  541. package/Materials/materialHelper.functions.js +45 -1
  542. package/Materials/materialHelper.functions.js.map +1 -1
  543. package/Materials/materialHelper.geometryrendering.d.ts +1 -1
  544. package/Materials/materialHelper.geometryrendering.js +1 -1
  545. package/Materials/materialHelper.geometryrendering.js.map +1 -1
  546. package/Materials/materialPluginFactoryExport.js +2 -2
  547. package/Materials/materialPluginFactoryExport.js.map +1 -1
  548. package/Materials/meshDebugPluginMaterial.pure.js +15 -13
  549. package/Materials/meshDebugPluginMaterial.pure.js.map +1 -1
  550. package/Materials/pushMaterial.d.ts +7 -1
  551. package/Materials/pushMaterial.js +7 -1
  552. package/Materials/pushMaterial.js.map +1 -1
  553. package/Materials/uniformBuffer.js +1 -1
  554. package/Materials/uniformBuffer.js.map +1 -1
  555. package/Maths/math.axis.d.ts +1 -1
  556. package/Maths/math.axis.js +1 -1
  557. package/Maths/math.axis.js.map +1 -1
  558. package/Maths/math.d.ts +2 -2
  559. package/Maths/math.functions.d.ts +1 -1
  560. package/Maths/math.functions.js +1 -1
  561. package/Maths/math.functions.js.map +1 -1
  562. package/Maths/math.isovector.d.ts +1 -1
  563. package/Maths/math.isovector.js +1 -1
  564. package/Maths/math.isovector.js.map +1 -1
  565. package/Maths/math.js +2 -2
  566. package/Maths/math.js.map +1 -1
  567. package/Maths/math.path.d.ts +1 -1
  568. package/Maths/math.path.js +1 -1
  569. package/Maths/math.path.js.map +1 -1
  570. package/Maths/math.plane.d.ts +1 -1
  571. package/Maths/math.plane.js +1 -1
  572. package/Maths/math.plane.js.map +1 -1
  573. package/Maths/math.polar.d.ts +1 -1
  574. package/Maths/math.polar.js +1 -1
  575. package/Maths/math.polar.js.map +1 -1
  576. package/Maths/math.vertexFormat.d.ts +1 -1
  577. package/Maths/math.vertexFormat.js +1 -1
  578. package/Maths/math.vertexFormat.js.map +1 -1
  579. package/Maths/pure.d.ts +1 -0
  580. package/Maths/pure.js +1 -0
  581. package/Maths/pure.js.map +1 -1
  582. package/Meshes/Builders/geodesicBuilder.js +1 -1
  583. package/Meshes/Builders/geodesicBuilder.js.map +1 -1
  584. package/Meshes/Builders/goldbergBuilder.d.ts +1 -1
  585. package/Meshes/Builders/goldbergBuilder.js +4 -4
  586. package/Meshes/Builders/goldbergBuilder.js.map +1 -1
  587. package/Meshes/Builders/greasedLineBuilder.d.ts +4 -4
  588. package/Meshes/Builders/greasedLineBuilder.js +5 -5
  589. package/Meshes/Builders/greasedLineBuilder.js.map +1 -1
  590. package/Meshes/Builders/textBuilder.d.ts +2 -2
  591. package/Meshes/Builders/textBuilder.js +4 -4
  592. package/Meshes/Builders/textBuilder.js.map +1 -1
  593. package/Meshes/Builders/tiledBoxBuilder.d.ts +3 -3
  594. package/Meshes/Builders/tiledBoxBuilder.js +3 -3
  595. package/Meshes/Builders/tiledBoxBuilder.js.map +1 -1
  596. package/Meshes/Builders/tiledPlaneBuilder.d.ts +1 -1
  597. package/Meshes/Builders/tiledPlaneBuilder.js +1 -1
  598. package/Meshes/Builders/tiledPlaneBuilder.js.map +1 -1
  599. package/Meshes/Compression/dracoCodec.js +1 -1
  600. package/Meshes/Compression/dracoCodec.js.map +1 -1
  601. package/Meshes/Compression/dracoDecoder.js +1 -1
  602. package/Meshes/Compression/dracoDecoder.js.map +1 -1
  603. package/Meshes/Compression/dracoEncoder.d.ts +1 -1
  604. package/Meshes/Compression/dracoEncoder.js +2 -2
  605. package/Meshes/Compression/dracoEncoder.js.map +1 -1
  606. package/Meshes/Compression/meshoptCompression.js +1 -1
  607. package/Meshes/Compression/meshoptCompression.js.map +1 -1
  608. package/Meshes/GaussianSplatting/gaussianSplattingMeshBase.pure.js +64 -3
  609. package/Meshes/GaussianSplatting/gaussianSplattingMeshBase.pure.js.map +1 -1
  610. package/Meshes/GreasedLine/greasedLineBaseMesh.d.ts +2 -2
  611. package/Meshes/GreasedLine/greasedLineBaseMesh.js +3 -3
  612. package/Meshes/GreasedLine/greasedLineBaseMesh.js.map +1 -1
  613. package/Meshes/Node/nodeGeometry.d.ts +2 -2
  614. package/Meshes/Node/nodeGeometry.js +4 -4
  615. package/Meshes/Node/nodeGeometry.js.map +1 -1
  616. package/Meshes/Node/nodeGeometryBuildState.d.ts +1 -1
  617. package/Meshes/Node/nodeGeometryBuildState.js +1 -1
  618. package/Meshes/Node/nodeGeometryBuildState.js.map +1 -1
  619. package/Meshes/abstractMesh.hotSpot.d.ts +1 -1
  620. package/Meshes/abstractMesh.hotSpot.js +2 -2
  621. package/Meshes/abstractMesh.hotSpot.js.map +1 -1
  622. package/Meshes/abstractMesh.pure.js +2 -13
  623. package/Meshes/abstractMesh.pure.js.map +1 -1
  624. package/Meshes/buffer.d.ts +1 -1
  625. package/Meshes/buffer.js +1 -1
  626. package/Meshes/buffer.js.map +1 -1
  627. package/Meshes/csg.d.ts +3 -3
  628. package/Meshes/csg.js +4 -4
  629. package/Meshes/csg.js.map +1 -1
  630. package/Meshes/csg2.d.ts +1 -1
  631. package/Meshes/csg2.js +38 -11
  632. package/Meshes/csg2.js.map +1 -1
  633. package/Meshes/geodesicMesh.d.ts +1 -1
  634. package/Meshes/geodesicMesh.js +1 -1
  635. package/Meshes/geodesicMesh.js.map +1 -1
  636. package/Meshes/geometry.d.ts +2 -2
  637. package/Meshes/geometry.js +4 -4
  638. package/Meshes/geometry.js.map +1 -1
  639. package/Meshes/lattice.d.ts +1 -1
  640. package/Meshes/lattice.js +1 -1
  641. package/Meshes/lattice.js.map +1 -1
  642. package/Meshes/lattice.material.d.ts +1 -1
  643. package/Meshes/lattice.material.js +1 -1
  644. package/Meshes/lattice.material.js.map +1 -1
  645. package/Meshes/mesh.vertexData.d.ts +2 -2
  646. package/Meshes/mesh.vertexData.js +3 -4
  647. package/Meshes/mesh.vertexData.js.map +1 -1
  648. package/Meshes/mesh.vertexData.subdivide.js +1 -1
  649. package/Meshes/mesh.vertexData.subdivide.js.map +1 -1
  650. package/Meshes/meshBuilder.d.ts +18 -18
  651. package/Meshes/meshBuilder.js +18 -18
  652. package/Meshes/meshBuilder.js.map +1 -1
  653. package/Meshes/meshSimplification.d.ts +1 -1
  654. package/Meshes/meshSimplification.js +4 -4
  655. package/Meshes/meshSimplification.js.map +1 -1
  656. package/Meshes/meshUVSpaceRenderer.d.ts +1 -1
  657. package/Meshes/meshUVSpaceRenderer.js +0 -1
  658. package/Meshes/meshUVSpaceRenderer.js.map +1 -1
  659. package/Meshes/meshUtils.d.ts +1 -1
  660. package/Meshes/meshUtils.js +2 -2
  661. package/Meshes/meshUtils.js.map +1 -1
  662. package/Meshes/polygonMesh.d.ts +2 -2
  663. package/Meshes/polygonMesh.js +3 -3
  664. package/Meshes/polygonMesh.js.map +1 -1
  665. package/Misc/HighDynamicRange/cubemapToSphericalPolynomial.js +2 -2
  666. package/Misc/HighDynamicRange/cubemapToSphericalPolynomial.js.map +1 -1
  667. package/Misc/HighDynamicRange/panoramaToCubemap.js +1 -1
  668. package/Misc/HighDynamicRange/panoramaToCubemap.js.map +1 -1
  669. package/Misc/PerformanceViewer/performanceViewerCollector.js +1 -1
  670. package/Misc/PerformanceViewer/performanceViewerCollector.js.map +1 -1
  671. package/Misc/areaLightsTextureTools.d.ts +1 -1
  672. package/Misc/areaLightsTextureTools.js +3 -3
  673. package/Misc/areaLightsTextureTools.js.map +1 -1
  674. package/Misc/assetsManager.d.ts +4 -4
  675. package/Misc/assetsManager.js +5 -5
  676. package/Misc/assetsManager.js.map +1 -1
  677. package/Misc/basisWorker.js +1 -1
  678. package/Misc/basisWorker.js.map +1 -1
  679. package/Misc/brdfTextureTools.js +1 -1
  680. package/Misc/brdfTextureTools.js.map +1 -1
  681. package/Misc/copyTextureToTexture.d.ts +1 -1
  682. package/Misc/copyTextureToTexture.js +1 -1
  683. package/Misc/copyTextureToTexture.js.map +1 -1
  684. package/Misc/decorators.serialization.js +2 -2
  685. package/Misc/decorators.serialization.js.map +1 -1
  686. package/Misc/depthReducer.d.ts +2 -2
  687. package/Misc/depthReducer.js +2 -2
  688. package/Misc/depthReducer.js.map +1 -1
  689. package/Misc/gradients.d.ts +1 -1
  690. package/Misc/gradients.js +1 -1
  691. package/Misc/gradients.js.map +1 -1
  692. package/Misc/greasedLineTools.d.ts +1 -1
  693. package/Misc/greasedLineTools.js +3 -3
  694. package/Misc/greasedLineTools.js.map +1 -1
  695. package/Misc/halfFloat.d.ts +17 -0
  696. package/Misc/halfFloat.js +131 -0
  697. package/Misc/halfFloat.js.map +1 -0
  698. package/Misc/khronosTextureContainer2.js +1 -1
  699. package/Misc/khronosTextureContainer2.js.map +1 -1
  700. package/Misc/meshExploder.js +1 -1
  701. package/Misc/meshExploder.js.map +1 -1
  702. package/Misc/pivotTools.js +1 -1
  703. package/Misc/pivotTools.js.map +1 -1
  704. package/Misc/rgbdTextureTools.js +1 -1
  705. package/Misc/rgbdTextureTools.js.map +1 -1
  706. package/Misc/sceneOptimizer.js +1 -1
  707. package/Misc/sceneOptimizer.js.map +1 -1
  708. package/Misc/sceneRecorder.js +7 -7
  709. package/Misc/sceneRecorder.js.map +1 -1
  710. package/Misc/sceneSerializer.js +3 -3
  711. package/Misc/sceneSerializer.js.map +1 -1
  712. package/Misc/snapshotRenderingHelper.js +1 -1
  713. package/Misc/snapshotRenderingHelper.js.map +1 -1
  714. package/Misc/textureTools.d.ts +3 -13
  715. package/Misc/textureTools.js +6 -64
  716. package/Misc/textureTools.js.map +1 -1
  717. package/Misc/thinMinMaxReducer.d.ts +1 -1
  718. package/Misc/thinMinMaxReducer.js +1 -1
  719. package/Misc/thinMinMaxReducer.js.map +1 -1
  720. package/Misc/tools.internals.js +1 -1
  721. package/Misc/tools.internals.js.map +1 -1
  722. package/Misc/tools.pure.js +11 -4
  723. package/Misc/tools.pure.js.map +1 -1
  724. package/Misc/trajectoryClassifier.d.ts +1 -1
  725. package/Misc/trajectoryClassifier.js +1 -1
  726. package/Misc/trajectoryClassifier.js.map +1 -1
  727. package/Misc/videoRecorder.js +1 -1
  728. package/Misc/videoRecorder.js.map +1 -1
  729. package/Misc/virtualJoystick.d.ts +1 -1
  730. package/Misc/virtualJoystick.js +1 -1
  731. package/Misc/virtualJoystick.js.map +1 -1
  732. package/Morph/morphTarget.js +1 -1
  733. package/Morph/morphTarget.js.map +1 -1
  734. package/Navigation/Plugins/recastJSPlugin.d.ts +1 -1
  735. package/Navigation/Plugins/recastJSPlugin.js +2 -2
  736. package/Navigation/Plugins/recastJSPlugin.js.map +1 -1
  737. package/Particles/EmitterTypes/boxParticleEmitter.d.ts +1 -1
  738. package/Particles/EmitterTypes/boxParticleEmitter.js +1 -1
  739. package/Particles/EmitterTypes/boxParticleEmitter.js.map +1 -1
  740. package/Particles/EmitterTypes/coneParticleEmitter.d.ts +1 -1
  741. package/Particles/EmitterTypes/coneParticleEmitter.js +1 -1
  742. package/Particles/EmitterTypes/coneParticleEmitter.js.map +1 -1
  743. package/Particles/EmitterTypes/customParticleEmitter.d.ts +1 -1
  744. package/Particles/EmitterTypes/customParticleEmitter.js +1 -1
  745. package/Particles/EmitterTypes/customParticleEmitter.js.map +1 -1
  746. package/Particles/EmitterTypes/cylinderParticleEmitter.d.ts +1 -1
  747. package/Particles/EmitterTypes/cylinderParticleEmitter.js +1 -1
  748. package/Particles/EmitterTypes/cylinderParticleEmitter.js.map +1 -1
  749. package/Particles/EmitterTypes/hemisphericParticleEmitter.d.ts +1 -1
  750. package/Particles/EmitterTypes/hemisphericParticleEmitter.js +1 -1
  751. package/Particles/EmitterTypes/hemisphericParticleEmitter.js.map +1 -1
  752. package/Particles/EmitterTypes/meshParticleEmitter.d.ts +1 -1
  753. package/Particles/EmitterTypes/meshParticleEmitter.js +2 -2
  754. package/Particles/EmitterTypes/meshParticleEmitter.js.map +1 -1
  755. package/Particles/EmitterTypes/pointParticleEmitter.d.ts +1 -1
  756. package/Particles/EmitterTypes/pointParticleEmitter.js +1 -1
  757. package/Particles/EmitterTypes/pointParticleEmitter.js.map +1 -1
  758. package/Particles/EmitterTypes/sphereParticleEmitter.d.ts +1 -1
  759. package/Particles/EmitterTypes/sphereParticleEmitter.js +1 -1
  760. package/Particles/EmitterTypes/sphereParticleEmitter.js.map +1 -1
  761. package/Particles/Node/nodeParticleBuildState.d.ts +4 -4
  762. package/Particles/Node/nodeParticleBuildState.js +2 -2
  763. package/Particles/Node/nodeParticleBuildState.js.map +1 -1
  764. package/Particles/Node/nodeParticleSystemSet.d.ts +2 -2
  765. package/Particles/Node/nodeParticleSystemSet.helper.js +31 -31
  766. package/Particles/Node/nodeParticleSystemSet.helper.js.map +1 -1
  767. package/Particles/Node/nodeParticleSystemSet.js +8 -8
  768. package/Particles/Node/nodeParticleSystemSet.js.map +1 -1
  769. package/Particles/attractor.d.ts +1 -1
  770. package/Particles/attractor.js +1 -1
  771. package/Particles/attractor.js.map +1 -1
  772. package/Particles/computeShaderParticleSystem.pure.js +5 -1
  773. package/Particles/computeShaderParticleSystem.pure.js.map +1 -1
  774. package/Particles/flowMap.d.ts +7 -1
  775. package/Particles/flowMap.js +7 -1
  776. package/Particles/flowMap.js.map +1 -1
  777. package/Particles/gpuParticleSystem.pure.d.ts +1 -0
  778. package/Particles/gpuParticleSystem.pure.js +17 -1
  779. package/Particles/gpuParticleSystem.pure.js.map +1 -1
  780. package/Particles/particle.d.ts +2 -2
  781. package/Particles/particle.js +2 -2
  782. package/Particles/particle.js.map +1 -1
  783. package/Particles/particleHelper.js +5 -5
  784. package/Particles/particleHelper.js.map +1 -1
  785. package/Particles/particleSystem.functions.d.ts +1 -1
  786. package/Particles/particleSystem.functions.js +1 -1
  787. package/Particles/particleSystem.functions.js.map +1 -1
  788. package/Particles/particleSystemSet.d.ts +1 -1
  789. package/Particles/particleSystemSet.js +5 -5
  790. package/Particles/particleSystemSet.js.map +1 -1
  791. package/Particles/pointsCloudSystem.d.ts +1 -1
  792. package/Particles/pointsCloudSystem.js +6 -6
  793. package/Particles/pointsCloudSystem.js.map +1 -1
  794. package/Particles/solidParticle.d.ts +2 -2
  795. package/Particles/solidParticle.js +3 -3
  796. package/Particles/solidParticle.js.map +1 -1
  797. package/Particles/solidParticleSystem.d.ts +4 -4
  798. package/Particles/solidParticleSystem.js +7 -7
  799. package/Particles/solidParticleSystem.js.map +1 -1
  800. package/Particles/subEmitter.js +1 -1
  801. package/Particles/subEmitter.js.map +1 -1
  802. package/Particles/thinParticleSystem.function.js +2 -2
  803. package/Particles/thinParticleSystem.function.js.map +1 -1
  804. package/Physics/Plugins/cannonJSPlugin.d.ts +1 -1
  805. package/Physics/Plugins/cannonJSPlugin.js +1 -1
  806. package/Physics/Plugins/cannonJSPlugin.js.map +1 -1
  807. package/Physics/castingResult.d.ts +1 -1
  808. package/Physics/castingResult.js +1 -1
  809. package/Physics/castingResult.js.map +1 -1
  810. package/Physics/physicsHelper.d.ts +1 -1
  811. package/Physics/physicsHelper.js +4 -4
  812. package/Physics/physicsHelper.js.map +1 -1
  813. package/Physics/physicsImpostor.d.ts +1 -1
  814. package/Physics/physicsImpostor.js +1 -1
  815. package/Physics/physicsImpostor.js.map +1 -1
  816. package/Physics/physicsRaycastResult.d.ts +1 -1
  817. package/Physics/physicsRaycastResult.js +1 -1
  818. package/Physics/physicsRaycastResult.js.map +1 -1
  819. package/Physics/v1/Plugins/ammoJSPlugin.d.ts +2 -2
  820. package/Physics/v1/Plugins/ammoJSPlugin.js +5 -5
  821. package/Physics/v1/Plugins/ammoJSPlugin.js.map +1 -1
  822. package/Physics/v1/Plugins/oimoJSPlugin.d.ts +2 -2
  823. package/Physics/v1/Plugins/oimoJSPlugin.js +2 -2
  824. package/Physics/v1/Plugins/oimoJSPlugin.js.map +1 -1
  825. package/Physics/v1/physicsEngine.d.ts +1 -1
  826. package/Physics/v1/physicsEngine.js +1 -1
  827. package/Physics/v1/physicsEngine.js.map +1 -1
  828. package/Physics/v2/Plugins/havokPlugin.d.ts +14 -2
  829. package/Physics/v2/Plugins/havokPlugin.js +45 -7
  830. package/Physics/v2/Plugins/havokPlugin.js.map +1 -1
  831. package/Physics/v2/characterController.d.ts +1 -1
  832. package/Physics/v2/characterController.js +2 -2
  833. package/Physics/v2/characterController.js.map +1 -1
  834. package/Physics/v2/physicsAggregate.d.ts +3 -3
  835. package/Physics/v2/physicsAggregate.js +10 -6
  836. package/Physics/v2/physicsAggregate.js.map +1 -1
  837. package/Physics/v2/physicsBody.d.ts +1 -1
  838. package/Physics/v2/physicsBody.js +1 -1
  839. package/Physics/v2/physicsBody.js.map +1 -1
  840. package/Physics/v2/physicsEngine.d.ts +1 -1
  841. package/Physics/v2/physicsEngine.js +1 -1
  842. package/Physics/v2/physicsEngine.js.map +1 -1
  843. package/Physics/v2/physicsShape.d.ts +1 -1
  844. package/Physics/v2/physicsShape.js +1 -1
  845. package/Physics/v2/physicsShape.js.map +1 -1
  846. package/Physics/v2/ragdoll.d.ts +2 -2
  847. package/Physics/v2/ragdoll.js +2 -2
  848. package/Physics/v2/ragdoll.js.map +1 -1
  849. package/PostProcesses/RenderPipeline/Pipelines/ssao2RenderingPipeline.pure.d.ts +1 -0
  850. package/PostProcesses/RenderPipeline/Pipelines/ssao2RenderingPipeline.pure.js +8 -6
  851. package/PostProcesses/RenderPipeline/Pipelines/ssao2RenderingPipeline.pure.js.map +1 -1
  852. package/PostProcesses/RenderPipeline/Pipelines/thinSSRRenderingPipeline.js +1 -1
  853. package/PostProcesses/RenderPipeline/Pipelines/thinSSRRenderingPipeline.js.map +1 -1
  854. package/PostProcesses/RenderPipeline/postProcessRenderEffect.js +1 -1
  855. package/PostProcesses/RenderPipeline/postProcessRenderEffect.js.map +1 -1
  856. package/PostProcesses/RenderPipeline/postProcessRenderPipeline.js +3 -2
  857. package/PostProcesses/RenderPipeline/postProcessRenderPipeline.js.map +1 -1
  858. package/PostProcesses/bloomEffect.d.ts +1 -1
  859. package/PostProcesses/bloomEffect.js +4 -4
  860. package/PostProcesses/bloomEffect.js.map +1 -1
  861. package/PostProcesses/depthOfFieldEffect.d.ts +1 -1
  862. package/PostProcesses/depthOfFieldEffect.js +3 -3
  863. package/PostProcesses/depthOfFieldEffect.js.map +1 -1
  864. package/PostProcesses/depthOfFieldMergePostProcess.d.ts +1 -1
  865. package/PostProcesses/depthOfFieldMergePostProcess.js +1 -1
  866. package/PostProcesses/depthOfFieldMergePostProcess.js.map +1 -1
  867. package/PostProcesses/highlightsPostProcess.d.ts +1 -1
  868. package/PostProcesses/highlightsPostProcess.js +1 -1
  869. package/PostProcesses/highlightsPostProcess.js.map +1 -1
  870. package/PostProcesses/imageProcessingPostProcess.d.ts +1 -1
  871. package/PostProcesses/imageProcessingPostProcess.js +1 -1
  872. package/PostProcesses/imageProcessingPostProcess.js.map +1 -1
  873. package/PostProcesses/postProcessManager.d.ts +3 -0
  874. package/PostProcesses/postProcessManager.js +4 -1
  875. package/PostProcesses/postProcessManager.js.map +1 -1
  876. package/PostProcesses/subSurfaceScatteringPostProcess.pure.d.ts +1 -0
  877. package/PostProcesses/subSurfaceScatteringPostProcess.pure.js +10 -0
  878. package/PostProcesses/subSurfaceScatteringPostProcess.pure.js.map +1 -1
  879. package/PostProcesses/thinAnaglyphPostProcess.d.ts +1 -1
  880. package/PostProcesses/thinAnaglyphPostProcess.js +1 -1
  881. package/PostProcesses/thinAnaglyphPostProcess.js.map +1 -1
  882. package/PostProcesses/thinBlackAndWhitePostProcess.d.ts +1 -1
  883. package/PostProcesses/thinBlackAndWhitePostProcess.js +1 -1
  884. package/PostProcesses/thinBlackAndWhitePostProcess.js.map +1 -1
  885. package/PostProcesses/thinBloomEffect.js +1 -1
  886. package/PostProcesses/thinBloomEffect.js.map +1 -1
  887. package/PostProcesses/thinBloomMergePostProcess.d.ts +1 -1
  888. package/PostProcesses/thinBloomMergePostProcess.js +1 -1
  889. package/PostProcesses/thinBloomMergePostProcess.js.map +1 -1
  890. package/PostProcesses/thinBlurPostProcess.d.ts +1 -1
  891. package/PostProcesses/thinBlurPostProcess.js +1 -1
  892. package/PostProcesses/thinBlurPostProcess.js.map +1 -1
  893. package/PostProcesses/thinChromaticAberrationPostProcess.d.ts +2 -2
  894. package/PostProcesses/thinChromaticAberrationPostProcess.js +2 -2
  895. package/PostProcesses/thinChromaticAberrationPostProcess.js.map +1 -1
  896. package/PostProcesses/thinCircleOfConfusionPostProcess.d.ts +1 -1
  897. package/PostProcesses/thinCircleOfConfusionPostProcess.js +1 -1
  898. package/PostProcesses/thinCircleOfConfusionPostProcess.js.map +1 -1
  899. package/PostProcesses/thinColorCorrectionPostProcess.d.ts +1 -1
  900. package/PostProcesses/thinColorCorrectionPostProcess.js +2 -2
  901. package/PostProcesses/thinColorCorrectionPostProcess.js.map +1 -1
  902. package/PostProcesses/thinConvolutionPostProcess.d.ts +1 -1
  903. package/PostProcesses/thinConvolutionPostProcess.js +1 -1
  904. package/PostProcesses/thinConvolutionPostProcess.js.map +1 -1
  905. package/PostProcesses/thinCustomPostProcess.d.ts +1 -1
  906. package/PostProcesses/thinCustomPostProcess.js +1 -1
  907. package/PostProcesses/thinCustomPostProcess.js.map +1 -1
  908. package/PostProcesses/thinDepthOfFieldEffect.d.ts +3 -0
  909. package/PostProcesses/thinDepthOfFieldEffect.js +4 -1
  910. package/PostProcesses/thinDepthOfFieldEffect.js.map +1 -1
  911. package/PostProcesses/thinDepthOfFieldMergePostProcess.d.ts +1 -1
  912. package/PostProcesses/thinDepthOfFieldMergePostProcess.js +1 -1
  913. package/PostProcesses/thinDepthOfFieldMergePostProcess.js.map +1 -1
  914. package/PostProcesses/thinExtractHighlightsPostProcess.d.ts +1 -1
  915. package/PostProcesses/thinExtractHighlightsPostProcess.js +1 -1
  916. package/PostProcesses/thinExtractHighlightsPostProcess.js.map +1 -1
  917. package/PostProcesses/thinFXAAPostProcess.d.ts +2 -2
  918. package/PostProcesses/thinFXAAPostProcess.js +2 -2
  919. package/PostProcesses/thinFXAAPostProcess.js.map +1 -1
  920. package/PostProcesses/thinFilterPostProcess.d.ts +2 -2
  921. package/PostProcesses/thinFilterPostProcess.js +2 -2
  922. package/PostProcesses/thinFilterPostProcess.js.map +1 -1
  923. package/PostProcesses/thinGrainPostProcess.d.ts +1 -1
  924. package/PostProcesses/thinGrainPostProcess.js +1 -1
  925. package/PostProcesses/thinGrainPostProcess.js.map +1 -1
  926. package/PostProcesses/thinImageProcessingPostProcess.d.ts +2 -2
  927. package/PostProcesses/thinImageProcessingPostProcess.js +2 -2
  928. package/PostProcesses/thinImageProcessingPostProcess.js.map +1 -1
  929. package/PostProcesses/thinMotionBlurPostProcess.d.ts +1 -1
  930. package/PostProcesses/thinMotionBlurPostProcess.js +2 -2
  931. package/PostProcesses/thinMotionBlurPostProcess.js.map +1 -1
  932. package/PostProcesses/thinPassPostProcess.d.ts +1 -1
  933. package/PostProcesses/thinPassPostProcess.js +1 -1
  934. package/PostProcesses/thinPassPostProcess.js.map +1 -1
  935. package/PostProcesses/thinSSAO2BlurPostProcess.d.ts +1 -1
  936. package/PostProcesses/thinSSAO2BlurPostProcess.js +1 -1
  937. package/PostProcesses/thinSSAO2BlurPostProcess.js.map +1 -1
  938. package/PostProcesses/thinSSAO2CombinePostProcess.d.ts +1 -1
  939. package/PostProcesses/thinSSAO2CombinePostProcess.js +2 -2
  940. package/PostProcesses/thinSSAO2CombinePostProcess.js.map +1 -1
  941. package/PostProcesses/thinSSAO2PostProcess.d.ts +7 -2
  942. package/PostProcesses/thinSSAO2PostProcess.js +36 -4
  943. package/PostProcesses/thinSSAO2PostProcess.js.map +1 -1
  944. package/PostProcesses/thinSSRBlurCombinerPostProcess.d.ts +1 -1
  945. package/PostProcesses/thinSSRBlurCombinerPostProcess.js +2 -2
  946. package/PostProcesses/thinSSRBlurCombinerPostProcess.js.map +1 -1
  947. package/PostProcesses/thinSSRBlurPostProcess.d.ts +2 -2
  948. package/PostProcesses/thinSSRBlurPostProcess.js +2 -2
  949. package/PostProcesses/thinSSRBlurPostProcess.js.map +1 -1
  950. package/PostProcesses/thinSSRPostProcess.d.ts +1 -1
  951. package/PostProcesses/thinSSRPostProcess.js +2 -2
  952. package/PostProcesses/thinSSRPostProcess.js.map +1 -1
  953. package/PostProcesses/thinScreenSpaceCurvaturePostProcess.d.ts +1 -1
  954. package/PostProcesses/thinScreenSpaceCurvaturePostProcess.js +1 -1
  955. package/PostProcesses/thinScreenSpaceCurvaturePostProcess.js.map +1 -1
  956. package/PostProcesses/thinSharpenPostProcess.d.ts +1 -1
  957. package/PostProcesses/thinSharpenPostProcess.js +1 -1
  958. package/PostProcesses/thinSharpenPostProcess.js.map +1 -1
  959. package/PostProcesses/thinTAAPostProcess.d.ts +3 -3
  960. package/PostProcesses/thinTAAPostProcess.js +4 -4
  961. package/PostProcesses/thinTAAPostProcess.js.map +1 -1
  962. package/PostProcesses/thinTonemapPostProcess.d.ts +1 -1
  963. package/PostProcesses/thinTonemapPostProcess.js +1 -1
  964. package/PostProcesses/thinTonemapPostProcess.js.map +1 -1
  965. package/PostProcesses/vrDistortionCorrectionPostProcess.d.ts +1 -1
  966. package/PostProcesses/vrDistortionCorrectionPostProcess.js +3 -3
  967. package/PostProcesses/vrDistortionCorrectionPostProcess.js.map +1 -1
  968. package/Rendering/IBLShadows/iblShadowsAccumulationPass.d.ts +2 -2
  969. package/Rendering/IBLShadows/iblShadowsAccumulationPass.js +4 -4
  970. package/Rendering/IBLShadows/iblShadowsAccumulationPass.js.map +1 -1
  971. package/Rendering/IBLShadows/iblShadowsSpatialBlurPass.d.ts +2 -2
  972. package/Rendering/IBLShadows/iblShadowsSpatialBlurPass.js +4 -4
  973. package/Rendering/IBLShadows/iblShadowsSpatialBlurPass.js.map +1 -1
  974. package/Rendering/IBLShadows/iblShadowsVoxelTracingPass.d.ts +3 -3
  975. package/Rendering/IBLShadows/iblShadowsVoxelTracingPass.js +4 -4
  976. package/Rendering/IBLShadows/iblShadowsVoxelTracingPass.js.map +1 -1
  977. package/Rendering/depthPeelingRenderer.d.ts +1 -1
  978. package/Rendering/depthPeelingRenderer.js +2 -2
  979. package/Rendering/depthPeelingRenderer.js.map +1 -1
  980. package/Rendering/fluidRenderer/fluidRenderingObject.d.ts +1 -1
  981. package/Rendering/fluidRenderer/fluidRenderingObject.js +1 -1
  982. package/Rendering/fluidRenderer/fluidRenderingObject.js.map +1 -1
  983. package/Rendering/fluidRenderer/fluidRenderingObjectCustomParticles.d.ts +1 -1
  984. package/Rendering/fluidRenderer/fluidRenderingObjectCustomParticles.js +2 -2
  985. package/Rendering/fluidRenderer/fluidRenderingObjectCustomParticles.js.map +1 -1
  986. package/Rendering/fluidRenderer/fluidRenderingTargetRenderer.d.ts +3 -3
  987. package/Rendering/fluidRenderer/fluidRenderingTargetRenderer.js +3 -3
  988. package/Rendering/fluidRenderer/fluidRenderingTargetRenderer.js.map +1 -1
  989. package/Rendering/fluidRenderer/fluidRenderingTextures.d.ts +2 -2
  990. package/Rendering/fluidRenderer/fluidRenderingTextures.js +3 -3
  991. package/Rendering/fluidRenderer/fluidRenderingTextures.js.map +1 -1
  992. package/Rendering/iblCdfGenerator.d.ts +3 -3
  993. package/Rendering/iblCdfGenerator.js +5 -5
  994. package/Rendering/iblCdfGenerator.js.map +1 -1
  995. package/Rendering/renderingGroup.js +1 -1
  996. package/Rendering/renderingGroup.js.map +1 -1
  997. package/Rendering/subSurfaceConfiguration.d.ts +2 -2
  998. package/Rendering/subSurfaceConfiguration.js +2 -2
  999. package/Rendering/subSurfaceConfiguration.js.map +1 -1
  1000. package/Rendering/utilityLayerRenderer.d.ts +2 -2
  1001. package/Rendering/utilityLayerRenderer.js +4 -4
  1002. package/Rendering/utilityLayerRenderer.js.map +1 -1
  1003. package/Shaders/ssao2.fragment.js +10 -2
  1004. package/Shaders/ssao2.fragment.js.map +1 -1
  1005. package/ShadersWGSL/gpuRenderParticles.fragment.d.ts +5 -0
  1006. package/ShadersWGSL/gpuRenderParticles.fragment.js +50 -0
  1007. package/ShadersWGSL/gpuRenderParticles.fragment.js.map +1 -0
  1008. package/ShadersWGSL/gpuRenderParticles.vertex.d.ts +5 -0
  1009. package/ShadersWGSL/gpuRenderParticles.vertex.js +120 -0
  1010. package/ShadersWGSL/gpuRenderParticles.vertex.js.map +1 -0
  1011. package/ShadersWGSL/noise.fragment.d.ts +5 -0
  1012. package/ShadersWGSL/noise.fragment.js +18 -0
  1013. package/ShadersWGSL/noise.fragment.js.map +1 -0
  1014. package/ShadersWGSL/ssao2.fragment.js +10 -2
  1015. package/ShadersWGSL/ssao2.fragment.js.map +1 -1
  1016. package/SmartAssets/smartAssetSerializer.js +1 -1
  1017. package/SmartAssets/smartAssetSerializer.js.map +1 -1
  1018. package/Sprites/sprite.d.ts +2 -2
  1019. package/Sprites/sprite.js +2 -2
  1020. package/Sprites/sprite.js.map +1 -1
  1021. package/Sprites/spriteManager.d.ts +2 -2
  1022. package/Sprites/spriteManager.js +4 -5
  1023. package/Sprites/spriteManager.js.map +1 -1
  1024. package/Sprites/spritePackedManager.js +1 -1
  1025. package/Sprites/spritePackedManager.js.map +1 -1
  1026. package/Sprites/spriteRenderer.js +2 -2
  1027. package/Sprites/spriteRenderer.js.map +1 -1
  1028. package/XR/features/WebXRHitTestLegacy.d.ts +1 -1
  1029. package/XR/features/WebXRHitTestLegacy.js +2 -2
  1030. package/XR/features/WebXRHitTestLegacy.js.map +1 -1
  1031. package/XR/motionController/webXRAbstractMotionController.js +2 -2
  1032. package/XR/motionController/webXRAbstractMotionController.js.map +1 -1
  1033. package/XR/motionController/webXRGenericMotionController.js +2 -2
  1034. package/XR/motionController/webXRGenericMotionController.js.map +1 -1
  1035. package/XR/motionController/webXRProfiledMotionController.js +4 -4
  1036. package/XR/motionController/webXRProfiledMotionController.js.map +1 -1
  1037. package/XR/webXRCamera.d.ts +3 -3
  1038. package/XR/webXRCamera.js +4 -4
  1039. package/XR/webXRCamera.js.map +1 -1
  1040. package/XR/webXRDefaultExperience.d.ts +4 -4
  1041. package/XR/webXRDefaultExperience.js +4 -4
  1042. package/XR/webXRDefaultExperience.js.map +1 -1
  1043. package/XR/webXREnterExitUI.js +1 -1
  1044. package/XR/webXREnterExitUI.js.map +1 -1
  1045. package/XR/webXRExperienceHelper.js +2 -2
  1046. package/XR/webXRExperienceHelper.js.map +1 -1
  1047. package/XR/webXRFeaturesManager.d.ts +47 -0
  1048. package/XR/webXRFeaturesManager.js +1 -1
  1049. package/XR/webXRFeaturesManager.js.map +1 -1
  1050. package/XR/webXRInput.js +1 -1
  1051. package/XR/webXRInput.js.map +1 -1
  1052. package/XR/webXRInputSource.js +4 -4
  1053. package/XR/webXRInputSource.js.map +1 -1
  1054. package/XR/webXRManagedOutputCanvas.js +1 -1
  1055. package/XR/webXRManagedOutputCanvas.js.map +1 -1
  1056. package/XR/webXRRenderTargetTextureProvider.d.ts +1 -1
  1057. package/XR/webXRRenderTargetTextureProvider.js +1 -1
  1058. package/XR/webXRRenderTargetTextureProvider.js.map +1 -1
  1059. package/assetContainer.d.ts +4 -4
  1060. package/assetContainer.js +6 -6
  1061. package/assetContainer.js.map +1 -1
  1062. package/node.d.ts +1 -1
  1063. package/node.js +6 -2
  1064. package/node.js.map +1 -1
  1065. package/package.json +44 -174
@@ -1,6 +1,6 @@
1
1
  import { type Nullable } from "../types.js";
2
- import { Vector2, Vector3, Vector4 } from "../Maths/math.vector.js";
3
- import { Color4 } from "../Maths/math.color.js";
2
+ import { Vector2, Vector3, Vector4 } from "../Maths/math.vector.pure.js";
3
+ import { Color4 } from "../Maths/math.color.pure.js";
4
4
  import { type SubEmitter } from "./subEmitter.js";
5
5
  import { type ColorGradient, type FactorGradient } from "../Misc/gradients.js";
6
6
  import { type ThinParticleSystem } from "./thinParticleSystem.js";
@@ -1,5 +1,5 @@
1
- import { Vector2, Vector3, TmpVectors, Vector4 } from "../Maths/math.vector.js";
2
- import { Color4 } from "../Maths/math.color.js";
1
+ import { Vector2, Vector3, TmpVectors, Vector4 } from "../Maths/math.vector.pure.js";
2
+ import { Color4 } from "../Maths/math.color.pure.js";
3
3
  import { Clamp } from "../Maths/math.scalar.functions.js";
4
4
  /**
5
5
  * @internal
@@ -1 +1 @@
1
- {"version":3,"file":"particle.js","sourceRoot":"","sources":["../../../../dev/core/src/Particles/particle.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC7E,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAM7C,OAAO,EAAE,KAAK,EAAE,MAAM,gCAAgC,CAAC;AAEvD;;;;GAIG;AACH,MAAM,0BAA0B;IAAhC;QAOI,gBAAgB;QACT,wBAAmB,GAAgC,IAAI,CAAC;QAW/D,gBAAgB;QACT,kBAAa,GAAG,IAAI,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;QAC9C,gBAAgB;QACT,kBAAa,GAAG,IAAI,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;QAI9C,gBAAgB;QACT,iBAAY,GAAG,CAAC,CAAC;QACxB,gBAAgB;QACT,iBAAY,GAAG,CAAC,CAAC;QAIxB,gBAAgB;QACT,yBAAoB,GAAG,CAAC,CAAC;QAChC,gBAAgB;QACT,yBAAoB,GAAG,CAAC,CAAC;QAIhC,gBAAgB;QACT,qBAAgB,GAAG,CAAC,CAAC;QAC5B,gBAAgB;QACT,qBAAgB,GAAG,CAAC,CAAC;QAI5B,gBAAgB;QACT,oBAAe,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC;QAIxC,gBAAgB;QACT,0BAAqB,GAAG,CAAC,CAAC;QACjC,gBAAgB;QACT,0BAAqB,GAAG,CAAC,CAAC;QAIjC,gBAAgB;QACT,iBAAY,GAAG,CAAC,CAAC;QACxB,gBAAgB;QACT,iBAAY,GAAG,CAAC,CAAC;IA2B5B,CAAC;IAZG,gBAAgB;IACT,KAAK;QACR,IAAI,CAAC,oBAAoB,GAAG,I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jG,CAAC;QACL,CAAC;QACD,KAAK,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;IACnC,CAAC;;AA5Qc,eAAM,GAAG,CAAC,AAAJ,CAAK","sourcesContent":["import { type Nullable } from \"../types\";\r\nimport { Vector2, Vector3, TmpVectors, Vector4 } from \"../Maths/math.vector\";\r\nimport { Color4 } from \"../Maths/math.color\";\r\nimport { type SubEmitter } from \"./subEmitter\";\r\nimport { type ColorGradient, type FactorGradient } from \"../Misc/gradients\";\r\n\r\nimport { type AbstractMesh } from \"../Meshes/abstractMesh\";\r\nimport { type ThinParticleSystem } from \"./thinParticleSystem\";\r\nimport { Clamp } from \"../Maths/math.scalar.functions\";\r\n\r\n/**\r\n * @internal\r\n * Holds all internal properties of a Particle, grouped into a single sub-object\r\n * to keep the Particle's own property count low (V8 in-object property limit).\r\n */\r\nclass ParticleInternalProperties {\r\n /** @internal */\r\n public randomCellOffset?: number;\r\n\r\n /** @internal */\r\n public initialDirection: Nullable<Vector3>;\r\n\r\n /** @internal */\r\n public attachedSubEmitters: Nullable<Array<SubEmitter>> = null;\r\n\r\n /** @internal */\r\n public initialStartSpriteCellId: number;\r\n /** @internal */\r\n public initialEndSpriteCellId: number;\r\n /** @internal */\r\n public initialSpriteCellLoop: boolean;\r\n\r\n /** @internal */\r\n public currentColorGradient: Nullable<ColorGradient>;\r\n /** @internal */\r\n public currentColor1 = new Color4(0, 0, 0, 0);\r\n /** @internal */\r\n public currentColor2 = new Color4(0, 0, 0, 0);\r\n\r\n /** @internal */\r\n public currentSizeGradient: Nullable<FactorGradient>;\r\n /** @internal */\r\n public currentSize1 = 0;\r\n /** @internal */\r\n public currentSize2 = 0;\r\n\r\n /** @internal */\r\n public currentAngularSpeedGradient: Nullable<FactorGradient>;\r\n /** @internal */\r\n public currentAngularSpeed1 = 0;\r\n /** @internal */\r\n public currentAngularSpeed2 = 0;\r\n\r\n /** @internal */\r\n public currentVelocityGradient: Nullable<FactorGradient>;\r\n /** @internal */\r\n public currentVelocity1 = 0;\r\n /** @internal */\r\n public currentVelocity2 = 0;\r\n\r\n /** @internal */\r\n public directionScale: number;\r\n /** @internal */\r\n public scaledDirection = Vector3.Zero();\r\n\r\n /** @internal */\r\n public currentLimitVelocityGradient: Nullable<FactorGradient>;\r\n /** @internal */\r\n public currentLimitVelocity1 = 0;\r\n /** @internal */\r\n public currentLimitVelocity2 = 0;\r\n\r\n /** @internal */\r\n public currentDragGradient: Nullable<FactorGradient>;\r\n /** @internal */\r\n public currentDrag1 = 0;\r\n /** @internal */\r\n public currentDrag2 = 0;\r\n\r\n /** @internal */\r\n public randomNoiseCoordinates1: Nullable<Vector3>;\r\n /** @internal */\r\n public randomNoiseCoordinates2: Nullable<Vector3>;\r\n\r\n /** @internal */\r\n public localPosition?: Vector3;\r\n\r\n /**\r\n * Callback triggered when the particle is reset\r\n */\r\n public onReset: Nullable<() => void>;\r\n\r\n /** @internal */\r\n public reset(): void {\r\n this.currentColorGradient = null;\r\n this.currentSizeGradient = null;\r\n this.currentAngularSpeedGradient = null;\r\n this.currentVelocityGradient = null;\r\n this.currentLimitVelocityGradient = null;\r\n this.currentDragGradient = null;\r\n this.randomCellOffset = undefined;\r\n this.randomNoiseCoordinates1 = null;\r\n this.randomNoiseCoordinates2 = null;\r\n }\r\n}\r\n\r\n/**\r\n * A particle represents one of the element emitted by a particle system.\r\n * This is mainly define by its coordinates, direction, velocity and age.\r\n */\r\nexport class Particle {\r\n private static _Count = 0;\r\n /**\r\n * Unique ID of the particle\r\n */\r\n public id: number;\r\n /**\r\n * The world position of the particle in the scene.\r\n */\r\n public position = Vector3.Zero();\r\n\r\n /**\r\n * The world direction of the particle in the scene.\r\n */\r\n public direction = Vector3.Zero();\r\n\r\n /**\r\n * The color of the particle.\r\n */\r\n public color = new Color4(0, 0, 0, 0);\r\n\r\n /**\r\n * The color change of the particle per step.\r\n */\r\n public colorStep = new Color4(0, 0, 0, 0);\r\n\r\n /**\r\n * The creation color of the particle.\r\n */\r\n public initialColor = new Color4(0, 0, 0, 0);\r\n\r\n /**\r\n * The color used when the end of life of the particle.\r\n */\r\n public colorDead = new Color4(0, 0, 0, 0);\r\n\r\n /**\r\n * Defines how long will the life of the particle be.\r\n */\r\n public lifeTime = 1.0;\r\n\r\n /**\r\n * The current age of the particle.\r\n */\r\n public age = 0;\r\n\r\n /**\r\n * The current size of the particle.\r\n */\r\n public size = 0;\r\n\r\n /**\r\n * The current scale of the particle.\r\n */\r\n public scale = new Vector2(1, 1);\r\n\r\n /**\r\n * The current angle of the particle.\r\n */\r\n public angle = 0;\r\n\r\n /**\r\n * Defines how fast is the angle changing.\r\n */\r\n public angularSpeed = 0;\r\n\r\n /**\r\n * Defines the cell index used by the particle to be rendered from a sprite.\r\n */\r\n public cellIndex: number = 0;\r\n\r\n /**\r\n * The information required to support color remapping\r\n */\r\n public remapData: Vector4;\r\n\r\n /**\r\n * Gets or sets an object used to store user defined information for the particle\r\n */\r\n public metadata: any = null;\r\n\r\n /** @internal */\r\n public _properties = new ParticleInternalProperties();\r\n\r\n /**\r\n * Creates a new instance Particle\r\n * @param particleSystem the particle system the particle belongs to\r\n */\r\n constructor(\r\n /**\r\n * The particle system the particle belongs to.\r\n */\r\n public particleSystem: ThinParticleSystem\r\n ) {\r\n this.id = Particle._Count++;\r\n if (!this.particleSystem.isAnimationSheetEnabled) {\r\n return;\r\n }\r\n\r\n this._updateCellInfoFromSystem();\r\n }\r\n\r\n private _updateCellInfoFromSystem(): void {\r\n this.cellIndex = this.particleSystem.startSpriteCellID;\r\n }\r\n\r\n /**\r\n * Defines how the sprite cell index is updated for the particle\r\n */\r\n public updateCellIndex(): void {\r\n let offsetAge = this.age;\r\n let changeSpeed = this.particleSystem.spriteCellChangeSpeed;\r\n\r\n if (this.particleSystem.spriteRandomStartCell) {\r\n if (this._properties.randomCellOffset === undefined) {\r\n this._properties.randomCellOffset = Math.random() * this.lifeTime;\r\n }\r\n\r\n if (changeSpeed === 0) {\r\n // Special case when speed = 0 meaning we want to stay on initial cell\r\n changeSpeed = 1;\r\n offsetAge = this._properties.randomCellOffset;\r\n } else {\r\n offsetAge += this._properties.randomCellOffset;\r\n }\r\n }\r\n\r\n const dist = this._properties.initialEndSpriteCellId - this._properties.initialStartSpriteCellId + 1;\r\n let ratio: number;\r\n if (this._properties.initialSpriteCellLoop) {\r\n ratio = Clamp(((offsetAge * changeSpeed) % this.lifeTime) / this.lifeTime);\r\n } else {\r\n ratio = Clamp((offsetAge * changeSpeed) / this.lifeTime);\r\n }\r\n this.cellIndex = (this._properties.initialStartSpriteCellId + ratio * dist) | 0;\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _inheritParticleInfoToSubEmitter(subEmitter: SubEmitter) {\r\n if ((<AbstractMesh>subEmitter.particleSystem.emitter).position) {\r\n const emitterMesh = <AbstractMesh>subEmitter.particleSystem.emitter;\r\n emitterMesh.position.copyFrom(this.position);\r\n if (subEmitter.inheritDirection) {\r\n const temp = TmpVectors.Vector3[0];\r\n this.direction.normalizeToRef(temp);\r\n emitterMesh.setDirection(temp, 0, Math.PI / 2);\r\n }\r\n } else {\r\n const emitterPosition = <Vector3>subEmitter.particleSystem.emitter;\r\n emitterPosition.copyFrom(this.position);\r\n }\r\n // Set inheritedVelocityOffset to be used when new particles are created\r\n this.direction.scaleToRef(subEmitter.inheritedVelocityAmount / 2, TmpVectors.Vector3[0]);\r\n subEmitter.particleSystem._inheritedVelocityOffset.copyFrom(TmpVectors.Vector3[0]);\r\n }\r\n\r\n /** @internal */\r\n public _inheritParticleInfoToSubEmitters() {\r\n if (this._properties.attachedSubEmitters && this._properties.attachedSubEmitters.length > 0) {\r\n for (const subEmitter of this._properties.attachedSubEmitters) {\r\n this._inheritParticleInfoToSubEmitter(subEmitter);\r\n }\r\n }\r\n }\r\n\r\n /** @internal */\r\n public _reset() {\r\n if (this._properties.onReset) {\r\n this._properties.onReset();\r\n }\r\n this.age = 0;\r\n this.id = Particle._Count++;\r\n this._properties.reset();\r\n this.metadata = null;\r\n this.cellIndex = this.particleSystem.startSpriteCellID;\r\n }\r\n\r\n /**\r\n * Copy the properties of particle to another one.\r\n * @param other the particle to copy the information to.\r\n */\r\n public copyTo(other: Particle) {\r\n other.position.copyFrom(this.position);\r\n if (this._properties.initialDirection) {\r\n if (other._properties.initialDirection) {\r\n other._properties.initialDirection.copyFrom(this._properties.initialDirection);\r\n } else {\r\n other._properties.initialDirection = this._properties.initialDirection.clone();\r\n }\r\n } else {\r\n other._properties.initialDirection = null;\r\n }\r\n other.direction.copyFrom(this.direction);\r\n if (this._properties.localPosition) {\r\n if (other._properties.localPosition) {\r\n other._properties.localPosition.copyFrom(this._properties.localPosition);\r\n } else {\r\n other._properties.localPosition = this._properties.localPosition.clone();\r\n }\r\n }\r\n other.color.copyFrom(this.color);\r\n other.colorStep.copyFrom(this.colorStep);\r\n other.initialColor.copyFrom(this.initialColor);\r\n other.colorDead.copyFrom(this.colorDead);\r\n other.lifeTime = this.lifeTime;\r\n other.age = this.age;\r\n other._properties.randomCellOffset = this._properties.randomCellOffset;\r\n other.size = this.size;\r\n other.scale.copyFrom(this.scale);\r\n other.angle = this.angle;\r\n other.angularSpeed = this.angularSpeed;\r\n other.particleSystem = this.particleSystem;\r\n other.cellIndex = this.cellIndex;\r\n other.id = this.id;\r\n other._properties.attachedSubEmitters = this._properties.attachedSubEmitters;\r\n if (this._properties.currentColorGradient) {\r\n other._properties.currentColorGradient = this._properties.currentColorGradient;\r\n other._properties.currentColor1.copyFrom(this._properties.currentColor1);\r\n other._properties.currentColor2.copyFrom(this._properties.currentColor2);\r\n }\r\n if (this._properties.currentSizeGradient) {\r\n other._properties.currentSizeGradient = this._properties.currentSizeGradient;\r\n other._properties.currentSize1 = this._properties.currentSize1;\r\n other._properties.currentSize2 = this._properties.currentSize2;\r\n }\r\n if (this._properties.currentAngularSpeedGradient) {\r\n other._properties.currentAngularSpeedGradient = this._properties.currentAngularSpeedGradient;\r\n other._properties.currentAngularSpeed1 = this._properties.currentAngularSpeed1;\r\n other._properties.currentAngularSpeed2 = this._properties.currentAngularSpeed2;\r\n }\r\n if (this._properties.currentVelocityGradient) {\r\n other._properties.currentVelocityGradient = this._properties.currentVelocityGradient;\r\n other._properties.currentVelocity1 = this._properties.currentVelocity1;\r\n other._properties.currentVelocity2 = this._properties.currentVelocity2;\r\n }\r\n if (this._properties.currentLimitVelocityGradient) {\r\n other._properties.currentLimitVelocityGradient = this._properties.currentLimitVelocityGradient;\r\n other._properties.currentLimitVelocity1 = this._properties.currentLimitVelocity1;\r\n other._properties.currentLimitVelocity2 = this._properties.currentLimitVelocity2;\r\n }\r\n if (this._properties.currentDragGradient) {\r\n other._properties.currentDragGradient = this._properties.currentDragGradient;\r\n other._properties.currentDrag1 = this._properties.currentDrag1;\r\n other._properties.currentDrag2 = this._properties.currentDrag2;\r\n }\r\n if (this.particleSystem.isAnimationSheetEnabled) {\r\n other._properties.initialStartSpriteCellId = this._properties.initialStartSpriteCellId;\r\n other._properties.initialEndSpriteCellId = this._properties.initialEndSpriteCellId;\r\n other._properties.initialSpriteCellLoop = this._properties.initialSpriteCellLoop;\r\n }\r\n if (this.particleSystem.useRampGradients) {\r\n if (other.remapData && this.remapData) {\r\n other.remapData.copyFrom(this.remapData);\r\n } else {\r\n other.remapData = new Vector4(0, 0, 0, 0);\r\n }\r\n }\r\n if (this._properties.randomNoiseCoordinates1 && this._properties.randomNoiseCoordinates2) {\r\n if (other._properties.randomNoiseCoordinates1 && other._properties.randomNoiseCoordinates2) {\r\n other._properties.randomNoiseCoordinates1.copyFrom(this._properties.randomNoiseCoordinates1);\r\n other._properties.randomNoiseCoordinates2.copyFrom(this._properties.randomNoiseCoordinates2);\r\n } else {\r\n other._properties.randomNoiseCoordinates1 = this._properties.randomNoiseCoordinates1.clone();\r\n other._properties.randomNoiseCoordinates2 = this._properties.randomNoiseCoordinates2.clone();\r\n }\r\n }\r\n other.metadata = this.metadata;\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"particle.js","sourceRoot":"","s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GAAG,CAAC,AAAJ,CAAK","sourcesContent":["import { type Nullable } from \"../types\";\r\nimport { Vector2, Vector3, TmpVectors, Vector4 } from \"../Maths/math.vector.pure\";\r\nimport { Color4 } from \"../Maths/math.color.pure\";\r\nimport { type SubEmitter } from \"./subEmitter\";\r\nimport { type ColorGradient, type FactorGradient } from \"../Misc/gradients\";\r\n\r\nimport { type AbstractMesh } from \"../Meshes/abstractMesh\";\r\nimport { type ThinParticleSystem } from \"./thinParticleSystem\";\r\nimport { Clamp } from \"../Maths/math.scalar.functions\";\r\n\r\n/**\r\n * @internal\r\n * Holds all internal properties of a Particle, grouped into a single sub-object\r\n * to keep the Particle's own property count low (V8 in-object property limit).\r\n */\r\nclass ParticleInternalProperties {\r\n /** @internal */\r\n public randomCellOffset?: number;\r\n\r\n /** @internal */\r\n public initialDirection: Nullable<Vector3>;\r\n\r\n /** @internal */\r\n public attachedSubEmitters: Nullable<Array<SubEmitter>> = null;\r\n\r\n /** @internal */\r\n public initialStartSpriteCellId: number;\r\n /** @internal */\r\n public initialEndSpriteCellId: number;\r\n /** @internal */\r\n public initialSpriteCellLoop: boolean;\r\n\r\n /** @internal */\r\n public currentColorGradient: Nullable<ColorGradient>;\r\n /** @internal */\r\n public currentColor1 = new Color4(0, 0, 0, 0);\r\n /** @internal */\r\n public currentColor2 = new Color4(0, 0, 0, 0);\r\n\r\n /** @internal */\r\n public currentSizeGradient: Nullable<FactorGradient>;\r\n /** @internal */\r\n public currentSize1 = 0;\r\n /** @internal */\r\n public currentSize2 = 0;\r\n\r\n /** @internal */\r\n public currentAngularSpeedGradient: Nullable<FactorGradient>;\r\n /** @internal */\r\n public currentAngularSpeed1 = 0;\r\n /** @internal */\r\n public currentAngularSpeed2 = 0;\r\n\r\n /** @internal */\r\n public currentVelocityGradient: Nullable<FactorGradient>;\r\n /** @internal */\r\n public currentVelocity1 = 0;\r\n /** @internal */\r\n public currentVelocity2 = 0;\r\n\r\n /** @internal */\r\n public directionScale: number;\r\n /** @internal */\r\n public scaledDirection = Vector3.Zero();\r\n\r\n /** @internal */\r\n public currentLimitVelocityGradient: Nullable<FactorGradient>;\r\n /** @internal */\r\n public currentLimitVelocity1 = 0;\r\n /** @internal */\r\n public currentLimitVelocity2 = 0;\r\n\r\n /** @internal */\r\n public currentDragGradient: Nullable<FactorGradient>;\r\n /** @internal */\r\n public currentDrag1 = 0;\r\n /** @internal */\r\n public currentDrag2 = 0;\r\n\r\n /** @internal */\r\n public randomNoiseCoordinates1: Nullable<Vector3>;\r\n /** @internal */\r\n public randomNoiseCoordinates2: Nullable<Vector3>;\r\n\r\n /** @internal */\r\n public localPosition?: Vector3;\r\n\r\n /**\r\n * Callback triggered when the particle is reset\r\n */\r\n public onReset: Nullable<() => void>;\r\n\r\n /** @internal */\r\n public reset(): void {\r\n this.currentColorGradient = null;\r\n this.currentSizeGradient = null;\r\n this.currentAngularSpeedGradient = null;\r\n this.currentVelocityGradient = null;\r\n this.currentLimitVelocityGradient = null;\r\n this.currentDragGradient = null;\r\n this.randomCellOffset = undefined;\r\n this.randomNoiseCoordinates1 = null;\r\n this.randomNoiseCoordinates2 = null;\r\n }\r\n}\r\n\r\n/**\r\n * A particle represents one of the element emitted by a particle system.\r\n * This is mainly define by its coordinates, direction, velocity and age.\r\n */\r\nexport class Particle {\r\n private static _Count = 0;\r\n /**\r\n * Unique ID of the particle\r\n */\r\n public id: number;\r\n /**\r\n * The world position of the particle in the scene.\r\n */\r\n public position = Vector3.Zero();\r\n\r\n /**\r\n * The world direction of the particle in the scene.\r\n */\r\n public direction = Vector3.Zero();\r\n\r\n /**\r\n * The color of the particle.\r\n */\r\n public color = new Color4(0, 0, 0, 0);\r\n\r\n /**\r\n * The color change of the particle per step.\r\n */\r\n public colorStep = new Color4(0, 0, 0, 0);\r\n\r\n /**\r\n * The creation color of the particle.\r\n */\r\n public initialColor = new Color4(0, 0, 0, 0);\r\n\r\n /**\r\n * The color used when the end of life of the particle.\r\n */\r\n public colorDead = new Color4(0, 0, 0, 0);\r\n\r\n /**\r\n * Defines how long will the life of the particle be.\r\n */\r\n public lifeTime = 1.0;\r\n\r\n /**\r\n * The current age of the particle.\r\n */\r\n public age = 0;\r\n\r\n /**\r\n * The current size of the particle.\r\n */\r\n public size = 0;\r\n\r\n /**\r\n * The current scale of the particle.\r\n */\r\n public scale = new Vector2(1, 1);\r\n\r\n /**\r\n * The current angle of the particle.\r\n */\r\n public angle = 0;\r\n\r\n /**\r\n * Defines how fast is the angle changing.\r\n */\r\n public angularSpeed = 0;\r\n\r\n /**\r\n * Defines the cell index used by the particle to be rendered from a sprite.\r\n */\r\n public cellIndex: number = 0;\r\n\r\n /**\r\n * The information required to support color remapping\r\n */\r\n public remapData: Vector4;\r\n\r\n /**\r\n * Gets or sets an object used to store user defined information for the particle\r\n */\r\n public metadata: any = null;\r\n\r\n /** @internal */\r\n public _properties = new ParticleInternalProperties();\r\n\r\n /**\r\n * Creates a new instance Particle\r\n * @param particleSystem the particle system the particle belongs to\r\n */\r\n constructor(\r\n /**\r\n * The particle system the particle belongs to.\r\n */\r\n public particleSystem: ThinParticleSystem\r\n ) {\r\n this.id = Particle._Count++;\r\n if (!this.particleSystem.isAnimationSheetEnabled) {\r\n return;\r\n }\r\n\r\n this._updateCellInfoFromSystem();\r\n }\r\n\r\n private _updateCellInfoFromSystem(): void {\r\n this.cellIndex = this.particleSystem.startSpriteCellID;\r\n }\r\n\r\n /**\r\n * Defines how the sprite cell index is updated for the particle\r\n */\r\n public updateCellIndex(): void {\r\n let offsetAge = this.age;\r\n let changeSpeed = this.particleSystem.spriteCellChangeSpeed;\r\n\r\n if (this.particleSystem.spriteRandomStartCell) {\r\n if (this._properties.randomCellOffset === undefined) {\r\n this._properties.randomCellOffset = Math.random() * this.lifeTime;\r\n }\r\n\r\n if (changeSpeed === 0) {\r\n // Special case when speed = 0 meaning we want to stay on initial cell\r\n changeSpeed = 1;\r\n offsetAge = this._properties.randomCellOffset;\r\n } else {\r\n offsetAge += this._properties.randomCellOffset;\r\n }\r\n }\r\n\r\n const dist = this._properties.initialEndSpriteCellId - this._properties.initialStartSpriteCellId + 1;\r\n let ratio: number;\r\n if (this._properties.initialSpriteCellLoop) {\r\n ratio = Clamp(((offsetAge * changeSpeed) % this.lifeTime) / this.lifeTime);\r\n } else {\r\n ratio = Clamp((offsetAge * changeSpeed) / this.lifeTime);\r\n }\r\n this.cellIndex = (this._properties.initialStartSpriteCellId + ratio * dist) | 0;\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _inheritParticleInfoToSubEmitter(subEmitter: SubEmitter) {\r\n if ((<AbstractMesh>subEmitter.particleSystem.emitter).position) {\r\n const emitterMesh = <AbstractMesh>subEmitter.particleSystem.emitter;\r\n emitterMesh.position.copyFrom(this.position);\r\n if (subEmitter.inheritDirection) {\r\n const temp = TmpVectors.Vector3[0];\r\n this.direction.normalizeToRef(temp);\r\n emitterMesh.setDirection(temp, 0, Math.PI / 2);\r\n }\r\n } else {\r\n const emitterPosition = <Vector3>subEmitter.particleSystem.emitter;\r\n emitterPosition.copyFrom(this.position);\r\n }\r\n // Set inheritedVelocityOffset to be used when new particles are created\r\n this.direction.scaleToRef(subEmitter.inheritedVelocityAmount / 2, TmpVectors.Vector3[0]);\r\n subEmitter.particleSystem._inheritedVelocityOffset.copyFrom(TmpVectors.Vector3[0]);\r\n }\r\n\r\n /** @internal */\r\n public _inheritParticleInfoToSubEmitters() {\r\n if (this._properties.attachedSubEmitters && this._properties.attachedSubEmitters.length > 0) {\r\n for (const subEmitter of this._properties.attachedSubEmitters) {\r\n this._inheritParticleInfoToSubEmitter(subEmitter);\r\n }\r\n }\r\n }\r\n\r\n /** @internal */\r\n public _reset() {\r\n if (this._properties.onReset) {\r\n this._properties.onReset();\r\n }\r\n this.age = 0;\r\n this.id = Particle._Count++;\r\n this._properties.reset();\r\n this.metadata = null;\r\n this.cellIndex = this.particleSystem.startSpriteCellID;\r\n }\r\n\r\n /**\r\n * Copy the properties of particle to another one.\r\n * @param other the particle to copy the information to.\r\n */\r\n public copyTo(other: Particle) {\r\n other.position.copyFrom(this.position);\r\n if (this._properties.initialDirection) {\r\n if (other._properties.initialDirection) {\r\n other._properties.initialDirection.copyFrom(this._properties.initialDirection);\r\n } else {\r\n other._properties.initialDirection = this._properties.initialDirection.clone();\r\n }\r\n } else {\r\n other._properties.initialDirection = null;\r\n }\r\n other.direction.copyFrom(this.direction);\r\n if (this._properties.localPosition) {\r\n if (other._properties.localPosition) {\r\n other._properties.localPosition.copyFrom(this._properties.localPosition);\r\n } else {\r\n other._properties.localPosition = this._properties.localPosition.clone();\r\n }\r\n }\r\n other.color.copyFrom(this.color);\r\n other.colorStep.copyFrom(this.colorStep);\r\n other.initialColor.copyFrom(this.initialColor);\r\n other.colorDead.copyFrom(this.colorDead);\r\n other.lifeTime = this.lifeTime;\r\n other.age = this.age;\r\n other._properties.randomCellOffset = this._properties.randomCellOffset;\r\n other.size = this.size;\r\n other.scale.copyFrom(this.scale);\r\n other.angle = this.angle;\r\n other.angularSpeed = this.angularSpeed;\r\n other.particleSystem = this.particleSystem;\r\n other.cellIndex = this.cellIndex;\r\n other.id = this.id;\r\n other._properties.attachedSubEmitters = this._properties.attachedSubEmitters;\r\n if (this._properties.currentColorGradient) {\r\n other._properties.currentColorGradient = this._properties.currentColorGradient;\r\n other._properties.currentColor1.copyFrom(this._properties.currentColor1);\r\n other._properties.currentColor2.copyFrom(this._properties.currentColor2);\r\n }\r\n if (this._properties.currentSizeGradient) {\r\n other._properties.currentSizeGradient = this._properties.currentSizeGradient;\r\n other._properties.currentSize1 = this._properties.currentSize1;\r\n other._properties.currentSize2 = this._properties.currentSize2;\r\n }\r\n if (this._properties.currentAngularSpeedGradient) {\r\n other._properties.currentAngularSpeedGradient = this._properties.currentAngularSpeedGradient;\r\n other._properties.currentAngularSpeed1 = this._properties.currentAngularSpeed1;\r\n other._properties.currentAngularSpeed2 = this._properties.currentAngularSpeed2;\r\n }\r\n if (this._properties.currentVelocityGradient) {\r\n other._properties.currentVelocityGradient = this._properties.currentVelocityGradient;\r\n other._properties.currentVelocity1 = this._properties.currentVelocity1;\r\n other._properties.currentVelocity2 = this._properties.currentVelocity2;\r\n }\r\n if (this._properties.currentLimitVelocityGradient) {\r\n other._properties.currentLimitVelocityGradient = this._properties.currentLimitVelocityGradient;\r\n other._properties.currentLimitVelocity1 = this._properties.currentLimitVelocity1;\r\n other._properties.currentLimitVelocity2 = this._properties.currentLimitVelocity2;\r\n }\r\n if (this._properties.currentDragGradient) {\r\n other._properties.currentDragGradient = this._properties.currentDragGradient;\r\n other._properties.currentDrag1 = this._properties.currentDrag1;\r\n other._properties.currentDrag2 = this._properties.currentDrag2;\r\n }\r\n if (this.particleSystem.isAnimationSheetEnabled) {\r\n other._properties.initialStartSpriteCellId = this._properties.initialStartSpriteCellId;\r\n other._properties.initialEndSpriteCellId = this._properties.initialEndSpriteCellId;\r\n other._properties.initialSpriteCellLoop = this._properties.initialSpriteCellLoop;\r\n }\r\n if (this.particleSystem.useRampGradients) {\r\n if (other.remapData && this.remapData) {\r\n other.remapData.copyFrom(this.remapData);\r\n } else {\r\n other.remapData = new Vector4(0, 0, 0, 0);\r\n }\r\n }\r\n if (this._properties.randomNoiseCoordinates1 && this._properties.randomNoiseCoordinates2) {\r\n if (other._properties.randomNoiseCoordinates1 && other._properties.randomNoiseCoordinates2) {\r\n other._properties.randomNoiseCoordinates1.copyFrom(this._properties.randomNoiseCoordinates1);\r\n other._properties.randomNoiseCoordinates2.copyFrom(this._properties.randomNoiseCoordinates2);\r\n } else {\r\n other._properties.randomNoiseCoordinates1 = this._properties.randomNoiseCoordinates1.clone();\r\n other._properties.randomNoiseCoordinates2 = this._properties.randomNoiseCoordinates2.clone();\r\n }\r\n }\r\n other.metadata = this.metadata;\r\n }\r\n}\r\n"]}
@@ -1,10 +1,10 @@
1
- import { Tools } from "../Misc/tools.js";
2
- import { Color4 } from "../Maths/math.color.js";
3
- import { Texture } from "../Materials/Textures/texture.js";
1
+ import { Tools } from "../Misc/tools.pure.js";
2
+ import { Color4 } from "../Maths/math.color.pure.js";
3
+ import { Texture } from "../Materials/Textures/texture.pure.js";
4
4
  import { EngineStore } from "../Engines/engineStore.js";
5
- import { GPUParticleSystem } from "./gpuParticleSystem.js";
5
+ import { GPUParticleSystem } from "./gpuParticleSystem.pure.js";
6
6
  import { ParticleSystemSet } from "./particleSystemSet.js";
7
- import { ParticleSystem } from "./particleSystem.js";
7
+ import { ParticleSystem } from "./particleSystem.pure.js";
8
8
  import { WebRequest } from "../Misc/webRequest.js";
9
9
 
10
10
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"particleHelper.js","sourceRoot":"","sources":["../../../../dev/core/src/Particles/particleHelper.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAEtC,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE7C,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAErD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD;;GAEG;AACH,MAAM,OAAO,cAAc;IASvB;;;;;;;OAOG;IACI,MAAM,CAAC,aAAa,CAAC,OAAyC,EAAE,QAAQ,GAAG,GAAG,EAAE,KAAa,EAAE,MAAM,GAAG,KAAK;QAChH,IAAI,MAAuB,CAAC;QAE5B,IAAI,MAAM,EAAE,CAAC;YACT,MAAM,GAAG,IAAI,iBAAiB,CAAC,gBAAgB,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE,KAAM,CAAC,CAAC;QACrF,CAAC;aA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,CAAC,CAAC;oBACpB,CAAC;yBAAM,CAAC;wBACJ,2EAA2E;wBAC3E,MAAM,CAAC,6BAA6B,GAAG,SAAS,CAAC,CAAC;oBACtD,CAAC;gBACL,CAAC;YACL,CAAC,CAAC,CAAC;YAEH,OAAO,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,UAAU,GAAG,GAAG,GAAG,SAAS,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,CAAC;YAC1E,OAAO,CAAC,IAAI,EAAE,CAAC;QACnB,CAAC,CAAC,CAAC;IACP,CAAC;;AAtMD;;GAEG;AACW,4BAAa,GAAG,iBAAiB,CAAC,aAAa,CAAC;AAE9D,sCAAsC;AACxB,yBAAU,GAAG,SAAS,CAAC,UAAU,CAAC;AAkMhD;;;;;;;;;GASG;AACW,qCAAsB,GAAG,cAAc,CAAC,qBAAqB,CAAC","sourcesContent":["import { type Nullable } from \"../types\";\r\nimport { type Scene } from \"../scene\";\r\nimport { Tools } from \"../Misc/tools\";\r\nimport { type Vector3 } from \"../Maths/math.vector\";\r\nimport { Color4 } from \"../Maths/math.color\";\r\nimport { type AbstractMesh } from \"../Meshes/abstractMesh\";\r\nimport { Texture } from \"../Materials/Textures/texture\";\r\nimport { EngineStore } from \"../Engines/engineStore\";\r\nimport { type IParticleSystem } from \"./IParticleSystem\";\r\nimport { GPUParticleSystem } from \"./gpuParticleSystem\";\r\nimport { ParticleSystemSet } from \"./particleSystemSet\";\r\nimport { ParticleSystem } from \"./particleSystem\";\r\nimport { WebRequest } from \"../Misc/webRequest\";\r\nimport { Constants } from \"../Engines/constants\";\r\n/**\r\n * This class is made for on one-liner static method to help creating particle system set.\r\n */\r\nexport class ParticleHelper {\r\n /**\r\n * Gets or sets base Assets URL\r\n */\r\n public static BaseAssetsUrl = ParticleSystemSet.BaseAssetsUrl;\r\n\r\n /** Define the Url to load snippets */\r\n public static SnippetUrl = Constants.SnippetUrl;\r\n\r\n /**\r\n * Create a default particle system that you can tweak\r\n * @param emitter defines the emitter to use\r\n * @param capacity defines the system capacity (default is 500 particles)\r\n * @param scene defines the hosting scene\r\n * @param useGPU defines if a GPUParticleSystem must be created (default is false)\r\n * @returns the new Particle system\r\n */\r\n public static CreateDefault(emitter: Nullable<AbstractMesh | Vector3>, capacity = 500, scene?: Scene, useGPU = false): IParticleSystem {\r\n let system: IParticleSystem;\r\n\r\n if (useGPU) {\r\n system = new GPUParticleSystem(\"default system\", { capacity: capacity }, scene!);\r\n } else {\r\n system = new ParticleSystem(\"default system\", capacity, scene!);\r\n }\r\n\r\n system.emitter = emitter;\r\n const textureUrl = Tools.GetAssetUrl(\"https://assets.babylonjs.com/core/textures/flare.png\");\r\n system.particleTexture = new Texture(textureUrl, system.getScene());\r\n system.createConeEmitter(0.1, Math.PI / 4);\r\n\r\n // Particle color\r\n system.color1 = new Color4(1.0, 1.0, 1.0, 1.0);\r\n system.color2 = new Color4(1.0, 1.0, 1.0, 1.0);\r\n system.colorDead = new Color4(1.0, 1.0, 1.0, 0.0);\r\n\r\n // Particle Size\r\n system.minSize = 0.1;\r\n system.maxSize = 0.1;\r\n\r\n // Emission speed\r\n system.minEmitPower = 2;\r\n system.maxEmitPower = 2;\r\n\r\n // Update speed\r\n system.updateSpeed = 1 / 60;\r\n\r\n system.emitRate = 30;\r\n\r\n return system;\r\n }\r\n\r\n /**\r\n * This is the main static method (one-liner) of this helper to create different particle systems\r\n * @param type This string represents the type to the particle system to create\r\n * @param scene The scene where the particle system should live\r\n * @param gpu If the system will use gpu\r\n * @param capacity defines the system capacity (if null or undefined the sotred capacity will be used)\r\n * @returns the ParticleSystemSet created\r\n */\r\n // eslint-disable-next-line @typescript-eslint/promise-function-async, no-restricted-syntax\r\n public static CreateAsync(type: string, scene: Nullable<Scene>, gpu: boolean = false, capacity?: number): Promise<ParticleSystemSet> {\r\n if (!scene) {\r\n scene = EngineStore.LastCreatedScene;\r\n }\r\n\r\n const token = {};\r\n\r\n scene!.addPendingData(token);\r\n\r\n return new Promise((resolve, reject) => {\r\n if (gpu && !GPUParticleSystem.IsSupported) {\r\n scene!.removePendingData(token);\r\n // eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors\r\n return reject(\"Particle system with GPU is not supported.\");\r\n }\r\n\r\n Tools.LoadFile(\r\n `${ParticleHelper.BaseAssetsUrl}/systems/${type}.json`,\r\n (data) => {\r\n scene!.removePendingData(token);\r\n const newData = JSON.parse(data.toString());\r\n return resolve(ParticleSystemSet.Parse(newData, scene!, gpu, capacity));\r\n },\r\n undefined,\r\n undefined,\r\n undefined,\r\n () => {\r\n scene!.removePendingData(token);\r\n // eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors\r\n return reject(`An error occurred with the creation of your particle system. Check if your type '${type}' exists.`);\r\n }\r\n );\r\n });\r\n }\r\n\r\n /**\r\n * Static function used to export a particle system to a ParticleSystemSet variable.\r\n * Please note that the emitter shape is not exported\r\n * @param systems defines the particle systems to export\r\n * @returns the created particle system set\r\n */\r\n public static ExportSet(systems: IParticleSystem[]): ParticleSystemSet {\r\n const set = new ParticleSystemSet();\r\n\r\n for (const system of systems) {\r\n set.systems.push(system);\r\n }\r\n\r\n return set;\r\n }\r\n\r\n /**\r\n * Creates a particle system from a snippet saved in a remote file\r\n * @param name defines the name of the particle system to create (can be null or empty to use the one from the json data)\r\n * @param url defines the url to load from\r\n * @param scene defines the hosting scene\r\n * @param gpu If the system will use gpu\r\n * @param rootUrl defines the root URL to use to load textures and relative dependencies\r\n * @param capacity defines the system capacity (if null or undefined the sotred capacity will be used)\r\n * @returns a promise that will resolve to the new particle system\r\n */\r\n // eslint-disable-next-line @typescript-eslint/promise-function-async, no-restricted-syntax\r\n public static ParseFromFileAsync(name: Nullable<string>, url: string, scene: Scene, gpu: boolean = false, rootUrl: string = \"\", capacity?: number): Promise<IParticleSystem> {\r\n return new Promise((resolve, reject) => {\r\n const request = new WebRequest();\r\n request.addEventListener(\"readystatechange\", () => {\r\n if (request.readyState == 4) {\r\n if (request.status == 200) {\r\n const serializationObject = JSON.parse(request.responseText);\r\n let output: IParticleSystem;\r\n\r\n if (gpu) {\r\n output = GPUParticleSystem.Parse(serializationObject, scene, rootUrl, false, capacity);\r\n } else {\r\n output = ParticleSystem.Parse(serializationObject, scene, rootUrl, false, capacity);\r\n }\r\n\r\n if (name) {\r\n output.name = name;\r\n }\r\n\r\n resolve(output);\r\n } else {\r\n // eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors\r\n reject(\"Unable to load the particle system\");\r\n }\r\n }\r\n });\r\n\r\n request.open(\"GET\", url);\r\n request.send();\r\n });\r\n }\r\n\r\n /**\r\n * Creates a particle system from a snippet saved by the particle system editor\r\n * @param snippetId defines the snippet to load (can be set to _BLANK to create a default one)\r\n * @param scene defines the hosting scene\r\n * @param gpu If the system will use gpu\r\n * @param rootUrl defines the root URL to use to load textures and relative dependencies\r\n * @param capacity defines the system capacity (if null or undefined the sotred capacity will be used)\r\n * @returns a promise that will resolve to the new particle system\r\n */\r\n // eslint-disable-next-line @typescript-eslint/promise-function-async, no-restricted-syntax\r\n public static ParseFromSnippetAsync(snippetId: string, scene: Scene, gpu: boolean = false, rootUrl: string = \"\", capacity?: number): Promise<IParticleSystem> {\r\n if (snippetId === \"_BLANK\") {\r\n const system = this.CreateDefault(null);\r\n system.start();\r\n return Promise.resolve(system);\r\n }\r\n\r\n return new Promise((resolve, reject) => {\r\n const request = new WebRequest();\r\n request.addEventListener(\"readystatechange\", () => {\r\n if (request.readyState == 4) {\r\n if (request.status == 200) {\r\n const snippet = JSON.parse(JSON.parse(request.responseText).jsonPayload);\r\n const serializationObject = JSON.parse(snippet.particleSystem);\r\n let output: IParticleSystem;\r\n\r\n if (gpu) {\r\n output = GPUParticleSystem.Parse(serializationObject, scene, rootUrl, false, capacity);\r\n } else {\r\n output = ParticleSystem.Parse(serializationObject, scene, rootUrl, false, capacity);\r\n }\r\n output.snippetId = snippetId;\r\n\r\n resolve(output);\r\n } else {\r\n // eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors\r\n reject(\"Unable to load the snippet \" + snippetId);\r\n }\r\n }\r\n });\r\n\r\n request.open(\"GET\", this.SnippetUrl + \"/\" + snippetId.replace(/#/g, \"/\"));\r\n request.send();\r\n });\r\n }\r\n\r\n /**\r\n * Creates a particle system from a snippet saved by the particle system editor\r\n * @deprecated Please use ParseFromSnippetAsync instead\r\n * @param snippetId defines the snippet to load (can be set to _BLANK to create a default one)\r\n * @param scene defines the hosting scene\r\n * @param gpu If the system will use gpu\r\n * @param rootUrl defines the root URL to use to load textures and relative dependencies\r\n * @param capacity defines the system capacity (if null or undefined the sotred capacity will be used)\r\n * @returns a promise that will resolve to the new particle system\r\n */\r\n public static CreateFromSnippetAsync = ParticleHelper.ParseFromSnippetAsync;\r\n}\r\n"]}
1
+ {"version":3,"file":"particleHelper.js","sourceRoot":"","sources":["../../../../dev/core/src/Particles/particleHelper.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAE3C,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAElD,OAAO,EAAE,OAAO,EAAE,MAAM,oCAAoC,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAErD,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD;;GAEG;AACH,MAAM,OAAO,cAAc;IASvB;;;;;;;OAOG;IACI,MAAM,CAAC,aAAa,CAAC,OAAyC,EAAE,QAAQ,GAAG,GAAG,EAAE,KAAa,EAAE,MAAM,GAAG,KAAK;QAChH,IAAI,MAAuB,CAAC;QAE5B,IAAI,MAA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,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;wBACxF,CAAC;wBACD,MAAM,CAAC,SAAS,GAAG,SAAS,CAAC;wBAE7B,OAAO,CAAC,MAAM,CAAC,CAAC;oBACpB,CAAC;yBAAM,CAAC;wBACJ,2EAA2E;wBAC3E,MAAM,CAAC,6BAA6B,GAAG,SAAS,CAAC,CAAC;oBACtD,CAAC;gBACL,CAAC;YACL,CAAC,CAAC,CAAC;YAEH,OAAO,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,UAAU,GAAG,GAAG,GAAG,SAAS,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,CAAC;YAC1E,OAAO,CAAC,IAAI,EAAE,CAAC;QACnB,CAAC,CAAC,CAAC;IACP,CAAC;;AAtMD;;GAEG;AACW,4BAAa,GAAG,iBAAiB,CAAC,aAAa,CAAC;AAE9D,sCAAsC;AACxB,yBAAU,GAAG,SAAS,CAAC,UAAU,CAAC;AAkMhD;;;;;;;;;GASG;AACW,qCAAsB,GAAG,cAAc,CAAC,qBAAqB,CAAC","sourcesContent":["import { type Nullable } from \"../types\";\r\nimport { type Scene } from \"../scene\";\r\nimport { Tools } from \"../Misc/tools.pure\";\r\nimport { type Vector3 } from \"../Maths/math.vector\";\r\nimport { Color4 } from \"../Maths/math.color.pure\";\r\nimport { type AbstractMesh } from \"../Meshes/abstractMesh\";\r\nimport { Texture } from \"../Materials/Textures/texture.pure\";\r\nimport { EngineStore } from \"../Engines/engineStore\";\r\nimport { type IParticleSystem } from \"./IParticleSystem\";\r\nimport { GPUParticleSystem } from \"./gpuParticleSystem.pure\";\r\nimport { ParticleSystemSet } from \"./particleSystemSet\";\r\nimport { ParticleSystem } from \"./particleSystem.pure\";\r\nimport { WebRequest } from \"../Misc/webRequest\";\r\nimport { Constants } from \"../Engines/constants\";\r\n/**\r\n * This class is made for on one-liner static method to help creating particle system set.\r\n */\r\nexport class ParticleHelper {\r\n /**\r\n * Gets or sets base Assets URL\r\n */\r\n public static BaseAssetsUrl = ParticleSystemSet.BaseAssetsUrl;\r\n\r\n /** Define the Url to load snippets */\r\n public static SnippetUrl = Constants.SnippetUrl;\r\n\r\n /**\r\n * Create a default particle system that you can tweak\r\n * @param emitter defines the emitter to use\r\n * @param capacity defines the system capacity (default is 500 particles)\r\n * @param scene defines the hosting scene\r\n * @param useGPU defines if a GPUParticleSystem must be created (default is false)\r\n * @returns the new Particle system\r\n */\r\n public static CreateDefault(emitter: Nullable<AbstractMesh | Vector3>, capacity = 500, scene?: Scene, useGPU = false): IParticleSystem {\r\n let system: IParticleSystem;\r\n\r\n if (useGPU) {\r\n system = new GPUParticleSystem(\"default system\", { capacity: capacity }, scene!);\r\n } else {\r\n system = new ParticleSystem(\"default system\", capacity, scene!);\r\n }\r\n\r\n system.emitter = emitter;\r\n const textureUrl = Tools.GetAssetUrl(\"https://assets.babylonjs.com/core/textures/flare.png\");\r\n system.particleTexture = new Texture(textureUrl, system.getScene());\r\n system.createConeEmitter(0.1, Math.PI / 4);\r\n\r\n // Particle color\r\n system.color1 = new Color4(1.0, 1.0, 1.0, 1.0);\r\n system.color2 = new Color4(1.0, 1.0, 1.0, 1.0);\r\n system.colorDead = new Color4(1.0, 1.0, 1.0, 0.0);\r\n\r\n // Particle Size\r\n system.minSize = 0.1;\r\n system.maxSize = 0.1;\r\n\r\n // Emission speed\r\n system.minEmitPower = 2;\r\n system.maxEmitPower = 2;\r\n\r\n // Update speed\r\n system.updateSpeed = 1 / 60;\r\n\r\n system.emitRate = 30;\r\n\r\n return system;\r\n }\r\n\r\n /**\r\n * This is the main static method (one-liner) of this helper to create different particle systems\r\n * @param type This string represents the type to the particle system to create\r\n * @param scene The scene where the particle system should live\r\n * @param gpu If the system will use gpu\r\n * @param capacity defines the system capacity (if null or undefined the sotred capacity will be used)\r\n * @returns the ParticleSystemSet created\r\n */\r\n // eslint-disable-next-line @typescript-eslint/promise-function-async, no-restricted-syntax\r\n public static CreateAsync(type: string, scene: Nullable<Scene>, gpu: boolean = false, capacity?: number): Promise<ParticleSystemSet> {\r\n if (!scene) {\r\n scene = EngineStore.LastCreatedScene;\r\n }\r\n\r\n const token = {};\r\n\r\n scene!.addPendingData(token);\r\n\r\n return new Promise((resolve, reject) => {\r\n if (gpu && !GPUParticleSystem.IsSupported) {\r\n scene!.removePendingData(token);\r\n // eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors\r\n return reject(\"Particle system with GPU is not supported.\");\r\n }\r\n\r\n Tools.LoadFile(\r\n `${ParticleHelper.BaseAssetsUrl}/systems/${type}.json`,\r\n (data) => {\r\n scene!.removePendingData(token);\r\n const newData = JSON.parse(data.toString());\r\n return resolve(ParticleSystemSet.Parse(newData, scene!, gpu, capacity));\r\n },\r\n undefined,\r\n undefined,\r\n undefined,\r\n () => {\r\n scene!.removePendingData(token);\r\n // eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors\r\n return reject(`An error occurred with the creation of your particle system. Check if your type '${type}' exists.`);\r\n }\r\n );\r\n });\r\n }\r\n\r\n /**\r\n * Static function used to export a particle system to a ParticleSystemSet variable.\r\n * Please note that the emitter shape is not exported\r\n * @param systems defines the particle systems to export\r\n * @returns the created particle system set\r\n */\r\n public static ExportSet(systems: IParticleSystem[]): ParticleSystemSet {\r\n const set = new ParticleSystemSet();\r\n\r\n for (const system of systems) {\r\n set.systems.push(system);\r\n }\r\n\r\n return set;\r\n }\r\n\r\n /**\r\n * Creates a particle system from a snippet saved in a remote file\r\n * @param name defines the name of the particle system to create (can be null or empty to use the one from the json data)\r\n * @param url defines the url to load from\r\n * @param scene defines the hosting scene\r\n * @param gpu If the system will use gpu\r\n * @param rootUrl defines the root URL to use to load textures and relative dependencies\r\n * @param capacity defines the system capacity (if null or undefined the sotred capacity will be used)\r\n * @returns a promise that will resolve to the new particle system\r\n */\r\n // eslint-disable-next-line @typescript-eslint/promise-function-async, no-restricted-syntax\r\n public static ParseFromFileAsync(name: Nullable<string>, url: string, scene: Scene, gpu: boolean = false, rootUrl: string = \"\", capacity?: number): Promise<IParticleSystem> {\r\n return new Promise((resolve, reject) => {\r\n const request = new WebRequest();\r\n request.addEventListener(\"readystatechange\", () => {\r\n if (request.readyState == 4) {\r\n if (request.status == 200) {\r\n const serializationObject = JSON.parse(request.responseText);\r\n let output: IParticleSystem;\r\n\r\n if (gpu) {\r\n output = GPUParticleSystem.Parse(serializationObject, scene, rootUrl, false, capacity);\r\n } else {\r\n output = ParticleSystem.Parse(serializationObject, scene, rootUrl, false, capacity);\r\n }\r\n\r\n if (name) {\r\n output.name = name;\r\n }\r\n\r\n resolve(output);\r\n } else {\r\n // eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors\r\n reject(\"Unable to load the particle system\");\r\n }\r\n }\r\n });\r\n\r\n request.open(\"GET\", url);\r\n request.send();\r\n });\r\n }\r\n\r\n /**\r\n * Creates a particle system from a snippet saved by the particle system editor\r\n * @param snippetId defines the snippet to load (can be set to _BLANK to create a default one)\r\n * @param scene defines the hosting scene\r\n * @param gpu If the system will use gpu\r\n * @param rootUrl defines the root URL to use to load textures and relative dependencies\r\n * @param capacity defines the system capacity (if null or undefined the sotred capacity will be used)\r\n * @returns a promise that will resolve to the new particle system\r\n */\r\n // eslint-disable-next-line @typescript-eslint/promise-function-async, no-restricted-syntax\r\n public static ParseFromSnippetAsync(snippetId: string, scene: Scene, gpu: boolean = false, rootUrl: string = \"\", capacity?: number): Promise<IParticleSystem> {\r\n if (snippetId === \"_BLANK\") {\r\n const system = this.CreateDefault(null);\r\n system.start();\r\n return Promise.resolve(system);\r\n }\r\n\r\n return new Promise((resolve, reject) => {\r\n const request = new WebRequest();\r\n request.addEventListener(\"readystatechange\", () => {\r\n if (request.readyState == 4) {\r\n if (request.status == 200) {\r\n const snippet = JSON.parse(JSON.parse(request.responseText).jsonPayload);\r\n const serializationObject = JSON.parse(snippet.particleSystem);\r\n let output: IParticleSystem;\r\n\r\n if (gpu) {\r\n output = GPUParticleSystem.Parse(serializationObject, scene, rootUrl, false, capacity);\r\n } else {\r\n output = ParticleSystem.Parse(serializationObject, scene, rootUrl, false, capacity);\r\n }\r\n output.snippetId = snippetId;\r\n\r\n resolve(output);\r\n } else {\r\n // eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors\r\n reject(\"Unable to load the snippet \" + snippetId);\r\n }\r\n }\r\n });\r\n\r\n request.open(\"GET\", this.SnippetUrl + \"/\" + snippetId.replace(/#/g, \"/\"));\r\n request.send();\r\n });\r\n }\r\n\r\n /**\r\n * Creates a particle system from a snippet saved by the particle system editor\r\n * @deprecated Please use ParseFromSnippetAsync instead\r\n * @param snippetId defines the snippet to load (can be set to _BLANK to create a default one)\r\n * @param scene defines the hosting scene\r\n * @param gpu If the system will use gpu\r\n * @param rootUrl defines the root URL to use to load textures and relative dependencies\r\n * @param capacity defines the system capacity (if null or undefined the sotred capacity will be used)\r\n * @returns a promise that will resolve to the new particle system\r\n */\r\n public static CreateFromSnippetAsync = ParticleHelper.ParseFromSnippetAsync;\r\n}\r\n"]}
@@ -1,4 +1,4 @@
1
- import { Vector3 } from "../Maths/math.vector.js";
1
+ import { Vector3 } from "../Maths/math.vector.pure.js";
2
2
  import { BoxParticleEmitter } from "./EmitterTypes/boxParticleEmitter.js";
3
3
  import { PointParticleEmitter } from "./EmitterTypes/pointParticleEmitter.js";
4
4
  import { HemisphericParticleEmitter } from "./EmitterTypes/hemisphericParticleEmitter.js";
@@ -1,4 +1,4 @@
1
- import { Vector3 } from "../Maths/math.vector.js";
1
+ import { Vector3 } from "../Maths/math.vector.pure.js";
2
2
  import { BoxParticleEmitter } from "./EmitterTypes/boxParticleEmitter.js";
3
3
  import { PointParticleEmitter } from "./EmitterTypes/pointParticleEmitter.js";
4
4
  import { HemisphericParticleEmitter } from "./EmitterTypes/hemisphericParticleEmitter.js";
@@ -1 +1 @@
1
- {"version":3,"file":"particleSystem.functions.js","sourceRoot":"","sources":["../../../../dev/core/src/Particles/particleSystem.functions.ts"],"names":[],"mapp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AC,CAAC;AAClF,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,gBAAgB;IAC5B,OAAO,IAAI,kBAAkB,EAAE,CAAC;AACpC,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,iBAAiB,CAAC,OAA+B,IAAI;IACjE,OAAO,IAAI,mBAAmB,CAAC,IAAI,CAAC,CAAC;AACzC,CAAC","sourcesContent":["import { Vector3 } from \"core/Maths/math.vector\";\r\nimport { BoxParticleEmitter } from \"./EmitterTypes/boxParticleEmitter\";\r\nimport { PointParticleEmitter } from \"./EmitterTypes/pointParticleEmitter\";\r\nimport { HemisphericParticleEmitter } from \"./EmitterTypes/hemisphericParticleEmitter\";\r\nimport { SphereDirectedParticleEmitter, SphereParticleEmitter } from \"./EmitterTypes/sphereParticleEmitter\";\r\nimport { CylinderDirectedParticleEmitter, CylinderParticleEmitter } from \"./EmitterTypes/cylinderParticleEmitter\";\r\nimport { ConeDirectedParticleEmitter, ConeParticleEmitter } from \"./EmitterTypes/coneParticleEmitter\";\r\nimport { MeshParticleEmitter } from \"./EmitterTypes/meshParticleEmitter\";\r\nimport { type Nullable } from \"../types\";\r\nimport { type AbstractMesh } from \"../Meshes/abstractMesh\";\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\nexport function CreatePointEmitter(direction1: Vector3, direction2: Vector3): PointParticleEmitter {\r\n const particleEmitter = new PointParticleEmitter();\r\n particleEmitter.direction1 = direction1;\r\n particleEmitter.direction2 = direction2;\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\nexport function CreateHemisphericEmitter(radius = 1, radiusRange = 1): HemisphericParticleEmitter {\r\n return new HemisphericParticleEmitter(radius, radiusRange);\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\nexport function CreateSphereEmitter(radius = 1, radiusRange = 1): SphereParticleEmitter {\r\n return new SphereParticleEmitter(radius, radiusRange);\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\nexport function CreateDirectedSphereEmitter(radius = 1, direction1 = new Vector3(0, 1.0, 0), direction2 = new Vector3(0, 1.0, 0)): SphereDirectedParticleEmitter {\r\n return new SphereDirectedParticleEmitter(radius, direction1, direction2);\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\nexport function CreateCylinderEmitter(radius = 1, height = 1, radiusRange = 1, directionRandomizer = 0): CylinderParticleEmitter {\r\n return new CylinderParticleEmitter(radius, height, radiusRange, directionRandomizer);\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\nexport function 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 return new CylinderDirectedParticleEmitter(radius, height, radiusRange, direction1, direction2);\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\nexport function CreateConeEmitter(radius = 1, angle = Math.PI / 4): ConeParticleEmitter {\r\n return new ConeParticleEmitter(radius, angle);\r\n}\r\n\r\nexport function CreateDirectedConeEmitter(radius = 1, angle = Math.PI / 4, direction1 = new Vector3(0, 1.0, 0), direction2 = new Vector3(0, 1.0, 0)): ConeDirectedParticleEmitter {\r\n return new ConeDirectedParticleEmitter(radius, angle, direction1, direction2);\r\n}\r\n\r\n/**\r\n * Creates a Box Emitter for the particle system.\r\n * Direction and box bounds are configured on the returned emitter instance.\r\n * @returns the emitter\r\n */\r\nexport function CreateBoxEmitter(): BoxParticleEmitter {\r\n return new BoxParticleEmitter();\r\n}\r\n\r\n/**\r\n * Creates a Mesh Emitter for the particle system (emits from the surface of a mesh)\r\n * @param mesh The mesh to use as the emitter source\r\n * @returns the emitter\r\n */\r\nexport function CreateMeshEmitter(mesh: Nullable<AbstractMesh> = null): MeshParticleEmitter {\r\n return new MeshParticleEmitter(mesh);\r\n}\r\n"]}
1
+ {"version":3,"file":"particleSystem.functions.js","sourceRoot":"","sources":["../../../../dev/core/src/Particles/particleSystem.functions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AACtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AACvE,OAAO,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAC3E,OAAO,EAAE,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AAO,IAAI,mBAAmB,CAAC,IAAI,CAAC,CAAC;AACzC,CAAC","sourcesContent":["import { Vector3 } from \"core/Maths/math.vector.pure\";\r\nimport { BoxParticleEmitter } from \"./EmitterTypes/boxParticleEmitter\";\r\nimport { PointParticleEmitter } from \"./EmitterTypes/pointParticleEmitter\";\r\nimport { HemisphericParticleEmitter } from \"./EmitterTypes/hemisphericParticleEmitter\";\r\nimport { SphereDirectedParticleEmitter, SphereParticleEmitter } from \"./EmitterTypes/sphereParticleEmitter\";\r\nimport { CylinderDirectedParticleEmitter, CylinderParticleEmitter } from \"./EmitterTypes/cylinderParticleEmitter\";\r\nimport { ConeDirectedParticleEmitter, ConeParticleEmitter } from \"./EmitterTypes/coneParticleEmitter\";\r\nimport { MeshParticleEmitter } from \"./EmitterTypes/meshParticleEmitter\";\r\nimport { type Nullable } from \"../types\";\r\nimport { type AbstractMesh } from \"../Meshes/abstractMesh\";\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\nexport function CreatePointEmitter(direction1: Vector3, direction2: Vector3): PointParticleEmitter {\r\n const particleEmitter = new PointParticleEmitter();\r\n particleEmitter.direction1 = direction1;\r\n particleEmitter.direction2 = direction2;\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\nexport function CreateHemisphericEmitter(radius = 1, radiusRange = 1): HemisphericParticleEmitter {\r\n return new HemisphericParticleEmitter(radius, radiusRange);\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\nexport function CreateSphereEmitter(radius = 1, radiusRange = 1): SphereParticleEmitter {\r\n return new SphereParticleEmitter(radius, radiusRange);\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\nexport function CreateDirectedSphereEmitter(radius = 1, direction1 = new Vector3(0, 1.0, 0), direction2 = new Vector3(0, 1.0, 0)): SphereDirectedParticleEmitter {\r\n return new SphereDirectedParticleEmitter(radius, direction1, direction2);\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\nexport function CreateCylinderEmitter(radius = 1, height = 1, radiusRange = 1, directionRandomizer = 0): CylinderParticleEmitter {\r\n return new CylinderParticleEmitter(radius, height, radiusRange, directionRandomizer);\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\nexport function 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 return new CylinderDirectedParticleEmitter(radius, height, radiusRange, direction1, direction2);\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\nexport function CreateConeEmitter(radius = 1, angle = Math.PI / 4): ConeParticleEmitter {\r\n return new ConeParticleEmitter(radius, angle);\r\n}\r\n\r\nexport function CreateDirectedConeEmitter(radius = 1, angle = Math.PI / 4, direction1 = new Vector3(0, 1.0, 0), direction2 = new Vector3(0, 1.0, 0)): ConeDirectedParticleEmitter {\r\n return new ConeDirectedParticleEmitter(radius, angle, direction1, direction2);\r\n}\r\n\r\n/**\r\n * Creates a Box Emitter for the particle system.\r\n * Direction and box bounds are configured on the returned emitter instance.\r\n * @returns the emitter\r\n */\r\nexport function CreateBoxEmitter(): BoxParticleEmitter {\r\n return new BoxParticleEmitter();\r\n}\r\n\r\n/**\r\n * Creates a Mesh Emitter for the particle system (emits from the surface of a mesh)\r\n * @param mesh The mesh to use as the emitter source\r\n * @returns the emitter\r\n */\r\nexport function CreateMeshEmitter(mesh: Nullable<AbstractMesh> = null): MeshParticleEmitter {\r\n return new MeshParticleEmitter(mesh);\r\n}\r\n"]}
@@ -1,5 +1,5 @@
1
1
  import { type Nullable } from "../types.js";
2
- import { Color3 } from "../Maths/math.color.js";
2
+ import { Color3 } from "../Maths/math.color.pure.js";
3
3
  import { type AbstractMesh } from "../Meshes/abstractMesh.js";
4
4
  import { type IParticleSystem } from "./IParticleSystem.js";
5
5
  import { type Scene, type IDisposable } from "../scene.js";
@@ -1,9 +1,9 @@
1
- import { Color3 } from "../Maths/math.color.js";
2
- import { CreateSphere } from "../Meshes/Builders/sphereBuilder.js";
3
- import { GPUParticleSystem } from "./gpuParticleSystem.js";
1
+ import { Color3 } from "../Maths/math.color.pure.js";
2
+ import { CreateSphere } from "../Meshes/Builders/sphereBuilder.pure.js";
3
+ import { GPUParticleSystem } from "./gpuParticleSystem.pure.js";
4
4
  import { EngineStore } from "../Engines/engineStore.js";
5
- import { ParticleSystem } from "../Particles/particleSystem.js";
6
- import { StandardMaterial } from "../Materials/standardMaterial.js";
5
+ import { ParticleSystem } from "../Particles/particleSystem.pure.js";
6
+ import { StandardMaterial } from "../Materials/standardMaterial.pure.js";
7
7
  /** Internal class used to store shapes for emitters */
8
8
  class ParticleSystemSetEmitterCreationOptions {
9
9
  }
@@ -1 +1 @@
1
- {"version":3,"file":"particleSystemSet.js","sourceRoot":"","sources":["../../../../dev/core/src/Particles/particleSystemSet.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE7C,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAEhE,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAE7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAGjE,uDAAuD;AACvD,MAAM,uCAAuC;CAI5C;AAED;;GAEG;AACH,MAAM,OAAO,iBAAiB;IAA9B;QASY,wBAAmB,GAAG,IAAI,CAAC;QAEnC;;WAEG;QACI,YAAO,GAAsB,EAAE,CAAC;IAwJ3C,CAAC;IAtJG;;OAEG;IACH,IAAW,WAAW;QAClB,OAAO,IAAI,CAAC,YAAY,CAAC;IAC7B,CAAC;IAED,IAAW,WAAW,CAAC,KAAuC;QAC1D,IAAI,IAAI,CAAC,mBAAmB,IAAI,IAAI,CAAC,YAAY,EAAE,CAAC;YAChD,IAAK,IAAI,CAAC,YAA6B,CAAC,OAAO,EAAE,CAAC;gBAC7C,IAAI,CAAC,YAA6B,CAAC,OAAO,EAAE,CAAC;YAClD,CAAC;YACD,IAAI,CAAC,mBAAmB,GAAG,KAAK,CAAC;QACrC,CAAC;QAED,K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MAAM,OAAO,GAAG,IAAI,CAAC,aAAa,GAAG,YAAY,CAAC;QAElD,KAAK,GAAG,KAAK,IAAI,WAAW,CAAC,gBAAgB,CAAC;QAE9C,KAAK,MAAM,MAAM,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YAChC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,iBAAiB,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC;QAC9J,CAAC;QAED,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YACf,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC;YACrC,QAAQ,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;gBACxB,KAAK,QAAQ;oBACT,MAAM,CAAC,kBAAkB,CACrB;wBACI,QAAQ,EAAE,OAAO,CAAC,QAAQ;wBAC1B,QAAQ,EAAE,OAAO,CAAC,QAAQ;wBAC1B,KAAK,EAAE,MAAM,CAAC,SAAS,CAAC,OAAO,CAAC,KAAK,CAAC;qBACzC,EACD,IAAI,CAAC,OAAO,CAAC,gBAAgB,EAC7B,KAAK,CACR,CAAC;oBACF,MAAM;YACd,CAAC;QACL,CAAC;QAED,OAAO,MAAM,CAAC;IAClB,CAAC;;AApKD;;;GAGG;AACW,+BAAa,GAAG,wCAAwC,AAA3C,CAA4C","sourcesContent":["import { type Nullable } from \"../types\";\r\nimport { Color3 } from \"../Maths/math.color\";\r\nimport { type AbstractMesh } from \"../Meshes/abstractMesh\";\r\nimport { CreateSphere } from \"../Meshes/Builders/sphereBuilder\";\r\nimport { type IParticleSystem } from \"./IParticleSystem\";\r\nimport { GPUParticleSystem } from \"./gpuParticleSystem\";\r\nimport { EngineStore } from \"../Engines/engineStore\";\r\nimport { ParticleSystem } from \"../Particles/particleSystem\";\r\nimport { type Scene, type IDisposable } from \"../scene\";\r\nimport { StandardMaterial } from \"../Materials/standardMaterial\";\r\nimport { type Vector3 } from \"../Maths/math.vector\";\r\n\r\n/** Internal class used to store shapes for emitters */\r\nclass ParticleSystemSetEmitterCreationOptions {\r\n public kind: string;\r\n public options: any;\r\n public renderingGroupId: number;\r\n}\r\n\r\n/**\r\n * Represents a set of particle systems working together to create a specific effect\r\n */\r\nexport class ParticleSystemSet implements IDisposable {\r\n /**\r\n * Gets or sets base Assets URL\r\n * Only used when parsing particle systems from JSON, not part of the core assets\r\n */\r\n public static BaseAssetsUrl = \"https://assets.babylonjs.com/particles\";\r\n\r\n private _emitterCreationOptions: ParticleSystemSetEmitterCreationOptions;\r\n private _emitterNode: Nullable<AbstractMesh | Vector3>;\r\n private _emitterNodeIsOwned = true;\r\n\r\n /**\r\n * Gets the particle system list\r\n */\r\n public systems: IParticleSystem[] = [];\r\n\r\n /**\r\n * Gets or sets the emitter node used with this set\r\n */\r\n public get emitterNode(): Nullable<AbstractMesh | Vector3> {\r\n return this._emitterNode;\r\n }\r\n\r\n public set emitterNode(value: Nullable<AbstractMesh | Vector3>) {\r\n if (this._emitterNodeIsOwned && this._emitterNode) {\r\n if ((this._emitterNode as AbstractMesh).dispose) {\r\n (this._emitterNode as AbstractMesh).dispose();\r\n }\r\n this._emitterNodeIsOwned = false;\r\n }\r\n\r\n for (const system of this.systems) {\r\n system.emitter = value;\r\n }\r\n\r\n this._emitterNode = value;\r\n }\r\n\r\n /**\r\n * Creates a new emitter mesh as a sphere\r\n * @param options defines the options used to create the sphere\r\n * @param options.diameter\r\n * @param options.segments\r\n * @param options.color\r\n * @param renderingGroupId defines the renderingGroupId to use for the sphere\r\n * @param scene defines the hosting scene\r\n */\r\n public setEmitterAsSphere(options: { diameter: number; segments: number; color: Color3 }, renderingGroupId: number, scene: Scene) {\r\n if (this._emitterNodeIsOwned && this._emitterNode) {\r\n if ((this._emitterNode as AbstractMesh).dispose) {\r\n (this._emitterNode as AbstractMesh).dispose();\r\n }\r\n }\r\n\r\n this._emitterNodeIsOwned = true;\r\n\r\n this._emitterCreationOptions = {\r\n kind: \"Sphere\",\r\n options: options,\r\n renderingGroupId: renderingGroupId,\r\n };\r\n\r\n const emitterMesh = CreateSphere(\"emitterSphere\", { diameter: options.diameter, segments: options.segments }, scene);\r\n emitterMesh.renderingGroupId = renderingGroupId;\r\n\r\n const material = new StandardMaterial(\"emitterSphereMaterial\", scene);\r\n material.emissiveColor = options.color;\r\n emitterMesh.material = material;\r\n\r\n for (const system of this.systems) {\r\n system.emitter = emitterMesh;\r\n }\r\n\r\n this._emitterNode = emitterMesh;\r\n }\r\n\r\n /**\r\n * Starts all particle systems of the set\r\n * @param emitter defines an optional mesh to use as emitter for the particle systems\r\n */\r\n public start(emitter?: AbstractMesh): void {\r\n for (const system of this.systems) {\r\n if (emitter) {\r\n system.emitter = emitter;\r\n }\r\n system.start();\r\n }\r\n }\r\n\r\n /**\r\n * Release all associated resources\r\n */\r\n public dispose(): void {\r\n for (const system of this.systems) {\r\n system.dispose();\r\n }\r\n\r\n this.systems.length = 0;\r\n\r\n if (this._emitterNode) {\r\n if ((this._emitterNode as AbstractMesh).dispose) {\r\n (this._emitterNode as AbstractMesh).dispose();\r\n }\r\n this._emitterNode = null;\r\n }\r\n }\r\n\r\n /**\r\n * Serialize the set into a JSON compatible object\r\n * @param serializeTexture defines if the texture must be serialized as well\r\n * @returns a JSON compatible representation of the set\r\n */\r\n public serialize(serializeTexture = false): any {\r\n const result: any = {};\r\n\r\n result.systems = [];\r\n for (const system of this.systems) {\r\n if (!system.doNotSerialize) {\r\n result.systems.push(system.serialize(serializeTexture));\r\n }\r\n }\r\n\r\n if (this._emitterNode) {\r\n result.emitter = this._emitterCreationOptions;\r\n }\r\n\r\n return result;\r\n }\r\n\r\n /**\r\n * Parse a new ParticleSystemSet from a serialized source\r\n * @param data defines a JSON compatible representation of the set\r\n * @param scene defines the hosting scene\r\n * @param gpu defines if we want GPU particles or CPU particles\r\n * @param capacity defines the system capacity (if null or undefined the sotred capacity will be used)\r\n * @returns a new ParticleSystemSet\r\n */\r\n public static Parse(data: any, scene: Scene, gpu = false, capacity?: number): ParticleSystemSet {\r\n const result = new ParticleSystemSet();\r\n const rootUrl = this.BaseAssetsUrl + \"/textures/\";\r\n\r\n scene = scene || EngineStore.LastCreatedScene;\r\n\r\n for (const system of data.systems) {\r\n result.systems.push(gpu ? GPUParticleSystem.Parse(system, scene, rootUrl, true, capacity) : ParticleSystem.Parse(system, scene, rootUrl, true, capacity));\r\n }\r\n\r\n if (data.emitter) {\r\n const options = data.emitter.options;\r\n switch (data.emitter.kind) {\r\n case \"Sphere\":\r\n result.setEmitterAsSphere(\r\n {\r\n diameter: options.diameter,\r\n segments: options.segments,\r\n color: Color3.FromArray(options.color),\r\n },\r\n data.emitter.renderingGroupId,\r\n scene\r\n );\r\n break;\r\n }\r\n }\r\n\r\n return result;\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"particleSystemSet.js","sourceRoot":"","sources":["../../../../dev/core/src/Particles/particleSystemSet.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAElD,OAAO,EAAE,YAAY,EAAE,MAAM,uCAAuC,CAAC;AAErE,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAElE,OAAO,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AAGtE,uDAAuD;AACvD,MAAM,uCAAuC;CAI5C;AAED;;GAEG;AACH,MAAM,OAAO,iBAAiB;IAA9B;QASY,wBAAmB,GAAG,IAAI,CAAC;QAEnC;;WAEG;QACI,YAAO,GAAsB,EAAE,CAAC;IAwJ3C,CAAC;IAt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AAC;oBACF,MAAM;YACd,CAAC;QACL,CAAC;QAED,OAAO,MAAM,CAAC;IAClB,CAAC;;AApKD;;;GAGG;AACW,+BAAa,GAAG,wCAAwC,AAA3C,CAA4C","sourcesContent":["import { type Nullable } from \"../types\";\r\nimport { Color3 } from \"../Maths/math.color.pure\";\r\nimport { type AbstractMesh } from \"../Meshes/abstractMesh\";\r\nimport { CreateSphere } from \"../Meshes/Builders/sphereBuilder.pure\";\r\nimport { type IParticleSystem } from \"./IParticleSystem\";\r\nimport { GPUParticleSystem } from \"./gpuParticleSystem.pure\";\r\nimport { EngineStore } from \"../Engines/engineStore\";\r\nimport { ParticleSystem } from \"../Particles/particleSystem.pure\";\r\nimport { type Scene, type IDisposable } from \"../scene\";\r\nimport { StandardMaterial } from \"../Materials/standardMaterial.pure\";\r\nimport { type Vector3 } from \"../Maths/math.vector\";\r\n\r\n/** Internal class used to store shapes for emitters */\r\nclass ParticleSystemSetEmitterCreationOptions {\r\n public kind: string;\r\n public options: any;\r\n public renderingGroupId: number;\r\n}\r\n\r\n/**\r\n * Represents a set of particle systems working together to create a specific effect\r\n */\r\nexport class ParticleSystemSet implements IDisposable {\r\n /**\r\n * Gets or sets base Assets URL\r\n * Only used when parsing particle systems from JSON, not part of the core assets\r\n */\r\n public static BaseAssetsUrl = \"https://assets.babylonjs.com/particles\";\r\n\r\n private _emitterCreationOptions: ParticleSystemSetEmitterCreationOptions;\r\n private _emitterNode: Nullable<AbstractMesh | Vector3>;\r\n private _emitterNodeIsOwned = true;\r\n\r\n /**\r\n * Gets the particle system list\r\n */\r\n public systems: IParticleSystem[] = [];\r\n\r\n /**\r\n * Gets or sets the emitter node used with this set\r\n */\r\n public get emitterNode(): Nullable<AbstractMesh | Vector3> {\r\n return this._emitterNode;\r\n }\r\n\r\n public set emitterNode(value: Nullable<AbstractMesh | Vector3>) {\r\n if (this._emitterNodeIsOwned && this._emitterNode) {\r\n if ((this._emitterNode as AbstractMesh).dispose) {\r\n (this._emitterNode as AbstractMesh).dispose();\r\n }\r\n this._emitterNodeIsOwned = false;\r\n }\r\n\r\n for (const system of this.systems) {\r\n system.emitter = value;\r\n }\r\n\r\n this._emitterNode = value;\r\n }\r\n\r\n /**\r\n * Creates a new emitter mesh as a sphere\r\n * @param options defines the options used to create the sphere\r\n * @param options.diameter\r\n * @param options.segments\r\n * @param options.color\r\n * @param renderingGroupId defines the renderingGroupId to use for the sphere\r\n * @param scene defines the hosting scene\r\n */\r\n public setEmitterAsSphere(options: { diameter: number; segments: number; color: Color3 }, renderingGroupId: number, scene: Scene) {\r\n if (this._emitterNodeIsOwned && this._emitterNode) {\r\n if ((this._emitterNode as AbstractMesh).dispose) {\r\n (this._emitterNode as AbstractMesh).dispose();\r\n }\r\n }\r\n\r\n this._emitterNodeIsOwned = true;\r\n\r\n this._emitterCreationOptions = {\r\n kind: \"Sphere\",\r\n options: options,\r\n renderingGroupId: renderingGroupId,\r\n };\r\n\r\n const emitterMesh = CreateSphere(\"emitterSphere\", { diameter: options.diameter, segments: options.segments }, scene);\r\n emitterMesh.renderingGroupId = renderingGroupId;\r\n\r\n const material = new StandardMaterial(\"emitterSphereMaterial\", scene);\r\n material.emissiveColor = options.color;\r\n emitterMesh.material = material;\r\n\r\n for (const system of this.systems) {\r\n system.emitter = emitterMesh;\r\n }\r\n\r\n this._emitterNode = emitterMesh;\r\n }\r\n\r\n /**\r\n * Starts all particle systems of the set\r\n * @param emitter defines an optional mesh to use as emitter for the particle systems\r\n */\r\n public start(emitter?: AbstractMesh): void {\r\n for (const system of this.systems) {\r\n if (emitter) {\r\n system.emitter = emitter;\r\n }\r\n system.start();\r\n }\r\n }\r\n\r\n /**\r\n * Release all associated resources\r\n */\r\n public dispose(): void {\r\n for (const system of this.systems) {\r\n system.dispose();\r\n }\r\n\r\n this.systems.length = 0;\r\n\r\n if (this._emitterNode) {\r\n if ((this._emitterNode as AbstractMesh).dispose) {\r\n (this._emitterNode as AbstractMesh).dispose();\r\n }\r\n this._emitterNode = null;\r\n }\r\n }\r\n\r\n /**\r\n * Serialize the set into a JSON compatible object\r\n * @param serializeTexture defines if the texture must be serialized as well\r\n * @returns a JSON compatible representation of the set\r\n */\r\n public serialize(serializeTexture = false): any {\r\n const result: any = {};\r\n\r\n result.systems = [];\r\n for (const system of this.systems) {\r\n if (!system.doNotSerialize) {\r\n result.systems.push(system.serialize(serializeTexture));\r\n }\r\n }\r\n\r\n if (this._emitterNode) {\r\n result.emitter = this._emitterCreationOptions;\r\n }\r\n\r\n return result;\r\n }\r\n\r\n /**\r\n * Parse a new ParticleSystemSet from a serialized source\r\n * @param data defines a JSON compatible representation of the set\r\n * @param scene defines the hosting scene\r\n * @param gpu defines if we want GPU particles or CPU particles\r\n * @param capacity defines the system capacity (if null or undefined the sotred capacity will be used)\r\n * @returns a new ParticleSystemSet\r\n */\r\n public static Parse(data: any, scene: Scene, gpu = false, capacity?: number): ParticleSystemSet {\r\n const result = new ParticleSystemSet();\r\n const rootUrl = this.BaseAssetsUrl + \"/textures/\";\r\n\r\n scene = scene || EngineStore.LastCreatedScene;\r\n\r\n for (const system of data.systems) {\r\n result.systems.push(gpu ? GPUParticleSystem.Parse(system, scene, rootUrl, true, capacity) : ParticleSystem.Parse(system, scene, rootUrl, true, capacity));\r\n }\r\n\r\n if (data.emitter) {\r\n const options = data.emitter.options;\r\n switch (data.emitter.kind) {\r\n case \"Sphere\":\r\n result.setEmitterAsSphere(\r\n {\r\n diameter: options.diameter,\r\n segments: options.segments,\r\n color: Color3.FromArray(options.color),\r\n },\r\n data.emitter.renderingGroupId,\r\n scene\r\n );\r\n break;\r\n }\r\n }\r\n\r\n return result;\r\n }\r\n}\r\n"]}
@@ -1,5 +1,5 @@
1
1
  import { Color4 } from "../Maths/math.js";
2
- import { Mesh } from "../Meshes/mesh.js";
2
+ import { Mesh } from "../Meshes/mesh.pure.js";
3
3
  import { type Scene, type IDisposable } from "../scene.js";
4
4
  import { CloudPoint } from "./cloudPoint.js";
5
5
  import { type Material } from "../Materials/material.js";
@@ -1,14 +1,14 @@
1
1
  import { Color4, Color3 } from "../Maths/math.js";
2
- import { Vector2, Vector3, Vector4, TmpVectors, Matrix } from "../Maths/math.vector.js";
2
+ import { Vector2, Vector3, Vector4, TmpVectors, Matrix } from "../Maths/math.vector.pure.js";
3
3
  import { Logger } from "../Misc/logger.js";
4
- import { VertexBuffer } from "../Buffers/buffer.js";
4
+ import { VertexBuffer } from "../Buffers/buffer.pure.js";
5
5
  import { VertexData } from "../Meshes/mesh.vertexData.js";
6
- import { Mesh } from "../Meshes/mesh.js";
6
+ import { Mesh } from "../Meshes/mesh.pure.js";
7
7
  import { EngineStore } from "../Engines/engineStore.js";
8
8
  import { CloudPoint, PointsGroup } from "./cloudPoint.js";
9
- import { Ray } from "../Culling/ray.js";
10
- import { StandardMaterial } from "../Materials/standardMaterial.js";
11
- import { BaseTexture } from "./../Materials/Textures/baseTexture.js";
9
+ import { Ray } from "../Culling/ray.pure.js";
10
+ import { StandardMaterial } from "../Materials/standardMaterial.pure.js";
11
+ import { BaseTexture } from "./../Materials/Textures/baseTexture.pure.js";
12
12
  import { RandomRange } from "../Maths/math.scalar.functions.js";
13
13
  /** Defines the 4 color options */
14
14
  export var PointColor;