@galacean/effects-core 2.2.6 → 2.3.0-alpha.1
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/components/base-render-component.d.ts +12 -4
- package/dist/components/shape-component.d.ts +92 -3
- package/dist/composition.d.ts +62 -2
- package/dist/config.d.ts +11 -0
- package/dist/downloader.d.ts +15 -0
- package/dist/index.js +1352 -676
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1352 -677
- package/dist/index.mjs.map +1 -1
- package/dist/math/value-getters/index.d.ts +1 -1
- package/dist/math/value-getters/{vector4-curve.d.ts → vector-curves.d.ts} +8 -0
- package/dist/plugins/shape/build-line.d.ts +32 -0
- package/dist/plugins/shape/graphics-path.d.ts +0 -4
- package/dist/plugins/shape/polygon.d.ts +0 -4
- package/dist/plugins/shape/shape-path.d.ts +0 -4
- package/dist/plugins/timeline/playable-assets/index.d.ts +1 -1
- package/dist/plugins/timeline/playable-assets/{vector4-property-playable-asset.d.ts → vector-property-playable-assets.d.ts} +5 -1
- package/dist/plugins/timeline/playables/color-property-mixer-playable.d.ts +5 -5
- package/dist/plugins/timeline/playables/float-property-mixer-playable.d.ts +4 -5
- package/dist/plugins/timeline/playables/index.d.ts +1 -1
- package/dist/plugins/timeline/playables/property-mixer-playable.d.ts +9 -0
- package/dist/plugins/timeline/playables/vector-property-mixer-playable.d.ts +11 -0
- package/dist/plugins/timeline/tracks/index.d.ts +1 -1
- package/dist/plugins/timeline/tracks/{vector4-property-track.d.ts → vector-property-track.d.ts} +3 -0
- package/package.json +2 -2
- package/dist/plugins/timeline/playables/vector4-property-mixer-playable.d.ts +0 -6
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import * as spec from '@galacean/effects-specification';
|
|
2
2
|
import { Matrix4 } from '@galacean/effects-math/es/core/matrix4';
|
|
3
3
|
import { RendererComponent } from './renderer-component';
|
|
4
|
-
import
|
|
4
|
+
import { Texture } from '../texture';
|
|
5
5
|
import type { GeometryDrawMode, Renderer } from '../render';
|
|
6
6
|
import { Geometry } from '../render';
|
|
7
7
|
import type { Engine } from '../engine';
|
|
8
8
|
import type { BoundingBoxTriangle, HitTestTriangleParams } from '../plugins';
|
|
9
|
+
import type { MaterialProps } from '../material';
|
|
9
10
|
import { Material } from '../material';
|
|
10
11
|
import type { GeometryFromShape } from '../shape';
|
|
11
12
|
/**
|
|
@@ -78,11 +79,17 @@ export declare class BaseRenderComponent extends RendererComponent {
|
|
|
78
79
|
*/
|
|
79
80
|
setColor(color: spec.vec4): void;
|
|
80
81
|
/**
|
|
81
|
-
*
|
|
82
|
+
* 使用纹理对象设置当前 Mesh 的纹理
|
|
82
83
|
* @since 2.0.0
|
|
83
|
-
* @param
|
|
84
|
+
* @param input - 纹理对象
|
|
84
85
|
*/
|
|
85
|
-
setTexture(
|
|
86
|
+
setTexture(input: Texture): void;
|
|
87
|
+
/**
|
|
88
|
+
* 使用资源链接异步设置当前 Mesh 的纹理
|
|
89
|
+
* @param input - 资料链接
|
|
90
|
+
* @since 2.3.0
|
|
91
|
+
*/
|
|
92
|
+
setTexture(input: string): Promise<void>;
|
|
86
93
|
render(renderer: Renderer): void;
|
|
87
94
|
onStart(): void;
|
|
88
95
|
onDestroy(): void;
|
|
@@ -96,6 +103,7 @@ export declare class BaseRenderComponent extends RendererComponent {
|
|
|
96
103
|
atlasOffset: number[];
|
|
97
104
|
};
|
|
98
105
|
protected createGeometry(mode: GeometryDrawMode): Geometry;
|
|
106
|
+
protected getMaterialProps(renderInfo: ItemRenderInfo, count: number): MaterialProps;
|
|
99
107
|
protected createMaterial(renderInfo: ItemRenderInfo, count: number): Material;
|
|
100
108
|
getTextures(): Texture[];
|
|
101
109
|
/**
|
|
@@ -1,17 +1,105 @@
|
|
|
1
1
|
import * as spec from '@galacean/effects-specification';
|
|
2
2
|
import type { Engine } from '../engine';
|
|
3
3
|
import { MeshComponent } from './mesh-component';
|
|
4
|
+
interface ShapeAttribute {
|
|
5
|
+
/**
|
|
6
|
+
* 矢量图形类型
|
|
7
|
+
*/
|
|
8
|
+
type: spec.ShapePrimitiveType;
|
|
9
|
+
/**
|
|
10
|
+
* 填充属性
|
|
11
|
+
*/
|
|
12
|
+
fill?: spec.ShapeFillParam;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* 椭圆组件参数
|
|
16
|
+
*/
|
|
17
|
+
export interface EllipseAttribute extends ShapeAttribute {
|
|
18
|
+
type: spec.ShapePrimitiveType.Ellipse;
|
|
19
|
+
/**
|
|
20
|
+
* x 轴半径
|
|
21
|
+
* -- TODO 后续完善类型
|
|
22
|
+
* -- TODO 可以看一下用xRadius/yRadius 还是 width/height
|
|
23
|
+
*/
|
|
24
|
+
xRadius: number;
|
|
25
|
+
/**
|
|
26
|
+
* y 轴半径
|
|
27
|
+
*/
|
|
28
|
+
yRadius: number;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* 矩形参数
|
|
32
|
+
*/
|
|
33
|
+
export interface RectangleAttribute extends ShapeAttribute {
|
|
34
|
+
/**
|
|
35
|
+
* 宽度
|
|
36
|
+
*/
|
|
37
|
+
width: number;
|
|
38
|
+
/**
|
|
39
|
+
* 高度
|
|
40
|
+
*/
|
|
41
|
+
height: number;
|
|
42
|
+
/**
|
|
43
|
+
* 角点元素
|
|
44
|
+
*/
|
|
45
|
+
roundness: number;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* 星形参数
|
|
49
|
+
*/
|
|
50
|
+
export interface StarAttribute extends ShapeAttribute {
|
|
51
|
+
/**
|
|
52
|
+
* 顶点数 - 内外顶点同数
|
|
53
|
+
*/
|
|
54
|
+
pointCount: number;
|
|
55
|
+
/**
|
|
56
|
+
* 内径
|
|
57
|
+
*/
|
|
58
|
+
innerRadius: number;
|
|
59
|
+
/**
|
|
60
|
+
* 外径
|
|
61
|
+
*/
|
|
62
|
+
outerRadius: number;
|
|
63
|
+
/**
|
|
64
|
+
* 内径点圆度
|
|
65
|
+
*/
|
|
66
|
+
innerRoundness: number;
|
|
67
|
+
/**
|
|
68
|
+
* 外径点圆度
|
|
69
|
+
*/
|
|
70
|
+
outerRoundness: number;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* 多边形参数
|
|
74
|
+
*/
|
|
75
|
+
export interface PolygonAttribute extends ShapeAttribute {
|
|
76
|
+
/**
|
|
77
|
+
* 顶点数
|
|
78
|
+
*/
|
|
79
|
+
pointCount: number;
|
|
80
|
+
/**
|
|
81
|
+
* 外切圆半径
|
|
82
|
+
*/
|
|
83
|
+
radius: number;
|
|
84
|
+
/**
|
|
85
|
+
* 角点圆度
|
|
86
|
+
*/
|
|
87
|
+
roundness: number;
|
|
88
|
+
}
|
|
4
89
|
/**
|
|
5
90
|
* 图形组件
|
|
6
91
|
* @since 2.1.0
|
|
7
92
|
*/
|
|
8
93
|
export declare class ShapeComponent extends MeshComponent {
|
|
9
|
-
|
|
94
|
+
isStroke: boolean;
|
|
95
|
+
private graphicsPath;
|
|
10
96
|
private curveValues;
|
|
11
|
-
private
|
|
12
|
-
private
|
|
97
|
+
private shapeDirty;
|
|
98
|
+
private strokeAttributes;
|
|
99
|
+
private shapeAttribute;
|
|
13
100
|
private vert;
|
|
14
101
|
private frag;
|
|
102
|
+
get shape(): ShapeAttribute;
|
|
15
103
|
/**
|
|
16
104
|
*
|
|
17
105
|
* @param engine
|
|
@@ -24,3 +112,4 @@ export declare class ShapeComponent extends MeshComponent {
|
|
|
24
112
|
private setFillColor;
|
|
25
113
|
fromData(data: spec.ShapeComponentData): void;
|
|
26
114
|
}
|
|
115
|
+
export {};
|
package/dist/composition.d.ts
CHANGED
|
@@ -21,6 +21,9 @@ import { SceneTicking } from './composition/scene-ticking';
|
|
|
21
21
|
*/
|
|
22
22
|
export interface CompositionStatistic {
|
|
23
23
|
loadStart: number;
|
|
24
|
+
/**
|
|
25
|
+
* 加载耗时
|
|
26
|
+
*/
|
|
24
27
|
loadTime: number;
|
|
25
28
|
/**
|
|
26
29
|
* Shader 编译耗时
|
|
@@ -35,30 +38,81 @@ export interface CompositionStatistic {
|
|
|
35
38
|
* 合成消息对象
|
|
36
39
|
*/
|
|
37
40
|
export interface MessageItem {
|
|
41
|
+
/**
|
|
42
|
+
* 元素 ID
|
|
43
|
+
*/
|
|
38
44
|
id: string;
|
|
45
|
+
/**
|
|
46
|
+
* 元素名称
|
|
47
|
+
*/
|
|
39
48
|
name: string;
|
|
40
|
-
|
|
49
|
+
/**
|
|
50
|
+
* 消息阶段(2:开始,1:结束)
|
|
51
|
+
*/
|
|
52
|
+
phrase: typeof spec.MESSAGE_ITEM_PHRASE_BEGIN | typeof spec.MESSAGE_ITEM_PHRASE_END;
|
|
53
|
+
/**
|
|
54
|
+
* 合成 ID
|
|
55
|
+
*/
|
|
41
56
|
compositionId: string;
|
|
42
57
|
}
|
|
43
58
|
/**
|
|
44
59
|
*
|
|
45
60
|
*/
|
|
46
61
|
export interface CompositionHitTestOptions {
|
|
62
|
+
/**
|
|
63
|
+
*
|
|
64
|
+
*/
|
|
47
65
|
maxCount?: number;
|
|
66
|
+
/**
|
|
67
|
+
*
|
|
68
|
+
* @param region
|
|
69
|
+
* @returns
|
|
70
|
+
*/
|
|
48
71
|
stop?: (region: Region) => boolean;
|
|
72
|
+
/**
|
|
73
|
+
*
|
|
74
|
+
* @param item
|
|
75
|
+
* @returns
|
|
76
|
+
*/
|
|
49
77
|
skip?: (item: VFXItem) => boolean;
|
|
50
78
|
}
|
|
51
79
|
/**
|
|
52
80
|
*
|
|
53
81
|
*/
|
|
54
82
|
export interface CompositionProps {
|
|
83
|
+
/**
|
|
84
|
+
*
|
|
85
|
+
*/
|
|
55
86
|
reusable?: boolean;
|
|
87
|
+
/**
|
|
88
|
+
*
|
|
89
|
+
*/
|
|
56
90
|
baseRenderOrder?: number;
|
|
91
|
+
/**
|
|
92
|
+
*
|
|
93
|
+
*/
|
|
57
94
|
renderer: Renderer;
|
|
95
|
+
/**
|
|
96
|
+
*
|
|
97
|
+
* @param message
|
|
98
|
+
* @returns
|
|
99
|
+
*/
|
|
58
100
|
handleItemMessage: (message: MessageItem) => void;
|
|
101
|
+
/**
|
|
102
|
+
*
|
|
103
|
+
*/
|
|
59
104
|
event?: EventSystem;
|
|
105
|
+
/**
|
|
106
|
+
*
|
|
107
|
+
*/
|
|
60
108
|
width: number;
|
|
109
|
+
/**
|
|
110
|
+
*
|
|
111
|
+
*/
|
|
61
112
|
height: number;
|
|
113
|
+
/**
|
|
114
|
+
*
|
|
115
|
+
*/
|
|
62
116
|
speed?: number;
|
|
63
117
|
}
|
|
64
118
|
/**
|
|
@@ -198,7 +252,6 @@ export declare class Composition extends EventEmitter<CompositionEvent<Compositi
|
|
|
198
252
|
* Composition 构造函数
|
|
199
253
|
* @param props - composition 的创建参数
|
|
200
254
|
* @param scene
|
|
201
|
-
* @param compositionSourceManager
|
|
202
255
|
*/
|
|
203
256
|
constructor(props: CompositionProps, scene: Scene);
|
|
204
257
|
/**
|
|
@@ -261,11 +314,18 @@ export declare class Composition extends EventEmitter<CompositionEvent<Compositi
|
|
|
261
314
|
* @returns
|
|
262
315
|
*/
|
|
263
316
|
getSpeed(): number;
|
|
317
|
+
/**
|
|
318
|
+
*
|
|
319
|
+
*/
|
|
264
320
|
play(): void;
|
|
265
321
|
/**
|
|
266
322
|
* 暂停合成的播放
|
|
267
323
|
*/
|
|
268
324
|
pause(): void;
|
|
325
|
+
/**
|
|
326
|
+
*
|
|
327
|
+
* @returns
|
|
328
|
+
*/
|
|
269
329
|
getPaused(): boolean;
|
|
270
330
|
/**
|
|
271
331
|
* 恢复合成的播放
|
package/dist/config.d.ts
CHANGED
|
@@ -2,5 +2,16 @@ export declare const RUNTIME_ENV = "runtime_env";
|
|
|
2
2
|
export declare const RENDER_PREFER_LOOKUP_TEXTURE = "lookup_texture";
|
|
3
3
|
export declare const TEMPLATE_USE_OFFSCREEN_CANVAS = "offscreen_canvas";
|
|
4
4
|
export declare const POST_PROCESS_SETTINGS = "post_process_settings";
|
|
5
|
+
/**
|
|
6
|
+
* 获取全局配置项
|
|
7
|
+
* @param name
|
|
8
|
+
* @returns
|
|
9
|
+
*/
|
|
5
10
|
export declare function getConfig<T extends number | boolean | string | Record<string, any>>(name: string): T;
|
|
11
|
+
/**
|
|
12
|
+
* 设置全局配置项
|
|
13
|
+
* @param name
|
|
14
|
+
* @param value
|
|
15
|
+
* @returns
|
|
16
|
+
*/
|
|
6
17
|
export declare function setConfig<T extends number | boolean | string | Record<string, any>>(name: string, value: T): string | number | boolean | Record<string, any>;
|
package/dist/downloader.d.ts
CHANGED
|
@@ -1,4 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 成功处理程序
|
|
3
|
+
* @template T
|
|
4
|
+
*/
|
|
1
5
|
type SuccessHandler<T> = (data: T) => void;
|
|
6
|
+
/**
|
|
7
|
+
* 错误处理程序
|
|
8
|
+
* @param status - HTTP 状态码
|
|
9
|
+
* @param responseText - 响应文本
|
|
10
|
+
*/
|
|
2
11
|
type ErrorHandler = (status: number, responseText: string) => void;
|
|
3
12
|
/**
|
|
4
13
|
* JSON 值,它可以是字符串、数字、布尔值、对象或者 JSON 值的数组。
|
|
@@ -79,5 +88,11 @@ export declare function loadBlob(url: string): Promise<Blob>;
|
|
|
79
88
|
* @param url - 视频文件的 URL 或 MediaProvider 对象
|
|
80
89
|
*/
|
|
81
90
|
export declare function loadVideo(url: string | MediaProvider): Promise<HTMLVideoElement>;
|
|
91
|
+
/**
|
|
92
|
+
* 异步加载一个媒体文件
|
|
93
|
+
* @param url
|
|
94
|
+
* @param loadFn
|
|
95
|
+
* @returns
|
|
96
|
+
*/
|
|
82
97
|
export declare function loadMedia(url: string | string[], loadFn: (url: string) => Promise<HTMLImageElement | HTMLVideoElement>): Promise<HTMLImageElement | HTMLVideoElement>;
|
|
83
98
|
export {};
|