@galacean/effects-core 2.0.0-alpha.2 → 2.0.0-alpha.20
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/asset-loader.d.ts +8 -90
- package/dist/asset-manager.d.ts +1 -80
- package/dist/asset-migrations.d.ts +1 -3
- package/dist/binary-asset.d.ts +6 -0
- package/dist/canvas-pool.d.ts +10 -0
- package/dist/comp-vfx-item.d.ts +24 -10
- package/dist/components/component.d.ts +5 -5
- package/dist/components/effect-component.d.ts +1 -1
- package/dist/components/renderer-component.d.ts +1 -1
- package/dist/composition-source-manager.d.ts +7 -4
- package/dist/composition.d.ts +40 -35
- package/dist/constants.d.ts +1 -2
- package/dist/decorators.d.ts +5 -4
- package/dist/downloader.d.ts +2 -8
- package/dist/effects-object.d.ts +3 -2
- package/dist/engine.d.ts +11 -7
- package/dist/fallback/camera.d.ts +2 -0
- package/dist/fallback/index.d.ts +12 -0
- package/dist/fallback/interact.d.ts +2 -0
- package/dist/fallback/migration.d.ts +20 -0
- package/dist/fallback/particle.d.ts +2 -0
- package/dist/fallback/sprite.d.ts +3 -0
- package/dist/fallback/utils.d.ts +25 -0
- package/dist/gl/create-gl-context.d.ts +2 -1
- package/dist/gl/index.d.ts +3 -0
- package/dist/image-asset.d.ts +5 -0
- package/dist/index.d.ts +7 -4
- package/dist/index.js +19952 -20233
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +19602 -19878
- package/dist/index.mjs.map +1 -1
- package/dist/material/material.d.ts +18 -5
- package/dist/material/types.d.ts +0 -5
- package/dist/material/utils.d.ts +4 -4
- package/dist/math/bezier.d.ts +99 -0
- package/dist/math/keyframe-info.d.ts +39 -0
- package/dist/math/translate.d.ts +3 -2
- package/dist/math/utils.d.ts +6 -2
- package/dist/math/value-getter.d.ts +52 -26
- package/dist/pass-render-level.d.ts +3 -1
- package/dist/plugin-system.d.ts +3 -4
- package/dist/plugins/cal/animation-mixer-playable.d.ts +1 -1
- package/dist/plugins/cal/animation-playable-output.d.ts +1 -1
- package/dist/plugins/cal/animation-playable.d.ts +2 -1
- package/dist/plugins/cal/calculate-item.d.ts +5 -39
- package/dist/plugins/cal/calculate-vfx-item.d.ts +58 -12
- package/dist/plugins/cal/playable-graph.d.ts +73 -18
- package/dist/plugins/cal/timeline-asset.d.ts +27 -0
- package/dist/plugins/camera/camera-controller-node.d.ts +1 -12
- package/dist/plugins/index.d.ts +8 -3
- package/dist/plugins/interact/click-handler.d.ts +2 -2
- package/dist/plugins/interact/event-system.d.ts +0 -2
- package/dist/plugins/interact/interact-item.d.ts +1 -1
- package/dist/plugins/interact/interact-mesh.d.ts +1 -1
- package/dist/plugins/particle/particle-loader.d.ts +1 -1
- package/dist/plugins/particle/particle-mesh.d.ts +7 -7
- package/dist/plugins/particle/particle-system-renderer.d.ts +1 -1
- package/dist/plugins/particle/particle-system.d.ts +3 -3
- package/dist/plugins/particle/particle-vfx-item.d.ts +9 -3
- package/dist/plugins/particle/trail-mesh.d.ts +7 -7
- package/dist/plugins/plugin.d.ts +7 -8
- package/dist/plugins/sprite/sprite-item.d.ts +29 -15
- package/dist/plugins/sprite/sprite-mesh.d.ts +0 -4
- package/dist/plugins/text/index.d.ts +4 -0
- package/dist/plugins/text/text-item.d.ts +19 -5
- package/dist/plugins/timeline/playables/activation-mixer-playable.d.ts +7 -0
- package/dist/plugins/timeline/playables/sub-composition-clip-playable.d.ts +5 -0
- package/dist/plugins/timeline/playables/sub-composition-playable-asset.d.ts +5 -0
- package/dist/plugins/timeline/track.d.ts +73 -0
- package/dist/plugins/timeline/tracks/activation-track.d.ts +5 -0
- package/dist/plugins/timeline/tracks/sprite-color-track.d.ts +3 -0
- package/dist/plugins/timeline/tracks/sub-composition-track.d.ts +4 -0
- package/dist/plugins/timeline/tracks/transform-track.d.ts +3 -0
- package/dist/render/create-copy-shader.d.ts +1 -1
- package/dist/render/{frame-buffer.d.ts → framebuffer.d.ts} +7 -7
- package/dist/render/geometry.d.ts +14 -1
- package/dist/render/global-volume.d.ts +3 -0
- package/dist/render/gpu-capability.d.ts +6 -6
- package/dist/render/index.d.ts +3 -2
- package/dist/render/render-frame.d.ts +6 -6
- package/dist/render/render-pass.d.ts +10 -10
- package/dist/render/{render-buffer.d.ts → renderbuffer.d.ts} +4 -4
- package/dist/render/renderer.d.ts +7 -6
- package/dist/render/semantic-map.d.ts +14 -0
- package/dist/render/shader.d.ts +12 -5
- package/dist/scene.d.ts +82 -4
- package/dist/serialization-helper.d.ts +6 -4
- package/dist/shader/index.d.ts +0 -11
- package/dist/shape/shape.d.ts +1 -1
- package/dist/shape/sphere.d.ts +0 -3
- package/dist/template-image.d.ts +10 -0
- package/dist/texture/texture.d.ts +8 -0
- package/dist/texture/types.d.ts +2 -2
- package/dist/texture/utils.d.ts +2 -1
- package/dist/ticker.d.ts +2 -2
- package/dist/transform.d.ts +3 -3
- package/dist/utils/array.d.ts +1 -1
- package/dist/utils/device.d.ts +1 -0
- package/dist/utils/index.d.ts +28 -14
- package/dist/utils/text.d.ts +8 -0
- package/dist/vfx-item.d.ts +36 -54
- package/package.json +5 -5
- package/dist/plugins/cal/track.d.ts +0 -35
- package/dist/semantic-map.d.ts +0 -14
- package/dist/template-image/index.d.ts +0 -67
- package/dist/template-image/qcanvas-viewer.d.ts +0 -21
- package/dist/template-image/qtext.d.ts +0 -96
- package/dist/template-image/template-v1.d.ts +0 -27
- package/dist/template-image/text-metrics.d.ts +0 -18
- package/dist/utils/timeline-component.d.ts +0 -6
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { EffectsObject } from '../../effects-object';
|
|
2
|
+
import type { Disposable } from '../../utils';
|
|
2
3
|
/**
|
|
3
4
|
* 动画图,负责更新所有的动画节点
|
|
4
5
|
* @since 2.0.0
|
|
@@ -6,36 +7,70 @@ import type { VFXItem, VFXItemContent } from '../../vfx-item';
|
|
|
6
7
|
*/
|
|
7
8
|
export declare class PlayableGraph {
|
|
8
9
|
private playableOutputs;
|
|
9
|
-
|
|
10
|
+
private playables;
|
|
10
11
|
evaluate(dt: number): void;
|
|
11
|
-
connect(source: Playable, destination: Playable): void;
|
|
12
|
+
connect(source: Playable, sourceOutputPort: number, destination: Playable, destinationInputPort: number): void;
|
|
12
13
|
addOutput(output: PlayableOutput): void;
|
|
13
|
-
|
|
14
|
+
addPlayable(playable: Playable): void;
|
|
15
|
+
private processFrameWithRoot;
|
|
16
|
+
private prepareFrameWithRoot;
|
|
17
|
+
private updatePlayableTime;
|
|
14
18
|
}
|
|
15
19
|
/**
|
|
16
20
|
* 动画图可播放节点对象
|
|
17
21
|
* @since 2.0.0
|
|
18
22
|
* @internal
|
|
19
23
|
*/
|
|
20
|
-
export declare class Playable {
|
|
21
|
-
|
|
24
|
+
export declare class Playable implements Disposable {
|
|
25
|
+
onPlayablePlayFlag: boolean;
|
|
26
|
+
onPlayablePauseFlag: boolean;
|
|
27
|
+
overrideTimeNextEvaluation: boolean;
|
|
28
|
+
private destroyed;
|
|
22
29
|
private inputs;
|
|
30
|
+
private inputOuputPorts;
|
|
31
|
+
private inputWeight;
|
|
32
|
+
private outputs;
|
|
33
|
+
private playState;
|
|
34
|
+
private traversalMode;
|
|
23
35
|
/**
|
|
24
36
|
* 当前本地播放的时间
|
|
25
37
|
*/
|
|
26
38
|
protected time: number;
|
|
27
|
-
constructor();
|
|
28
|
-
|
|
39
|
+
constructor(graph: PlayableGraph, inputCount?: number);
|
|
40
|
+
play(): void;
|
|
41
|
+
pause(): void;
|
|
42
|
+
connectInput(inputPort: number, sourcePlayable: Playable, sourceOutputPort: number, weight?: number): void;
|
|
43
|
+
addInput(sourcePlayable: Playable, sourceOutputPort: number, weight?: number): void;
|
|
44
|
+
getInputCount(): number;
|
|
29
45
|
getInputs(): Playable[];
|
|
30
|
-
getInput(index: number): Playable
|
|
46
|
+
getInput(index: number): Playable;
|
|
47
|
+
getOutputCount(): number;
|
|
48
|
+
getOutputs(): Playable[];
|
|
49
|
+
getOutput(index: number): Playable;
|
|
50
|
+
getInputWeight(inputIndex: number): number;
|
|
51
|
+
setInputWeight(playable: Playable, weight: number): void;
|
|
52
|
+
setInputWeight(inputIndex: number, weight: number): void;
|
|
31
53
|
setTime(time: number): void;
|
|
32
54
|
getTime(): number;
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
55
|
+
getPlayState(): PlayState;
|
|
56
|
+
setTraversalMode(mode: PlayableTraversalMode): void;
|
|
57
|
+
getTraversalMode(): PlayableTraversalMode;
|
|
58
|
+
onPlayablePlay(context: FrameContext): void;
|
|
59
|
+
onPlayablePause(context: FrameContext): void;
|
|
60
|
+
prepareFrame(context: FrameContext): void;
|
|
61
|
+
processFrame(context: FrameContext): void;
|
|
37
62
|
onPlayableDestroy(): void;
|
|
38
|
-
|
|
63
|
+
dispose(): void;
|
|
64
|
+
/**
|
|
65
|
+
* @internal
|
|
66
|
+
*/
|
|
67
|
+
prepareFrameRecursive(context: FrameContext, passthroughPort: number): void;
|
|
68
|
+
/**
|
|
69
|
+
* @internal
|
|
70
|
+
*/
|
|
71
|
+
processFrameRecursive(context: FrameContext, passthroughPort: number): void;
|
|
72
|
+
private setOutput;
|
|
73
|
+
private setInput;
|
|
39
74
|
}
|
|
40
75
|
/**
|
|
41
76
|
* 动画图输出节点对象,将动画数据采样到绑定的元素属性上
|
|
@@ -46,17 +81,37 @@ export declare class PlayableOutput {
|
|
|
46
81
|
/**
|
|
47
82
|
* 绑定到的动画 item
|
|
48
83
|
*/
|
|
49
|
-
|
|
84
|
+
userData: object;
|
|
50
85
|
/**
|
|
51
86
|
* 源 playable 对象
|
|
52
87
|
*/
|
|
53
88
|
sourcePlayable: Playable;
|
|
89
|
+
context: FrameContext;
|
|
54
90
|
/**
|
|
55
91
|
* 当前本地播放的时间
|
|
56
92
|
*/
|
|
57
93
|
protected time: number;
|
|
94
|
+
private sourceOutputPort;
|
|
58
95
|
constructor();
|
|
59
|
-
setSourcePlayeble(playable: Playable): void;
|
|
60
|
-
|
|
61
|
-
|
|
96
|
+
setSourcePlayeble(playable: Playable, port?: number): void;
|
|
97
|
+
getSourceOutputPort(): number;
|
|
98
|
+
setUserData(value: object): void;
|
|
99
|
+
getUserData(): object;
|
|
100
|
+
prepareFrame(): void;
|
|
101
|
+
processFrame(): void;
|
|
102
|
+
}
|
|
103
|
+
export declare abstract class PlayableAsset extends EffectsObject {
|
|
104
|
+
abstract createPlayable(graph: PlayableGraph): Playable;
|
|
105
|
+
}
|
|
106
|
+
export interface FrameContext {
|
|
107
|
+
deltaTime: number;
|
|
108
|
+
output: PlayableOutput;
|
|
109
|
+
}
|
|
110
|
+
export declare enum PlayState {
|
|
111
|
+
Playing = 0,
|
|
112
|
+
Paused = 1
|
|
113
|
+
}
|
|
114
|
+
export declare enum PlayableTraversalMode {
|
|
115
|
+
Mix = 0,
|
|
116
|
+
Passthrough = 1
|
|
62
117
|
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { DataPath, EffectsObjectData } from '@galacean/effects-specification';
|
|
2
|
+
import type { RuntimeClip, TrackAsset } from '../timeline/track';
|
|
3
|
+
import type { FrameContext, PlayableGraph } from './playable-graph';
|
|
4
|
+
import { Playable, PlayableAsset } from './playable-graph';
|
|
5
|
+
import type { Constructor } from '../../utils';
|
|
6
|
+
export interface TimelineAssetData extends EffectsObjectData {
|
|
7
|
+
tracks: DataPath[];
|
|
8
|
+
}
|
|
9
|
+
export declare class TimelineAsset extends PlayableAsset {
|
|
10
|
+
tracks: TrackAsset[];
|
|
11
|
+
createPlayable(graph: PlayableGraph): Playable;
|
|
12
|
+
createTrack<T extends TrackAsset>(classConstructor: Constructor<T>, parent: TrackAsset, name?: string): T;
|
|
13
|
+
fromData(data: TimelineAssetData): void;
|
|
14
|
+
}
|
|
15
|
+
export declare class TimelinePlayable extends Playable {
|
|
16
|
+
clips: RuntimeClip[];
|
|
17
|
+
prepareFrame(context: FrameContext): void;
|
|
18
|
+
evaluate(): void;
|
|
19
|
+
compileTracks(graph: PlayableGraph, tracks: TrackAsset[]): void;
|
|
20
|
+
private sortTracks;
|
|
21
|
+
private addSubTracksRecursive;
|
|
22
|
+
}
|
|
23
|
+
export declare class TrackSortWrapper {
|
|
24
|
+
track: TrackAsset;
|
|
25
|
+
originalIndex: number;
|
|
26
|
+
constructor(track: TrackAsset, originalIndex: number);
|
|
27
|
+
}
|
|
@@ -1,20 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
import type * as spec from '@galacean/effects-specification';
|
|
1
|
+
import * as spec from '@galacean/effects-specification';
|
|
3
2
|
import { ItemBehaviour } from '../../components';
|
|
4
3
|
import type { Engine } from '../../engine';
|
|
5
4
|
export declare class CameraController extends ItemBehaviour {
|
|
6
|
-
near: number;
|
|
7
|
-
far: number;
|
|
8
|
-
fov: number;
|
|
9
|
-
clipMode?: spec.CameraClipMode;
|
|
10
|
-
position: Vector3;
|
|
11
|
-
rotation: Euler;
|
|
12
5
|
private options;
|
|
13
|
-
private translateOverLifetime?;
|
|
14
|
-
private rotationOverLifetime?;
|
|
15
6
|
constructor(engine: Engine, props?: spec.CameraContent);
|
|
16
|
-
start(): void;
|
|
17
7
|
update(): void;
|
|
18
8
|
fromData(data: spec.CameraContent): void;
|
|
19
|
-
private updateCamera;
|
|
20
9
|
}
|
package/dist/plugins/index.d.ts
CHANGED
|
@@ -18,6 +18,11 @@ export * from './particle/particle-system-renderer';
|
|
|
18
18
|
export * from './cal/calculate-loader';
|
|
19
19
|
export * from './cal/calculate-vfx-item';
|
|
20
20
|
export * from './cal/calculate-item';
|
|
21
|
-
export * from './
|
|
22
|
-
export * from './
|
|
23
|
-
export * from './
|
|
21
|
+
export * from './timeline/track';
|
|
22
|
+
export * from './timeline/tracks/transform-track';
|
|
23
|
+
export * from './timeline/tracks/activation-track';
|
|
24
|
+
export * from './timeline/tracks/sprite-color-track';
|
|
25
|
+
export * from './timeline/tracks/sub-composition-track';
|
|
26
|
+
export * from './timeline/playables/sub-composition-playable-asset';
|
|
27
|
+
export * from './cal/timeline-asset';
|
|
28
|
+
export * from './text';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Matrix4, Ray, TriangleLike, Vector2, Vector3 } from '@galacean/effects-math/es/core/index';
|
|
2
2
|
import type * as spec from '@galacean/effects-specification';
|
|
3
|
-
import type { VFXItem
|
|
3
|
+
import type { VFXItem } from '../../vfx-item';
|
|
4
4
|
export declare enum HitTestType {
|
|
5
5
|
triangle = 1,
|
|
6
6
|
box = 2,
|
|
@@ -46,7 +46,7 @@ export interface HitTestCustomParams {
|
|
|
46
46
|
behavior?: spec.InteractBehavior;
|
|
47
47
|
}
|
|
48
48
|
export type Region = {
|
|
49
|
-
compContent: VFXItem
|
|
49
|
+
compContent: VFXItem;
|
|
50
50
|
name: string;
|
|
51
51
|
id: string;
|
|
52
52
|
position: Vector3;
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import * as spec from '@galacean/effects-specification';
|
|
2
1
|
import type { Disposable } from '../../utils';
|
|
3
2
|
export declare const EVENT_TYPE_CLICK = "click";
|
|
4
3
|
export declare const EVENT_TYPE_TOUCH_START = "touchstart";
|
|
5
4
|
export declare const EVENT_TYPE_TOUCH_MOVE = "touchmove";
|
|
6
5
|
export declare const EVENT_TYPE_TOUCH_END = "touchend";
|
|
7
|
-
export declare const InteractBehavior: typeof spec.InteractBehavior;
|
|
8
6
|
export type TouchEventType = {
|
|
9
7
|
x: number;
|
|
10
8
|
y: number;
|
|
@@ -24,5 +24,5 @@ export declare class InteractComponent extends RendererComponent {
|
|
|
24
24
|
beginDragTarget(options: spec.DragInteractOption, eventSystem: EventSystem): void;
|
|
25
25
|
getHitTestParams: (force?: boolean) => HitTestTriangleParams | void;
|
|
26
26
|
getBoundingBox(): BoundingBoxTriangle | void;
|
|
27
|
-
fromData(data:
|
|
27
|
+
fromData(data: spec.InteractContent): void;
|
|
28
28
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type * as spec from '@galacean/effects-specification';
|
|
2
|
+
import type { Engine } from '../../engine';
|
|
2
3
|
import type { MeshRendererOptions } from '../../render';
|
|
3
4
|
import { Mesh } from '../../render';
|
|
4
5
|
import type { Transform } from '../../transform';
|
|
5
|
-
import type { Engine } from '../../engine';
|
|
6
6
|
export declare class InteractMesh {
|
|
7
7
|
private readonly transform;
|
|
8
8
|
private readonly engine;
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import type * as spec from '@galacean/effects-specification';
|
|
2
|
-
import type { Matrix4 } from '@galacean/effects-math/es/core/
|
|
3
|
-
import { Vector2
|
|
4
|
-
import
|
|
5
|
-
import type {
|
|
2
|
+
import type { Matrix4 } from '@galacean/effects-math/es/core/matrix4';
|
|
3
|
+
import { Vector2 } from '@galacean/effects-math/es/core/vector2';
|
|
4
|
+
import { Vector3 } from '@galacean/effects-math/es/core/vector3';
|
|
5
|
+
import type { Engine } from '../../engine';
|
|
6
|
+
import { ValueGetter } from '../../math';
|
|
7
|
+
import type { GPUCapability, SharedShaderWithSource } from '../../render';
|
|
6
8
|
import { Geometry, Mesh } from '../../render';
|
|
7
9
|
import { Texture } from '../../texture';
|
|
8
10
|
import { Transform } from '../../transform';
|
|
9
|
-
import type { Engine } from '../../engine';
|
|
10
11
|
export type Point = {
|
|
11
12
|
vel: Vector3;
|
|
12
13
|
lifetime: number;
|
|
@@ -66,7 +67,6 @@ export interface ParticleMeshProps extends ParticleMeshData {
|
|
|
66
67
|
mask: number;
|
|
67
68
|
maskMode: number;
|
|
68
69
|
side: number;
|
|
69
|
-
filter?: spec.FilterParams;
|
|
70
70
|
transparentOcclusion?: boolean;
|
|
71
71
|
matrix?: Matrix4;
|
|
72
72
|
sprite?: {
|
|
@@ -151,7 +151,7 @@ export declare class ParticleMesh implements ParticleMeshData {
|
|
|
151
151
|
removePoint(index: number): void;
|
|
152
152
|
setPoint(index: number, point: Point): void;
|
|
153
153
|
}
|
|
154
|
-
export declare function getParticleMeshShader(item: spec.ParticleItem,
|
|
154
|
+
export declare function getParticleMeshShader(item: spec.ParticleItem, gpuCapability: GPUCapability, env?: string): {
|
|
155
155
|
shader: SharedShaderWithSource;
|
|
156
156
|
vertex: number;
|
|
157
157
|
fragment: number;
|
|
@@ -15,7 +15,7 @@ export declare class ParticleSystemRenderer extends RendererComponent {
|
|
|
15
15
|
meshes: Mesh[];
|
|
16
16
|
particleMesh: ParticleMesh;
|
|
17
17
|
private trailMesh?;
|
|
18
|
-
constructor(engine: Engine, particleMeshProps
|
|
18
|
+
constructor(engine: Engine, particleMeshProps?: ParticleMeshProps, trailMeshProps?: TrailMeshProps);
|
|
19
19
|
start(): void;
|
|
20
20
|
update(dt: number): void;
|
|
21
21
|
render(renderer: Renderer): void;
|
|
@@ -48,7 +48,7 @@ type ParticleOptions = {
|
|
|
48
48
|
maxCount: number;
|
|
49
49
|
gravity: vec3;
|
|
50
50
|
gravityModifier: ValueGetter<number>;
|
|
51
|
-
renderLevel?:
|
|
51
|
+
renderLevel?: spec.RenderLevel;
|
|
52
52
|
particleFollowParent?: boolean;
|
|
53
53
|
forceTarget?: {
|
|
54
54
|
curve: ValueGetter<number>;
|
|
@@ -141,7 +141,7 @@ export declare class ParticleSystem extends Component {
|
|
|
141
141
|
textureSheetAnimation?: ParticleTextureSheetAnimation;
|
|
142
142
|
interaction?: ParticleInteraction;
|
|
143
143
|
emissionStopped: boolean;
|
|
144
|
-
|
|
144
|
+
destroyed: boolean;
|
|
145
145
|
props: ParticleSystemProps;
|
|
146
146
|
private generatedCount;
|
|
147
147
|
private lastUpdate;
|
|
@@ -192,6 +192,6 @@ export declare class ParticleSystem extends Component {
|
|
|
192
192
|
resumeParticleEmission(): void;
|
|
193
193
|
getBoundingBox(): void | BoundingBoxSphere;
|
|
194
194
|
getHitTestParams: (force?: boolean) => void | HitTestCustomParams;
|
|
195
|
-
fromData(data:
|
|
195
|
+
fromData(data: unknown): void;
|
|
196
196
|
}
|
|
197
197
|
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { FrameContext, PlayableGraph } from '../cal/playable-graph';
|
|
2
|
+
import { Playable, PlayableAsset } from '../cal/playable-graph';
|
|
2
3
|
import { ParticleSystem } from './particle-system';
|
|
3
4
|
/**
|
|
4
5
|
* @since 2.0.0
|
|
@@ -6,6 +7,11 @@ import { ParticleSystem } from './particle-system';
|
|
|
6
7
|
*/
|
|
7
8
|
export declare class ParticleBehaviourPlayable extends Playable {
|
|
8
9
|
particleSystem: ParticleSystem;
|
|
9
|
-
|
|
10
|
-
|
|
10
|
+
lastTime: number;
|
|
11
|
+
start(context: FrameContext): void;
|
|
12
|
+
processFrame(context: FrameContext): void;
|
|
11
13
|
}
|
|
14
|
+
export declare class ParticleBehaviourPlayableAsset extends PlayableAsset {
|
|
15
|
+
createPlayable(graph: PlayableGraph): Playable;
|
|
16
|
+
}
|
|
17
|
+
export declare const particleUniformTypeMap: Record<string, string>;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import type * as spec from '@galacean/effects-specification';
|
|
2
|
-
import type { vec4, GradientStop } from '@galacean/effects-specification';
|
|
3
|
-
import { Vector3 } from '@galacean/effects-math/es/core/index';
|
|
4
1
|
import type { Matrix4 } from '@galacean/effects-math/es/core/index';
|
|
5
|
-
import
|
|
2
|
+
import { Vector3 } from '@galacean/effects-math/es/core/index';
|
|
3
|
+
import type * as spec from '@galacean/effects-specification';
|
|
4
|
+
import type { GradientStop, vec4 } from '@galacean/effects-specification';
|
|
5
|
+
import type { Engine } from '../../engine';
|
|
6
|
+
import { ValueGetter } from '../../math';
|
|
7
|
+
import type { GPUCapability, ShaderWithSource } from '../../render';
|
|
6
8
|
import { Geometry, Mesh } from '../../render';
|
|
7
9
|
import { Texture } from '../../texture';
|
|
8
|
-
import type { Engine } from '../../engine';
|
|
9
|
-
import type { ValueGetter } from '../../math';
|
|
10
10
|
export type TrailMeshProps = {
|
|
11
11
|
maxTrailCount: number;
|
|
12
12
|
pointCountPerTrail: number;
|
|
@@ -56,4 +56,4 @@ export declare class TrailMesh {
|
|
|
56
56
|
setPointStartPos(index: number, pos: Vector3): void;
|
|
57
57
|
onUpdate(escapeTime: number): any;
|
|
58
58
|
}
|
|
59
|
-
export declare function getTrailMeshShader(trails: spec.ParticleTrail, particleMaxCount: number, name: string,
|
|
59
|
+
export declare function getTrailMeshShader(trails: spec.ParticleTrail, particleMaxCount: number, name: string, gpuCapability: GPUCapability, env?: string): ShaderWithSource;
|
package/dist/plugins/plugin.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type * as spec from '@galacean/effects-specification';
|
|
2
|
-
import type { SceneLoadOptions } from '../
|
|
3
|
-
import type { Scene } from '../scene';
|
|
2
|
+
import type { Scene, SceneLoadOptions } from '../scene';
|
|
4
3
|
import type { VFXItem } from '../vfx-item';
|
|
5
4
|
import type { RenderFrame, Renderer } from '../render';
|
|
6
5
|
import type { Composition } from '../composition';
|
|
@@ -22,21 +21,21 @@ export interface Plugin {
|
|
|
22
21
|
* @param composition
|
|
23
22
|
* @param item
|
|
24
23
|
*/
|
|
25
|
-
onCompositionItemLifeBegin: (composition: Composition, item: VFXItem
|
|
24
|
+
onCompositionItemLifeBegin: (composition: Composition, item: VFXItem) => void;
|
|
26
25
|
/**
|
|
27
26
|
* 合成生命周期结束时触发(无论结束行为)
|
|
28
27
|
* 合成播放阶段只触发一次此函数
|
|
29
28
|
* @param composition
|
|
30
29
|
* @param item
|
|
31
30
|
*/
|
|
32
|
-
onCompositionItemLifeEnd: (composition: Composition, item: VFXItem
|
|
31
|
+
onCompositionItemLifeEnd: (composition: Composition, item: VFXItem) => void;
|
|
33
32
|
/**
|
|
34
33
|
* 合成销毁时触发(当合成的结束行为是冻结、循环或合成配置了 reusable 时不触发)
|
|
35
34
|
* 元素销毁应该在合成销毁时调用。
|
|
36
35
|
* @param composition
|
|
37
36
|
* @param item
|
|
38
37
|
*/
|
|
39
|
-
onCompositionItemRemoved: (composition: Composition, item: VFXItem
|
|
38
|
+
onCompositionItemRemoved: (composition: Composition, item: VFXItem) => void;
|
|
40
39
|
/**
|
|
41
40
|
* 合成重播时的回调
|
|
42
41
|
* @param composition
|
|
@@ -113,9 +112,9 @@ export declare abstract class AbstractPlugin implements Plugin {
|
|
|
113
112
|
*/
|
|
114
113
|
static precompile(compositions: spec.Composition[], renderer: Renderer): Promise<void>;
|
|
115
114
|
onCompositionConstructed(composition: Composition, scene: Scene): void;
|
|
116
|
-
onCompositionItemLifeBegin(composition: Composition, item: VFXItem
|
|
117
|
-
onCompositionItemLifeEnd(composition: Composition, item: VFXItem
|
|
118
|
-
onCompositionItemRemoved(composition: Composition, item: VFXItem
|
|
115
|
+
onCompositionItemLifeBegin(composition: Composition, item: VFXItem): void;
|
|
116
|
+
onCompositionItemLifeEnd(composition: Composition, item: VFXItem): void;
|
|
117
|
+
onCompositionItemRemoved(composition: Composition, item: VFXItem): void;
|
|
119
118
|
onCompositionReset(composition: Composition, frame: RenderFrame): void;
|
|
120
119
|
onCompositionWillReset(composition: Composition, frame: RenderFrame): void;
|
|
121
120
|
onCompositionDestroyed(composition: Composition): void;
|
|
@@ -9,9 +9,8 @@ import type { Renderer } from '../../render';
|
|
|
9
9
|
import { Geometry } from '../../render';
|
|
10
10
|
import type { GeometryFromShape } from '../../shape';
|
|
11
11
|
import type { Texture } from '../../texture';
|
|
12
|
-
import type {
|
|
13
|
-
import {
|
|
14
|
-
import { Playable } from '../cal/playable-graph';
|
|
12
|
+
import type { FrameContext, PlayableGraph } from '../cal/playable-graph';
|
|
13
|
+
import { Playable, PlayableAsset } from '../cal/playable-graph';
|
|
15
14
|
import type { BoundingBoxTriangle, HitTestTriangleParams } from '../interact/click-handler';
|
|
16
15
|
/**
|
|
17
16
|
* 用于创建 spriteItem 的数据类型, 经过处理后的 spec.SpriteContent
|
|
@@ -23,17 +22,14 @@ export interface SpriteItemProps extends Omit<spec.SpriteContent, 'renderer'> {
|
|
|
23
22
|
shape: GeometryFromShape;
|
|
24
23
|
texture: Texture;
|
|
25
24
|
} & Omit<spec.RendererOptions, 'texture'>;
|
|
26
|
-
filter?: {
|
|
27
|
-
feather: number | spec.FunctionExpression;
|
|
28
|
-
} & Omit<spec.FilterParams, 'feather'>;
|
|
29
25
|
}
|
|
30
26
|
/**
|
|
31
27
|
* 图层元素基础属性, 经过处理后的 spec.SpriteContent.options
|
|
32
28
|
*/
|
|
33
29
|
export type SpriteItemOptions = {
|
|
34
30
|
startColor: vec4;
|
|
35
|
-
renderLevel?:
|
|
36
|
-
}
|
|
31
|
+
renderLevel?: spec.RenderLevel;
|
|
32
|
+
};
|
|
37
33
|
/**
|
|
38
34
|
* 图层元素渲染属性, 经过处理后的 spec.SpriteContent.renderer
|
|
39
35
|
*/
|
|
@@ -72,12 +68,17 @@ export declare class SpriteColorPlayable extends Playable {
|
|
|
72
68
|
startColor: spec.RGBAColorValue;
|
|
73
69
|
renderColor: vec4;
|
|
74
70
|
spriteMaterial: Material;
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
71
|
+
processFrame(context: FrameContext): void;
|
|
72
|
+
create(clipData: SpriteColorPlayableAssetData): this;
|
|
73
|
+
}
|
|
74
|
+
export declare class SpriteColorPlayableAsset extends PlayableAsset {
|
|
75
|
+
data: SpriteColorPlayableAssetData;
|
|
76
|
+
createPlayable(graph: PlayableGraph): Playable;
|
|
77
|
+
fromData(data: SpriteColorPlayableAssetData): void;
|
|
78
|
+
}
|
|
79
|
+
export interface SpriteColorPlayableAssetData extends spec.EffectsObjectData {
|
|
80
|
+
colorOverLifetime?: spec.ColorOverLifetime;
|
|
81
|
+
startColor?: spec.RGBAColorValue;
|
|
81
82
|
}
|
|
82
83
|
export declare class SpriteComponent extends RendererComponent {
|
|
83
84
|
renderer: SpriteItemRenderer;
|
|
@@ -90,8 +91,8 @@ export declare class SpriteComponent extends RendererComponent {
|
|
|
90
91
|
index: number[] | spec.TypedArray;
|
|
91
92
|
};
|
|
92
93
|
anchor?: vec2;
|
|
93
|
-
timelineComponent: TimelineComponent;
|
|
94
94
|
textureSheetAnimation?: spec.TextureSheetAnimation;
|
|
95
|
+
frameAnimationTime: number;
|
|
95
96
|
splits: splitsDataType;
|
|
96
97
|
emptyTexture: Texture;
|
|
97
98
|
color: vec4;
|
|
@@ -112,6 +113,19 @@ export declare class SpriteComponent extends RendererComponent {
|
|
|
112
113
|
* 获取当前 Mesh 的可见性。
|
|
113
114
|
*/
|
|
114
115
|
getVisible(): boolean;
|
|
116
|
+
/**
|
|
117
|
+
* 设置当前图层的颜色
|
|
118
|
+
* > Tips: 透明度也属于颜色的一部分,当有透明度/颜色 K 帧变化时,该 API 会失效
|
|
119
|
+
* @since 2.0.0
|
|
120
|
+
* @param color - 颜色值
|
|
121
|
+
*/
|
|
122
|
+
setColor(color: vec4): void;
|
|
123
|
+
/**
|
|
124
|
+
* 设置当前 Mesh 的纹理
|
|
125
|
+
* @since 2.0.0
|
|
126
|
+
* @param texture - 纹理对象
|
|
127
|
+
*/
|
|
128
|
+
setTexture(texture: Texture): void;
|
|
115
129
|
render(renderer: Renderer): void;
|
|
116
130
|
start(): void;
|
|
117
131
|
update(dt: number): void;
|
|
@@ -20,16 +20,12 @@ export type SpriteRegionData = {
|
|
|
20
20
|
size: spec.vec2;
|
|
21
21
|
};
|
|
22
22
|
export declare let maxSpriteMeshItemCount: number;
|
|
23
|
-
export declare let maxSpriteTextureCount: number;
|
|
24
23
|
export declare function setSpriteMeshMaxItemCountByGPU(gpuCapability: GPUCapabilityDetail): 16 | 32 | undefined;
|
|
25
24
|
export declare function getImageItemRenderInfo(item: SpriteComponent): SpriteItemRenderInfo;
|
|
26
25
|
export declare function spriteMeshShaderFromFilter(level: number, options?: {
|
|
27
|
-
count?: number;
|
|
28
|
-
ignoreBlend?: boolean;
|
|
29
26
|
wireframe?: boolean;
|
|
30
27
|
env?: string;
|
|
31
28
|
}): SharedShaderWithSource;
|
|
32
29
|
export declare function spriteMeshShaderIdFromRenderInfo(renderInfo: SpriteItemRenderInfo, count: number): string;
|
|
33
30
|
export declare function spriteMeshShaderFromRenderInfo(renderInfo: SpriteItemRenderInfo, count: number, level: number, env?: string): SharedShaderWithSource;
|
|
34
31
|
export declare function setMaxSpriteMeshItemCount(count: number): void;
|
|
35
|
-
export declare function setSpriteMeshMaxFragmentTextures(count: number): void;
|
|
@@ -4,19 +4,35 @@ import type { SpriteItemProps } from '../sprite/sprite-item';
|
|
|
4
4
|
import { SpriteComponent } from '../sprite/sprite-item';
|
|
5
5
|
import { TextLayout } from './text-layout';
|
|
6
6
|
import { TextStyle } from './text-style';
|
|
7
|
+
import type { Material } from '../../material';
|
|
8
|
+
export declare const DEFAULT_FONTS: string[];
|
|
9
|
+
export interface TextComponent extends TextComponentBase {
|
|
10
|
+
}
|
|
7
11
|
/**
|
|
8
12
|
* @since 2.0.0
|
|
9
13
|
* @internal
|
|
10
14
|
*/
|
|
11
15
|
export declare class TextComponent extends SpriteComponent {
|
|
12
|
-
textStyle: TextStyle;
|
|
13
16
|
isDirty: boolean;
|
|
17
|
+
constructor(engine: Engine, props?: spec.TextContent);
|
|
18
|
+
update(dt: number): void;
|
|
19
|
+
fromData(data: SpriteItemProps): void;
|
|
20
|
+
updateWithOptions(options: spec.TextContentOptions): void;
|
|
21
|
+
updateTexture(flipY?: boolean): void;
|
|
22
|
+
}
|
|
23
|
+
export declare class TextComponentBase {
|
|
24
|
+
textStyle: TextStyle;
|
|
14
25
|
canvas: HTMLCanvasElement;
|
|
15
26
|
context: CanvasRenderingContext2D | null;
|
|
16
27
|
textLayout: TextLayout;
|
|
17
28
|
text: string;
|
|
29
|
+
/***** mix 类型兼容用 *****/
|
|
30
|
+
isDirty: boolean;
|
|
31
|
+
engine: Engine;
|
|
32
|
+
material: Material;
|
|
33
|
+
/***** mix 类型兼容用 *****/
|
|
18
34
|
private char;
|
|
19
|
-
|
|
35
|
+
updateWithOptions(options: spec.TextContentOptions): void;
|
|
20
36
|
/**
|
|
21
37
|
* 设置字号大小
|
|
22
38
|
* @param value - 字号
|
|
@@ -107,13 +123,11 @@ export declare class TextComponent extends SpriteComponent {
|
|
|
107
123
|
* @returns
|
|
108
124
|
*/
|
|
109
125
|
setFontScale(value: number): void;
|
|
110
|
-
update(dt: number): void;
|
|
111
126
|
/**
|
|
112
127
|
* 更新文本
|
|
113
128
|
* @returns
|
|
114
129
|
*/
|
|
115
|
-
updateTexture(): void;
|
|
116
|
-
fromData(data: SpriteItemProps): void;
|
|
130
|
+
updateTexture(flipY?: boolean): void;
|
|
117
131
|
private getFontDesc;
|
|
118
132
|
private setupOutline;
|
|
119
133
|
private setupShadow;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { FrameContext } from '../../cal/playable-graph';
|
|
2
|
+
import { Playable } from '../../cal/playable-graph';
|
|
3
|
+
export declare class ActivationMixerPlayable extends Playable {
|
|
4
|
+
processFrame(context: FrameContext): void;
|
|
5
|
+
private hideRendererComponents;
|
|
6
|
+
private showRendererComponents;
|
|
7
|
+
}
|