@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
package/dist/composition.d.ts
CHANGED
|
@@ -1,23 +1,25 @@
|
|
|
1
|
-
import type { Ray } from '@galacean/effects-math/es/core/index';
|
|
2
1
|
import * as spec from '@galacean/effects-specification';
|
|
2
|
+
import type { Ray } from '@galacean/effects-math/es/core/ray';
|
|
3
|
+
import type { Vector3 } from '@galacean/effects-math/es/core/vector3';
|
|
3
4
|
import { Camera } from './camera';
|
|
4
5
|
import { CompositionComponent } from './comp-vfx-item';
|
|
5
|
-
import
|
|
6
|
+
import { CompositionSourceManager } from './composition-source-manager';
|
|
6
7
|
import type { PluginSystem } from './plugin-system';
|
|
7
|
-
import type { EventSystem, Region } from './plugins';
|
|
8
|
+
import type { EventSystem, Plugin, Region } from './plugins';
|
|
8
9
|
import type { MeshRendererOptions, Renderer } from './render';
|
|
9
10
|
import { RenderFrame } from './render';
|
|
10
|
-
import type { Scene } from './scene';
|
|
11
|
+
import type { Scene, SceneType } from './scene';
|
|
11
12
|
import type { Texture } from './texture';
|
|
12
|
-
import { Transform } from './transform';
|
|
13
13
|
import type { Disposable, LostHandler } from './utils';
|
|
14
|
-
import type {
|
|
14
|
+
import type { VFXItemProps } from './vfx-item';
|
|
15
15
|
import { VFXItem } from './vfx-item';
|
|
16
|
-
import type
|
|
16
|
+
import { type Matrix4 } from '@galacean/effects-math/es/core';
|
|
17
|
+
import type { PostProcessVolume } from './components/post-process-volume';
|
|
17
18
|
export interface CompositionStatistic {
|
|
18
19
|
loadTime: number;
|
|
19
20
|
loadStart: number;
|
|
20
21
|
firstFrameTime: number;
|
|
22
|
+
precompileTime: number;
|
|
21
23
|
}
|
|
22
24
|
export interface MessageItem {
|
|
23
25
|
id: string;
|
|
@@ -25,19 +27,26 @@ export interface MessageItem {
|
|
|
25
27
|
phrase: number;
|
|
26
28
|
compositionId: string;
|
|
27
29
|
}
|
|
30
|
+
export interface CompItemClickedData {
|
|
31
|
+
name: string;
|
|
32
|
+
id: string;
|
|
33
|
+
hitPositions: Vector3[];
|
|
34
|
+
position: Vector3;
|
|
35
|
+
}
|
|
28
36
|
/**
|
|
29
37
|
*
|
|
30
38
|
*/
|
|
31
39
|
export interface CompositionHitTestOptions {
|
|
32
40
|
maxCount?: number;
|
|
33
41
|
stop?: (region: Region) => boolean;
|
|
34
|
-
skip?: (item: VFXItem
|
|
42
|
+
skip?: (item: VFXItem) => boolean;
|
|
35
43
|
}
|
|
36
44
|
export interface CompositionProps {
|
|
37
45
|
reusable?: boolean;
|
|
38
46
|
baseRenderOrder?: number;
|
|
39
47
|
renderer: Renderer;
|
|
40
|
-
onPlayerPause?: (item: VFXItem
|
|
48
|
+
onPlayerPause?: (item: VFXItem) => void;
|
|
49
|
+
onItemClicked?: (item: VFXItem) => void;
|
|
41
50
|
onMessageItem?: (item: MessageItem) => void;
|
|
42
51
|
onEnd?: (composition: Composition) => void;
|
|
43
52
|
event?: EventSystem;
|
|
@@ -51,7 +60,6 @@ export interface CompositionProps {
|
|
|
51
60
|
* 也负责 Item 相关的动画播放控制,和持有渲染帧数据。
|
|
52
61
|
*/
|
|
53
62
|
export declare class Composition implements Disposable, LostHandler {
|
|
54
|
-
compositionSourceManager: CompositionSourceManager;
|
|
55
63
|
renderer: Renderer;
|
|
56
64
|
/**
|
|
57
65
|
* 当前帧的渲染数据对象
|
|
@@ -70,10 +78,6 @@ export declare class Composition implements Disposable, LostHandler {
|
|
|
70
78
|
* 合成渲染顺序,默认按升序渲染
|
|
71
79
|
*/
|
|
72
80
|
renderOrder: number;
|
|
73
|
-
/**
|
|
74
|
-
* 所有合成 Item 的根变换
|
|
75
|
-
*/
|
|
76
|
-
transform: Transform;
|
|
77
81
|
/**
|
|
78
82
|
* 播放完成后是否需要再使用,是的话生命周期结束后不会自动 dispose
|
|
79
83
|
*/
|
|
@@ -82,12 +86,18 @@ export declare class Composition implements Disposable, LostHandler {
|
|
|
82
86
|
* 是否播放完成后销毁 texture 对象
|
|
83
87
|
*/
|
|
84
88
|
keepResource: boolean;
|
|
85
|
-
extraCamera: VFXItem
|
|
89
|
+
extraCamera: VFXItem;
|
|
90
|
+
/**
|
|
91
|
+
* 合成内的元素否允许点击、拖拽交互
|
|
92
|
+
* @since 1.6.0
|
|
93
|
+
*/
|
|
94
|
+
interactive: boolean;
|
|
95
|
+
compositionSourceManager: CompositionSourceManager;
|
|
86
96
|
/**
|
|
87
97
|
* 合成结束行为是 spec.END_BEHAVIOR_PAUSE 或 spec.END_BEHAVIOR_PAUSE_AND_DESTROY 时执行的回调
|
|
88
98
|
* @internal
|
|
89
99
|
*/
|
|
90
|
-
onPlayerPause?: (item: VFXItem
|
|
100
|
+
onPlayerPause?: (item: VFXItem) => void;
|
|
91
101
|
/**
|
|
92
102
|
* 单个合成结束时的回调
|
|
93
103
|
*/
|
|
@@ -96,6 +106,14 @@ export declare class Composition implements Disposable, LostHandler {
|
|
|
96
106
|
* 合成中消息元素创建/销毁时触发的回调
|
|
97
107
|
*/
|
|
98
108
|
onMessageItem?: (item: MessageItem) => void;
|
|
109
|
+
/**
|
|
110
|
+
* 合成中元素点击时触发的回调
|
|
111
|
+
* 注意:此接口随时可能下线,请务使用!
|
|
112
|
+
* @since 1.6.0
|
|
113
|
+
* @ignore
|
|
114
|
+
* @deprecated
|
|
115
|
+
*/
|
|
116
|
+
onItemClicked?: (data: CompItemClickedData) => void;
|
|
99
117
|
/**
|
|
100
118
|
* 合成id
|
|
101
119
|
*/
|
|
@@ -128,10 +146,6 @@ export declare class Composition implements Disposable, LostHandler {
|
|
|
128
146
|
* 用于保存与当前合成相关的插件数据
|
|
129
147
|
*/
|
|
130
148
|
readonly loaderData: Record<string, any>;
|
|
131
|
-
/**
|
|
132
|
-
* 渲染等级:S,A+,A,B+,B
|
|
133
|
-
*/
|
|
134
|
-
readonly renderLevel?: spec.RenderLevel;
|
|
135
149
|
/**
|
|
136
150
|
* 场景加载和首帧渲染时间
|
|
137
151
|
*/
|
|
@@ -143,11 +157,11 @@ export declare class Composition implements Disposable, LostHandler {
|
|
|
143
157
|
/**
|
|
144
158
|
* 合成根元素
|
|
145
159
|
*/
|
|
146
|
-
rootItem: VFXItem
|
|
160
|
+
readonly rootItem: VFXItem;
|
|
147
161
|
/**
|
|
148
162
|
* 预合成数组
|
|
149
163
|
*/
|
|
150
|
-
readonly refContent: VFXItem
|
|
164
|
+
readonly refContent: VFXItem[];
|
|
151
165
|
/**
|
|
152
166
|
* 预合成的合成属性,在 content 中会被其元素属性覆盖
|
|
153
167
|
*/
|
|
@@ -160,6 +174,10 @@ export declare class Composition implements Disposable, LostHandler {
|
|
|
160
174
|
* 合成全局时间
|
|
161
175
|
*/
|
|
162
176
|
globalTime: number;
|
|
177
|
+
/**
|
|
178
|
+
* 后处理渲染配置
|
|
179
|
+
*/
|
|
180
|
+
globalVolume: PostProcessVolume;
|
|
163
181
|
protected rendererOptions: MeshRendererOptions | null;
|
|
164
182
|
protected assigned: boolean;
|
|
165
183
|
/**
|
|
@@ -171,31 +189,24 @@ export declare class Composition implements Disposable, LostHandler {
|
|
|
171
189
|
*/
|
|
172
190
|
protected readonly keepColorBuffer: boolean;
|
|
173
191
|
protected rootComposition: CompositionComponent;
|
|
192
|
+
protected readonly postLoaders: Plugin[];
|
|
174
193
|
/**
|
|
175
194
|
* 合成暂停/播放 标识
|
|
176
195
|
*/
|
|
177
196
|
private paused;
|
|
178
197
|
private lastVideoUpdateTime;
|
|
179
|
-
/**
|
|
180
|
-
* 后处理渲染配置
|
|
181
|
-
*/
|
|
182
|
-
private readonly globalVolume;
|
|
183
198
|
private readonly texInfo;
|
|
184
|
-
private readonly postLoaders;
|
|
185
|
-
private rootTimeline;
|
|
186
199
|
/**
|
|
187
200
|
* Composition 构造函数
|
|
188
201
|
* @param props - composition 的创建参数
|
|
189
202
|
* @param scene
|
|
190
203
|
* @param compositionSourceManager
|
|
191
204
|
*/
|
|
192
|
-
constructor(props: CompositionProps, scene: Scene
|
|
205
|
+
constructor(props: CompositionProps, scene: Scene);
|
|
193
206
|
/**
|
|
194
|
-
*
|
|
195
|
-
* @param {(composition: Composition) => void} func
|
|
196
|
-
* @deprecated since 2.0 - use `onEnd` instead
|
|
207
|
+
* 所有合成 Item 的根变换
|
|
197
208
|
*/
|
|
198
|
-
|
|
209
|
+
get transform(): import("@galacean/effects-core").Transform;
|
|
199
210
|
/**
|
|
200
211
|
* 获取场景中的纹理数组
|
|
201
212
|
*/
|
|
@@ -203,7 +214,7 @@ export declare class Composition implements Disposable, LostHandler {
|
|
|
203
214
|
/**
|
|
204
215
|
* 获取合成中所有元素
|
|
205
216
|
*/
|
|
206
|
-
get items(): VFXItem
|
|
217
|
+
get items(): VFXItem[];
|
|
207
218
|
/**
|
|
208
219
|
* 获取合成开始渲染的时间
|
|
209
220
|
*/
|
|
@@ -216,6 +227,8 @@ export declare class Composition implements Disposable, LostHandler {
|
|
|
216
227
|
* 获取销毁状态
|
|
217
228
|
*/
|
|
218
229
|
get isDestroyed(): boolean;
|
|
230
|
+
set viewportMatrix(matrix: Matrix4);
|
|
231
|
+
get viewportMatrix(): Matrix4;
|
|
219
232
|
/**
|
|
220
233
|
* 获取合成的时长
|
|
221
234
|
*/
|
|
@@ -239,6 +252,12 @@ export declare class Composition implements Disposable, LostHandler {
|
|
|
239
252
|
* @param speed - 速度
|
|
240
253
|
*/
|
|
241
254
|
setSpeed(speed: number): void;
|
|
255
|
+
/**
|
|
256
|
+
* 设置合成的可见性
|
|
257
|
+
* @since 2.0.0
|
|
258
|
+
* @param visible - 是否可见
|
|
259
|
+
*/
|
|
260
|
+
setVisible(visible: boolean): void;
|
|
242
261
|
/**
|
|
243
262
|
* 获取合成的动画速度
|
|
244
263
|
* @returns
|
|
@@ -273,7 +292,7 @@ export declare class Composition implements Disposable, LostHandler {
|
|
|
273
292
|
* @param time - 相对 startTime 的时间
|
|
274
293
|
*/
|
|
275
294
|
setTime(time: number): void;
|
|
276
|
-
addItem(item: VFXItem
|
|
295
|
+
addItem(item: VFXItem): void;
|
|
277
296
|
/**
|
|
278
297
|
* 前进合成到指定时间
|
|
279
298
|
* @param time - 相对0时刻的时间
|
|
@@ -285,6 +304,7 @@ export declare class Composition implements Disposable, LostHandler {
|
|
|
285
304
|
*/
|
|
286
305
|
protected reset(): void;
|
|
287
306
|
prepareRender(): void;
|
|
307
|
+
protected gatherRendererComponent(vfxItem: VFXItem, renderFrame: RenderFrame): void;
|
|
288
308
|
/**
|
|
289
309
|
* 是否合成需要重新播放
|
|
290
310
|
* @returns 重新播放合成标志位
|
|
@@ -301,6 +321,7 @@ export declare class Composition implements Disposable, LostHandler {
|
|
|
301
321
|
* @param skipRender - 是否需要渲染
|
|
302
322
|
*/
|
|
303
323
|
update(deltaTime: number, skipRender?: boolean): void;
|
|
324
|
+
private toLocalTime;
|
|
304
325
|
private getUpdateTime;
|
|
305
326
|
private callStart;
|
|
306
327
|
private callUpdate;
|
|
@@ -330,7 +351,7 @@ export declare class Composition implements Disposable, LostHandler {
|
|
|
330
351
|
* @param name - 元素名称
|
|
331
352
|
* @returns 元素对象
|
|
332
353
|
*/
|
|
333
|
-
getItemByName(name: string): VFXItem
|
|
354
|
+
getItemByName(name: string): VFXItem | undefined;
|
|
334
355
|
/**
|
|
335
356
|
* 获取指定位置和相机连成的射线
|
|
336
357
|
* @param x
|
|
@@ -342,7 +363,7 @@ export declare class Composition implements Disposable, LostHandler {
|
|
|
342
363
|
* 获取 engine 对象
|
|
343
364
|
* @returns
|
|
344
365
|
*/
|
|
345
|
-
getEngine(): import("
|
|
366
|
+
getEngine(): import("@galacean/effects-core").Engine;
|
|
346
367
|
/**
|
|
347
368
|
* Item 求交测试,返回求交结果列表,x 和 y 是归一化到[-1, 1]区间的值,原点在左上角
|
|
348
369
|
* @param x - 鼠标或触点的 x,已经归一化到[-1, 1]
|
|
@@ -356,13 +377,13 @@ export declare class Composition implements Disposable, LostHandler {
|
|
|
356
377
|
* @param item - 交互元素
|
|
357
378
|
* @param type - 交互类型
|
|
358
379
|
*/
|
|
359
|
-
addInteractiveItem(item: VFXItem
|
|
380
|
+
addInteractiveItem(item: VFXItem, type: spec.InteractType): string | undefined;
|
|
360
381
|
/**
|
|
361
382
|
* InteractItem 生命周期结束时的调用
|
|
362
383
|
* @param item - 交互元素
|
|
363
384
|
* @param type - 交互类型
|
|
364
385
|
*/
|
|
365
|
-
removeInteractiveItem(item: VFXItem
|
|
386
|
+
removeInteractiveItem(item: VFXItem, type: spec.InteractType): void;
|
|
366
387
|
/**
|
|
367
388
|
* 销毁插件 Item 中保存的纹理数组
|
|
368
389
|
* @internal
|
|
@@ -374,7 +395,7 @@ export declare class Composition implements Disposable, LostHandler {
|
|
|
374
395
|
* @internal
|
|
375
396
|
* @param item - 需要销毁的 item
|
|
376
397
|
*/
|
|
377
|
-
destroyItem(item: VFXItem
|
|
398
|
+
destroyItem(item: VFXItem): void;
|
|
378
399
|
lost(e: Event): void;
|
|
379
400
|
/**
|
|
380
401
|
* 合成对象销毁
|
|
@@ -392,6 +413,15 @@ export declare class Composition implements Disposable, LostHandler {
|
|
|
392
413
|
* 合成整体在水平方向移动 x 像素,垂直方向移动 y 像素
|
|
393
414
|
*/
|
|
394
415
|
translateByPixel(x: number, y: number): void;
|
|
416
|
+
/**
|
|
417
|
+
* 设置合成在画布上的像素位置
|
|
418
|
+
* Tips:
|
|
419
|
+
* - 坐标原点在 canvas 左上角,x 正方向水平向右, y 正方向垂直向下
|
|
420
|
+
* - 设置后会覆盖原有的位置信息
|
|
421
|
+
* @param x - x 坐标
|
|
422
|
+
* @param y - y 坐标
|
|
423
|
+
*/
|
|
424
|
+
setPositionByPixel(x: number, y: number): void;
|
|
395
425
|
/**
|
|
396
426
|
* 设置合成在 3D 坐标轴上相对当前的位移
|
|
397
427
|
*/
|
package/dist/constants.d.ts
CHANGED
|
@@ -4,8 +4,7 @@ export declare const SEMANTIC_PRE_COLOR_ATTACHMENT_SIZE_0 = "PRE_COLOR_SIZE_0";
|
|
|
4
4
|
export declare const SEMANTIC_MAIN_PRE_COLOR_ATTACHMENT_0 = "PRE_MAIN_COLOR_0";
|
|
5
5
|
export declare const SEMANTIC_MAIN_PRE_COLOR_ATTACHMENT_SIZE_0 = "PRE_MAIN_COLOR_SIZE_0";
|
|
6
6
|
export declare const PLAYER_OPTIONS_ENV_EDITOR = "editor";
|
|
7
|
-
export declare const FILTER_NAME_NONE = "none";
|
|
8
7
|
export declare const HELP_LINK: {
|
|
9
|
-
'Filter not imported': string;
|
|
10
8
|
'Item duration can\'t be less than 0': string;
|
|
9
|
+
'ValueType: 21/22 is not supported': string;
|
|
11
10
|
};
|
package/dist/decorators.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
+
import type { Constructor } from './utils';
|
|
1
2
|
export declare const effectsClassStore: Record<string, any>;
|
|
2
|
-
export declare function
|
|
3
|
-
export declare function serialize(sourceName?: string): (target:
|
|
4
|
-
export declare function
|
|
3
|
+
export declare function effectsClass(className: string): (target: Object, context?: unknown) => void;
|
|
4
|
+
export declare function serialize(type?: Constructor, sourceName?: string): (target: Object, propertyKey: string | symbol) => void;
|
|
5
|
+
export declare function getMergedStore(target: Object): Record<string, any> | undefined;
|
package/dist/downloader.d.ts
CHANGED
|
@@ -3,12 +3,6 @@ type ErrorHandler = (status: number, responseText: string) => void;
|
|
|
3
3
|
/**
|
|
4
4
|
*
|
|
5
5
|
*/
|
|
6
|
-
type VideoLoadOptions = {
|
|
7
|
-
/**
|
|
8
|
-
* 视频是否循环播放
|
|
9
|
-
*/
|
|
10
|
-
loop?: boolean;
|
|
11
|
-
};
|
|
12
6
|
/**
|
|
13
7
|
* JSON 值,它可以是字符串、数字、布尔值、对象或者 JSON 值的数组。
|
|
14
8
|
*
|
|
@@ -59,6 +53,15 @@ export declare function loadWebPOptional(png: string, webp?: string): Promise<{
|
|
|
59
53
|
image: HTMLImageElement;
|
|
60
54
|
url: string;
|
|
61
55
|
}>;
|
|
56
|
+
/**
|
|
57
|
+
* 异步加载一个 AVIF 图片文件,如果不支持 AVIF,则加载 PNG 图片文件
|
|
58
|
+
* @param png - PNG 图片文件的 URL
|
|
59
|
+
* @param avif - AVIF 图片文件的 URL
|
|
60
|
+
*/
|
|
61
|
+
export declare function loadAVIFOptional(png: string, avif?: string): Promise<{
|
|
62
|
+
image: HTMLImageElement;
|
|
63
|
+
url: string;
|
|
64
|
+
}>;
|
|
62
65
|
/**
|
|
63
66
|
* 异步加载一个图片文件
|
|
64
67
|
* @param source - 图片文件的 URL、Blob 或 HTMLImageElement 对象
|
|
@@ -77,7 +80,7 @@ export declare function loadBlob(url: string): Promise<Blob>;
|
|
|
77
80
|
/**
|
|
78
81
|
* 异步加载一个视频文件
|
|
79
82
|
* @param url - 视频文件的 URL 或 MediaProvider 对象
|
|
80
|
-
* @param options - 加载参数
|
|
81
83
|
*/
|
|
82
|
-
export declare function loadVideo(url: string | MediaProvider
|
|
84
|
+
export declare function loadVideo(url: string | MediaProvider): Promise<HTMLVideoElement>;
|
|
85
|
+
export declare function loadMedia(url: string | string[], loadFn: (url: string) => Promise<HTMLImageElement | HTMLVideoElement>): Promise<HTMLImageElement | HTMLVideoElement>;
|
|
83
86
|
export {};
|
package/dist/effects-object.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import type * as spec from '@galacean/effects-specification';
|
|
2
2
|
import type { Engine } from './engine';
|
|
3
3
|
/**
|
|
4
4
|
* @since 2.0.0
|
|
@@ -6,6 +6,7 @@ import type { Engine } from './engine';
|
|
|
6
6
|
*/
|
|
7
7
|
export declare abstract class EffectsObject {
|
|
8
8
|
engine: Engine;
|
|
9
|
+
static is(obj: unknown): obj is EffectsObject;
|
|
9
10
|
protected guid: string;
|
|
10
11
|
/**
|
|
11
12
|
* 存储需要序列化的数据
|
|
@@ -20,6 +21,6 @@ export declare abstract class EffectsObject {
|
|
|
20
21
|
*
|
|
21
22
|
* @param data - 对象的序列化的数据
|
|
22
23
|
*/
|
|
23
|
-
fromData(data: EffectsObjectData): void;
|
|
24
|
+
fromData(data: spec.EffectsObjectData): void;
|
|
24
25
|
dispose(): void;
|
|
25
26
|
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as spec from '@galacean/effects-specification';
|
|
2
|
+
interface FileSummary {
|
|
3
|
+
assetType: string;
|
|
4
|
+
guid: string;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* @since 2.0.0
|
|
8
|
+
* @internal
|
|
9
|
+
*/
|
|
10
|
+
export declare class EffectsPackage {
|
|
11
|
+
fileSummary: FileSummary;
|
|
12
|
+
exportObjectDatas: spec.EffectsObjectData[];
|
|
13
|
+
addData(effectsObjectData: spec.EffectsObjectData): void;
|
|
14
|
+
serializeToBinary(): Uint8Array;
|
|
15
|
+
deserializeFromBinary(buffer: Uint8Array): void;
|
|
16
|
+
private geometryDataToBinary;
|
|
17
|
+
private binaryToGeometryData;
|
|
18
|
+
}
|
|
19
|
+
export {};
|
package/dist/engine.d.ts
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as spec from '@galacean/effects-specification';
|
|
2
|
+
import type { Database, SceneData } from './asset-loader';
|
|
2
3
|
import { AssetLoader } from './asset-loader';
|
|
3
4
|
import type { EffectsObject } from './effects-object';
|
|
4
5
|
import type { Material } from './material';
|
|
5
6
|
import type { GPUCapability, Geometry, Mesh, RenderPass, Renderer, ShaderLibrary } from './render';
|
|
6
7
|
import type { Scene } from './scene';
|
|
7
|
-
import { Texture } from './texture';
|
|
8
|
+
import type { Texture } from './texture';
|
|
8
9
|
import type { Disposable } from './utils';
|
|
9
10
|
/**
|
|
10
|
-
* Engine 基类,负责维护所有 GPU
|
|
11
|
+
* Engine 基类,负责维护所有 GPU 资源的管理及销毁
|
|
11
12
|
*/
|
|
12
13
|
export declare class Engine implements Disposable {
|
|
13
14
|
renderer: Renderer;
|
|
@@ -18,6 +19,10 @@ export declare class Engine implements Disposable {
|
|
|
18
19
|
objectInstance: Record<string, EffectsObject>;
|
|
19
20
|
assetLoader: AssetLoader;
|
|
20
21
|
database?: Database;
|
|
22
|
+
/**
|
|
23
|
+
* 渲染过程中错误队列
|
|
24
|
+
*/
|
|
25
|
+
renderErrors: Set<Error>;
|
|
21
26
|
protected destroyed: boolean;
|
|
22
27
|
protected textures: Texture[];
|
|
23
28
|
protected materials: Material[];
|
|
@@ -30,13 +35,13 @@ export declare class Engine implements Disposable {
|
|
|
30
35
|
*/
|
|
31
36
|
static create: (gl: WebGLRenderingContext | WebGL2RenderingContext) => Engine;
|
|
32
37
|
clearResources(): void;
|
|
33
|
-
addEffectsObjectData(data: EffectsObjectData): void;
|
|
34
|
-
findEffectsObjectData(uuid: string): EffectsObjectData;
|
|
38
|
+
addEffectsObjectData(data: spec.EffectsObjectData): void;
|
|
39
|
+
findEffectsObjectData(uuid: string): spec.EffectsObjectData;
|
|
35
40
|
addInstance(effectsObject: EffectsObject): void;
|
|
36
41
|
getInstance(id: string): EffectsObject;
|
|
37
42
|
removeInstance(id: string): void;
|
|
38
43
|
addPackageDatas(scene: Scene): void;
|
|
39
|
-
|
|
44
|
+
createVFXItems(scene: Scene): Promise<void>;
|
|
40
45
|
addTexture(tex: Texture): void;
|
|
41
46
|
removeTexture(tex: Texture): void;
|
|
42
47
|
addMaterial(mat: Material): void;
|
|
@@ -49,7 +54,6 @@ export declare class Engine implements Disposable {
|
|
|
49
54
|
removeRenderPass(pass: RenderPass): void;
|
|
50
55
|
get isDestroyed(): boolean;
|
|
51
56
|
getShaderLibrary(): ShaderLibrary;
|
|
52
|
-
private createDefaultTexture;
|
|
53
57
|
/**
|
|
54
58
|
* 销毁所有缓存的资源
|
|
55
59
|
*/
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { BaseItem, Composition, CompressedImage, Image, JSONScene, ParticleItem, RenderLevel, SpriteItem, TemplateImage } from '@galacean/effects-specification';
|
|
2
|
+
export * from './utils';
|
|
3
|
+
export declare function getStandardJSON(json: any): JSONScene;
|
|
4
|
+
export declare function getStandardImage(image: any, index: number, imageTags: RenderLevel[]): TemplateImage | Image | CompressedImage;
|
|
5
|
+
export declare function getStandardComposition(composition: any, opt?: {
|
|
6
|
+
plugins?: string[];
|
|
7
|
+
requires?: string[];
|
|
8
|
+
}): Composition;
|
|
9
|
+
export declare function getStandardItem(item: any, opt?: {
|
|
10
|
+
plugins?: string[];
|
|
11
|
+
requires?: string[];
|
|
12
|
+
}): SpriteItem | ParticleItem | BaseItem;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { BaseContent, BinaryFile, JSONScene, JSONSceneLegacy, SpineResource, SpineContent } from '@galacean/effects-specification';
|
|
2
|
+
/**
|
|
3
|
+
* 2.1 以下版本数据适配(mars-player@2.4.0 及以上版本支持 2.1 以下数据的适配)
|
|
4
|
+
*/
|
|
5
|
+
export declare function version21Migration(json: JSONSceneLegacy): JSONSceneLegacy;
|
|
6
|
+
/**
|
|
7
|
+
* 2.2 以下版本数据适配(mars-player@2.5.0 及以上版本支持 2.2 以下数据的适配)
|
|
8
|
+
*/
|
|
9
|
+
export declare function version22Migration(json: JSONSceneLegacy): JSONSceneLegacy;
|
|
10
|
+
/**
|
|
11
|
+
* 3.0 以下版本数据适配(runtime 2.0及以上版本支持)
|
|
12
|
+
*/
|
|
13
|
+
export declare function version30Migration(json: JSONSceneLegacy): JSONScene;
|
|
14
|
+
/**
|
|
15
|
+
* 2.5 以下版本 赫尔米特数据转换成贝塞尔数据
|
|
16
|
+
*/
|
|
17
|
+
export declare function version24Migration(json: JSONScene): JSONScene;
|
|
18
|
+
export declare function convertParam(content?: BaseContent): void;
|
|
19
|
+
export declare function convertBinaryAsset(bins: BinaryFile[], jsonScene: JSONScene): void;
|
|
20
|
+
export declare function convertSpineData(resource: SpineResource, content: SpineContent, jsonScene: JSONScene): void;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { BaseItemTransform, NullContent, SpriteContent } from '@galacean/effects-specification';
|
|
2
|
+
export declare function getStandardNullContent(sprite: any, transform: BaseItemTransform): NullContent;
|
|
3
|
+
export declare function getStandardSpriteContent(sprite: any, transform: BaseItemTransform): SpriteContent;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { FixedNumberExpression, RGBAColorValue, ColorExpression, NumberExpression, GradientColor, FixedVec3Expression, vec4, vec3, BezierKeyframeValue, vec2 } from '@galacean/effects-specification';
|
|
2
|
+
import { ParticleOrigin } from '@galacean/effects-specification';
|
|
3
|
+
export declare function arrAdd<T>(arr: T[], item: T): boolean | undefined;
|
|
4
|
+
export declare function ensureFixedNumber(a: any): FixedNumberExpression | undefined;
|
|
5
|
+
export declare function ensureFixedNumberWithRandom(a: any, p: number): FixedNumberExpression | undefined;
|
|
6
|
+
export declare function ensureRGBAValue(a: any): RGBAColorValue;
|
|
7
|
+
export declare function ensureColorExpression(a: any, normalized?: boolean): ColorExpression | undefined;
|
|
8
|
+
export declare function ensureNumberExpression(a: any): NumberExpression | undefined;
|
|
9
|
+
export declare function ensureValueGetter(a: any): any;
|
|
10
|
+
export declare function ensureGradient(a: any, normalized?: boolean): GradientColor | undefined;
|
|
11
|
+
export declare function colorToArr(hex: string | number[], normalized?: boolean): vec4;
|
|
12
|
+
export declare function normalizeColor(a: number[]): number[] | undefined;
|
|
13
|
+
export declare function parsePercent(c: string): number;
|
|
14
|
+
export declare function getGradientColor(color: string | Array<string | number[]> | GradientColor, normalized?: boolean): GradientColor | undefined;
|
|
15
|
+
export declare function ensureFixedVec3(a: any): FixedVec3Expression | undefined;
|
|
16
|
+
export declare function objectValueToNumber(o: Record<string, any>): object;
|
|
17
|
+
export declare function deleteEmptyValue(o: Record<string, any>): object;
|
|
18
|
+
export declare function quatFromXYZRotation(out: vec4 | number[], x: number, y: number, z: number): vec4;
|
|
19
|
+
export declare function rotationZYXFromQuat(out: vec3 | number[], quat: vec4): vec3;
|
|
20
|
+
/**
|
|
21
|
+
* 提取并转换 JSON 数据中的 anchor 值
|
|
22
|
+
*/
|
|
23
|
+
export declare function convertAnchor(anchor?: vec2, particleOrigin?: ParticleOrigin): vec2;
|
|
24
|
+
export declare const particleOriginTranslateMap: Record<number, vec2>;
|
|
25
|
+
export declare function getBezierCurveFromHermiteInGE(geHermiteCurves: number[][]): BezierKeyframeValue[];
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export type GLType = 'webgl' | 'webgl2';
|
|
1
2
|
/**
|
|
2
3
|
* Helper class to create a WebGL Context
|
|
3
4
|
*
|
|
@@ -6,4 +7,4 @@
|
|
|
6
7
|
* @param options
|
|
7
8
|
* @returns
|
|
8
9
|
*/
|
|
9
|
-
export declare function createGLContext(canvas: HTMLCanvasElement | OffscreenCanvas, glType:
|
|
10
|
+
export declare function createGLContext(canvas: HTMLCanvasElement | OffscreenCanvas, glType: GLType | undefined, options: WebGLContextAttributes): WebGLRenderingContext | WebGL2RenderingContext;
|
package/dist/gl/index.d.ts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
|
+
import * as spec from '@galacean/effects-specification';
|
|
1
2
|
export * from './create-gl-context';
|
|
2
3
|
export * from './gpu-time';
|
|
3
4
|
export declare const initErrors: string[];
|
|
4
5
|
export declare const glContext: WebGL2RenderingContext;
|
|
5
6
|
export declare function initGLContext(): void;
|
|
6
7
|
export declare function isWebGL2(gl: WebGLRenderingContext | WebGL2RenderingContext): gl is WebGL2RenderingContext;
|
|
8
|
+
export declare function vertexFormatType2GLType(formatType: spec.VertexFormatType): spec.BufferType;
|
|
9
|
+
export declare function glType2VertexFormatType(webglType: spec.BufferType): spec.VertexFormatType;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
export * as math from '@galacean/effects-math/es/core/index';
|
|
2
2
|
export * as spec from '@galacean/effects-specification';
|
|
3
|
-
export
|
|
3
|
+
export * from './asset-loader';
|
|
4
4
|
export * from './asset-manager';
|
|
5
5
|
export * from './camera';
|
|
6
|
+
export * from './canvas-pool';
|
|
6
7
|
export * from './comp-vfx-item';
|
|
7
8
|
export * from './components';
|
|
8
9
|
export * from './composition';
|
|
@@ -10,10 +11,10 @@ export * from './composition-source-manager';
|
|
|
10
11
|
export * from './config';
|
|
11
12
|
export * from './constants';
|
|
12
13
|
export * from './decorators';
|
|
13
|
-
export * from './asset-loader';
|
|
14
14
|
export * from './downloader';
|
|
15
15
|
export * from './effects-object';
|
|
16
16
|
export * from './engine';
|
|
17
|
+
export { ensureFixedNumber, getStandardComposition, getStandardImage, getStandardItem, getStandardJSON, normalizeColor } from './fallback';
|
|
17
18
|
export * from './gl';
|
|
18
19
|
export * from './material';
|
|
19
20
|
export * from './math';
|
|
@@ -22,13 +23,16 @@ export * from './plugin-system';
|
|
|
22
23
|
export * from './plugins';
|
|
23
24
|
export * from './render';
|
|
24
25
|
export * from './scene';
|
|
25
|
-
export * from './
|
|
26
|
+
export * from './serialization-helper';
|
|
26
27
|
export * from './shader';
|
|
27
28
|
export * from './shape';
|
|
28
29
|
export * from './template-image';
|
|
29
30
|
export * from './texture';
|
|
30
|
-
export * from './serialization-helper';
|
|
31
31
|
export * from './ticker';
|
|
32
32
|
export * from './transform';
|
|
33
33
|
export * from './utils';
|
|
34
34
|
export * from './vfx-item';
|
|
35
|
+
export * from './binary-asset';
|
|
36
|
+
export * from './effects-object';
|
|
37
|
+
export * from './effects-package';
|
|
38
|
+
export declare const version: string;
|