@galacean/effects-core 2.0.0-alpha.3 → 2.0.0-alpha.30
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/__definations__/fbeffects-object-data.d.ts +28 -0
- package/dist/__definations__/fbeffects-package-data.d.ts +26 -0
- package/dist/__definations__/fbgeometry-data.d.ts +77 -0
- package/dist/__definations__/fbsub-mesh.d.ts +26 -0
- package/dist/__definations__/fbvertex-channel.d.ts +33 -0
- package/dist/__definations__/fbvertex-data.d.ts +27 -0
- package/dist/__definations__/index.d.ts +6 -0
- package/dist/asset-loader.d.ts +8 -90
- package/dist/asset-manager.d.ts +1 -80
- package/dist/binary-asset.d.ts +6 -0
- package/dist/camera.d.ts +10 -1
- 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/index.d.ts +1 -0
- package/dist/components/post-process-volume.d.ts +15 -0
- package/dist/components/renderer-component.d.ts +1 -1
- package/dist/composition-source-manager.d.ts +8 -7
- package/dist/composition.d.ts +70 -40
- package/dist/constants.d.ts +1 -2
- package/dist/decorators.d.ts +4 -3
- package/dist/downloader.d.ts +11 -8
- package/dist/effects-object.d.ts +3 -2
- package/dist/effects-package.d.ts +19 -0
- 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 +8 -4
- package/dist/index.js +21126 -19663
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +21425 -19960
- package/dist/index.mjs.map +1 -1
- package/dist/material/material.d.ts +19 -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-playable.d.ts +2 -1
- package/dist/plugins/cal/calculate-item.d.ts +5 -39
- package/dist/plugins/cal/calculate-vfx-item.d.ts +54 -13
- package/dist/plugins/cal/playable-graph.d.ts +72 -21
- 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 +3 -3
- package/dist/plugins/interact/event-system.d.ts +0 -2
- package/dist/plugins/interact/interact-item.d.ts +15 -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 +5 -3
- package/dist/plugins/particle/particle-vfx-item.d.ts +8 -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 +28 -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 +33 -5
- package/dist/plugins/text/text-layout.d.ts +9 -1
- 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 +72 -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 +7 -5
- package/dist/render/gpu-capability.d.ts +6 -6
- package/dist/render/index.d.ts +3 -2
- package/dist/render/render-frame.d.ts +12 -12
- 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 +86 -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 +4 -0
- package/dist/utils/index.d.ts +29 -14
- package/dist/utils/text.d.ts +8 -0
- package/dist/vfx-item.d.ts +37 -61
- package/package.json +8 -6
- package/dist/asset-migrations.d.ts +0 -7
- package/dist/plugins/cal/animation-mixer-playable.d.ts +0 -4
- package/dist/plugins/cal/animation-playable-output.d.ts +0 -4
- package/dist/plugins/cal/track.d.ts +0 -34
- 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,21 +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
|
|
62
113
|
}
|
|
63
|
-
export declare
|
|
64
|
-
|
|
65
|
-
|
|
114
|
+
export declare enum PlayableTraversalMode {
|
|
115
|
+
Mix = 0,
|
|
116
|
+
Passthrough = 1
|
|
66
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,13 +46,13 @@ 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;
|
|
53
53
|
behavior?: spec.InteractBehavior;
|
|
54
54
|
parentId?: string;
|
|
55
|
-
hitPositions
|
|
55
|
+
hitPositions: Vector3[];
|
|
56
56
|
};
|
|
57
57
|
export type HitTestParams = {
|
|
58
58
|
camera: {
|
|
@@ -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;
|
|
@@ -15,6 +15,19 @@ export declare class InteractComponent extends RendererComponent {
|
|
|
15
15
|
bouncingArg: TouchEventType | null;
|
|
16
16
|
previewContent: InteractMesh | null;
|
|
17
17
|
interactData: spec.InteractContent;
|
|
18
|
+
/**
|
|
19
|
+
* 拖拽的惯性衰减系数,范围[0, 1], 越大惯性越强
|
|
20
|
+
*/
|
|
21
|
+
downgrade: number;
|
|
22
|
+
/**
|
|
23
|
+
* 拖拽的距离映射系数,越大越容易拖动
|
|
24
|
+
*/
|
|
25
|
+
dragRatio: number[];
|
|
26
|
+
/** 是否响应点击和拖拽交互事件 */
|
|
27
|
+
private _interactive;
|
|
28
|
+
private hasBeenAddedToComposition;
|
|
29
|
+
set interactive(enable: boolean);
|
|
30
|
+
get interactive(): boolean;
|
|
18
31
|
start(): void;
|
|
19
32
|
update(dt: number): void;
|
|
20
33
|
render(renderer: Renderer): void;
|
|
@@ -24,5 +37,6 @@ export declare class InteractComponent extends RendererComponent {
|
|
|
24
37
|
beginDragTarget(options: spec.DragInteractOption, eventSystem: EventSystem): void;
|
|
25
38
|
getHitTestParams: (force?: boolean) => HitTestTriangleParams | void;
|
|
26
39
|
getBoundingBox(): BoundingBoxTriangle | void;
|
|
27
|
-
fromData(data:
|
|
40
|
+
fromData(data: spec.InteractContent): void;
|
|
41
|
+
canInteract(): boolean;
|
|
28
42
|
}
|
|
@@ -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;
|
|
@@ -158,6 +158,7 @@ export declare class ParticleSystem extends Component {
|
|
|
158
158
|
get timePassed(): number;
|
|
159
159
|
get lifetime(): number;
|
|
160
160
|
get particleCount(): number;
|
|
161
|
+
isFrozen(): boolean;
|
|
161
162
|
initEmitterTransform(): void;
|
|
162
163
|
private updateEmitterTransform;
|
|
163
164
|
private addParticle;
|
|
@@ -192,6 +193,7 @@ export declare class ParticleSystem extends Component {
|
|
|
192
193
|
resumeParticleEmission(): void;
|
|
193
194
|
getBoundingBox(): void | BoundingBoxSphere;
|
|
194
195
|
getHitTestParams: (force?: boolean) => void | HitTestCustomParams;
|
|
195
|
-
|
|
196
|
+
onAttached(): void;
|
|
197
|
+
fromData(data: unknown): void;
|
|
196
198
|
}
|
|
197
199
|
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,10 @@ import { ParticleSystem } from './particle-system';
|
|
|
6
7
|
*/
|
|
7
8
|
export declare class ParticleBehaviourPlayable extends Playable {
|
|
8
9
|
particleSystem: ParticleSystem;
|
|
9
|
-
|
|
10
|
-
processFrame(
|
|
10
|
+
start(context: FrameContext): void;
|
|
11
|
+
processFrame(context: FrameContext): void;
|
|
11
12
|
}
|
|
13
|
+
export declare class ParticleBehaviourPlayableAsset extends PlayableAsset {
|
|
14
|
+
createPlayable(graph: PlayableGraph): Playable;
|
|
15
|
+
}
|
|
16
|
+
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,16 @@ 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
81
|
}
|
|
82
82
|
export declare class SpriteComponent extends RendererComponent {
|
|
83
83
|
renderer: SpriteItemRenderer;
|
|
@@ -90,8 +90,8 @@ export declare class SpriteComponent extends RendererComponent {
|
|
|
90
90
|
index: number[] | spec.TypedArray;
|
|
91
91
|
};
|
|
92
92
|
anchor?: vec2;
|
|
93
|
-
timelineComponent: TimelineComponent;
|
|
94
93
|
textureSheetAnimation?: spec.TextureSheetAnimation;
|
|
94
|
+
frameAnimationTime: number;
|
|
95
95
|
splits: splitsDataType;
|
|
96
96
|
emptyTexture: Texture;
|
|
97
97
|
color: vec4;
|
|
@@ -112,6 +112,19 @@ export declare class SpriteComponent extends RendererComponent {
|
|
|
112
112
|
* 获取当前 Mesh 的可见性。
|
|
113
113
|
*/
|
|
114
114
|
getVisible(): boolean;
|
|
115
|
+
/**
|
|
116
|
+
* 设置当前图层的颜色
|
|
117
|
+
* > Tips: 透明度也属于颜色的一部分,当有透明度/颜色 K 帧变化时,该 API 会失效
|
|
118
|
+
* @since 2.0.0
|
|
119
|
+
* @param color - 颜色值
|
|
120
|
+
*/
|
|
121
|
+
setColor(color: vec4): void;
|
|
122
|
+
/**
|
|
123
|
+
* 设置当前 Mesh 的纹理
|
|
124
|
+
* @since 2.0.0
|
|
125
|
+
* @param texture - 纹理对象
|
|
126
|
+
*/
|
|
127
|
+
setTexture(texture: Texture): void;
|
|
115
128
|
render(renderer: Renderer): void;
|
|
116
129
|
start(): void;
|
|
117
130
|
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,43 @@ 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
|
+
import type { VFXItem } from '../../vfx-item';
|
|
9
|
+
export declare const DEFAULT_FONTS: string[];
|
|
10
|
+
export interface TextComponent extends TextComponentBase {
|
|
11
|
+
}
|
|
7
12
|
/**
|
|
8
13
|
* @since 2.0.0
|
|
9
14
|
* @internal
|
|
10
15
|
*/
|
|
11
16
|
export declare class TextComponent extends SpriteComponent {
|
|
12
|
-
textStyle: TextStyle;
|
|
13
17
|
isDirty: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* 文本行数
|
|
20
|
+
*/
|
|
21
|
+
lineCount: number;
|
|
22
|
+
constructor(engine: Engine, props?: spec.TextContent);
|
|
23
|
+
update(dt: number): void;
|
|
24
|
+
fromData(data: SpriteItemProps): void;
|
|
25
|
+
updateWithOptions(options: spec.TextContentOptions): void;
|
|
26
|
+
updateTexture(flipY?: boolean): void;
|
|
27
|
+
}
|
|
28
|
+
export declare class TextComponentBase {
|
|
29
|
+
textStyle: TextStyle;
|
|
14
30
|
canvas: HTMLCanvasElement;
|
|
15
31
|
context: CanvasRenderingContext2D | null;
|
|
16
32
|
textLayout: TextLayout;
|
|
17
33
|
text: string;
|
|
34
|
+
/***** mix 类型兼容用 *****/
|
|
35
|
+
isDirty: boolean;
|
|
36
|
+
engine: Engine;
|
|
37
|
+
material: Material;
|
|
38
|
+
lineCount: number;
|
|
39
|
+
item: VFXItem;
|
|
40
|
+
/***** mix 类型兼容用 *****/
|
|
18
41
|
private char;
|
|
19
|
-
|
|
42
|
+
updateWithOptions(options: spec.TextContentOptions): void;
|
|
43
|
+
private getLineCount;
|
|
20
44
|
/**
|
|
21
45
|
* 设置字号大小
|
|
22
46
|
* @param value - 字号
|
|
@@ -107,13 +131,17 @@ export declare class TextComponent extends SpriteComponent {
|
|
|
107
131
|
* @returns
|
|
108
132
|
*/
|
|
109
133
|
setFontScale(value: number): void;
|
|
110
|
-
|
|
134
|
+
/**
|
|
135
|
+
* 设置自适应宽高开关
|
|
136
|
+
* @param value - 是否自适应宽高开关
|
|
137
|
+
* @returns
|
|
138
|
+
*/
|
|
139
|
+
setAutoWidth(value: boolean): void;
|
|
111
140
|
/**
|
|
112
141
|
* 更新文本
|
|
113
142
|
* @returns
|
|
114
143
|
*/
|
|
115
|
-
updateTexture(): void;
|
|
116
|
-
fromData(data: SpriteItemProps): void;
|
|
144
|
+
updateTexture(flipY?: boolean): void;
|
|
117
145
|
private getFontDesc;
|
|
118
146
|
private setupOutline;
|
|
119
147
|
private setupShadow;
|
|
@@ -17,7 +17,15 @@ export declare class TextLayout {
|
|
|
17
17
|
*/
|
|
18
18
|
lineHeight: number;
|
|
19
19
|
constructor(options: spec.TextContentOptions);
|
|
20
|
-
|
|
20
|
+
/**
|
|
21
|
+
* 获取初始的行高偏移值
|
|
22
|
+
* @param style - 字体基础数据
|
|
23
|
+
* @param lineCount - 渲染行数
|
|
24
|
+
* @param lineHeight - 渲染时的字体行高
|
|
25
|
+
* @param fontSize - 渲染时的字体大小
|
|
26
|
+
* @returns - 行高偏移值
|
|
27
|
+
*/
|
|
28
|
+
getOffsetY(style: TextStyle, lineCount: number, lineHeight: number, fontSize: number): number;
|
|
21
29
|
getOffsetX(style: TextStyle, maxWidth: number): number;
|
|
22
30
|
/**
|
|
23
31
|
* 设置文本框的宽度和高度
|
|
@@ -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
|
+
}
|