@galacean/effects-core 2.1.0-alpha.1 → 2.1.0-alpha.10
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/animation/color-playable.d.ts +26 -0
- package/dist/animation/index.d.ts +1 -0
- package/dist/asset-manager.d.ts +15 -7
- package/dist/asset.d.ts +4 -0
- package/dist/binary-asset.d.ts +2 -2
- package/dist/comp-vfx-item.d.ts +2 -5
- package/dist/components/base-render-component.d.ts +108 -0
- package/dist/components/effect-component.d.ts +3 -34
- package/dist/components/fake-3d-component.d.ts +28 -0
- package/dist/components/index.d.ts +3 -0
- package/dist/components/mesh-component.d.ts +21 -0
- package/dist/components/post-process-volume.d.ts +5 -3
- package/dist/components/shape-component.d.ts +291 -0
- package/dist/composition/scene-ticking.d.ts +15 -1
- package/dist/composition-source-manager.d.ts +5 -6
- package/dist/composition.d.ts +29 -23
- package/dist/downloader.d.ts +0 -3
- package/dist/effects-object.d.ts +23 -0
- package/dist/engine.d.ts +9 -0
- package/dist/events/event-emitter.d.ts +6 -0
- package/dist/events/types.d.ts +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +22231 -19196
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +19639 -16607
- package/dist/index.mjs.map +1 -1
- package/dist/math/index.d.ts +1 -1
- package/dist/math/translate.d.ts +1 -1
- package/dist/math/value-getters/color-curve.d.ts +12 -0
- package/dist/math/value-getters/index.d.ts +4 -0
- package/dist/math/value-getters/value-getter-map.d.ts +2 -0
- package/dist/math/{value-getter.d.ts → value-getters/value-getter.d.ts} +6 -4
- package/dist/math/value-getters/vector4-curve.d.ts +12 -0
- package/dist/plugin-system.d.ts +7 -5
- package/dist/plugins/cal/calculate-item.d.ts +5 -3
- package/dist/plugins/cal/calculate-loader.d.ts +1 -1
- package/dist/plugins/cal/calculate-vfx-item.d.ts +1 -1
- package/dist/plugins/cal/playable-graph.d.ts +1 -2
- package/dist/plugins/camera/camera-vfx-item-loader.d.ts +1 -1
- package/dist/plugins/index.d.ts +2 -7
- package/dist/plugins/interact/interact-item.d.ts +12 -0
- package/dist/plugins/interact/interact-loader.d.ts +1 -1
- package/dist/plugins/interact/mesh-collider.d.ts +15 -0
- package/dist/plugins/particle/burst.d.ts +2 -0
- package/dist/plugins/particle/particle-mesh.d.ts +8 -5
- package/dist/plugins/particle/particle-system.d.ts +3 -4
- package/dist/plugins/plugin.d.ts +14 -3
- package/dist/plugins/shape/build-adaptive-bezier.d.ts +1 -0
- package/dist/plugins/shape/ellipse.d.ts +79 -0
- package/dist/plugins/shape/graphics-path.d.ts +65 -0
- package/dist/plugins/shape/point-data.d.ts +6 -0
- package/dist/plugins/shape/point-like.d.ts +31 -0
- package/dist/plugins/shape/point.d.ts +58 -0
- package/dist/plugins/shape/poly-star.d.ts +42 -0
- package/dist/plugins/shape/polygon.d.ts +67 -0
- package/dist/plugins/shape/rectangle.d.ts +129 -0
- package/dist/plugins/shape/shape-path.d.ts +75 -0
- package/dist/plugins/shape/shape-primitive.d.ts +15 -0
- package/dist/plugins/shape/triangle.d.ts +89 -0
- package/dist/plugins/shape/triangulate.d.ts +1 -0
- package/dist/plugins/sprite/sprite-item.d.ts +15 -116
- package/dist/plugins/sprite/sprite-loader.d.ts +1 -1
- package/dist/plugins/sprite/sprite-mesh.d.ts +3 -4
- package/dist/plugins/text/text-item.d.ts +15 -5
- package/dist/plugins/timeline/index.d.ts +3 -0
- package/dist/plugins/timeline/playable-assets/color-property-playable-asset.d.ts +7 -0
- package/dist/plugins/timeline/playable-assets/float-property-playable-asset.d.ts +7 -0
- package/dist/plugins/timeline/playable-assets/index.d.ts +3 -0
- package/dist/plugins/{cal → timeline/playable-assets}/timeline-asset.d.ts +9 -9
- package/dist/plugins/timeline/playable-assets/vector4-property-playable-asset.d.ts +7 -0
- package/dist/plugins/timeline/playables/color-property-mixer-playable.d.ts +6 -0
- package/dist/plugins/timeline/playables/float-property-mixer-playable.d.ts +6 -0
- package/dist/plugins/timeline/playables/index.d.ts +7 -0
- package/dist/plugins/timeline/playables/property-clip-playable.d.ts +8 -0
- package/dist/plugins/timeline/playables/vector4-property-mixer-playable.d.ts +6 -0
- package/dist/plugins/timeline/track-instance.d.ts +14 -0
- package/dist/plugins/timeline/track.d.ts +6 -4
- package/dist/plugins/timeline/tracks/color-property-track.d.ts +5 -0
- package/dist/plugins/timeline/tracks/float-property-track.d.ts +6 -0
- package/dist/plugins/timeline/tracks/index.d.ts +9 -0
- package/dist/plugins/timeline/tracks/material-track.d.ts +5 -0
- package/dist/plugins/timeline/tracks/property-track.d.ts +8 -0
- package/dist/plugins/timeline/tracks/sub-composition-track.d.ts +1 -1
- package/dist/plugins/timeline/tracks/vector4-property-track.d.ts +5 -0
- package/dist/render/gpu-capability.d.ts +1 -1
- package/dist/render/index.d.ts +0 -1
- package/dist/render/mesh.d.ts +1 -1
- package/dist/render/render-frame.d.ts +5 -1
- package/dist/render/renderer.d.ts +1 -1
- package/dist/render/semantic-map.d.ts +1 -1
- package/dist/render/shader.d.ts +1 -1
- package/dist/scene.d.ts +17 -18
- package/dist/serialization-helper.d.ts +3 -3
- package/dist/shape/geometry.d.ts +4 -4
- package/dist/texture/texture.d.ts +11 -2
- package/dist/texture/utils.d.ts +1 -2
- package/dist/transform.d.ts +8 -0
- package/dist/utils/color.d.ts +4 -5
- package/dist/utils/index.d.ts +1 -1
- package/dist/vfx-item.d.ts +45 -9
- package/package.json +4 -3
- package/dist/image-asset.d.ts +0 -5
- package/dist/render/global-volume.d.ts +0 -17
- /package/dist/plugins/timeline/{playables → playable-assets}/sub-composition-playable-asset.d.ts +0 -0
|
@@ -5,13 +5,12 @@ import type { PluginSystem } from './plugin-system';
|
|
|
5
5
|
import type { Scene, SceneRenderLevel } from './scene';
|
|
6
6
|
import type { Texture } from './texture';
|
|
7
7
|
import type { Disposable } from './utils';
|
|
8
|
-
import type { VFXItemProps } from './vfx-item';
|
|
9
8
|
export interface ContentOptions {
|
|
10
9
|
id: string;
|
|
11
10
|
duration: number;
|
|
12
11
|
name: string;
|
|
13
12
|
endBehavior: spec.EndBehavior;
|
|
14
|
-
items:
|
|
13
|
+
items: spec.DataPath[];
|
|
15
14
|
camera: spec.CameraOptions;
|
|
16
15
|
startTime: number;
|
|
17
16
|
timelineAsset: spec.DataPath;
|
|
@@ -22,17 +21,17 @@ export interface ContentOptions {
|
|
|
22
21
|
*/
|
|
23
22
|
export declare class CompositionSourceManager implements Disposable {
|
|
24
23
|
composition?: spec.CompositionData;
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
refCompositionProps: Map<string, VFXItemProps>;
|
|
24
|
+
sourceContent?: spec.CompositionData;
|
|
25
|
+
refCompositionProps: Map<string, spec.CompositionData>;
|
|
28
26
|
renderLevel?: SceneRenderLevel;
|
|
29
27
|
pluginSystem?: PluginSystem;
|
|
30
28
|
totalTime: number;
|
|
31
|
-
imgUsage: Record<string, number
|
|
29
|
+
imgUsage: Record<string, number>;
|
|
32
30
|
textures: Texture[];
|
|
33
31
|
jsonScene?: spec.JSONScene;
|
|
34
32
|
mask: number;
|
|
35
33
|
engine: Engine;
|
|
34
|
+
private refCompositions;
|
|
36
35
|
constructor(scene: Scene, engine: Engine);
|
|
37
36
|
private getContent;
|
|
38
37
|
private assembleItems;
|
package/dist/composition.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import * as spec from '@galacean/effects-specification';
|
|
2
2
|
import type { Ray } from '@galacean/effects-math/es/core/ray';
|
|
3
|
-
import type { Vector3 } from '@galacean/effects-math/es/core/vector3';
|
|
4
3
|
import type { Matrix4 } from '@galacean/effects-math/es/core/matrix4';
|
|
5
4
|
import { Camera } from './camera';
|
|
6
5
|
import { CompositionComponent } from './comp-vfx-item';
|
|
@@ -9,33 +8,38 @@ import type { PluginSystem } from './plugin-system';
|
|
|
9
8
|
import type { EventSystem, Plugin, Region } from './plugins';
|
|
10
9
|
import type { MeshRendererOptions, Renderer } from './render';
|
|
11
10
|
import { RenderFrame } from './render';
|
|
12
|
-
import type { Scene
|
|
11
|
+
import type { Scene } from './scene';
|
|
13
12
|
import type { Texture } from './texture';
|
|
14
13
|
import type { Disposable, LostHandler } from './utils';
|
|
15
|
-
import type { VFXItemProps } from './vfx-item';
|
|
16
14
|
import { VFXItem } from './vfx-item';
|
|
17
15
|
import type { CompositionEvent } from './events';
|
|
18
16
|
import { EventEmitter } from './events';
|
|
19
|
-
import type { PostProcessVolume } from './components
|
|
17
|
+
import type { PostProcessVolume } from './components';
|
|
20
18
|
import { SceneTicking } from './composition/scene-ticking';
|
|
19
|
+
/**
|
|
20
|
+
* 合成统计信息
|
|
21
|
+
*/
|
|
21
22
|
export interface CompositionStatistic {
|
|
22
|
-
loadTime: number;
|
|
23
23
|
loadStart: number;
|
|
24
|
+
loadTime: number;
|
|
25
|
+
/**
|
|
26
|
+
* Shader 编译耗时
|
|
27
|
+
*/
|
|
28
|
+
compileTime: number;
|
|
29
|
+
/**
|
|
30
|
+
* 从加载到渲染第一帧的时间(含 Shader 编译)
|
|
31
|
+
*/
|
|
24
32
|
firstFrameTime: number;
|
|
25
|
-
precompileTime: number;
|
|
26
33
|
}
|
|
34
|
+
/**
|
|
35
|
+
* 合成消息对象
|
|
36
|
+
*/
|
|
27
37
|
export interface MessageItem {
|
|
28
38
|
id: string;
|
|
29
39
|
name: string;
|
|
30
40
|
phrase: number;
|
|
31
41
|
compositionId: string;
|
|
32
42
|
}
|
|
33
|
-
export interface CompItemClickedData {
|
|
34
|
-
name: string;
|
|
35
|
-
id: string;
|
|
36
|
-
hitPositions: Vector3[];
|
|
37
|
-
position: Vector3;
|
|
38
|
-
}
|
|
39
43
|
/**
|
|
40
44
|
*
|
|
41
45
|
*/
|
|
@@ -44,6 +48,9 @@ export interface CompositionHitTestOptions {
|
|
|
44
48
|
stop?: (region: Region) => boolean;
|
|
45
49
|
skip?: (item: VFXItem) => boolean;
|
|
46
50
|
}
|
|
51
|
+
/**
|
|
52
|
+
*
|
|
53
|
+
*/
|
|
47
54
|
export interface CompositionProps {
|
|
48
55
|
reusable?: boolean;
|
|
49
56
|
baseRenderOrder?: number;
|
|
@@ -61,6 +68,9 @@ export interface CompositionProps {
|
|
|
61
68
|
*/
|
|
62
69
|
export declare class Composition extends EventEmitter<CompositionEvent<Composition>> implements Disposable, LostHandler {
|
|
63
70
|
renderer: Renderer;
|
|
71
|
+
/**
|
|
72
|
+
*
|
|
73
|
+
*/
|
|
64
74
|
sceneTicking: SceneTicking;
|
|
65
75
|
/**
|
|
66
76
|
* 当前帧的渲染数据对象
|
|
@@ -87,7 +97,6 @@ export declare class Composition extends EventEmitter<CompositionEvent<Compositi
|
|
|
87
97
|
* 是否播放完成后销毁 texture 对象
|
|
88
98
|
*/
|
|
89
99
|
keepResource: boolean;
|
|
90
|
-
extraCamera: VFXItem;
|
|
91
100
|
/**
|
|
92
101
|
* 合成内的元素否允许点击、拖拽交互
|
|
93
102
|
* @since 1.6.0
|
|
@@ -117,7 +126,7 @@ export declare class Composition extends EventEmitter<CompositionEvent<Compositi
|
|
|
117
126
|
/**
|
|
118
127
|
* 是否在合成结束时自动销毁引用的纹理,合成重播时不销毁
|
|
119
128
|
*/
|
|
120
|
-
autoRefTex: boolean;
|
|
129
|
+
readonly autoRefTex: boolean;
|
|
121
130
|
/**
|
|
122
131
|
* 当前合成名称
|
|
123
132
|
*/
|
|
@@ -133,7 +142,7 @@ export declare class Composition extends EventEmitter<CompositionEvent<Compositi
|
|
|
133
142
|
/**
|
|
134
143
|
* 合成对应的 url 或者 JSON
|
|
135
144
|
*/
|
|
136
|
-
readonly url:
|
|
145
|
+
readonly url: Scene.LoadType;
|
|
137
146
|
/**
|
|
138
147
|
* 合成根元素
|
|
139
148
|
*/
|
|
@@ -145,19 +154,19 @@ export declare class Composition extends EventEmitter<CompositionEvent<Compositi
|
|
|
145
154
|
/**
|
|
146
155
|
* 预合成的合成属性,在 content 中会被其元素属性覆盖
|
|
147
156
|
*/
|
|
148
|
-
refCompositionProps: Map<string,
|
|
157
|
+
readonly refCompositionProps: Map<string, spec.CompositionData>;
|
|
149
158
|
/**
|
|
150
159
|
* 合成的相机对象
|
|
151
160
|
*/
|
|
152
161
|
readonly camera: Camera;
|
|
153
162
|
/**
|
|
154
|
-
*
|
|
163
|
+
* 后处理渲染配置
|
|
155
164
|
*/
|
|
156
|
-
|
|
165
|
+
globalVolume?: PostProcessVolume;
|
|
157
166
|
/**
|
|
158
|
-
*
|
|
167
|
+
* 是否开启后处理
|
|
159
168
|
*/
|
|
160
|
-
|
|
169
|
+
postProcessingEnabled: boolean;
|
|
161
170
|
protected rendererOptions: MeshRendererOptions | null;
|
|
162
171
|
protected assigned: boolean;
|
|
163
172
|
/**
|
|
@@ -187,7 +196,6 @@ export declare class Composition extends EventEmitter<CompositionEvent<Compositi
|
|
|
187
196
|
* @param compositionSourceManager
|
|
188
197
|
*/
|
|
189
198
|
constructor(props: CompositionProps, scene: Scene);
|
|
190
|
-
initializeSceneTicking(item: VFXItem): void;
|
|
191
199
|
/**
|
|
192
200
|
* 所有合成 Item 的根变换
|
|
193
201
|
*/
|
|
@@ -294,7 +302,6 @@ export declare class Composition extends EventEmitter<CompositionEvent<Compositi
|
|
|
294
302
|
* @param deltaTime - 更新的时间步长
|
|
295
303
|
*/
|
|
296
304
|
update(deltaTime: number): void;
|
|
297
|
-
private toLocalTime;
|
|
298
305
|
private shouldDispose;
|
|
299
306
|
private getUpdateTime;
|
|
300
307
|
private callAwake;
|
|
@@ -302,7 +309,6 @@ export declare class Composition extends EventEmitter<CompositionEvent<Compositi
|
|
|
302
309
|
* 构建父子树,同时保存到 itemCacheMap 中便于查找
|
|
303
310
|
*/
|
|
304
311
|
private buildItemTree;
|
|
305
|
-
private getParentIdWithoutSuffix;
|
|
306
312
|
/**
|
|
307
313
|
* 更新视频数据到纹理
|
|
308
314
|
* @override
|
package/dist/downloader.d.ts
CHANGED
package/dist/effects-object.d.ts
CHANGED
|
@@ -5,15 +5,35 @@ import type { Engine } from './engine';
|
|
|
5
5
|
*/
|
|
6
6
|
export declare abstract class EffectsObject {
|
|
7
7
|
engine: Engine;
|
|
8
|
+
/**
|
|
9
|
+
*
|
|
10
|
+
* @param obj
|
|
11
|
+
* @returns
|
|
12
|
+
*/
|
|
8
13
|
static is(obj: unknown): obj is EffectsObject;
|
|
9
14
|
protected guid: string;
|
|
10
15
|
/**
|
|
11
16
|
* 存储需要序列化的数据
|
|
12
17
|
*/
|
|
13
18
|
readonly taggedProperties: Record<string, any>;
|
|
19
|
+
/**
|
|
20
|
+
*
|
|
21
|
+
* @param engine
|
|
22
|
+
*/
|
|
14
23
|
constructor(engine: Engine);
|
|
24
|
+
/**
|
|
25
|
+
*
|
|
26
|
+
* @returns
|
|
27
|
+
*/
|
|
15
28
|
getInstanceId(): string;
|
|
29
|
+
/**
|
|
30
|
+
*
|
|
31
|
+
* @param guid
|
|
32
|
+
*/
|
|
16
33
|
setInstanceId(guid: string): void;
|
|
34
|
+
/**
|
|
35
|
+
*
|
|
36
|
+
*/
|
|
17
37
|
toData(): void;
|
|
18
38
|
/**
|
|
19
39
|
* 反序列化函数
|
|
@@ -21,5 +41,8 @@ export declare abstract class EffectsObject {
|
|
|
21
41
|
* @param data - 对象的序列化的数据
|
|
22
42
|
*/
|
|
23
43
|
fromData(data: spec.EffectsObjectData): void;
|
|
44
|
+
/**
|
|
45
|
+
*
|
|
46
|
+
*/
|
|
24
47
|
dispose(): void;
|
|
25
48
|
}
|
package/dist/engine.d.ts
CHANGED
|
@@ -11,9 +11,15 @@ import type { Disposable } from './utils';
|
|
|
11
11
|
* Engine 基类,负责维护所有 GPU 资源的管理及销毁
|
|
12
12
|
*/
|
|
13
13
|
export declare class Engine implements Disposable {
|
|
14
|
+
/**
|
|
15
|
+
* 渲染器
|
|
16
|
+
*/
|
|
14
17
|
renderer: Renderer;
|
|
15
18
|
emptyTexture: Texture;
|
|
16
19
|
transparentTexture: Texture;
|
|
20
|
+
/**
|
|
21
|
+
* GPU 能力
|
|
22
|
+
*/
|
|
17
23
|
gpuCapability: GPUCapability;
|
|
18
24
|
jsonSceneData: SceneData;
|
|
19
25
|
objectInstance: Record<string, EffectsObject>;
|
|
@@ -29,6 +35,9 @@ export declare class Engine implements Disposable {
|
|
|
29
35
|
protected geometries: Geometry[];
|
|
30
36
|
protected meshes: Mesh[];
|
|
31
37
|
protected renderPasses: RenderPass[];
|
|
38
|
+
/**
|
|
39
|
+
*
|
|
40
|
+
*/
|
|
32
41
|
constructor();
|
|
33
42
|
/**
|
|
34
43
|
* 创建 Engine 对象。
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
*/
|
|
1
4
|
export type EventEmitterListener<P extends any[]> = (...callbackArgs: P) => void;
|
|
2
5
|
/**
|
|
3
6
|
* 事件监听器选项
|
|
@@ -8,6 +11,9 @@ export type EventEmitterOptions = {
|
|
|
8
11
|
*/
|
|
9
12
|
once?: boolean;
|
|
10
13
|
};
|
|
14
|
+
/**
|
|
15
|
+
* 事件监听器
|
|
16
|
+
*/
|
|
11
17
|
export declare class EventEmitter<T extends Record<string, any[]>> {
|
|
12
18
|
private listeners;
|
|
13
19
|
/**
|
package/dist/events/types.d.ts
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export * as math from '@galacean/effects-math/es/core/index';
|
|
2
2
|
export * as spec from '@galacean/effects-specification';
|
|
3
|
+
export * from './asset';
|
|
4
|
+
export * from './binary-asset';
|
|
3
5
|
export * from './asset-loader';
|
|
4
6
|
export * from './asset-manager';
|
|
5
7
|
export * from './camera';
|
|
@@ -32,8 +34,8 @@ export * from './ticker';
|
|
|
32
34
|
export * from './transform';
|
|
33
35
|
export * from './utils';
|
|
34
36
|
export * from './vfx-item';
|
|
35
|
-
export * from './binary-asset';
|
|
36
37
|
export * from './effects-object';
|
|
37
38
|
export * from './effects-package';
|
|
38
39
|
export * from './events';
|
|
40
|
+
export * from './pass-render-level';
|
|
39
41
|
export declare const version: string;
|