@galacean/engine-core 2.0.0-alpha.5 → 2.0.0-alpha.51

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 (293) hide show
  1. package/dist/main.js +23869 -20445
  2. package/dist/main.js.map +1 -1
  3. package/dist/module.js +23857 -20437
  4. package/dist/module.js.map +1 -1
  5. package/package.json +3 -3
  6. package/types/2d/assembler/ISpriteAssembler.d.ts +1 -0
  7. package/types/2d/assembler/ISpriteRenderer.d.ts +3 -2
  8. package/types/2d/assembler/SimpleSpriteAssembler.d.ts +1 -0
  9. package/types/2d/assembler/SlicedSpriteAssembler.d.ts +1 -0
  10. package/types/2d/assembler/TiledSpriteAssembler.d.ts +1 -0
  11. package/types/2d/atlas/FontAtlas.d.ts +23 -1
  12. package/types/2d/atlas/SpriteAtlas.d.ts +8 -0
  13. package/types/2d/sprite/Sprite.d.ts +30 -4
  14. package/types/2d/sprite/SpriteMask.d.ts +49 -1
  15. package/types/2d/sprite/SpriteRenderer.d.ts +35 -1
  16. package/types/2d/text/CharInfo.d.ts +20 -1
  17. package/types/2d/text/CharRenderInfo.d.ts +15 -1
  18. package/types/2d/text/Font.d.ts +11 -1
  19. package/types/2d/text/ITextRenderer.d.ts +3 -0
  20. package/types/2d/text/SubFont.d.ts +35 -1
  21. package/types/2d/text/TextRenderer.d.ts +54 -1
  22. package/types/2d/text/TextUtils.d.ts +89 -1
  23. package/types/Background.d.ts +19 -2
  24. package/types/BasicResources.d.ts +52 -0
  25. package/types/Camera.d.ts +73 -1
  26. package/types/Canvas.d.ts +36 -7
  27. package/types/Component.d.ts +35 -2
  28. package/types/ComponentsDependencies.d.ts +38 -1
  29. package/types/ComponentsManager.d.ts +17 -0
  30. package/types/Engine.d.ts +110 -4
  31. package/types/EngineEventType.d.ts +13 -0
  32. package/types/Entity.d.ts +112 -21
  33. package/types/Polyfill.d.ts +12 -1
  34. package/types/RenderPipeline/BasicRenderPipeline.d.ts +4 -1
  35. package/types/RenderPipeline/BatcherManager.d.ts +23 -1
  36. package/types/RenderPipeline/Blitter.d.ts +1 -1
  37. package/types/RenderPipeline/CullingResults.d.ts +17 -1
  38. package/types/RenderPipeline/DepthOnlyPass.d.ts +18 -1
  39. package/types/RenderPipeline/InstanceBuffer.d.ts +28 -0
  40. package/types/RenderPipeline/MaskManager.d.ts +36 -1
  41. package/types/RenderPipeline/OpaqueTexturePass.d.ts +16 -1
  42. package/types/RenderPipeline/PipelineUtils.d.ts +11 -1
  43. package/types/RenderPipeline/PrimitiveChunk.d.ts +27 -1
  44. package/types/RenderPipeline/PrimitiveChunkManager.d.ts +16 -1
  45. package/types/RenderPipeline/RenderContext.d.ts +46 -1
  46. package/types/RenderPipeline/RenderElement.d.ts +26 -6
  47. package/types/RenderPipeline/RenderQueue.d.ts +23 -1
  48. package/types/RenderPipeline/RenderTargetPool.d.ts +17 -1
  49. package/types/RenderPipeline/SubPrimitiveChunk.d.ts +14 -1
  50. package/types/RenderPipeline/VertexArea.d.ts +10 -1
  51. package/types/RenderPipeline/VertexMergeBatcher.d.ts +11 -0
  52. package/types/RenderPipeline/enums/RenderQueueMaskType.d.ts +9 -1
  53. package/types/RenderPipeline/index.d.ts +4 -1
  54. package/types/Renderer.d.ts +81 -18
  55. package/types/Scene.d.ts +34 -7
  56. package/types/SceneManager.d.ts +18 -6
  57. package/types/Script.d.ts +41 -0
  58. package/types/Signal.d.ts +69 -0
  59. package/types/SystemInfo.d.ts +13 -0
  60. package/types/Transform.d.ts +26 -1
  61. package/types/UpdateFlag.d.ts +4 -1
  62. package/types/UpdateFlagManager.d.ts +41 -1
  63. package/types/Utils.d.ts +20 -0
  64. package/types/VirtualCamera.d.ts +16 -1
  65. package/types/animation/AnimationClip.d.ts +13 -2
  66. package/types/animation/AnimationClipCurveBinding.d.ts +17 -2
  67. package/types/animation/AnimationEvent.d.ts +2 -2
  68. package/types/animation/Animator.d.ts +49 -10
  69. package/types/animation/AnimatorController.d.ts +20 -2
  70. package/types/animation/AnimatorControllerLayer.d.ts +17 -2
  71. package/types/animation/AnimatorControllerParameter.d.ts +4 -0
  72. package/types/animation/AnimatorState.d.ts +46 -2
  73. package/types/animation/AnimatorStateInstance.d.ts +46 -0
  74. package/types/animation/AnimatorStateMachine.d.ts +17 -2
  75. package/types/animation/AnimatorStateTransition.d.ts +9 -0
  76. package/types/animation/AnimatorStateTransitionCollection.d.ts +23 -1
  77. package/types/animation/Keyframe.d.ts +1 -1
  78. package/types/animation/StateMachineScript.d.ts +2 -0
  79. package/types/animation/animationCurve/AnimationArrayCurve.d.ts +39 -0
  80. package/types/animation/animationCurve/AnimationBoolCurve.d.ts +39 -0
  81. package/types/animation/animationCurve/AnimationColorCurve.d.ts +39 -0
  82. package/types/animation/animationCurve/AnimationCurve.d.ts +9 -1
  83. package/types/animation/animationCurve/AnimationFloatArrayCurve.d.ts +38 -0
  84. package/types/animation/animationCurve/AnimationFloatCurve.d.ts +39 -0
  85. package/types/animation/animationCurve/AnimationQuaternionCurve.d.ts +41 -0
  86. package/types/animation/animationCurve/AnimationRectCurve.d.ts +18 -0
  87. package/types/animation/animationCurve/AnimationRefCurve.d.ts +20 -2
  88. package/types/animation/animationCurve/AnimationStringCurve.d.ts +39 -0
  89. package/types/animation/animationCurve/AnimationVector2Curve.d.ts +39 -0
  90. package/types/animation/animationCurve/AnimationVector3Curve.d.ts +43 -0
  91. package/types/animation/animationCurve/AnimationVector4Curve.d.ts +39 -0
  92. package/types/animation/animationCurve/interfaces/IAnimationCurveCalculator.d.ts +18 -1
  93. package/types/animation/enums/AnimatorStatePlayState.d.ts +8 -1
  94. package/types/animation/index.d.ts +1 -0
  95. package/types/animation/internal/AnimationCurveLayerOwner.d.ts +15 -1
  96. package/types/animation/internal/AnimationEventHandler.d.ts +8 -1
  97. package/types/animation/internal/AnimatorLayerData.d.ts +28 -1
  98. package/types/animation/internal/AnimatorStateData.d.ts +14 -1
  99. package/types/animation/internal/AnimatorStatePlayData.d.ts +27 -1
  100. package/types/animation/internal/AnimatorTempValue.d.ts +12 -1
  101. package/types/animation/internal/animationCurveOwner/AnimationCurveOwner.d.ts +39 -0
  102. package/types/animation/internal/animationCurveOwner/assembler/BlendShapeWeightsAnimationCurveOwnerAssembler.d.ts +12 -1
  103. package/types/animation/internal/animationCurveOwner/assembler/IAnimationCurveOwnerAssembler.d.ts +10 -1
  104. package/types/animation/internal/animationCurveOwner/assembler/PositionAnimationCurveOwnerAssembler.d.ts +13 -1
  105. package/types/animation/internal/animationCurveOwner/assembler/RotationAnimationCurveOwnerAssembler.d.ts +13 -1
  106. package/types/animation/internal/animationCurveOwner/assembler/ScaleAnimationCurveOwnerAssembler.d.ts +13 -1
  107. package/types/animation/internal/animationCurveOwner/assembler/UniversalAnimationCurveOwnerAssembler.d.ts +23 -1
  108. package/types/asset/AssetPromise.d.ts +4 -4
  109. package/types/asset/AssetType.d.ts +7 -9
  110. package/types/asset/GraphicsResource.d.ts +10 -0
  111. package/types/asset/IReferable.d.ts +8 -0
  112. package/types/asset/JSONAsset.d.ts +1 -1
  113. package/types/asset/LoadItem.d.ts +1 -1
  114. package/types/asset/Loader.d.ts +2 -2
  115. package/types/asset/ReferResource.d.ts +28 -0
  116. package/types/asset/RenderingStatistics.d.ts +8 -0
  117. package/types/asset/ResourceManager.d.ts +117 -9
  118. package/types/audio/AudioClip.d.ts +8 -0
  119. package/types/audio/AudioManager.d.ts +18 -0
  120. package/types/audio/AudioSource.d.ts +20 -2
  121. package/types/base/DataObject.d.ts +6 -0
  122. package/types/base/EngineObject.d.ts +4 -0
  123. package/types/base/Time.d.ts +13 -0
  124. package/types/base/index.d.ts +1 -0
  125. package/types/clone/CloneDecorators.d.ts +37 -0
  126. package/types/clone/CloneUtil.d.ts +30 -0
  127. package/types/clone/ComponentCloner.d.ts +4 -10
  128. package/types/clone/ICloneHook.d.ts +12 -0
  129. package/types/enums/CameraType.d.ts +9 -1
  130. package/types/env-probe/CubeProbe.d.ts +2 -0
  131. package/types/env-probe/Probe.d.ts +1 -1
  132. package/types/graphic/Buffer.d.ts +23 -3
  133. package/types/graphic/BufferUtil.d.ts +8 -0
  134. package/types/graphic/IndexBufferBinding.d.ts +4 -0
  135. package/types/graphic/Mesh.d.ts +58 -1
  136. package/types/graphic/Primitive.d.ts +50 -1
  137. package/types/graphic/TransformFeedback.d.ts +46 -0
  138. package/types/graphic/TransformFeedbackPrimitive.d.ts +67 -0
  139. package/types/graphic/TransformFeedbackSimulator.d.ts +55 -0
  140. package/types/graphic/VertexBufferBinding.d.ts +4 -0
  141. package/types/graphic/VertexElement.d.ts +1 -0
  142. package/types/graphic/enums/BufferBindFlag.d.ts +5 -3
  143. package/types/index.d.ts +7 -4
  144. package/types/input/InputManager.d.ts +25 -6
  145. package/types/input/enums/PointerButton.d.ts +8 -0
  146. package/types/input/keyboard/KeyboardManager.d.ts +41 -1
  147. package/types/input/pointer/Pointer.d.ts +37 -1
  148. package/types/input/pointer/PointerEventData.d.ts +4 -0
  149. package/types/input/pointer/PointerManager.d.ts +58 -0
  150. package/types/input/pointer/emitter/IHitResult.d.ts +11 -1
  151. package/types/input/pointer/emitter/PhysicsPointerEventEmitter.d.ts +20 -1
  152. package/types/input/wheel/WheelManager.d.ts +34 -1
  153. package/types/lighting/AmbientLight.d.ts +9 -8
  154. package/types/lighting/DirectLight.d.ts +17 -0
  155. package/types/lighting/KHR_lights.d.ts +13 -1
  156. package/types/lighting/Light.d.ts +2 -0
  157. package/types/lighting/LightManager.d.ts +57 -0
  158. package/types/lighting/PointLight.d.ts +17 -0
  159. package/types/lighting/SpotLight.d.ts +17 -0
  160. package/types/lighting/ambientOcclusion/AmbientOcclusion.d.ts +4 -0
  161. package/types/lighting/ambientOcclusion/ScalableAmbientObscurancePass.d.ts +38 -1
  162. package/types/material/BaseMaterial.d.ts +15 -11
  163. package/types/material/Material.d.ts +5 -9
  164. package/types/mesh/BlendShape.d.ts +14 -1
  165. package/types/mesh/BlendShapeFrame.d.ts +11 -4
  166. package/types/mesh/BlendShapeManager.d.ts +101 -1
  167. package/types/mesh/BufferMesh.d.ts +2 -2
  168. package/types/mesh/MeshRenderer.d.ts +42 -0
  169. package/types/mesh/ModelMesh.d.ts +23 -4
  170. package/types/mesh/PrimitiveMesh.d.ts +38 -4
  171. package/types/mesh/PrimitiveMeshRestorer.d.ts +107 -0
  172. package/types/mesh/Skin.d.ts +12 -3
  173. package/types/mesh/SkinnedMeshRenderer.d.ts +27 -1
  174. package/types/particle/ParticleBufferUtils.d.ts +26 -1
  175. package/types/particle/ParticleGenerator.d.ts +147 -2
  176. package/types/particle/ParticleMaterial.d.ts +3 -1
  177. package/types/particle/ParticleRenderer.d.ts +61 -1
  178. package/types/particle/ParticleTransformFeedbackSimulator.d.ts +52 -0
  179. package/types/particle/enums/ParticleRandomSubSeeds.d.ts +25 -1
  180. package/types/particle/enums/ParticleScaleMode.d.ts +5 -5
  181. package/types/particle/enums/ParticleSubEmitterInheritProperty.d.ts +17 -0
  182. package/types/particle/enums/ParticleSubEmitterType.d.ts +9 -0
  183. package/types/particle/enums/attributes/BillboardParticleVertexAttribute.d.ts +6 -1
  184. package/types/particle/enums/attributes/ParticleFeedbackVertexAttribute.d.ts +8 -0
  185. package/types/particle/enums/attributes/ParticleInstanceVertexAttribute.d.ts +17 -1
  186. package/types/particle/index.d.ts +7 -0
  187. package/types/particle/modules/Burst.d.ts +23 -2
  188. package/types/particle/modules/ColorOverLifetimeModule.d.ts +19 -0
  189. package/types/particle/modules/CustomDataModule.d.ts +90 -0
  190. package/types/particle/modules/EmissionModule.d.ts +36 -0
  191. package/types/particle/modules/ForceOverLifetimeModule.d.ts +16 -1
  192. package/types/particle/modules/LimitVelocityOverLifetimeModule.d.ts +164 -0
  193. package/types/particle/modules/MainModule.d.ts +45 -6
  194. package/types/particle/modules/NoiseModule.d.ts +114 -0
  195. package/types/particle/modules/ParticleCompositeCurve.d.ts +42 -4
  196. package/types/particle/modules/ParticleCompositeGradient.d.ts +8 -2
  197. package/types/particle/modules/ParticleCurve.d.ts +31 -2
  198. package/types/particle/modules/ParticleGeneratorModule.d.ts +9 -3
  199. package/types/particle/modules/ParticleGradient.d.ts +22 -5
  200. package/types/particle/modules/RotationOverLifetimeModule.d.ts +27 -3
  201. package/types/particle/modules/SizeOverLifetimeModule.d.ts +25 -0
  202. package/types/particle/modules/SubEmitter.d.ts +31 -0
  203. package/types/particle/modules/SubEmittersModule.d.ts +57 -0
  204. package/types/particle/modules/TextureSheetAnimationModule.d.ts +14 -1
  205. package/types/particle/modules/VelocityOverLifetimeModule.d.ts +120 -0
  206. package/types/particle/modules/shape/BaseShape.d.ts +65 -2
  207. package/types/particle/modules/shape/BoxShape.d.ts +13 -2
  208. package/types/particle/modules/shape/CircleShape.d.ts +13 -1
  209. package/types/particle/modules/shape/ConeShape.d.ts +13 -4
  210. package/types/particle/modules/shape/HemisphereShape.d.ts +13 -0
  211. package/types/particle/modules/shape/MeshShape.d.ts +26 -3
  212. package/types/particle/modules/shape/ShapeUtils.d.ts +13 -1
  213. package/types/particle/modules/shape/SphereShape.d.ts +13 -0
  214. package/types/physics/CharacterController.d.ts +21 -0
  215. package/types/physics/Collider.d.ts +47 -2
  216. package/types/physics/Collision.d.ts +3 -0
  217. package/types/physics/DynamicCollider.d.ts +28 -1
  218. package/types/physics/HitResult.d.ts +2 -2
  219. package/types/physics/PhysicsMaterial.d.ts +3 -0
  220. package/types/physics/PhysicsScene.d.ts +56 -6
  221. package/types/physics/StaticCollider.d.ts +5 -0
  222. package/types/physics/enums/ColliderShapeChangeFlag.d.ts +8 -1
  223. package/types/physics/enums/HingeJointFlag.d.ts +14 -1
  224. package/types/physics/joint/HingeJoint.d.ts +4 -0
  225. package/types/physics/joint/Joint.d.ts +22 -2
  226. package/types/physics/joint/JointLimits.d.ts +2 -1
  227. package/types/physics/joint/JointMotor.d.ts +2 -1
  228. package/types/physics/shape/ColliderShape.d.ts +26 -3
  229. package/types/physics/shape/MeshColliderShape.d.ts +11 -5
  230. package/types/postProcess/FinalPass.d.ts +19 -1
  231. package/types/postProcess/PostProcess.d.ts +11 -6
  232. package/types/postProcess/PostProcessEffect.d.ts +6 -1
  233. package/types/postProcess/PostProcessEffectParameter.d.ts +23 -3
  234. package/types/postProcess/PostProcessManager.d.ts +43 -0
  235. package/types/postProcess/PostProcessPass.d.ts +3 -2
  236. package/types/postProcess/PostProcessUberPass.d.ts +2 -1
  237. package/types/postProcess/effects/BloomEffect.d.ts +26 -1
  238. package/types/postProcess/effects/TonemappingEffect.d.ts +3 -0
  239. package/types/renderingHardwareInterface/IPlatformBuffer.d.ts +1 -0
  240. package/types/renderingHardwareInterface/IPlatformTransformFeedback.d.ts +36 -0
  241. package/types/renderingHardwareInterface/IPlatformTransformFeedbackPrimitive.d.ts +40 -0
  242. package/types/renderingHardwareInterface/index.d.ts +2 -0
  243. package/types/shader/Shader.d.ts +38 -22
  244. package/types/shader/ShaderBlockProperty.d.ts +19 -0
  245. package/types/shader/ShaderData.d.ts +43 -4
  246. package/types/shader/ShaderFactory.d.ts +78 -0
  247. package/types/shader/ShaderMacro.d.ts +17 -2
  248. package/types/shader/ShaderMacroCollection.d.ts +57 -1
  249. package/types/shader/ShaderMacroProcessor.d.ts +72 -0
  250. package/types/shader/ShaderPass.d.ts +46 -13
  251. package/types/shader/ShaderProgram.d.ts +91 -1
  252. package/types/shader/ShaderProgramMap.d.ts +20 -0
  253. package/types/shader/ShaderProperty.d.ts +17 -0
  254. package/types/shader/ShaderTagKey.d.ts +2 -0
  255. package/types/shader/ShaderUniform.d.ts +49 -1
  256. package/types/shader/ShaderUniformBlock.d.ts +9 -1
  257. package/types/shader/enums/ConstantBufferBindingPoint.d.ts +7 -0
  258. package/types/shader/enums/ShaderPreprocessorDirective.d.ts +16 -0
  259. package/types/shader/index.d.ts +1 -1
  260. package/types/shader/state/BlendState.d.ts +16 -1
  261. package/types/shader/state/DepthState.d.ts +16 -1
  262. package/types/shader/state/RasterState.d.ts +19 -1
  263. package/types/shader/state/RenderState.d.ts +13 -2
  264. package/types/shader/state/RenderTargetBlendState.d.ts +2 -1
  265. package/types/shader/state/StencilState.d.ts +15 -1
  266. package/types/shadow/CascadedShadowCasterPass.d.ts +5 -0
  267. package/types/shadow/ShadowSliceData.d.ts +13 -1
  268. package/types/shadow/ShadowUtils.d.ts +43 -1
  269. package/types/sky/Sky.d.ts +13 -4
  270. package/types/sky/SkyBoxMaterial.d.ts +0 -7
  271. package/types/texture/RenderTarget.d.ts +28 -3
  272. package/types/texture/Texture.d.ts +21 -0
  273. package/types/texture/Texture2D.d.ts +4 -0
  274. package/types/texture/Texture2DArray.d.ts +4 -0
  275. package/types/texture/TextureCube.d.ts +4 -0
  276. package/types/texture/TextureUtils.d.ts +16 -1
  277. package/types/trail/TrailRenderer.d.ts +13 -8
  278. package/types/ui/IUICanvas.d.ts +16 -1
  279. package/types/utils/DisorderedArray.d.ts +3 -1
  280. package/types/xr/XRManager.d.ts +28 -0
  281. package/types/RenderPipeline/BatchUtils.d.ts +0 -1
  282. package/types/RenderPipeline/SubRenderElement.d.ts +0 -22
  283. package/types/clone/CloneManager.d.ts +0 -31
  284. package/types/clone/enums/CloneMode.d.ts +0 -13
  285. package/types/shader/ShaderPool.d.ts +0 -1
  286. package/types/shader/ShaderProgramPool.d.ts +0 -1
  287. package/types/shader/state/index.d.ts +0 -6
  288. package/types/shaderlib/ShaderFactory.d.ts +0 -20
  289. package/types/shaderlib/ShaderLib.d.ts +0 -73
  290. package/types/shaderlib/index.d.ts +0 -1
  291. package/types/shaderlib/particle/index.d.ts +0 -15
  292. package/types/shaderlib/pbr/index.d.ts +0 -11
  293. package/types/shaderlib/shadow/index.d.ts +0 -8
@@ -1,3 +1,5 @@
1
+ import { Rand } from "@galacean/engine-math";
2
+ import { ShaderData, ShaderMacro } from "../../shader";
1
3
  import { Burst } from "./Burst";
2
4
  import { ParticleCompositeCurve } from "./ParticleCompositeCurve";
3
5
  import { ParticleGeneratorModule } from "./ParticleGeneratorModule";
@@ -6,11 +8,25 @@ import { BaseShape } from "./shape/BaseShape";
6
8
  * The EmissionModule of a Particle Generator.
7
9
  */
8
10
  export declare class EmissionModule extends ParticleGeneratorModule {
11
+ /** @internal */
12
+ static readonly _emissionShapeMacro: ShaderMacro;
13
+ private static _tempEmitPosition;
9
14
  /** The rate of particle emission. */
10
15
  rateOverTime: ParticleCompositeCurve;
11
16
  /** The rate at which the emitter spawns new particles over distance. */
12
17
  rateOverDistance: ParticleCompositeCurve;
18
+ /** @internal */
13
19
  _shape: BaseShape;
20
+ /** @internal */
21
+ _shapeRand: Rand;
22
+ private _shapeMacro;
23
+ /** @internal */
24
+ _rateRand: Rand;
25
+ /** @internal */
26
+ _frameRateTime: number;
27
+ private _distanceAccumulator;
28
+ private _lastEmitPosition;
29
+ private _hasLastEmitPosition;
14
30
  private _bursts;
15
31
  private _currentBurstIndex;
16
32
  private _burstRand;
@@ -47,7 +63,27 @@ export declare class EmissionModule extends ParticleGeneratorModule {
47
63
  * Clear burst data.
48
64
  */
49
65
  clearBurst(): void;
66
+ /**
67
+ * @internal
68
+ */
69
+ _emit(lastPlayTime: number, playTime: number): void;
70
+ /**
71
+ * @internal
72
+ */
73
+ _updateShaderData(shaderData: ShaderData): void;
74
+ /**
75
+ * @internal
76
+ */
77
+ _resetRandomSeed(seed: number): void;
78
+ /** @internal */
79
+ _resyncCursors(playTime: number): void;
80
+ /**
81
+ * @internal
82
+ */
83
+ _destroy(): void;
50
84
  private _emitByRateOverTime;
85
+ private _emitByRateOverDistance;
86
+ private _evaluateRate;
51
87
  private _emitByBurst;
52
88
  private _emitBySubBurst;
53
89
  }
@@ -1,4 +1,5 @@
1
- import { ShaderMacro, ShaderProperty } from "../../shader";
1
+ import { Rand } from "@galacean/engine-math";
2
+ import { ShaderData, ShaderMacro, ShaderProperty } from "../../shader";
2
3
  import { ParticleSimulationSpace } from "../enums/ParticleSimulationSpace";
3
4
  import { ParticleGenerator } from "../ParticleGenerator";
4
5
  import { ParticleCompositeCurve } from "./ParticleCompositeCurve";
@@ -19,6 +20,8 @@ export declare class ForceOverLifetimeModule extends ParticleGeneratorModule {
19
20
  static readonly _maxGradientYProperty: ShaderProperty;
20
21
  static readonly _maxGradientZProperty: ShaderProperty;
21
22
  static readonly _spaceProperty: ShaderProperty;
23
+ /** @internal */
24
+ _forceRand: Rand;
22
25
  private _forceMinConstant;
23
26
  private _forceMaxConstant;
24
27
  private _forceMacro;
@@ -48,4 +51,16 @@ export declare class ForceOverLifetimeModule extends ParticleGeneratorModule {
48
51
  get space(): ParticleSimulationSpace;
49
52
  set space(value: ParticleSimulationSpace);
50
53
  constructor(generator: ParticleGenerator);
54
+ /**
55
+ * @internal
56
+ */
57
+ _updateShaderData(shaderData: ShaderData): void;
58
+ /**
59
+ * @internal
60
+ */
61
+ _resetRandomSeed(seed: number): void;
62
+ /**
63
+ * @internal
64
+ */
65
+ _isRandomMode(): boolean;
51
66
  }
@@ -0,0 +1,164 @@
1
+ import { Rand } from "@galacean/engine-math";
2
+ import { ShaderData, ShaderMacro } from "../../shader";
3
+ import { ShaderProperty } from "../../shader/ShaderProperty";
4
+ import { ParticleSimulationSpace } from "../enums/ParticleSimulationSpace";
5
+ import { ParticleGenerator } from "../ParticleGenerator";
6
+ import { ParticleCompositeCurve } from "./ParticleCompositeCurve";
7
+ import { ParticleGeneratorModule } from "./ParticleGeneratorModule";
8
+ /**
9
+ * Limit velocity over lifetime module.
10
+ */
11
+ export declare class LimitVelocityOverLifetimeModule extends ParticleGeneratorModule {
12
+ /** @internal */
13
+ static readonly _enabledMacro: ShaderMacro;
14
+ /** @internal */
15
+ static readonly _separateAxesMacro: ShaderMacro;
16
+ /** @internal */
17
+ static readonly _speedConstantModeMacro: ShaderMacro;
18
+ /** @internal */
19
+ static readonly _speedCurveModeMacro: ShaderMacro;
20
+ /** @internal */
21
+ static readonly _speedIsRandomMacro: ShaderMacro;
22
+ /** @internal */
23
+ static readonly _dragCurveModeMacro: ShaderMacro;
24
+ /** @internal */
25
+ static readonly _dragIsRandomMacro: ShaderMacro;
26
+ /** @internal */
27
+ static readonly _multiplyDragBySizeMacro: ShaderMacro;
28
+ /** @internal */
29
+ static readonly _multiplyDragByVelocityMacro: ShaderMacro;
30
+ /** @internal */
31
+ static readonly _speedMaxConstProperty: ShaderProperty;
32
+ /** @internal */
33
+ static readonly _speedMinConstProperty: ShaderProperty;
34
+ /** @internal */
35
+ static readonly _speedMaxCurveProperty: ShaderProperty;
36
+ /** @internal */
37
+ static readonly _speedMinCurveProperty: ShaderProperty;
38
+ /** @internal */
39
+ static readonly _speedMaxConstVecProperty: ShaderProperty;
40
+ /** @internal */
41
+ static readonly _speedMinConstVecProperty: ShaderProperty;
42
+ /** @internal */
43
+ static readonly _speedXMaxCurveProperty: ShaderProperty;
44
+ /** @internal */
45
+ static readonly _speedXMinCurveProperty: ShaderProperty;
46
+ /** @internal */
47
+ static readonly _speedYMaxCurveProperty: ShaderProperty;
48
+ /** @internal */
49
+ static readonly _speedYMinCurveProperty: ShaderProperty;
50
+ /** @internal */
51
+ static readonly _speedZMaxCurveProperty: ShaderProperty;
52
+ /** @internal */
53
+ static readonly _speedZMinCurveProperty: ShaderProperty;
54
+ /** @internal */
55
+ static readonly _dampenProperty: ShaderProperty;
56
+ /** @internal */
57
+ static readonly _dragConstantProperty: ShaderProperty;
58
+ /** @internal */
59
+ static readonly _dragMaxCurveProperty: ShaderProperty;
60
+ /** @internal */
61
+ static readonly _dragMinCurveProperty: ShaderProperty;
62
+ /** @internal */
63
+ static readonly _spaceProperty: ShaderProperty;
64
+ /** @internal */
65
+ _speedRand: Rand;
66
+ private _speedMinConstantVec;
67
+ private _speedMaxConstantVec;
68
+ private _dragConstantVec;
69
+ private _enabledModuleMacro;
70
+ private _separateAxesCachedMacro;
71
+ private _speedModeMacro;
72
+ private _speedRandomMacro;
73
+ private _dragCurveCachedMacro;
74
+ private _dragRandomCachedMacro;
75
+ private _dragSizeMacro;
76
+ private _dragVelocityMacro;
77
+ private _separateAxes;
78
+ private _speedX;
79
+ private _speedY;
80
+ private _speedZ;
81
+ private _dampen;
82
+ private _drag;
83
+ private _multiplyDragByParticleSize;
84
+ private _multiplyDragByParticleVelocity;
85
+ private _space;
86
+ /**
87
+ * Whether to limit velocity on each axis separately.
88
+ */
89
+ get separateAxes(): boolean;
90
+ set separateAxes(value: boolean);
91
+ /**
92
+ * Speed limit when separateAxes is false.
93
+ */
94
+ get speed(): ParticleCompositeCurve;
95
+ set speed(value: ParticleCompositeCurve);
96
+ /**
97
+ * Speed limit for the x-axis (or overall limit when separateAxes is false).
98
+ */
99
+ get speedX(): ParticleCompositeCurve;
100
+ set speedX(value: ParticleCompositeCurve);
101
+ /**
102
+ * Speed limit for the y-axis.
103
+ */
104
+ get speedY(): ParticleCompositeCurve;
105
+ set speedY(value: ParticleCompositeCurve);
106
+ /**
107
+ * Speed limit for the z-axis.
108
+ */
109
+ get speedZ(): ParticleCompositeCurve;
110
+ set speedZ(value: ParticleCompositeCurve);
111
+ /**
112
+ * Controls how much the velocity is dampened when it exceeds the limit.
113
+ * @remarks Value is clamped to [0, 1]. 0 means no damping, 1 means full damping.
114
+ */
115
+ get dampen(): number;
116
+ set dampen(value: number);
117
+ /**
118
+ * Controls the amount of drag applied to particle velocities.
119
+ */
120
+ get drag(): ParticleCompositeCurve;
121
+ set drag(value: ParticleCompositeCurve);
122
+ /**
123
+ * Adjust the amount of drag based on particle sizes.
124
+ */
125
+ get multiplyDragByParticleSize(): boolean;
126
+ set multiplyDragByParticleSize(value: boolean);
127
+ /**
128
+ * Adjust the amount of drag based on particle speeds.
129
+ */
130
+ get multiplyDragByParticleVelocity(): boolean;
131
+ set multiplyDragByParticleVelocity(value: boolean);
132
+ /**
133
+ * Specifies if the velocity limits are in local space or world space.
134
+ * @remarks Only takes effect when 'separateAxes' is enabled.
135
+ */
136
+ get space(): ParticleSimulationSpace;
137
+ set space(value: ParticleSimulationSpace);
138
+ /**
139
+ * Specifies whether the module is enabled.
140
+ * @remarks This module requires WebGL2, On WebGL1, enabling will be silently ignored.
141
+ */
142
+ get enabled(): boolean;
143
+ set enabled(value: boolean);
144
+ constructor(generator: ParticleGenerator);
145
+ /**
146
+ * @internal
147
+ */
148
+ _isDragRandomMode(): boolean;
149
+ /**
150
+ * @internal
151
+ */
152
+ _isSpeedRandomMode(): boolean;
153
+ /**
154
+ * @internal
155
+ */
156
+ _updateShaderData(shaderData: ShaderData): void;
157
+ /**
158
+ * @internal
159
+ */
160
+ _resetRandomSeed(seed: number): void;
161
+ private _uploadScalarSpeed;
162
+ private _uploadSeparateAxisSpeeds;
163
+ private _uploadDrag;
164
+ }
@@ -1,10 +1,13 @@
1
- import { Rand } from "@galacean/engine-math";
2
- import { ICustomClone } from "../../clone/ComponentCloner";
1
+ import { DataObject } from "../../base/DataObject";
2
+ import { Rand, Vector3 } from "@galacean/engine-math";
3
+ import type { ICloneHook } from "../../clone/ICloneHook";
4
+ import { ShaderData } from "../../shader/ShaderData";
5
+ import { ParticleGenerator } from "../ParticleGenerator";
3
6
  import { ParticleScaleMode } from "../enums/ParticleScaleMode";
4
7
  import { ParticleSimulationSpace } from "../enums/ParticleSimulationSpace";
5
8
  import { ParticleCompositeCurve } from "./ParticleCompositeCurve";
6
9
  import { ParticleCompositeGradient } from "./ParticleCompositeGradient";
7
- export declare class MainModule implements ICustomClone {
10
+ export declare class MainModule extends DataObject implements ICloneHook<MainModule> {
8
11
  private _tempVector40;
9
12
  private static _vector3One;
10
13
  private static readonly _positionScale;
@@ -23,11 +26,11 @@ export declare class MainModule implements ICustomClone {
23
26
  startDelay: ParticleCompositeCurve;
24
27
  /** A flag to enable 3D particle rotation, when disabled, only `startRotationZ` is used. */
25
28
  startRotation3D: boolean;
26
- /** The initial rotation of particles around the x-axis when emitted.*/
29
+ /** The initial rotation of particles around the x-axis when emitted, in degrees. */
27
30
  startRotationX: ParticleCompositeCurve;
28
- /** The initial rotation of particles around the y-axis when emitted. */
31
+ /** The initial rotation of particles around the y-axis when emitted, in degrees. */
29
32
  startRotationY: ParticleCompositeCurve;
30
- /** The initial rotation of particles around the z-axis when emitted. */
33
+ /** The initial rotation of particles around the z-axis when emitted, in degrees. */
31
34
  startRotationZ: ParticleCompositeCurve;
32
35
  /** Makes some particles spin in the opposite direction. */
33
36
  flipRotation: number;
@@ -40,6 +43,21 @@ export declare class MainModule implements ICustomClone {
40
43
  scalingMode: ParticleScaleMode;
41
44
  /** If set to true, the Particle Generator automatically begins to play on startup. */
42
45
  playOnEnabled: boolean;
46
+ /** @internal */
47
+ _maxParticleBuffer: number;
48
+ /** @internal */
49
+ readonly _startDelayRand: Rand;
50
+ /** @internal */
51
+ readonly _startSpeedRand: Rand;
52
+ /** @internal */
53
+ readonly _startLifeTimeRand: Rand;
54
+ /** @internal */
55
+ readonly _startColorRand: Rand;
56
+ /** @internal */
57
+ readonly _startSizeRand: Rand;
58
+ /** @internal */
59
+ readonly _startRotationRand: Rand;
60
+ /** @internal */
43
61
  readonly _gravityModifierRand: Rand;
44
62
  private _startLifetime;
45
63
  private _startSpeed;
@@ -100,5 +118,26 @@ export declare class MainModule implements ICustomClone {
100
118
  */
101
119
  get startSize(): ParticleCompositeCurve;
102
120
  set startSize(value: ParticleCompositeCurve);
121
+ /**
122
+ * @internal
123
+ */
124
+ constructor(generator: ParticleGenerator);
125
+ /**
126
+ * @internal
127
+ */
128
+ _resetRandomSeed(randomSeed: number): void;
129
+ /**
130
+ * @internal
131
+ */
132
+ _getPositionScale(): Vector3;
133
+ /**
134
+ * @internal
135
+ */
136
+ _updateShaderData(shaderData: ShaderData): void;
137
+ /**
138
+ * @internal
139
+ * @inheritdoc
140
+ */
141
+ _onClone(target: MainModule): void;
103
142
  private _onCompositeCurveChange;
104
143
  }
@@ -0,0 +1,114 @@
1
+ import { Rand } from "@galacean/engine-math";
2
+ import { ShaderData, ShaderMacro, ShaderProperty } from "../../shader";
3
+ import { ParticleGenerator } from "../ParticleGenerator";
4
+ import { ParticleCompositeCurve } from "./ParticleCompositeCurve";
5
+ import { ParticleGeneratorModule } from "./ParticleGeneratorModule";
6
+ /**
7
+ * Noise module for particle system.
8
+ * Adds simplex noise-based turbulence displacement to particles.
9
+ */
10
+ export declare class NoiseModule extends ParticleGeneratorModule {
11
+ /** @internal */
12
+ static readonly _enabledMacro: ShaderMacro;
13
+ /** @internal */
14
+ static readonly _strengthCurveMacro: ShaderMacro;
15
+ /** @internal */
16
+ static readonly _strengthIsRandomTwoMacro: ShaderMacro;
17
+ /** @internal */
18
+ static readonly _separateAxesMacro: ShaderMacro;
19
+ /** @internal */
20
+ static readonly _noiseProperty: ShaderProperty;
21
+ /** @internal */
22
+ static readonly _noiseOctaveProperty: ShaderProperty;
23
+ /** @internal */
24
+ static readonly _strengthMinConstProperty: ShaderProperty;
25
+ /** @internal */
26
+ static readonly _strengthMaxCurveXProperty: ShaderProperty;
27
+ /** @internal */
28
+ static readonly _strengthMaxCurveYProperty: ShaderProperty;
29
+ /** @internal */
30
+ static readonly _strengthMaxCurveZProperty: ShaderProperty;
31
+ /** @internal */
32
+ static readonly _strengthMinCurveXProperty: ShaderProperty;
33
+ /** @internal */
34
+ static readonly _strengthMinCurveYProperty: ShaderProperty;
35
+ /** @internal */
36
+ static readonly _strengthMinCurveZProperty: ShaderProperty;
37
+ private _enabledModuleMacro;
38
+ private _strengthCurveModeMacro;
39
+ private _strengthIsRandomTwoModeMacro;
40
+ private _separateAxesModeMacro;
41
+ /** @internal */
42
+ _noiseRand: Rand;
43
+ private _noiseParams;
44
+ private _noiseOctaveParams;
45
+ private _strengthMinConst;
46
+ private _strengthX;
47
+ private _strengthY;
48
+ private _strengthZ;
49
+ private _scrollSpeed;
50
+ private _separateAxes;
51
+ private _frequency;
52
+ private _octaveCount;
53
+ private _octaveIntensityMultiplier;
54
+ private _octaveFrequencyMultiplier;
55
+ /**
56
+ * Specifies whether the strength is separate on each axis, when disabled, only `strength` is used.
57
+ */
58
+ get separateAxes(): boolean;
59
+ set separateAxes(value: boolean);
60
+ /**
61
+ * Noise strength. When `separateAxes` is disabled, applies to all axes.
62
+ * When `separateAxes` is enabled, applies only to x axis.
63
+ */
64
+ get strengthX(): ParticleCompositeCurve;
65
+ set strengthX(value: ParticleCompositeCurve);
66
+ /**
67
+ * Noise strength for y axis, used when `separateAxes` is enabled.
68
+ */
69
+ get strengthY(): ParticleCompositeCurve;
70
+ set strengthY(value: ParticleCompositeCurve);
71
+ /**
72
+ * Noise strength for z axis, used when `separateAxes` is enabled.
73
+ */
74
+ get strengthZ(): ParticleCompositeCurve;
75
+ set strengthZ(value: ParticleCompositeCurve);
76
+ /**
77
+ * Noise spatial frequency.
78
+ */
79
+ get frequency(): number;
80
+ set frequency(value: number);
81
+ /**
82
+ * Noise field scroll speed over time.
83
+ */
84
+ get scrollSpeed(): number;
85
+ set scrollSpeed(value: number);
86
+ /**
87
+ * Number of noise octave layers (1-3).
88
+ */
89
+ get octaveCount(): number;
90
+ set octaveCount(value: number);
91
+ /**
92
+ * Intensity multiplier for each successive octave, only effective when `octaveCount` > 1.
93
+ * Each layer's contribution is scaled by this factor relative to the previous layer, range [0, 1].
94
+ */
95
+ get octaveIntensityMultiplier(): number;
96
+ set octaveIntensityMultiplier(value: number);
97
+ /**
98
+ * Frequency multiplier for each successive octave, only effective when `octaveCount` > 1.
99
+ * Each layer samples at this multiple of the previous layer's frequency, range [1, 4].
100
+ */
101
+ get octaveFrequencyMultiplier(): number;
102
+ set octaveFrequencyMultiplier(value: number);
103
+ get enabled(): boolean;
104
+ set enabled(value: boolean);
105
+ constructor(generator: ParticleGenerator);
106
+ /**
107
+ * @internal
108
+ */
109
+ _updateShaderData(shaderData: ShaderData): void;
110
+ /**
111
+ * @internal
112
+ */
113
+ _resetRandomSeed(seed: number): void;
114
+ }
@@ -1,9 +1,12 @@
1
+ import { DataObject } from "../../base/DataObject";
2
+ import { Vector2 } from "@galacean/engine-math";
1
3
  import { ParticleCurveMode } from "../enums/ParticleCurveMode";
2
4
  import { ParticleCurve } from "./ParticleCurve";
3
5
  /**
4
6
  * Particle composite curve.
5
7
  */
6
- export declare class ParticleCompositeCurve {
8
+ export declare class ParticleCompositeCurve extends DataObject {
9
+ private static _minMaxRange;
7
10
  private _updateManager;
8
11
  private _mode;
9
12
  private _constantMin;
@@ -74,8 +77,43 @@ export declare class ParticleCompositeCurve {
74
77
  * @param lerpFactor - Lerp factor between two constants or curves, Valid when `mode` is set to `TwoConstants` or `TwoCurves`
75
78
  * @returns - The result curve value
76
79
  */
77
- evaluate(time: number, lerpFactor: number): number;
78
- private _getMaxKeyValue;
79
- private _getMinKeyValue;
80
+ evaluate(time: number | undefined, lerpFactor: number | undefined): number;
81
+ /**
82
+ * @internal
83
+ */
84
+ _evaluateCumulative(normalizedAge: number, lerpFactor: number | undefined): number;
85
+ /**
86
+ * @internal
87
+ */
88
+ _getMax(): number;
89
+ /**
90
+ * @internal
91
+ */
92
+ _getMinMax(out: Vector2): void;
93
+ /**
94
+ * @internal
95
+ */
96
+ _isZero(): boolean;
97
+ /**
98
+ * @internal
99
+ */
100
+ _isCurveMode(): boolean;
101
+ /**
102
+ * @internal
103
+ */
104
+ _isRandomMode(): boolean;
105
+ /**
106
+ * @internal
107
+ */
108
+ _isRandomCurveMode(): boolean;
109
+ /**
110
+ * @internal
111
+ */
112
+ _registerOnValueChanged(listener: () => void): void;
113
+ /**
114
+ * @internal
115
+ */
116
+ _unRegisterOnValueChanged(listener: () => void): void;
117
+ private _getKeyMinMax;
80
118
  private _onCurveChange;
81
119
  }
@@ -1,10 +1,12 @@
1
+ import { DataObject } from "../../base/DataObject";
1
2
  import { Color } from "@galacean/engine-math";
2
3
  import { ParticleGradientMode } from "../enums/ParticleGradientMode";
3
4
  import { ParticleGradient } from "./ParticleGradient";
4
5
  /**
5
6
  * Particle composite gradient.
6
7
  */
7
- export declare class ParticleCompositeGradient {
8
+ export declare class ParticleCompositeGradient extends DataObject {
9
+ private static _tempColor;
8
10
  /** The gradient mode. */
9
11
  mode: ParticleGradientMode;
10
12
  constantMin: Color;
@@ -23,6 +25,10 @@ export declare class ParticleCompositeGradient {
23
25
  */
24
26
  get gradient(): ParticleGradient;
25
27
  set gradient(value: ParticleGradient);
28
+ /**
29
+ * Create a particle gradient in constant mode with the default color.
30
+ */
31
+ constructor();
26
32
  /**
27
33
  * Create a particle gradient that generates a constant color.
28
34
  * @param constant - The constant color
@@ -51,5 +57,5 @@ export declare class ParticleCompositeGradient {
51
57
  * @param lerpFactor - Lerp factor between two constants or gradients, Valid when `mode` is set to `TwoConstants` or `TwoGradients`
52
58
  * @param out - The result color
53
59
  */
54
- evaluate(time: number, lerpFactor: number, out: Color): void;
60
+ evaluate(time: number | undefined, lerpFactor: number | undefined, out: Color): void;
55
61
  }
@@ -1,7 +1,8 @@
1
+ import { DataObject } from "../../base/DataObject";
1
2
  /**
2
3
  * Particle curve.
3
4
  */
4
- export declare class ParticleCurve {
5
+ export declare class ParticleCurve extends DataObject {
5
6
  private _updateManager;
6
7
  private _keys;
7
8
  private _typeArray;
@@ -37,12 +38,32 @@ export declare class ParticleCurve {
37
38
  * @param keys - The keys
38
39
  */
39
40
  setKeys(keys: CurveKey[]): void;
41
+ /**
42
+ * @internal
43
+ */
44
+ _evaluate(normalizedAge: number): number;
45
+ /**
46
+ * @internal
47
+ */
48
+ _evaluateCumulative(normalizedAge: number): number;
49
+ /**
50
+ * @internal
51
+ */
52
+ _getTypeArray(): Float32Array;
53
+ /**
54
+ * @internal
55
+ */
56
+ _registerOnValueChanged(listener: () => void): void;
57
+ /**
58
+ * @internal
59
+ */
60
+ _unRegisterOnValueChanged(listener: () => void): void;
40
61
  private _addKey;
41
62
  }
42
63
  /**
43
64
  * The key of the curve.
44
65
  */
45
- export declare class CurveKey {
66
+ export declare class CurveKey extends DataObject {
46
67
  private _updateManager;
47
68
  private _time;
48
69
  private _value;
@@ -60,4 +81,12 @@ export declare class CurveKey {
60
81
  * Create a new key.
61
82
  */
62
83
  constructor(time: number, value: number);
84
+ /**
85
+ * @internal
86
+ */
87
+ _registerOnValueChanged(listener: () => void): void;
88
+ /**
89
+ * @internal
90
+ */
91
+ _unRegisterOnValueChanged(listener: () => void): void;
63
92
  }
@@ -1,17 +1,23 @@
1
+ import { DataObject } from "../../base/DataObject";
1
2
  import { ShaderData, ShaderMacro } from "../../shader";
2
3
  import { ParticleGenerator } from "../ParticleGenerator";
3
4
  import { ParticleCompositeCurve } from "./ParticleCompositeCurve";
4
5
  /**
5
6
  * Particle generator module.
6
7
  */
7
- export declare abstract class ParticleGeneratorModule {
8
- protected _generator: ParticleGenerator;
8
+ export declare abstract class ParticleGeneratorModule extends DataObject {
9
+ /** @internal */
10
+ _generator: ParticleGenerator;
9
11
  protected _enabled: boolean;
10
12
  /**
11
13
  * Specifies whether the module is enabled or not.
12
14
  */
13
15
  get enabled(): boolean;
14
16
  set enabled(value: boolean);
15
- protected _enableMacro(shaderData: ShaderData, lastEnableMacro: ShaderMacro, enableMacro: ShaderMacro): ShaderMacro;
17
+ /**
18
+ * @internal
19
+ */
20
+ constructor(generator: ParticleGenerator);
21
+ protected _enableMacro(shaderData: ShaderData, lastEnableMacro: ShaderMacro | null, enableMacro: ShaderMacro | null): ShaderMacro | null;
16
22
  protected _onCompositeCurveChange(lastValue: ParticleCompositeCurve, value: ParticleCompositeCurve): void;
17
23
  }