@galacean/engine-core 1.1.0-alpha.1 → 1.1.0-alpha.2
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.
- package/dist/main.js +93 -31
- package/dist/main.js.map +1 -1
- package/dist/miniprogram.js +93 -31
- package/dist/module.js +93 -31
- package/dist/module.js.map +1 -1
- package/package.json +3 -3
- package/types/RenderPipeline/MeshRenderElement.d.ts +1 -3
- package/types/RenderPipeline/RenderElementX.d.ts +12 -0
- package/types/RenderPipeline/SpriteElement.d.ts +1 -3
- package/types/RenderPipeline/SpriteMaskElement.d.ts +1 -3
- package/types/RenderPipeline/TextRenderElement.d.ts +1 -3
- package/types/SafeLoopArray.d.ts +37 -0
- package/types/Ticker.d.ts +30 -0
- package/types/Transform.d.ts +1 -0
- package/types/animation/internal/AnimationCurveOwnerLayerData.d.ts +1 -0
- package/types/asset/Loader.d.ts +1 -1
- package/types/asset/ResourceManager.d.ts +8 -0
- package/types/graphic/Primitive.d.ts +1 -0
- package/types/graphic/PrimitiveVertexBinding.d.ts +1 -0
- package/types/graphic/SubPrimitive.d.ts +9 -0
- package/types/index.d.ts +1 -1
- package/types/particle/ParticleBufferUtils.d.ts +1 -0
- package/types/particle/ParticleData.d.ts +1 -0
- package/types/particle/ParticleGenerator.d.ts +72 -0
- package/types/particle/ParticleMaterial.d.ts +28 -0
- package/types/particle/ParticleMesh.d.ts +289 -0
- package/types/particle/ParticleShaderDeclaration.d.ts +1 -0
- package/types/particle/ParticleShaderMacro.d.ts +1 -0
- package/types/particle/ParticleShaderProperty.d.ts +1 -0
- package/types/particle/ParticleSystem.d.ts +41 -0
- package/types/particle/ParticleVertexElements.d.ts +1 -0
- package/types/particle/ParticleVertexUtils.d.ts +1 -0
- package/types/particle/enum/ParticleAnimationRowMode.d.ts +9 -0
- package/types/particle/enum/ParticleAnimationType.d.ts +9 -0
- package/types/particle/enum/ParticleCurveMode.d.ts +13 -0
- package/types/particle/enum/ParticleGradientMode.d.ts +13 -0
- package/types/particle/enum/ParticleRenderMode.d.ts +17 -0
- package/types/particle/enum/ParticleScaleMode.d.ts +11 -0
- package/types/particle/enum/ParticleShapeMultiModeValue.d.ts +9 -0
- package/types/particle/enum/ParticleShapeType.d.ts +15 -0
- package/types/particle/enum/ParticleSimulationSpace.d.ts +9 -0
- package/types/particle/enum/index.d.ts +9 -0
- package/types/particle/enums/ParticleCurveMode.d.ts +9 -0
- package/types/particle/enums/ParticleGradientMode.d.ts +9 -0
- package/types/particle/enums/ParticleRandomSubSeeds.d.ts +1 -0
- package/types/particle/enums/ParticleRenderMode.d.ts +17 -0
- package/types/particle/enums/ParticleScaleMode.d.ts +11 -0
- package/types/particle/enums/ParticleSimulationSpace.d.ts +9 -0
- package/types/particle/enums/ParticleStopMode.d.ts +6 -0
- package/types/particle/enums/attributes/BillboardParticleVertexAttribute.d.ts +1 -0
- package/types/particle/enums/attributes/MeshParticleVertexAttribute.d.ts +5 -0
- package/types/particle/enums/attributes/ParticleInstanceVertexAttribute.d.ts +1 -0
- package/types/particle/module/Burst.d.ts +38 -0
- package/types/particle/module/ColorGradient.d.ts +75 -0
- package/types/particle/module/ColorOverLifetimeModule.d.ts +20 -0
- package/types/particle/module/EmissionModule.d.ts +63 -0
- package/types/particle/module/FrameOverTime.d.ts +73 -0
- package/types/particle/module/ParticleCurve.d.ts +37 -0
- package/types/particle/module/RotationOverLifetimeModule.d.ts +21 -0
- package/types/particle/module/RotationVelocityGradient.d.ts +184 -0
- package/types/particle/module/SizeGradient.d.ts +151 -0
- package/types/particle/module/SizeOverLifetimeModule.d.ts +21 -0
- package/types/particle/module/StartFrame.d.ts +46 -0
- package/types/particle/module/TextureSheetAnimationModule.d.ts +37 -0
- package/types/particle/module/VelocityGradient.d.ts +110 -0
- package/types/particle/module/VelocityOverLifetimeModule.d.ts +22 -0
- package/types/particle/module/index.d.ts +15 -0
- package/types/particle/module/shape/BaseShape.d.ts +26 -0
- package/types/particle/module/shape/BoxShape.d.ts +20 -0
- package/types/particle/module/shape/CircleShape.d.ts +27 -0
- package/types/particle/module/shape/ConeShape.d.ts +35 -0
- package/types/particle/module/shape/HemisphereShape.d.ts +23 -0
- package/types/particle/module/shape/ShapeUtils.d.ts +1 -0
- package/types/particle/module/shape/SphereShape.d.ts +23 -0
- package/types/particle/module/shape/index.d.ts +5 -0
- package/types/particle/modules/Burst.d.ts +14 -0
- package/types/particle/modules/ColorOverLifetimeModule.d.ts +20 -0
- package/types/particle/modules/EmissionModule.d.ts +45 -0
- package/types/particle/modules/MainModule.d.ts +68 -0
- package/types/particle/modules/ParticleCompositeCurve.d.ts +56 -0
- package/types/particle/modules/ParticleCompositeGradient.d.ts +55 -0
- package/types/particle/modules/ParticleCurve.d.ts +56 -0
- package/types/particle/modules/ParticleGeneratorModule.d.ts +12 -0
- package/types/particle/modules/ParticleGradient.d.ts +94 -0
- package/types/particle/modules/RotationOverLifetimeModule.d.ts +34 -0
- package/types/particle/modules/ShapeModule.d.ts +9 -0
- package/types/particle/modules/SizeOverLifetimeModule.d.ts +34 -0
- package/types/particle/modules/TextureSheetAnimationModule.d.ts +42 -0
- package/types/particle/modules/VelocityOverLifetimeModule.d.ts +34 -0
- package/types/particle/modules/shape/BaseShape.d.ts +12 -0
- package/types/particle/modules/shape/BoxShape.d.ts +11 -0
- package/types/particle/modules/shape/CircleShape.d.ts +17 -0
- package/types/particle/modules/shape/ConeShape.d.ts +28 -0
- package/types/particle/modules/shape/HemisphereShape.d.ts +9 -0
- package/types/particle/modules/shape/ShapeUtils.d.ts +1 -0
- package/types/particle/modules/shape/SphereShape.d.ts +9 -0
- package/types/particle/modules/shape/enums/ParticleShapeArcMode.d.ts +9 -0
- package/types/particle/modules/shape/enums/ParticleShapeMultiModeValue.d.ts +9 -0
- package/types/particle/modules/shape/enums/ParticleShapeType.d.ts +15 -0
- package/types/particle/modules/shape/index.d.ts +6 -0
- package/types/particle/moudules/Burst.d.ts +25 -0
- package/types/particle/moudules/Emission.d.ts +47 -0
- package/types/particle/moudules/EmissionModule.d.ts +49 -0
- package/types/particle/moudules/MainModule.d.ts +59 -0
- package/types/particle/moudules/ParticleCurve.d.ts +27 -0
- package/types/particle/moudules/ParticleGradient.d.ts +28 -0
- package/types/particle/moudules/ShapeModule.d.ts +7 -0
- package/types/particle/moudules/shape/BaseShape.d.ts +28 -0
- package/types/particle/moudules/shape/BoxShape.d.ts +20 -0
- package/types/particle/moudules/shape/CircleShape.d.ts +27 -0
- package/types/particle/moudules/shape/ConeShape.d.ts +35 -0
- package/types/particle/moudules/shape/HemisphereShape.d.ts +23 -0
- package/types/particle/moudules/shape/ShapeUtils.d.ts +1 -0
- package/types/particle/moudules/shape/SphereShape.d.ts +23 -0
- package/types/particle/moudules/shape/enums/ParticleShapeMultiModeValue.d.ts +9 -0
- package/types/particle/moudules/shape/enums/ParticleShapeType.d.ts +15 -0
- package/types/particle/moudules/shape/index.d.ts +5 -0
- package/types/physics/PhysicsScene.d.ts +6 -2
- package/types/shaderlib/particle/index.d.ts +14 -0
- package/types/shadow/PipelinePass.d.ts +16 -0
- package/types/utils/BoolUpdateFlag.d.ts +12 -0
- package/types/utils/DisorderedArray.d.ts +18 -0
- package/types/utils/UpdateFlag.d.ts +20 -0
- package/types/utils/UpdateFlagManager.d.ts +1 -0
- package/types/utils/Utils.d.ts +31 -0
- package/types/xr/XRManager.d.ts +31 -0
- package/types/xr/component/XRPoseDriver.d.ts +10 -0
- package/types/xr/data/XRCamera.d.ts +6 -0
- package/types/xr/data/XRDevice.d.ts +9 -0
- package/types/xr/data/XRHandle.d.ts +10 -0
- package/types/xr/enum/EnumXRButton.d.ts +5 -0
- package/types/xr/enum/EnumXRDevicePhase.d.ts +4 -0
- package/types/xr/enum/EnumXRFeature.d.ts +9 -0
- package/types/xr/enum/EnumXRInputSource.d.ts +8 -0
- package/types/xr/enum/EnumXRMode.d.ts +7 -0
- package/types/xr/enum/EnumXRSubsystem.d.ts +4 -0
- package/types/xr/enum/EnumXRTrackingMode.d.ts +7 -0
- package/types/xr/feature/XRCameraManager.d.ts +21 -0
- package/types/xr/feature/XRFeature.d.ts +29 -0
- package/types/xr/feature/XRImageTrackManager.d.ts +10 -0
- package/types/xr/feature/XRInputManager.d.ts +16 -0
- package/types/xr/index.d.ts +18 -0
- package/types/xr/provider/XRProvider.d.ts +19 -0
- package/types/xr/subsystem/XRInputSubsystem.d.ts +5 -0
- 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": "1.1.0-alpha.
|
|
3
|
+
"version": "1.1.0-alpha.2",
|
|
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": "1.1.0-alpha.
|
|
18
|
+
"@galacean/engine-math": "1.1.0-alpha.2"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
|
-
"@galacean/engine-design": "1.1.0-alpha.
|
|
21
|
+
"@galacean/engine-design": "1.1.0-alpha.2"
|
|
22
22
|
},
|
|
23
23
|
"scripts": {
|
|
24
24
|
"b:types": "tsc"
|
|
@@ -4,16 +4,14 @@ import { Material } from "../material/Material";
|
|
|
4
4
|
import { Renderer } from "../Renderer";
|
|
5
5
|
import { ShaderPass } from "../shader/ShaderPass";
|
|
6
6
|
import { RenderState } from "../shader/state/RenderState";
|
|
7
|
-
import { IPoolElement } from "./IPoolElement";
|
|
8
7
|
import { RenderElement } from "./RenderElement";
|
|
9
8
|
/**
|
|
10
9
|
* Render element.
|
|
11
10
|
*/
|
|
12
|
-
export declare class MeshRenderElement extends RenderElement
|
|
11
|
+
export declare class MeshRenderElement extends RenderElement {
|
|
13
12
|
/** Mesh. */
|
|
14
13
|
mesh: Mesh;
|
|
15
14
|
/** Sub mesh. */
|
|
16
15
|
subMesh: SubMesh;
|
|
17
16
|
setValue(component: Renderer, mesh: Mesh, subMesh: SubMesh, material: Material, renderState: RenderState, shaderPass: ShaderPass): void;
|
|
18
|
-
dispose(): void;
|
|
19
17
|
}
|
|
@@ -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
|
+
}
|
|
@@ -4,12 +4,10 @@ import { Renderer } from "../Renderer";
|
|
|
4
4
|
import { ShaderPass } from "../shader";
|
|
5
5
|
import { RenderState } from "../shader/state/RenderState";
|
|
6
6
|
import { Texture2D } from "../texture";
|
|
7
|
-
import { IPoolElement } from "./IPoolElement";
|
|
8
7
|
import { RenderElement } from "./RenderElement";
|
|
9
|
-
export declare class SpriteElement extends RenderElement
|
|
8
|
+
export declare class SpriteElement extends RenderElement {
|
|
10
9
|
renderData: RenderData2D;
|
|
11
10
|
texture: Texture2D;
|
|
12
11
|
constructor();
|
|
13
12
|
setValue(component: Renderer, renderDate: RenderData2D, material: Material, texture: Texture2D, renderState: RenderState, shaderPass: ShaderPass): void;
|
|
14
|
-
dispose(): void;
|
|
15
13
|
}
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import { RenderData2D } from "../2d/data/RenderData2D";
|
|
2
2
|
import { Material } from "../material/Material";
|
|
3
3
|
import { Renderer } from "../Renderer";
|
|
4
|
-
import { IPoolElement } from "./IPoolElement";
|
|
5
4
|
import { RenderElement } from "./RenderElement";
|
|
6
|
-
export declare class SpriteMaskElement extends RenderElement
|
|
5
|
+
export declare class SpriteMaskElement extends RenderElement {
|
|
7
6
|
renderData: RenderData2D;
|
|
8
7
|
isAdd: boolean;
|
|
9
8
|
constructor();
|
|
10
9
|
setValue(component: Renderer, renderData: RenderData2D, material: Material): void;
|
|
11
|
-
dispose(): void;
|
|
12
10
|
}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import { IPoolElement } from "./IPoolElement";
|
|
2
1
|
import { RenderElement } from "./RenderElement";
|
|
3
2
|
import { SpriteElement } from "./SpriteElement";
|
|
4
|
-
export declare class TextRenderElement extends RenderElement
|
|
3
|
+
export declare class TextRenderElement extends RenderElement {
|
|
5
4
|
charElements: SpriteElement[];
|
|
6
5
|
constructor();
|
|
7
|
-
dispose(): void;
|
|
8
6
|
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export declare class SafeLoopArray<T> {
|
|
2
|
+
private _array;
|
|
3
|
+
private _loopArray;
|
|
4
|
+
private _loopArrayDirty;
|
|
5
|
+
/**
|
|
6
|
+
* Get the length of the array.
|
|
7
|
+
*/
|
|
8
|
+
get length(): number;
|
|
9
|
+
/**
|
|
10
|
+
* Push item to the array.
|
|
11
|
+
* @param item - The item which want to be pushed
|
|
12
|
+
*/
|
|
13
|
+
push(item: T): void;
|
|
14
|
+
/**
|
|
15
|
+
* Splice the array.
|
|
16
|
+
* @param index - The index of the array
|
|
17
|
+
* @param deleteCount - The count of the array which want to be deleted
|
|
18
|
+
* @param item - The item which want to be added
|
|
19
|
+
*/
|
|
20
|
+
splice(index: number, deleteCount: number, item?: T): void;
|
|
21
|
+
/**
|
|
22
|
+
* The index of the item.
|
|
23
|
+
* @param item - The item which want to get the index
|
|
24
|
+
* @returns Index of the item
|
|
25
|
+
*/
|
|
26
|
+
indexOf(item: T): number;
|
|
27
|
+
/**
|
|
28
|
+
* Get the array.
|
|
29
|
+
* @returns The array
|
|
30
|
+
*/
|
|
31
|
+
getArray(): ReadonlyArray<T>;
|
|
32
|
+
/**
|
|
33
|
+
* Get the array use for loop.
|
|
34
|
+
* @returns The array use for loop
|
|
35
|
+
*/
|
|
36
|
+
getLoopArray(): ReadonlyArray<T>;
|
|
37
|
+
}
|
|
@@ -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
|
+
}
|
package/types/Transform.d.ts
CHANGED
|
@@ -195,6 +195,7 @@ export declare class Transform extends Component {
|
|
|
195
195
|
* @returns Change flag
|
|
196
196
|
*/
|
|
197
197
|
registerWorldChangeFlag(): BoolUpdateFlag;
|
|
198
|
+
protected _onDestroy(): void;
|
|
198
199
|
/**
|
|
199
200
|
* Get worldMatrix: Will trigger the worldMatrix update of itself and all parent entities.
|
|
200
201
|
* Get worldPosition: Will trigger the worldMatrix, local position update of itself and the worldMatrix update of all parent entities.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/types/asset/Loader.d.ts
CHANGED
|
@@ -27,6 +27,6 @@ export declare abstract class Loader<T> {
|
|
|
27
27
|
private static _engineObjects;
|
|
28
28
|
constructor(useCache: boolean);
|
|
29
29
|
initialize?(engine: Engine, configuration: EngineConfiguration): Promise<void>;
|
|
30
|
-
abstract load(item: LoadItem, resourceManager: ResourceManager): AssetPromise<T
|
|
30
|
+
abstract load(item: LoadItem, resourceManager: ResourceManager): AssetPromise<T>;
|
|
31
31
|
request: <U>(url: string, config: RequestConfig) => AssetPromise<U>;
|
|
32
32
|
}
|
|
@@ -26,6 +26,7 @@ export declare class ResourceManager {
|
|
|
26
26
|
private _graphicResourcePool;
|
|
27
27
|
/** Restorable resource information pool, key is the `instanceID` of resource. */
|
|
28
28
|
private _contentRestorerPool;
|
|
29
|
+
private _subAssetPromiseCallbacks;
|
|
29
30
|
/**
|
|
30
31
|
* Create a ResourceManager.
|
|
31
32
|
* @param engine - Engine to which the current ResourceManager belongs
|
|
@@ -61,6 +62,12 @@ export declare class ResourceManager {
|
|
|
61
62
|
* @returns Resource object
|
|
62
63
|
*/
|
|
63
64
|
getFromCache<T>(url: string): T;
|
|
65
|
+
/**
|
|
66
|
+
* Find the resource by type.
|
|
67
|
+
* @param type - Resource type
|
|
68
|
+
* @returns - Resource collection
|
|
69
|
+
*/
|
|
70
|
+
findResourcesByType<T extends EngineObject>(type: new (...args: any[]) => T): T[];
|
|
64
71
|
/**
|
|
65
72
|
* Get asset url from instanceId.
|
|
66
73
|
* @param instanceId - Engine instance id
|
|
@@ -93,6 +100,7 @@ export declare class ResourceManager {
|
|
|
93
100
|
addContentRestorer<T extends EngineObject>(restorer: ContentRestorer<T>): void;
|
|
94
101
|
private _assignDefaultOptions;
|
|
95
102
|
private _loadSingleItem;
|
|
103
|
+
private _pushSubAssetPromiseCallback;
|
|
96
104
|
private _gc;
|
|
97
105
|
private _getResolveResource;
|
|
98
106
|
private _parseURL;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
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";
|
|
@@ -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 System.
|
|
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 system 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 system of the child entity
|
|
54
|
+
*/
|
|
55
|
+
play(withChildren?: boolean): void;
|
|
56
|
+
/**
|
|
57
|
+
* Stop emitting particles.
|
|
58
|
+
* @param withChildren - Whether to stop the particle system 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 _addNewParticlesToVertexBuffer;
|
|
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 {};
|