@galacean/engine-core 1.0.0-beta.9 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (186) hide show
  1. package/dist/main.js +11947 -11300
  2. package/dist/main.js.map +1 -1
  3. package/dist/miniprogram.js +11947 -11300
  4. package/dist/module.js +11943 -11302
  5. package/dist/module.js.map +1 -1
  6. package/package.json +3 -3
  7. package/types/2d/sprite/Sprite.d.ts +3 -0
  8. package/types/2d/sprite/SpriteMask.d.ts +1 -2
  9. package/types/2d/sprite/SpriteRenderer.d.ts +1 -2
  10. package/types/2d/text/TextRenderer.d.ts +1 -2
  11. package/types/Camera.d.ts +5 -2
  12. package/types/ComponentsManager.d.ts +3 -2
  13. package/types/DisorderedArray.d.ts +4 -3
  14. package/types/Engine.d.ts +5 -3
  15. package/types/Entity.d.ts +1 -1
  16. package/types/RenderPipeline/ClassPool.d.ts +3 -1
  17. package/types/RenderPipeline/CullingResults.d.ts +1 -0
  18. package/types/RenderPipeline/DepthOnlyPass.d.ts +1 -0
  19. package/types/RenderPipeline/IPoolElement.d.ts +3 -0
  20. package/types/RenderPipeline/MeshRenderData.d.ts +3 -1
  21. package/types/RenderPipeline/PipelinePass.d.ts +16 -0
  22. package/types/RenderPipeline/PipelineUtils.d.ts +1 -0
  23. package/types/RenderPipeline/RenderElement.d.ts +3 -1
  24. package/types/RenderPipeline/RenderElementX.d.ts +12 -0
  25. package/types/RenderPipeline/SpriteMaskRenderData.d.ts +3 -1
  26. package/types/RenderPipeline/SpriteRenderData.d.ts +3 -1
  27. package/types/RenderPipeline/TextRenderData.d.ts +3 -1
  28. package/types/Renderer.d.ts +7 -3
  29. package/types/SafeLoopArray.d.ts +37 -0
  30. package/types/Scene.d.ts +10 -4
  31. package/types/Ticker.d.ts +30 -0
  32. package/types/Transform.d.ts +1 -0
  33. package/types/animation/Animator.d.ts +7 -4
  34. package/types/animation/animationCurve/AnimationRectCurve.d.ts +8 -0
  35. package/types/animation/animationCurve/AnimationRefCurve.d.ts +8 -0
  36. package/types/animation/enums/LayerState.d.ts +3 -1
  37. package/types/animation/internal/AnimationCurveLayerOwner.d.ts +1 -0
  38. package/types/animation/internal/AnimationCurveOwnerLayerData.d.ts +1 -0
  39. package/types/asset/LoadItem.d.ts +16 -9
  40. package/types/asset/request.d.ts +7 -3
  41. package/types/base/EventDispatcher.d.ts +1 -1
  42. package/types/enums/ActiveChangeFlag.d.ts +6 -0
  43. package/types/enums/DepthTextureMode.d.ts +7 -0
  44. package/types/graphic/Primitive.d.ts +1 -0
  45. package/types/graphic/PrimitiveVertexBinding.d.ts +1 -0
  46. package/types/graphic/SubMesh.d.ts +3 -1
  47. package/types/graphic/SubPrimitive.d.ts +9 -0
  48. package/types/index.d.ts +1 -1
  49. package/types/lighting/AmbientLight.d.ts +4 -1
  50. package/types/lighting/LightManager.d.ts +1 -0
  51. package/types/material/Material.d.ts +9 -2
  52. package/types/mesh/MeshRenderer.d.ts +1 -2
  53. package/types/particle/ParticleBufferUtils.d.ts +1 -0
  54. package/types/particle/ParticleData.d.ts +1 -0
  55. package/types/particle/ParticleGenerator.d.ts +72 -0
  56. package/types/particle/ParticleMaterial.d.ts +28 -0
  57. package/types/particle/ParticleMesh.d.ts +289 -0
  58. package/types/particle/ParticleShaderDeclaration.d.ts +1 -0
  59. package/types/particle/ParticleShaderMacro.d.ts +1 -0
  60. package/types/particle/ParticleShaderProperty.d.ts +1 -0
  61. package/types/particle/ParticleSystem.d.ts +41 -0
  62. package/types/particle/ParticleVertexElements.d.ts +1 -0
  63. package/types/particle/ParticleVertexUtils.d.ts +1 -0
  64. package/types/particle/enum/ParticleAnimationRowMode.d.ts +9 -0
  65. package/types/particle/enum/ParticleAnimationType.d.ts +9 -0
  66. package/types/particle/enum/ParticleCurveMode.d.ts +13 -0
  67. package/types/particle/enum/ParticleGradientMode.d.ts +13 -0
  68. package/types/particle/enum/ParticleRenderMode.d.ts +17 -0
  69. package/types/particle/enum/ParticleScaleMode.d.ts +11 -0
  70. package/types/particle/enum/ParticleShapeMultiModeValue.d.ts +9 -0
  71. package/types/particle/enum/ParticleShapeType.d.ts +15 -0
  72. package/types/particle/enum/ParticleSimulationSpace.d.ts +9 -0
  73. package/types/particle/enum/index.d.ts +9 -0
  74. package/types/particle/enums/ParticleCurveMode.d.ts +9 -0
  75. package/types/particle/enums/ParticleGradientMode.d.ts +9 -0
  76. package/types/particle/enums/ParticleRandomSubSeeds.d.ts +1 -0
  77. package/types/particle/enums/ParticleRenderMode.d.ts +17 -0
  78. package/types/particle/enums/ParticleScaleMode.d.ts +11 -0
  79. package/types/particle/enums/ParticleSimulationSpace.d.ts +9 -0
  80. package/types/particle/enums/ParticleStopMode.d.ts +6 -0
  81. package/types/particle/enums/attributes/BillboardParticleVertexAttribute.d.ts +1 -0
  82. package/types/particle/enums/attributes/MeshParticleVertexAttribute.d.ts +5 -0
  83. package/types/particle/enums/attributes/ParticleInstanceVertexAttribute.d.ts +1 -0
  84. package/types/particle/module/Burst.d.ts +38 -0
  85. package/types/particle/module/ColorGradient.d.ts +75 -0
  86. package/types/particle/module/ColorOverLifetimeModule.d.ts +20 -0
  87. package/types/particle/module/EmissionModule.d.ts +63 -0
  88. package/types/particle/module/FrameOverTime.d.ts +73 -0
  89. package/types/particle/module/ParticleCurve.d.ts +37 -0
  90. package/types/particle/module/RotationOverLifetimeModule.d.ts +21 -0
  91. package/types/particle/module/RotationVelocityGradient.d.ts +184 -0
  92. package/types/particle/module/SizeGradient.d.ts +151 -0
  93. package/types/particle/module/SizeOverLifetimeModule.d.ts +21 -0
  94. package/types/particle/module/StartFrame.d.ts +46 -0
  95. package/types/particle/module/TextureSheetAnimationModule.d.ts +37 -0
  96. package/types/particle/module/VelocityGradient.d.ts +110 -0
  97. package/types/particle/module/VelocityOverLifetimeModule.d.ts +22 -0
  98. package/types/particle/module/index.d.ts +15 -0
  99. package/types/particle/module/shape/BaseShape.d.ts +26 -0
  100. package/types/particle/module/shape/BoxShape.d.ts +20 -0
  101. package/types/particle/module/shape/CircleShape.d.ts +27 -0
  102. package/types/particle/module/shape/ConeShape.d.ts +35 -0
  103. package/types/particle/module/shape/HemisphereShape.d.ts +23 -0
  104. package/types/particle/module/shape/ShapeUtils.d.ts +1 -0
  105. package/types/particle/module/shape/SphereShape.d.ts +23 -0
  106. package/types/particle/module/shape/index.d.ts +5 -0
  107. package/types/particle/modules/Burst.d.ts +14 -0
  108. package/types/particle/modules/ColorOverLifetimeModule.d.ts +20 -0
  109. package/types/particle/modules/EmissionModule.d.ts +45 -0
  110. package/types/particle/modules/MainModule.d.ts +68 -0
  111. package/types/particle/modules/ParticleCompositeCurve.d.ts +56 -0
  112. package/types/particle/modules/ParticleCompositeGradient.d.ts +55 -0
  113. package/types/particle/modules/ParticleCurve.d.ts +56 -0
  114. package/types/particle/modules/ParticleGeneratorModule.d.ts +12 -0
  115. package/types/particle/modules/ParticleGradient.d.ts +94 -0
  116. package/types/particle/modules/RotationOverLifetimeModule.d.ts +34 -0
  117. package/types/particle/modules/ShapeModule.d.ts +9 -0
  118. package/types/particle/modules/SizeOverLifetimeModule.d.ts +34 -0
  119. package/types/particle/modules/TextureSheetAnimationModule.d.ts +42 -0
  120. package/types/particle/modules/VelocityOverLifetimeModule.d.ts +34 -0
  121. package/types/particle/modules/shape/BaseShape.d.ts +12 -0
  122. package/types/particle/modules/shape/BoxShape.d.ts +11 -0
  123. package/types/particle/modules/shape/CircleShape.d.ts +17 -0
  124. package/types/particle/modules/shape/ConeShape.d.ts +28 -0
  125. package/types/particle/modules/shape/HemisphereShape.d.ts +9 -0
  126. package/types/particle/modules/shape/ShapeUtils.d.ts +1 -0
  127. package/types/particle/modules/shape/SphereShape.d.ts +9 -0
  128. package/types/particle/modules/shape/enums/ParticleShapeArcMode.d.ts +9 -0
  129. package/types/particle/modules/shape/enums/ParticleShapeMultiModeValue.d.ts +9 -0
  130. package/types/particle/modules/shape/enums/ParticleShapeType.d.ts +15 -0
  131. package/types/particle/modules/shape/index.d.ts +6 -0
  132. package/types/particle/moudules/Burst.d.ts +25 -0
  133. package/types/particle/moudules/Emission.d.ts +47 -0
  134. package/types/particle/moudules/EmissionModule.d.ts +49 -0
  135. package/types/particle/moudules/MainModule.d.ts +59 -0
  136. package/types/particle/moudules/ParticleCurve.d.ts +27 -0
  137. package/types/particle/moudules/ParticleGradient.d.ts +28 -0
  138. package/types/particle/moudules/ShapeModule.d.ts +7 -0
  139. package/types/particle/moudules/shape/BaseShape.d.ts +28 -0
  140. package/types/particle/moudules/shape/BoxShape.d.ts +20 -0
  141. package/types/particle/moudules/shape/CircleShape.d.ts +27 -0
  142. package/types/particle/moudules/shape/ConeShape.d.ts +35 -0
  143. package/types/particle/moudules/shape/HemisphereShape.d.ts +23 -0
  144. package/types/particle/moudules/shape/ShapeUtils.d.ts +1 -0
  145. package/types/particle/moudules/shape/SphereShape.d.ts +23 -0
  146. package/types/particle/moudules/shape/enums/ParticleShapeMultiModeValue.d.ts +9 -0
  147. package/types/particle/moudules/shape/enums/ParticleShapeType.d.ts +15 -0
  148. package/types/particle/moudules/shape/index.d.ts +5 -0
  149. package/types/physics/PhysicsManager.d.ts +4 -2
  150. package/types/physics/PhysicsScene.d.ts +79 -0
  151. package/types/shader/enums/RenderStateElementKey.d.ts +60 -0
  152. package/types/shader/index.d.ts +1 -0
  153. package/types/shader/state/index.d.ts +6 -0
  154. package/types/shaderlib/particle/index.d.ts +14 -0
  155. package/types/shadow/PipelinePass.d.ts +16 -0
  156. package/types/sky/Sky.d.ts +12 -4
  157. package/types/texture/Texture.d.ts +6 -0
  158. package/types/texture/Texture2D.d.ts +3 -1
  159. package/types/texture/enums/TextureUsage.d.ts +9 -0
  160. package/types/texture/index.d.ts +1 -0
  161. package/types/utils/BoolUpdateFlag.d.ts +12 -0
  162. package/types/utils/DisorderedArray.d.ts +18 -0
  163. package/types/utils/SafeLoopArray.d.ts +41 -0
  164. package/types/utils/UpdateFlag.d.ts +20 -0
  165. package/types/utils/UpdateFlagManager.d.ts +1 -0
  166. package/types/utils/Utils.d.ts +31 -0
  167. package/types/xr/XRManager.d.ts +31 -0
  168. package/types/xr/component/XRPoseDriver.d.ts +10 -0
  169. package/types/xr/data/XRCamera.d.ts +6 -0
  170. package/types/xr/data/XRDevice.d.ts +9 -0
  171. package/types/xr/data/XRHandle.d.ts +10 -0
  172. package/types/xr/enum/EnumXRButton.d.ts +5 -0
  173. package/types/xr/enum/EnumXRDevicePhase.d.ts +4 -0
  174. package/types/xr/enum/EnumXRFeature.d.ts +9 -0
  175. package/types/xr/enum/EnumXRInputSource.d.ts +8 -0
  176. package/types/xr/enum/EnumXRMode.d.ts +7 -0
  177. package/types/xr/enum/EnumXRSubsystem.d.ts +4 -0
  178. package/types/xr/enum/EnumXRTrackingMode.d.ts +7 -0
  179. package/types/xr/feature/XRCameraManager.d.ts +21 -0
  180. package/types/xr/feature/XRFeature.d.ts +29 -0
  181. package/types/xr/feature/XRImageTrackManager.d.ts +10 -0
  182. package/types/xr/feature/XRInputManager.d.ts +16 -0
  183. package/types/xr/index.d.ts +18 -0
  184. package/types/xr/provider/XRProvider.d.ts +19 -0
  185. package/types/xr/subsystem/XRInputSubsystem.d.ts +5 -0
  186. package/types/xr/subsystem/XRSubsystem.d.ts +30 -0
@@ -1,8 +1,9 @@
1
+ import { IPoolElement } from "../RenderPipeline/IPoolElement";
1
2
  import { MeshTopology } from "./enums/MeshTopology";
2
3
  /**
3
4
  * Sub-mesh, mainly contains drawing information.
4
5
  */
5
- export declare class SubMesh {
6
+ export declare class SubMesh implements IPoolElement {
6
7
  /** Start drawing offset. */
7
8
  start: number;
8
9
  /** Drawing count. */
@@ -16,4 +17,5 @@ export declare class SubMesh {
16
17
  * @param topology - Drawing topology
17
18
  */
18
19
  constructor(start?: number, count?: number, topology?: MeshTopology);
20
+ dispose?(): void;
19
21
  }
@@ -0,0 +1,9 @@
1
+ import { MeshTopology } from "./enums/MeshTopology";
2
+ export declare class SubPrimitive {
3
+ /** Start drawing offset. */
4
+ start: number;
5
+ /** Drawing count. */
6
+ count: number;
7
+ /** Drawing topology. */
8
+ topology: MeshTopology;
9
+ }
package/types/index.d.ts CHANGED
@@ -22,7 +22,7 @@ export { AssetPromise } from "./asset/AssetPromise";
22
22
  export type { LoadItem } from "./asset/LoadItem";
23
23
  export { AssetType } from "./asset/AssetType";
24
24
  export { ReferResource } from "./asset/ReferResource";
25
- export * from "./RenderPipeline";
25
+ export * from "./RenderPipeline/index";
26
26
  export * from "./base";
27
27
  export { Background } from "./Background";
28
28
  export { BackgroundMode } from "./enums/BackgroundMode";
@@ -1,10 +1,12 @@
1
1
  import { Color, SphericalHarmonics3 } from "@galacean/engine-math";
2
2
  import { TextureCube } from "../texture";
3
3
  import { DiffuseMode } from "./enums/DiffuseMode";
4
+ import { ReferResource } from "../asset/ReferResource";
5
+ import { Engine } from "../Engine";
4
6
  /**
5
7
  * Ambient light.
6
8
  */
7
- export declare class AmbientLight {
9
+ export declare class AmbientLight extends ReferResource {
8
10
  private static _shMacro;
9
11
  private static _specularMacro;
10
12
  private static _decodeRGBMMacro;
@@ -60,6 +62,7 @@ export declare class AmbientLight {
60
62
  */
61
63
  get specularIntensity(): number;
62
64
  set specularIntensity(value: number);
65
+ constructor(engine: Engine);
63
66
  private _setDiffuseMode;
64
67
  private _setSpecularTexture;
65
68
  private _setSpecularTextureDecodeRGBM;
@@ -2,4 +2,5 @@
2
2
  * Light manager.
3
3
  */
4
4
  export declare class LightManager {
5
+ private _getSunLightIndex;
5
6
  }
@@ -10,8 +10,11 @@ import { RenderState } from "../shader/state/RenderState";
10
10
  export declare class Material extends ReferResource implements IClone {
11
11
  /** Name. */
12
12
  name: string;
13
- /** Shader data. */
14
- readonly shaderData: ShaderData;
13
+ private _shaderData;
14
+ /**
15
+ * Shader data.
16
+ */
17
+ get shaderData(): ShaderData;
15
18
  /**
16
19
  * Shader used by the material.
17
20
  */
@@ -41,4 +44,8 @@ export declare class Material extends ReferResource implements IClone {
41
44
  */
42
45
  cloneTo(target: Material): void;
43
46
  _addReferCount(value: number): void;
47
+ /**
48
+ * @override
49
+ */
50
+ protected _onDestroy(): void;
44
51
  }
@@ -1,10 +1,9 @@
1
1
  import { Renderer } from "../Renderer";
2
- import { ICustomClone } from "../clone/ComponentCloner";
3
2
  import { Mesh } from "../graphic/Mesh";
4
3
  /**
5
4
  * MeshRenderer Component.
6
5
  */
7
- export declare class MeshRenderer extends Renderer implements ICustomClone {
6
+ export declare class MeshRenderer extends Renderer {
8
7
  private static _uvMacro;
9
8
  private static _uv1Macro;
10
9
  private static _normalMacro;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,72 @@
1
+ import { ParticleRenderer } from "./ParticleRenderer";
2
+ import { ParticleStopMode } from "./enums/ParticleStopMode";
3
+ import { ColorOverLifetimeModule } from "./modules/ColorOverLifetimeModule";
4
+ import { EmissionModule } from "./modules/EmissionModule";
5
+ import { MainModule } from "./modules/MainModule";
6
+ import { RotationOverLifetimeModule } from "./modules/RotationOverLifetimeModule";
7
+ import { SizeOverLifetimeModule } from "./modules/SizeOverLifetimeModule";
8
+ import { TextureSheetAnimationModule } from "./modules/TextureSheetAnimationModule";
9
+ import { VelocityOverLifetimeModule } from "./modules/VelocityOverLifetimeModule";
10
+ /**
11
+ * Particle Generator.
12
+ */
13
+ export declare class ParticleGenerator {
14
+ private static readonly _particleIncreaseCount;
15
+ /** Use auto random seed. */
16
+ useAutoRandomSeed: boolean;
17
+ /** Main module. */
18
+ readonly main: MainModule;
19
+ /** Emission module. */
20
+ readonly emission: EmissionModule;
21
+ /** Velocity over lifetime module. */
22
+ readonly velocityOverLifetime: VelocityOverLifetimeModule;
23
+ /** Size over lifetime module. */
24
+ readonly sizeOverLifetime: SizeOverLifetimeModule;
25
+ /** Rotation over lifetime module. */
26
+ readonly rotationOverLifetime: RotationOverLifetimeModule;
27
+ /** Color over lifetime module. */
28
+ readonly colorOverLifetime: ColorOverLifetimeModule;
29
+ /** Texture sheet animation module. */
30
+ readonly textureSheetAnimation: TextureSheetAnimationModule;
31
+ private _isPlaying;
32
+ private _instanceBufferResized;
33
+ private _waitProcessRetiredElementCount;
34
+ private _instanceVertexBufferBinding;
35
+ private _instanceVertices;
36
+ private _randomSeed;
37
+ /**
38
+ * Whether the particle generator is contain alive or is still creating particles.
39
+ */
40
+ get isAlive(): boolean;
41
+ /**
42
+ * Random seed.
43
+ *
44
+ * @remarks
45
+ * If `useAutoRandomSeed` is true, this value will be random changed when play.
46
+ * If you set this value custom, `useAutoRandomSeed` will be false.
47
+ */
48
+ get randomSeed(): number;
49
+ set randomSeed(value: number);
50
+ constructor(renderer: ParticleRenderer);
51
+ /**
52
+ * Start emitting particles.
53
+ * @param withChildren - Whether to start the particle generator of the child entity
54
+ */
55
+ play(withChildren?: boolean): void;
56
+ /**
57
+ * Stop emitting particles.
58
+ * @param withChildren - Whether to stop the particle generator of the child entity
59
+ * @param stopMode - Stop mode
60
+ */
61
+ stop(withChildren?: boolean, stopMode?: ParticleStopMode): void;
62
+ /**
63
+ * Manually emit certain number of particles immediately.
64
+ * @param count - Number of particles to emit
65
+ */
66
+ emit(count: number): void;
67
+ private _addNewParticle;
68
+ private _retireActiveParticles;
69
+ private _freeRetiredParticles;
70
+ private _addActiveParticlesToVertexBuffer;
71
+ private _addVertexBufferBindingsFilterDuplicate;
72
+ }
@@ -0,0 +1,28 @@
1
+ import { Color } from "@galacean/engine-math";
2
+ import { Engine } from "../Engine";
3
+ import { BaseMaterial } from "../material/BaseMaterial";
4
+ import { Texture2D } from "../texture/Texture2D";
5
+ /**
6
+ * Particle Material.
7
+ */
8
+ export declare class ParticleMaterial extends BaseMaterial {
9
+ /**
10
+ * Base color.
11
+ */
12
+ get baseColor(): Color;
13
+ set baseColor(value: Color);
14
+ /**
15
+ * Base texture.
16
+ */
17
+ get baseTexture(): Texture2D;
18
+ set baseTexture(value: Texture2D);
19
+ /**
20
+ * Create a unlit material instance.
21
+ * @param engine - Engine to which the material belongs
22
+ */
23
+ constructor(engine: Engine);
24
+ /**
25
+ * @inheritdoc
26
+ */
27
+ clone(): ParticleMaterial;
28
+ }
@@ -0,0 +1,289 @@
1
+ import { BoundingBox, Color, Vector2, Vector3 } from "@galacean/engine-math";
2
+ import { ParticleRenderer } from "./ParticleRenderer";
3
+ import { BufferMesh } from "../mesh";
4
+ import { Buffer, VertexElement } from "../graphic";
5
+ import { ColorOverLifetimeModule, EmissionModule, ParticleCurve, RotationOverLifetimeModule, SizeOverLifetimeModule, TextureSheetAnimationModule, VelocityOverLifetimeModule } from "./module";
6
+ import { BaseShape } from "./module/shape/BaseShape";
7
+ import { ParticleCurveMode, ParticleScaleMode, ParticleSimulationSpace } from "./enum";
8
+ /**
9
+ * Particle Mesh
10
+ */
11
+ export declare class ParticleMesh extends BufferMesh {
12
+ protected static VERTEX_STRIDE: number;
13
+ protected static VERTEX_ELEMENTS: VertexElement[];
14
+ protected static halfKSqrtOf2: number;
15
+ protected static g: number;
16
+ protected static _maxElapsedTime: number;
17
+ protected static _tempVector30: Vector3;
18
+ protected static _tempVector31: Vector3;
19
+ protected static _tempVector32: Vector3;
20
+ protected static _tempVector33: Vector3;
21
+ protected static _tempVector34: Vector3;
22
+ protected static _tempVector35: Vector3;
23
+ protected static _tempVector36: Vector3;
24
+ protected static _tempVector37: Vector3;
25
+ protected static _tempPosition: Vector3;
26
+ protected static _tempDirection: Vector3;
27
+ protected _simulateUpdate: boolean;
28
+ protected _drawCounter: number;
29
+ protected _isEmitting: boolean;
30
+ protected _isPlaying: boolean;
31
+ protected _isPaused: boolean;
32
+ protected _playStartDelay: number;
33
+ protected _frameRateTime: number;
34
+ protected _emissionTime: number;
35
+ protected _totalDelayTime: number;
36
+ protected _emissionDistance: number;
37
+ protected _emissionLastPosition: Vector3;
38
+ protected _uvLength: Vector2;
39
+ protected _renderer: ParticleRenderer;
40
+ protected _indexBuffer: Buffer;
41
+ protected _vertexBuffer: Buffer;
42
+ protected _vertices: Float32Array;
43
+ protected _simulationUV_Index: number;
44
+ protected _startLifeTimeIndex: number;
45
+ protected _timeIndex: number;
46
+ protected _burstsIndex: number;
47
+ protected _firstActiveElement: number;
48
+ protected _firstNewElement: number;
49
+ protected _firstFreeElement: number;
50
+ protected _firstRetiredElement: number;
51
+ protected _vertexStride: number;
52
+ protected _indexStride: number;
53
+ protected _floatCountPerVertex: number;
54
+ protected _bufferMaxParticles: number;
55
+ protected _emission: EmissionModule;
56
+ protected _shape: BaseShape;
57
+ protected _velocityOverLifetime: VelocityOverLifetimeModule;
58
+ protected _colorOverLifetime: ColorOverLifetimeModule;
59
+ protected _sizeOverLifetime: SizeOverLifetimeModule;
60
+ protected _rotationOverLifetime: RotationOverLifetimeModule;
61
+ protected _textureSheetAnimation: TextureSheetAnimationModule;
62
+ protected _startLifetimeType: ParticleCurveMode;
63
+ protected _startLifetimeConstant: number;
64
+ protected _startLifeTimeGradient: ParticleCurve;
65
+ protected _startLifetimeConstantMin: number;
66
+ protected _startLifetimeConstantMax: number;
67
+ protected _startLifeTimeGradientMin: ParticleCurve;
68
+ protected _startLifeTimeGradientMax: ParticleCurve;
69
+ protected _maxStartLifetime: number;
70
+ /** The mode of drag */
71
+ dragType: ParticleCurveMode;
72
+ /** Apply drag to particles within the volume of the Force Field. */
73
+ dragConstant: number;
74
+ /** Min apply drag to particles within the volume of the Force Field. */
75
+ dragSpeedConstantMin: number;
76
+ /** Max apply drag to particles within the volume of the Force Field. */
77
+ dragSpeedConstantMax: number;
78
+ /** Random seed.(should set before play()) */
79
+ randomSeed: Uint32Array;
80
+ /** Whether to use random seed */
81
+ autoRandomSeed: boolean;
82
+ /** Whether to use performance mode, which will delay particle release.*/
83
+ isPerformanceMode: boolean;
84
+ /** The duration of the Particle System in seconds. */
85
+ duration: number;
86
+ /** Specifies whether the Particle System is looping. */
87
+ looping: boolean;
88
+ /** A scale that this Particle System applies to gravity, defined by Physics.gravity. */
89
+ gravityModifier: number;
90
+ /** Control how the Particle System applies its Transform component to the particles it emits. */
91
+ scalingMode: ParticleScaleMode;
92
+ /** This selects the space in which to simulate particles. It can be either world or local space. */
93
+ simulationSpace: ParticleSimulationSpace;
94
+ /** Override the default playback speed of the Particle System. */
95
+ simulationSpeed: number;
96
+ /** If set to true, the Particle System automatically begins to play on startup. */
97
+ playOnAwake: boolean;
98
+ /** Makes some particles spin in the opposite direction. */
99
+ flipRotation: number;
100
+ /** Start delay mode. */
101
+ startDelayType: ParticleCurveMode;
102
+ /** Start delay in seconds. */
103
+ startDelay: number;
104
+ /** Start delay in min seconds. */
105
+ startDelayMin: number;
106
+ /** Start delay in max seconds. */
107
+ startDelayMax: number;
108
+ /** The mode of start particles speed */
109
+ startSpeedType: ParticleCurveMode;
110
+ /** The initial speed of particles when the Particle System first spawns them. */
111
+ startSpeedConstant: number;
112
+ /** The min initial speed of particles when the Particle System first spawns them. */
113
+ startSpeedConstantMin: number;
114
+ /** The max initial speed of particles when the Particle System first spawns them. */
115
+ startSpeedConstantMax: number;
116
+ /** A flag to enable 3D particle rotation. */
117
+ startRotation3D: boolean;
118
+ /** The mode of start rotation */
119
+ startRotationType: ParticleCurveMode;
120
+ /** The initial rotation of particles when the Particle System first spawns them. */
121
+ startRotationConstant: number;
122
+ /** The initial rotation of particles when the Particle System first spawns them. */
123
+ startRotationConstantSeparate: Vector3;
124
+ /** The min initial rotation of particles when the Particle System first spawns them. */
125
+ startRotationConstantMin: number;
126
+ /** The max initial rotation of particles when the Particle System first spawns them. */
127
+ startRotationConstantMax: number;
128
+ /** The min initial rotation of particles when the Particle System first spawns them. */
129
+ startRotationConstantMinSeparate: Vector3;
130
+ /** The max initial rotation of particles when the Particle System first spawns them. */
131
+ startRotationConstantMaxSeparate: Vector3;
132
+ /** A flag to enable specifying particle size individually for each axis. */
133
+ startSize3D: boolean;
134
+ /** The mode of start size */
135
+ startSizeType: ParticleCurveMode;
136
+ /** The initial size of particles when the Particle System first spawns them. */
137
+ startSizeConstant: number;
138
+ /** The initial size of particles when the Particle System first spawns them. */
139
+ startSizeConstantSeparate: Vector3;
140
+ /** The min initial size of particles when the Particle System first spawns them. */
141
+ startSizeConstantMin: number;
142
+ /** The max initial size of particles when the Particle System first spawns them. */
143
+ startSizeConstantMax: number;
144
+ /** The min initial size of particles when the Particle System first spawns them. */
145
+ startSizeConstantMinSeparate: Vector3;
146
+ /** The max initial size of particles when the Particle System first spawns them. */
147
+ startSizeConstantMaxSeparate: Vector3;
148
+ /** The mode of start color */
149
+ startColorType: ParticleCurveMode;
150
+ /** The initial color of particles when the Particle System first spawns them. */
151
+ startColorConstant: Color;
152
+ /** The min initial color of particles when the Particle System first spawns them. */
153
+ startColorConstantMin: Color;
154
+ /** The max initial color of particles when the Particle System first spawns them. */
155
+ startColorConstantMax: Color;
156
+ /**
157
+ * The mode of total lifetime.
158
+ */
159
+ get startLifetimeType(): ParticleCurveMode;
160
+ set startLifetimeType(value: ParticleCurveMode);
161
+ /**
162
+ * The total lifetime in seconds that each new particle has.
163
+ */
164
+ get startLifetimeConstant(): number;
165
+ set startLifetimeConstant(value: number);
166
+ /**
167
+ * The total lifetime in seconds that each new particle has.
168
+ */
169
+ get startLifeTimeGradient(): ParticleCurve;
170
+ set startLifeTimeGradient(value: ParticleCurve);
171
+ /**
172
+ * The lower total lifetime in seconds that each new particle has.
173
+ */
174
+ get startLifetimeConstantMin(): number;
175
+ set startLifetimeConstantMin(value: number);
176
+ /**
177
+ * The upper total lifetime in seconds that each new particle has.
178
+ */
179
+ get startLifetimeConstantMax(): number;
180
+ set startLifetimeConstantMax(value: number);
181
+ /**
182
+ * The lower total lifetime in seconds that each new particle has.
183
+ */
184
+ get startLifeTimeGradientMin(): ParticleCurve;
185
+ set startLifeTimeGradientMin(value: ParticleCurve);
186
+ /**
187
+ * The upper total lifetime in seconds that each new particle has.
188
+ */
189
+ get startLifeTimeGradientMax(): ParticleCurve;
190
+ set startLifeTimeGradientMax(value: ParticleCurve);
191
+ /**
192
+ * The ShapeModule of a Particle System.
193
+ */
194
+ get shape(): BaseShape;
195
+ set shape(value: BaseShape);
196
+ /**
197
+ * The maximum number of particles to emit.
198
+ */
199
+ get maxParticles(): number;
200
+ set maxParticles(value: number);
201
+ /**
202
+ * the sum of all alive particles within the particle system.
203
+ */
204
+ get aliveParticleCount(): number;
205
+ /**
206
+ * The emission time of the Particle System in seconds.
207
+ */
208
+ get emissionTime(): number;
209
+ /**
210
+ * The EmissionModule of a Particle System.
211
+ */
212
+ get emission(): EmissionModule;
213
+ /**
214
+ * Determines whether the Particle System is alive
215
+ */
216
+ get isAlive(): boolean;
217
+ /**
218
+ * Determines whether the Particle System is emitting particles.
219
+ */
220
+ get isEmitting(): boolean;
221
+ /**
222
+ * Determines whether the Particle System is playing.
223
+ */
224
+ get isPlaying(): boolean;
225
+ /**
226
+ * Determines whether the Particle System is paused.
227
+ */
228
+ get isPaused(): boolean;
229
+ /**
230
+ * The VelocityOverLifetimeModule of a Particle System.
231
+ */
232
+ get velocityOverLifetime(): VelocityOverLifetimeModule;
233
+ set velocityOverLifetime(value: VelocityOverLifetimeModule);
234
+ /**
235
+ * The ColorOverLifetimeModule of a Particle System.
236
+ */
237
+ get colorOverLifetime(): ColorOverLifetimeModule;
238
+ set colorOverLifetime(value: ColorOverLifetimeModule);
239
+ /**
240
+ * The SizeOverLifetimeModule of a Particle System.
241
+ */
242
+ get sizeOverLifetime(): SizeOverLifetimeModule;
243
+ set sizeOverLifetime(value: SizeOverLifetimeModule);
244
+ /**
245
+ * The RotationOverLifetimeModule of a Particle System.
246
+ */
247
+ get rotationOverLifetime(): RotationOverLifetimeModule;
248
+ set rotationOverLifetime(value: RotationOverLifetimeModule);
249
+ /**
250
+ * The TextureSheetAnimationModule of a Particle System.
251
+ */
252
+ get textureSheetAnimation(): TextureSheetAnimationModule;
253
+ set textureSheetAnimation(value: TextureSheetAnimationModule);
254
+ /**
255
+ * Self-defined bounding box
256
+ */
257
+ get customBounds(): BoundingBox;
258
+ set customBounds(value: BoundingBox);
259
+ constructor(renderer: ParticleRenderer);
260
+ /**
261
+ * Starts the Particle System.
262
+ */
263
+ play(): void;
264
+ /**
265
+ * Pauses the system so no new particles are emitted and the existing particles are not updated.
266
+ */
267
+ pause(): void;
268
+ /**
269
+ * Fast-forwards the Particle System by simulating particles over the given period of time, then pauses it.
270
+ * @param time - Time period in seconds to advance the ParticleSystem simulation by.
271
+ * @param restart - Restart and start from the beginning.
272
+ */
273
+ simulate(time: number, restart?: boolean): void;
274
+ /**
275
+ * Stops playing the Particle System using the supplied stop behaviour.
276
+ */
277
+ stop(): void;
278
+ protected _updateEmission(elapsedTime: number): void;
279
+ protected _updateParticles(elapsedTime: number): void;
280
+ protected _advanceTime(elapsedTime: number, emitTime: number): void;
281
+ protected _advanceDistance(emitTime: number): void;
282
+ protected _burst(fromTime: number, toTime: number): number;
283
+ protected _retireActiveParticles(): void;
284
+ protected _freeRetiredParticles(): void;
285
+ protected _emit(time: number): boolean;
286
+ protected _addParticle(position: Vector3, direction: Vector3, time: number): boolean;
287
+ protected _addNewParticlesToVertexBuffer(): void;
288
+ protected _updateParticlesSimulationRestart(time: number): void;
289
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,41 @@
1
+ import { ParticleRenderer } from "./ParticleRenderer";
2
+ import { EmissionModule } from "./modules/EmissionModule";
3
+ import { MainModule } from "./modules/MainModule";
4
+ import { ShapeModule } from "./modules/ShapeModule";
5
+ /**
6
+ * Particle System.
7
+ */
8
+ export declare class ParticleGenerator {
9
+ /** Use auto random seed. */
10
+ useAutoRandomSeed: boolean;
11
+ /** Main module. */
12
+ readonly main: MainModule;
13
+ /** Emission module. */
14
+ readonly emission: EmissionModule;
15
+ /** Shape module. */
16
+ readonly shape: ShapeModule;
17
+ private _waitProcessRetiredElementCount;
18
+ private _instanceVertexBufferBinding;
19
+ private _instanceVertices;
20
+ private readonly _engine;
21
+ private readonly _renderer;
22
+ private readonly _particleIncreaseCount;
23
+ /**
24
+ * Random seed.
25
+ * @remarks If `useAutoRandomSeed` is true, this value will be random changed when play.
26
+ */
27
+ get randomSeed(): number;
28
+ set randomSeed(value: number);
29
+ constructor(renderer: ParticleRenderer);
30
+ /**
31
+ * Emit a certain number of particles.
32
+ * @param count - Number of particles to emit
33
+ */
34
+ emit(count: number): void;
35
+ private _addNewParticle;
36
+ private _retireActiveParticles;
37
+ private _freeRetiredParticles;
38
+ private _addNewParticlesToVertexBuffer;
39
+ private _createParticleData;
40
+ private _addVertexBufferBindingsFilterDuplicate;
41
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,9 @@
1
+ /**
2
+ * The mode used for selecting rows of an animation in the Texture Sheet Animation Module.
3
+ */
4
+ export declare enum ParticleAnimationRowMode {
5
+ /** Use a random row for each particle. */
6
+ Random = 0,
7
+ /** Use the mesh index as the row, so that meshes can be mapped to specific animation frames. */
8
+ MeshIndex = 1
9
+ }
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Controls how texture sheet animations play.
3
+ */
4
+ export declare enum ParticleAnimationType {
5
+ /** Animate over the whole texture sheet from left to right, top to bottom. */
6
+ WholeSheet = 0,
7
+ /** Animate a single row in the sheet from left to right. */
8
+ SingleRow = 1
9
+ }
@@ -0,0 +1,13 @@
1
+ /**
2
+ * The particle curve mode.
3
+ */
4
+ export declare enum ParticleCurveMode {
5
+ /** Use a single constant for the MinMaxCurve. */
6
+ Constant = 0,
7
+ /** Use a single curve for the MinMaxCurve. */
8
+ Curve = 1,
9
+ /** Use a random value between 2 constants for the MinMaxCurve. */
10
+ TwoConstants = 2,
11
+ /** Use a random value between 2 curves for the MinMaxCurve. */
12
+ TwoCurves = 3
13
+ }
@@ -0,0 +1,13 @@
1
+ /**
2
+ * The particle gradient mode.
3
+ */
4
+ export declare enum ParticleGradientMode {
5
+ /** Use a single color for the MinMaxGradient. */
6
+ Color = 0,
7
+ /** Use a single color gradient for the MinMaxGradient. */
8
+ Gradient = 1,
9
+ /** Use a random value between 2 colors for the MinMaxGradient. */
10
+ TwoColors = 2,
11
+ /** Use a random value between 2 color gradients for the MinMaxGradient. */
12
+ TwoGradients = 3
13
+ }
@@ -0,0 +1,17 @@
1
+ /**
2
+ * The rendering mode for particle systems.
3
+ */
4
+ export declare enum ParticleRenderMode {
5
+ /** Render particles as billboards facing the active camera. (Default) */
6
+ Billboard = 0,
7
+ /** Stretch particles in the direction of motion. */
8
+ Stretch = 1,
9
+ /** Render particles as billboards always facing up along the y-Axis. */
10
+ HorizontalBillboard = 2,
11
+ /** Render particles as billboards always facing the player, but not pitching along the x-Axis. */
12
+ VerticalBillboard = 3,
13
+ /** Render particles as meshes. */
14
+ Mesh = 4,
15
+ /** Do not render particles. */
16
+ None = 5
17
+ }
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Control how particle systems apply transform scale.
3
+ */
4
+ export declare enum ParticleScaleMode {
5
+ /** Scale the Particle System using the entire transform hierarchy. */
6
+ Hierarchy = 0,
7
+ /** Scale the Particle System using only its own transform scale. (Ignores parent scale). */
8
+ Local = 1,
9
+ /** Only apply transform scale to the shape component, which controls where particles are spawned, but does not affect their size or movement. */
10
+ World = 2
11
+ }
@@ -0,0 +1,9 @@
1
+ /**
2
+ * The mode used to generate new points in a shape.
3
+ */
4
+ export declare enum ParticleShapeMultiModeValue {
5
+ /** Generate points randomly. (Default) */
6
+ Random = 0,
7
+ /** Animate the emission point around the shape. */
8
+ Loop = 1
9
+ }
@@ -0,0 +1,15 @@
1
+ /**
2
+ * The emission shape.
3
+ */
4
+ export declare enum ParticleShapeType {
5
+ /** Emit from the volume of a box. */
6
+ Box = 0,
7
+ /** Emit from a circle. */
8
+ Circle = 1,
9
+ /** Emit from the base of a cone. */
10
+ Cone = 2,
11
+ /** Emit from a half-sphere. */
12
+ Hemisphere = 3,
13
+ /** Emit from a sphere. */
14
+ Sphere = 4
15
+ }