@galacean/effects-core 2.1.0-alpha.5 → 2.1.0-alpha.6
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-manager.d.ts +7 -6
- package/dist/binary-asset.d.ts +2 -2
- package/dist/components/index.d.ts +1 -0
- package/dist/components/shape-component.d.ts +172 -0
- package/dist/composition-source-manager.d.ts +1 -1
- package/dist/composition.d.ts +10 -4
- package/dist/image-asset.d.ts +2 -2
- package/dist/index.js +1824 -226
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1825 -224
- package/dist/index.mjs.map +1 -1
- package/dist/plugins/cal/timeline-asset.d.ts +1 -1
- package/dist/plugins/shape/build-adaptive-bezier.d.ts +1 -0
- package/dist/plugins/shape/graphics-path.d.ts +35 -0
- package/dist/plugins/shape/point-data.d.ts +6 -0
- package/dist/plugins/shape/polygon.d.ts +60 -0
- package/dist/plugins/shape/shape-path.d.ts +51 -0
- package/dist/plugins/shape/triangulate.d.ts +1 -0
- package/dist/plugins/timeline/track.d.ts +2 -2
- package/dist/render/gpu-capability.d.ts +1 -1
- package/dist/render/shader.d.ts +1 -1
- package/dist/scene.d.ts +17 -18
- package/dist/shape/geometry.d.ts +3 -3
- package/dist/texture/utils.d.ts +1 -2
- package/package.json +4 -3
package/dist/asset-manager.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Downloader } from './downloader';
|
|
2
|
-
import type {
|
|
2
|
+
import type { SceneLoadOptions } from './scene';
|
|
3
|
+
import { Scene } from './scene';
|
|
3
4
|
import type { Disposable } from './utils';
|
|
4
5
|
import type { Renderer } from './render';
|
|
5
6
|
/**
|
|
@@ -7,14 +8,14 @@ import type { Renderer } from './render';
|
|
|
7
8
|
* 用于加载和动效中所有的资源文件,包括图片、插件、图层粒子数据等
|
|
8
9
|
*/
|
|
9
10
|
export declare class AssetManager implements Disposable {
|
|
10
|
-
|
|
11
|
+
options: Omit<SceneLoadOptions, 'speed' | 'autoplay' | 'reusable'>;
|
|
11
12
|
private readonly downloader;
|
|
12
13
|
/**
|
|
13
|
-
* 相对url的基本路径
|
|
14
|
+
* 相对 url 的基本路径
|
|
14
15
|
*/
|
|
15
16
|
private baseUrl;
|
|
16
17
|
/**
|
|
17
|
-
* 图像资源,用于创建和释放GPU纹理资源
|
|
18
|
+
* 图像资源,用于创建和释放 GPU 纹理资源
|
|
18
19
|
*/
|
|
19
20
|
private assets;
|
|
20
21
|
/**
|
|
@@ -36,7 +37,7 @@ export declare class AssetManager implements Disposable {
|
|
|
36
37
|
* @param options - 场景加载参数
|
|
37
38
|
* @param downloader - 资源下载对象
|
|
38
39
|
*/
|
|
39
|
-
constructor(options?: SceneLoadOptions, downloader?: Downloader);
|
|
40
|
+
constructor(options?: Omit<SceneLoadOptions, 'speed' | 'autoplay' | 'reusable'>, downloader?: Downloader);
|
|
40
41
|
updateOptions(options?: SceneLoadOptions): void;
|
|
41
42
|
/**
|
|
42
43
|
* 场景创建,通过 json 创建出场景对象,并进行提前编译等工作
|
|
@@ -45,7 +46,7 @@ export declare class AssetManager implements Disposable {
|
|
|
45
46
|
* @param options - 扩展参数
|
|
46
47
|
* @returns
|
|
47
48
|
*/
|
|
48
|
-
loadScene(url:
|
|
49
|
+
loadScene(url: Scene.LoadType, renderer?: Renderer, options?: {
|
|
49
50
|
env: string;
|
|
50
51
|
}): Promise<Scene>;
|
|
51
52
|
private precompile;
|
package/dist/binary-asset.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as spec from '@galacean/effects-specification';
|
|
2
2
|
import { EffectsObject } from './effects-object';
|
|
3
3
|
export declare class BinaryAsset extends EffectsObject {
|
|
4
4
|
buffer: ArrayBuffer;
|
|
5
|
-
fromData(data: EffectsObjectData): void;
|
|
5
|
+
fromData(data: spec.EffectsObjectData): void;
|
|
6
6
|
}
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import type * as spec from '@galacean/effects-specification';
|
|
2
|
+
import type { Engine } from '../engine';
|
|
3
|
+
import { GraphicsPath } from '../plugins/shape/graphics-path';
|
|
4
|
+
import type { ShapePath } from '../plugins/shape/shape-path';
|
|
5
|
+
import type { Renderer } from '../render';
|
|
6
|
+
import { RendererComponent } from './renderer-component';
|
|
7
|
+
/**
|
|
8
|
+
* 图形组件
|
|
9
|
+
* @since 2.1.0
|
|
10
|
+
*/
|
|
11
|
+
export declare class ShapeComponent extends RendererComponent {
|
|
12
|
+
path: GraphicsPath;
|
|
13
|
+
private curveValues;
|
|
14
|
+
private geometry;
|
|
15
|
+
private dirty;
|
|
16
|
+
private vert;
|
|
17
|
+
private frag;
|
|
18
|
+
constructor(engine: Engine);
|
|
19
|
+
onUpdate(dt: number): void;
|
|
20
|
+
render(renderer: Renderer): void;
|
|
21
|
+
buildGeometryFromPath(shapePath: ShapePath): void;
|
|
22
|
+
fromData(data: ShapeCustomComponent): void;
|
|
23
|
+
}
|
|
24
|
+
/************************** Test Interface **********************************/
|
|
25
|
+
/**
|
|
26
|
+
* 矢量图形组件
|
|
27
|
+
*/
|
|
28
|
+
export interface ShapeComponentData extends spec.ComponentData {
|
|
29
|
+
/**
|
|
30
|
+
* 矢量类型
|
|
31
|
+
*/
|
|
32
|
+
type: ComponentShapeType;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* 矢量图形类型
|
|
36
|
+
*/
|
|
37
|
+
export declare enum ComponentShapeType {
|
|
38
|
+
/**
|
|
39
|
+
* 自定义图形
|
|
40
|
+
*/
|
|
41
|
+
CUSTOM = 0,
|
|
42
|
+
/**
|
|
43
|
+
* 矩形
|
|
44
|
+
*/
|
|
45
|
+
RECTANGLE = 1,
|
|
46
|
+
/**
|
|
47
|
+
* 椭圆
|
|
48
|
+
*/
|
|
49
|
+
ELLIPSE = 2,
|
|
50
|
+
/**
|
|
51
|
+
* 多边形
|
|
52
|
+
*/
|
|
53
|
+
POLYGON = 3,
|
|
54
|
+
/**
|
|
55
|
+
* 星形
|
|
56
|
+
*/
|
|
57
|
+
STAR = 4
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* 自定义图形组件
|
|
61
|
+
*/
|
|
62
|
+
export interface ShapeCustomComponent extends ShapeComponentData {
|
|
63
|
+
/**
|
|
64
|
+
* 矢量类型 - 形状
|
|
65
|
+
*/
|
|
66
|
+
type: ComponentShapeType.CUSTOM;
|
|
67
|
+
/**
|
|
68
|
+
* 矢量参数 - 形状
|
|
69
|
+
*/
|
|
70
|
+
param: ShapeCustomParam;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* 矢量路径参数
|
|
74
|
+
*/
|
|
75
|
+
export interface ShapeCustomParam {
|
|
76
|
+
/**
|
|
77
|
+
* 路径点
|
|
78
|
+
*/
|
|
79
|
+
points: spec.Vector3Data[];
|
|
80
|
+
/**
|
|
81
|
+
* 入射控制点
|
|
82
|
+
*/
|
|
83
|
+
easingIn: spec.Vector3Data[];
|
|
84
|
+
/**
|
|
85
|
+
* 入射控制点
|
|
86
|
+
*/
|
|
87
|
+
easingOut: spec.Vector3Data[];
|
|
88
|
+
/**
|
|
89
|
+
* 自定义形状
|
|
90
|
+
*/
|
|
91
|
+
shapes: CustomShape[];
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* 自定义形状参数
|
|
95
|
+
*/
|
|
96
|
+
export interface CustomShape {
|
|
97
|
+
/**
|
|
98
|
+
* 是否垂直与平面 - 用于减少实时运算
|
|
99
|
+
*/
|
|
100
|
+
verticalToPlane: 'x' | 'y' | 'z' | 'none';
|
|
101
|
+
/**
|
|
102
|
+
* 点索引 - 用于构成闭合图形
|
|
103
|
+
*/
|
|
104
|
+
indexes: CustomShapePoint[];
|
|
105
|
+
/**
|
|
106
|
+
* 是否为闭合图形 - 用于Stroke
|
|
107
|
+
*/
|
|
108
|
+
close: boolean;
|
|
109
|
+
/**
|
|
110
|
+
* 填充属性
|
|
111
|
+
*/
|
|
112
|
+
fill?: ShapeFillParam;
|
|
113
|
+
/**
|
|
114
|
+
* 描边属性
|
|
115
|
+
*/
|
|
116
|
+
stroke?: ShapeStrokeParam;
|
|
117
|
+
/**
|
|
118
|
+
* 空间变换
|
|
119
|
+
*/
|
|
120
|
+
transform?: spec.TransformData;
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* 自定义形状点
|
|
124
|
+
*/
|
|
125
|
+
export interface CustomShapePoint {
|
|
126
|
+
/**
|
|
127
|
+
* 顶点索引
|
|
128
|
+
*/
|
|
129
|
+
point: number;
|
|
130
|
+
/**
|
|
131
|
+
* 入射点索引
|
|
132
|
+
*/
|
|
133
|
+
easingIn: number;
|
|
134
|
+
/**
|
|
135
|
+
* 出射点索引
|
|
136
|
+
*/
|
|
137
|
+
easingOut: number;
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* 矢量填充参数
|
|
141
|
+
*/
|
|
142
|
+
export interface ShapeFillParam {
|
|
143
|
+
/**
|
|
144
|
+
* 填充颜色
|
|
145
|
+
*/
|
|
146
|
+
color: spec.ColorExpression;
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* 矢量描边参数
|
|
150
|
+
*/
|
|
151
|
+
export interface ShapeStrokeParam {
|
|
152
|
+
/**
|
|
153
|
+
* 线宽
|
|
154
|
+
*/
|
|
155
|
+
width: number;
|
|
156
|
+
/**
|
|
157
|
+
* 线颜色
|
|
158
|
+
*/
|
|
159
|
+
color: spec.ColorExpression;
|
|
160
|
+
/**
|
|
161
|
+
* 连接类型
|
|
162
|
+
*/
|
|
163
|
+
connectType: ShapeConnectType;
|
|
164
|
+
/**
|
|
165
|
+
* 点类型
|
|
166
|
+
*/
|
|
167
|
+
pointType: ShapePointType;
|
|
168
|
+
}
|
|
169
|
+
export declare enum ShapeConnectType {
|
|
170
|
+
}
|
|
171
|
+
export declare enum ShapePointType {
|
|
172
|
+
}
|
|
@@ -28,7 +28,7 @@ export declare class CompositionSourceManager implements Disposable {
|
|
|
28
28
|
renderLevel?: SceneRenderLevel;
|
|
29
29
|
pluginSystem?: PluginSystem;
|
|
30
30
|
totalTime: number;
|
|
31
|
-
imgUsage: Record<string, number
|
|
31
|
+
imgUsage: Record<string, number>;
|
|
32
32
|
textures: Texture[];
|
|
33
33
|
jsonScene?: spec.JSONScene;
|
|
34
34
|
mask: number;
|
package/dist/composition.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ import type { PluginSystem } from './plugin-system';
|
|
|
9
9
|
import type { EventSystem, Plugin, Region } from './plugins';
|
|
10
10
|
import type { MeshRendererOptions, Renderer } from './render';
|
|
11
11
|
import { RenderFrame } from './render';
|
|
12
|
-
import type { Scene
|
|
12
|
+
import type { Scene } from './scene';
|
|
13
13
|
import type { Texture } from './texture';
|
|
14
14
|
import type { Disposable, LostHandler } from './utils';
|
|
15
15
|
import type { VFXItemProps } from './vfx-item';
|
|
@@ -19,10 +19,16 @@ import { EventEmitter } from './events';
|
|
|
19
19
|
import type { PostProcessVolume } from './components/post-process-volume';
|
|
20
20
|
import { SceneTicking } from './composition/scene-ticking';
|
|
21
21
|
export interface CompositionStatistic {
|
|
22
|
-
loadTime: number;
|
|
23
22
|
loadStart: number;
|
|
23
|
+
loadTime: number;
|
|
24
|
+
/**
|
|
25
|
+
* Shader 编译耗时
|
|
26
|
+
*/
|
|
27
|
+
compileTime: number;
|
|
28
|
+
/**
|
|
29
|
+
* 从加载到渲染第一帧的时间(含 Shader 编译)
|
|
30
|
+
*/
|
|
24
31
|
firstFrameTime: number;
|
|
25
|
-
precompileTime: number;
|
|
26
32
|
}
|
|
27
33
|
export interface MessageItem {
|
|
28
34
|
id: string;
|
|
@@ -133,7 +139,7 @@ export declare class Composition extends EventEmitter<CompositionEvent<Compositi
|
|
|
133
139
|
/**
|
|
134
140
|
* 合成对应的 url 或者 JSON
|
|
135
141
|
*/
|
|
136
|
-
readonly url:
|
|
142
|
+
readonly url: Scene.LoadType;
|
|
137
143
|
/**
|
|
138
144
|
* 合成根元素
|
|
139
145
|
*/
|
package/dist/image-asset.d.ts
CHANGED