@galacean/engine-core 0.9.19 → 0.9.21

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 (151) hide show
  1. package/dist/main.js +854 -1513
  2. package/dist/main.js.map +1 -1
  3. package/dist/miniprogram.js +854 -1513
  4. package/dist/module.js +633 -1127
  5. package/dist/module.js.map +1 -1
  6. package/package.json +3 -3
  7. package/types/RenderPipeline/CullingResults.d.ts +1 -0
  8. package/types/RenderPipeline/DepthOnlyPass.d.ts +1 -0
  9. package/types/RenderPipeline/PipelinePass.d.ts +16 -0
  10. package/types/RenderPipeline/PipelineUtils.d.ts +1 -0
  11. package/types/RenderPipeline/RenderData.d.ts +8 -1
  12. package/types/RenderPipeline/RenderElementX.d.ts +12 -0
  13. package/types/RenderPipeline/enums/PipelineStage.d.ts +2 -0
  14. package/types/Ticker.d.ts +30 -0
  15. package/types/animation/animationCurve/AnimationRectCurve.d.ts +8 -0
  16. package/types/animation/animationCurve/AnimationRefCurve.d.ts +8 -0
  17. package/types/animation/internal/AnimationCurveOwnerLayerData.d.ts +1 -0
  18. package/types/asset/GraphicsResource.d.ts +4 -0
  19. package/types/asset/request.d.ts +7 -3
  20. package/types/enums/DepthTextureMode.d.ts +7 -0
  21. package/types/graphic/Primitive.d.ts +1 -0
  22. package/types/graphic/PrimitiveVertexBinding.d.ts +1 -0
  23. package/types/graphic/SubPrimitive.d.ts +9 -0
  24. package/types/particle/ParticleBufferUtils.d.ts +1 -0
  25. package/types/particle/ParticleData.d.ts +1 -0
  26. package/types/particle/ParticleGenerator.d.ts +72 -0
  27. package/types/particle/ParticleMaterial.d.ts +28 -0
  28. package/types/particle/ParticleMesh.d.ts +289 -0
  29. package/types/particle/ParticleShaderDeclaration.d.ts +1 -0
  30. package/types/particle/ParticleShaderMacro.d.ts +1 -0
  31. package/types/particle/ParticleShaderProperty.d.ts +1 -0
  32. package/types/particle/ParticleSystem.d.ts +41 -0
  33. package/types/particle/ParticleVertexElements.d.ts +1 -0
  34. package/types/particle/ParticleVertexUtils.d.ts +1 -0
  35. package/types/particle/enum/ParticleAnimationRowMode.d.ts +9 -0
  36. package/types/particle/enum/ParticleAnimationType.d.ts +9 -0
  37. package/types/particle/enum/ParticleCurveMode.d.ts +13 -0
  38. package/types/particle/enum/ParticleGradientMode.d.ts +13 -0
  39. package/types/particle/enum/ParticleRenderMode.d.ts +17 -0
  40. package/types/particle/enum/ParticleScaleMode.d.ts +11 -0
  41. package/types/particle/enum/ParticleShapeMultiModeValue.d.ts +9 -0
  42. package/types/particle/enum/ParticleShapeType.d.ts +15 -0
  43. package/types/particle/enum/ParticleSimulationSpace.d.ts +9 -0
  44. package/types/particle/enum/index.d.ts +9 -0
  45. package/types/particle/enums/ParticleCurveMode.d.ts +9 -0
  46. package/types/particle/enums/ParticleGradientMode.d.ts +9 -0
  47. package/types/particle/enums/ParticleRandomSubSeeds.d.ts +1 -0
  48. package/types/particle/enums/ParticleRenderMode.d.ts +17 -0
  49. package/types/particle/enums/ParticleScaleMode.d.ts +11 -0
  50. package/types/particle/enums/ParticleSimulationSpace.d.ts +9 -0
  51. package/types/particle/enums/ParticleStopMode.d.ts +6 -0
  52. package/types/particle/enums/attributes/BillboardParticleVertexAttribute.d.ts +1 -0
  53. package/types/particle/enums/attributes/MeshParticleVertexAttribute.d.ts +5 -0
  54. package/types/particle/enums/attributes/ParticleInstanceVertexAttribute.d.ts +1 -0
  55. package/types/particle/module/Burst.d.ts +38 -0
  56. package/types/particle/module/ColorGradient.d.ts +75 -0
  57. package/types/particle/module/ColorOverLifetimeModule.d.ts +20 -0
  58. package/types/particle/module/EmissionModule.d.ts +63 -0
  59. package/types/particle/module/FrameOverTime.d.ts +73 -0
  60. package/types/particle/module/ParticleCurve.d.ts +37 -0
  61. package/types/particle/module/RotationOverLifetimeModule.d.ts +21 -0
  62. package/types/particle/module/RotationVelocityGradient.d.ts +184 -0
  63. package/types/particle/module/SizeGradient.d.ts +151 -0
  64. package/types/particle/module/SizeOverLifetimeModule.d.ts +21 -0
  65. package/types/particle/module/StartFrame.d.ts +46 -0
  66. package/types/particle/module/TextureSheetAnimationModule.d.ts +37 -0
  67. package/types/particle/module/VelocityGradient.d.ts +110 -0
  68. package/types/particle/module/VelocityOverLifetimeModule.d.ts +22 -0
  69. package/types/particle/module/index.d.ts +15 -0
  70. package/types/particle/module/shape/BaseShape.d.ts +26 -0
  71. package/types/particle/module/shape/BoxShape.d.ts +20 -0
  72. package/types/particle/module/shape/CircleShape.d.ts +27 -0
  73. package/types/particle/module/shape/ConeShape.d.ts +35 -0
  74. package/types/particle/module/shape/HemisphereShape.d.ts +23 -0
  75. package/types/particle/module/shape/ShapeUtils.d.ts +1 -0
  76. package/types/particle/module/shape/SphereShape.d.ts +23 -0
  77. package/types/particle/module/shape/index.d.ts +5 -0
  78. package/types/particle/modules/Burst.d.ts +14 -0
  79. package/types/particle/modules/ColorOverLifetimeModule.d.ts +20 -0
  80. package/types/particle/modules/EmissionModule.d.ts +45 -0
  81. package/types/particle/modules/MainModule.d.ts +70 -0
  82. package/types/particle/modules/ParticleCompositeCurve.d.ts +56 -0
  83. package/types/particle/modules/ParticleCompositeGradient.d.ts +55 -0
  84. package/types/particle/modules/ParticleCurve.d.ts +56 -0
  85. package/types/particle/modules/ParticleGeneratorModule.d.ts +12 -0
  86. package/types/particle/modules/ParticleGradient.d.ts +94 -0
  87. package/types/particle/modules/RotationOverLifetimeModule.d.ts +34 -0
  88. package/types/particle/modules/ShapeModule.d.ts +9 -0
  89. package/types/particle/modules/SizeOverLifetimeModule.d.ts +34 -0
  90. package/types/particle/modules/TextureSheetAnimationModule.d.ts +38 -0
  91. package/types/particle/modules/VelocityOverLifetimeModule.d.ts +34 -0
  92. package/types/particle/modules/shape/BaseShape.d.ts +12 -0
  93. package/types/particle/modules/shape/BoxShape.d.ts +11 -0
  94. package/types/particle/modules/shape/CircleShape.d.ts +17 -0
  95. package/types/particle/modules/shape/ConeShape.d.ts +28 -0
  96. package/types/particle/modules/shape/HemisphereShape.d.ts +9 -0
  97. package/types/particle/modules/shape/ShapeUtils.d.ts +1 -0
  98. package/types/particle/modules/shape/SphereShape.d.ts +9 -0
  99. package/types/particle/modules/shape/enums/ParticleShapeArcMode.d.ts +9 -0
  100. package/types/particle/modules/shape/enums/ParticleShapeMultiModeValue.d.ts +9 -0
  101. package/types/particle/modules/shape/enums/ParticleShapeType.d.ts +15 -0
  102. package/types/particle/modules/shape/index.d.ts +6 -0
  103. package/types/particle/moudules/Burst.d.ts +25 -0
  104. package/types/particle/moudules/Emission.d.ts +47 -0
  105. package/types/particle/moudules/EmissionModule.d.ts +49 -0
  106. package/types/particle/moudules/MainModule.d.ts +59 -0
  107. package/types/particle/moudules/ParticleCurve.d.ts +27 -0
  108. package/types/particle/moudules/ParticleGradient.d.ts +28 -0
  109. package/types/particle/moudules/ShapeModule.d.ts +7 -0
  110. package/types/particle/moudules/shape/BaseShape.d.ts +28 -0
  111. package/types/particle/moudules/shape/BoxShape.d.ts +20 -0
  112. package/types/particle/moudules/shape/CircleShape.d.ts +27 -0
  113. package/types/particle/moudules/shape/ConeShape.d.ts +35 -0
  114. package/types/particle/moudules/shape/HemisphereShape.d.ts +23 -0
  115. package/types/particle/moudules/shape/ShapeUtils.d.ts +1 -0
  116. package/types/particle/moudules/shape/SphereShape.d.ts +23 -0
  117. package/types/particle/moudules/shape/enums/ParticleShapeMultiModeValue.d.ts +9 -0
  118. package/types/particle/moudules/shape/enums/ParticleShapeType.d.ts +15 -0
  119. package/types/particle/moudules/shape/index.d.ts +5 -0
  120. package/types/physics/PhysicsScene.d.ts +6 -2
  121. package/types/renderingHardwareInterface/IPlatformBuffer.d.ts +0 -1
  122. package/types/shader/ShaderPart.d.ts +5 -0
  123. package/types/shader/SubShader.d.ts +0 -1
  124. package/types/shader/enums/RenderStateElementKey.d.ts +60 -0
  125. package/types/shaderlib/particle/index.d.ts +14 -0
  126. package/types/shadow/PipelinePass.d.ts +16 -0
  127. package/types/utils/BoolUpdateFlag.d.ts +12 -0
  128. package/types/utils/DisorderedArray.d.ts +18 -0
  129. package/types/utils/UpdateFlag.d.ts +20 -0
  130. package/types/utils/UpdateFlagManager.d.ts +1 -0
  131. package/types/utils/Utils.d.ts +31 -0
  132. package/types/xr/XRManager.d.ts +31 -0
  133. package/types/xr/component/XRPoseDriver.d.ts +10 -0
  134. package/types/xr/data/XRCamera.d.ts +6 -0
  135. package/types/xr/data/XRDevice.d.ts +9 -0
  136. package/types/xr/data/XRHandle.d.ts +10 -0
  137. package/types/xr/enum/EnumXRButton.d.ts +5 -0
  138. package/types/xr/enum/EnumXRDevicePhase.d.ts +4 -0
  139. package/types/xr/enum/EnumXRFeature.d.ts +9 -0
  140. package/types/xr/enum/EnumXRInputSource.d.ts +8 -0
  141. package/types/xr/enum/EnumXRMode.d.ts +7 -0
  142. package/types/xr/enum/EnumXRSubsystem.d.ts +4 -0
  143. package/types/xr/enum/EnumXRTrackingMode.d.ts +7 -0
  144. package/types/xr/feature/XRCameraManager.d.ts +21 -0
  145. package/types/xr/feature/XRFeature.d.ts +29 -0
  146. package/types/xr/feature/XRImageTrackManager.d.ts +10 -0
  147. package/types/xr/feature/XRInputManager.d.ts +16 -0
  148. package/types/xr/index.d.ts +18 -0
  149. package/types/xr/provider/XRProvider.d.ts +19 -0
  150. package/types/xr/subsystem/XRInputSubsystem.d.ts +5 -0
  151. package/types/xr/subsystem/XRSubsystem.d.ts +30 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@galacean/engine-core",
3
- "version": "0.9.19",
3
+ "version": "0.9.21",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "registry": "https://registry.npmjs.org"
@@ -15,10 +15,10 @@
15
15
  "types/**/*"
16
16
  ],
17
17
  "dependencies": {
18
- "@galacean/engine-math": "0.9.19"
18
+ "@galacean/engine-math": "0.9.21"
19
19
  },
20
20
  "devDependencies": {
21
- "@galacean/engine-design": "0.9.19"
21
+ "@galacean/engine-design": "0.9.21"
22
22
  },
23
23
  "scripts": {
24
24
  "b:types": "tsc"
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,16 @@
1
+ import { Engine } from "../Engine";
2
+ import { CullingResults } from "../RenderPipeline/CullingResults";
3
+ import { RenderContext } from "../RenderPipeline/RenderContext";
4
+ /**
5
+ * PipelinePass is a base class for all pipeline passes.
6
+ */
7
+ export declare abstract class PipelinePass {
8
+ protected _engine: Engine;
9
+ constructor(engine: Engine);
10
+ /**
11
+ * Called before rendering a camera, override this method to configure the camera If you need to configure the camera clear flag or render target.
12
+ * @param context - Rendering context
13
+ * @param cullingResults - Culling results
14
+ */
15
+ abstract onRender(context: RenderContext, cullingResults: CullingResults): void;
16
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -1,7 +1,14 @@
1
+ import { SubMesh } from "../graphic";
2
+ import { Primitive } from "../graphic/Primitive";
1
3
  import { Material } from "../material";
2
4
  import { Renderer } from "../Renderer";
3
- export declare class RenderData {
5
+ import { IPoolElement } from "./IPoolElement";
6
+ export declare class RenderData implements IPoolElement {
4
7
  component: Renderer;
5
8
  material: Material;
9
+ primitive: Primitive;
10
+ subPrimitive: SubMesh;
6
11
  multiRenderData: boolean;
12
+ setX(component: Renderer, material: Material, primitive: Primitive, subPrimitive: SubMesh): void;
13
+ dispose(): void;
7
14
  }
@@ -0,0 +1,12 @@
1
+ import { Renderer } from "../Renderer";
2
+ import { Primitive } from "../graphic/Primitive";
3
+ import { Material } from "../material/Material";
4
+ import { ShaderPass } from "../shader/ShaderPass";
5
+ import { IPoolElement } from "./IPoolElement";
6
+ export declare class RenderElementX implements IPoolElement {
7
+ shaderPasses: ReadonlyArray<ShaderPass>;
8
+ component: Renderer;
9
+ material: Material;
10
+ primitive: Primitive;
11
+ dispose(): void;
12
+ }
@@ -2,6 +2,8 @@
2
2
  * Pipeline stage.
3
3
  */
4
4
  export declare enum PipelineStage {
5
+ /** DepthOnly stage. */
6
+ DepthOnly = "DepthOnly",
5
7
  /** Shadow caster stage. */
6
8
  ShadowCaster = "ShadowCaster",
7
9
  /** Forward shading stage. */
@@ -0,0 +1,30 @@
1
+ export declare class Ticker {
2
+ private _vSyncCount;
3
+ private _vSyncCounter;
4
+ private _requestId;
5
+ private _animationLoop;
6
+ private _requestAnimationFrame;
7
+ private _cancelAnimationFrame;
8
+ /**
9
+ * The number of vertical synchronization means the number of vertical blanking for one frame.
10
+ * @remarks 0 means that the vertical synchronization is turned off.
11
+ */
12
+ get vSyncCount(): number;
13
+ set vSyncCount(value: number);
14
+ get requestAnimationFrame(): (...params: any[]) => any;
15
+ set requestAnimationFrame(func: (...params: any[]) => any);
16
+ get cancelAnimationFrame(): (...params: any[]) => any;
17
+ set cancelAnimationFrame(func: (...params: any[]) => any);
18
+ get animationLoop(): (...params: any[]) => any;
19
+ set animationLoop(func: (...params: any[]) => any);
20
+ /**
21
+ * Pause the engine.
22
+ */
23
+ pause(): void;
24
+ /**
25
+ * Resume the engine.
26
+ */
27
+ resume(): void;
28
+ private _onAnimationFrame;
29
+ constructor();
30
+ }
@@ -0,0 +1,8 @@
1
+ import { Rect } from "@galacean/engine-math";
2
+ import { AnimationCurve } from "./AnimationCurve";
3
+ /**
4
+ * Store a collection of Keyframes that can be evaluated over time.
5
+ */
6
+ export declare class AnimationRectCurve extends AnimationCurve<Rect> {
7
+ constructor();
8
+ }
@@ -0,0 +1,8 @@
1
+ import { ReferResource } from "../../asset/ReferResource";
2
+ import { AnimationCurve } from "./AnimationCurve";
3
+ /**
4
+ * Store a collection of Keyframes that can be evaluated over time.
5
+ */
6
+ export declare class AnimationRefCurve extends AnimationCurve<ReferResource> {
7
+ constructor();
8
+ }
@@ -1,5 +1,9 @@
1
1
  import { Engine } from "../Engine";
2
2
  import { ReferResource } from "./ReferResource";
3
3
  export declare abstract class GraphicsResource extends ReferResource {
4
+ /**
5
+ * Whether the content of the resource is lost.
6
+ */
7
+ get isContentLost(): boolean;
4
8
  protected constructor(engine: Engine);
5
9
  }
@@ -17,9 +17,13 @@ export declare class MultiExecutor {
17
17
  private interval;
18
18
  private _timeoutId;
19
19
  private _currentCount;
20
+ private _onComplete;
21
+ private _onError;
22
+ private _error;
20
23
  constructor(execFunc: (count?: number) => Promise<any>, totalCount: number, interval: number);
21
- private done;
22
- start(done?: Function): void;
23
- stop(): void;
24
+ start(): this;
25
+ onComplete(func: Function): this;
26
+ onError(func: Function): this;
27
+ cancel(): void;
24
28
  private exec;
25
29
  }
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Depth texture mode.
3
+ */
4
+ export declare enum DepthTextureMode {
5
+ None = 0,
6
+ PrePass = 1
7
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -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
+ }
@@ -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
+ }