@galacean/effects-core 2.1.0-alpha.8 → 2.1.0-beta.0
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/comp-vfx-item.d.ts +2 -2
- package/dist/components/base-render-component.d.ts +9 -0
- package/dist/components/effect-component.d.ts +2 -34
- package/dist/components/fake-3d-component.d.ts +28 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/mesh-component.d.ts +21 -0
- package/dist/components/post-process-volume.d.ts +10 -10
- package/dist/components/shape-component.d.ts +122 -43
- package/dist/composition/scene-ticking.d.ts +14 -0
- package/dist/composition.d.ts +19 -9
- 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.js +2902 -2055
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2902 -2056
- package/dist/index.mjs.map +1 -1
- package/dist/material/material.d.ts +14 -1
- package/dist/plugins/cal/playable-graph.d.ts +3 -0
- package/dist/plugins/index.d.ts +1 -0
- package/dist/plugins/interact/interact-item.d.ts +4 -1
- package/dist/plugins/interact/mesh-collider.d.ts +15 -0
- package/dist/plugins/shape/graphics-path.d.ts +3 -1
- package/dist/plugins/shape/poly-star.d.ts +42 -0
- package/dist/plugins/shape/shape-path.d.ts +12 -0
- package/dist/plugins/shape/shape-primitive.d.ts +0 -3
- package/dist/plugins/sprite/sprite-item.d.ts +0 -7
- package/dist/plugins/text/text-item.d.ts +2 -0
- package/dist/plugins/timeline/playables/activation-mixer-playable.d.ts +0 -2
- package/dist/shape/geometry.d.ts +2 -2
- package/dist/transform.d.ts +8 -0
- package/dist/vfx-item.d.ts +63 -22
- package/package.json +2 -2
package/dist/comp-vfx-item.d.ts
CHANGED
|
@@ -29,8 +29,8 @@ export declare class CompositionComponent extends Behaviour {
|
|
|
29
29
|
getReusable(): boolean;
|
|
30
30
|
onUpdate(dt: number): void;
|
|
31
31
|
createContent(): void;
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
onEnable(): void;
|
|
33
|
+
onDisable(): void;
|
|
34
34
|
onDestroy(): void;
|
|
35
35
|
hitTest(ray: Ray, x: number, y: number, regions: Region[], force?: boolean, options?: CompositionHitTestOptions): Region[];
|
|
36
36
|
fromData(data: any): void;
|
|
@@ -7,6 +7,7 @@ import { Geometry } from '../render';
|
|
|
7
7
|
import type { Engine } from '../engine';
|
|
8
8
|
import type { BoundingBoxTriangle, HitTestTriangleParams } from '../plugins';
|
|
9
9
|
import { Material } from '../material';
|
|
10
|
+
import type { GeometryFromShape } from '../shape';
|
|
10
11
|
/**
|
|
11
12
|
* 图层元素渲染属性, 经过处理后的 spec.SpriteContent.renderer
|
|
12
13
|
*/
|
|
@@ -14,6 +15,7 @@ export interface ItemRenderer extends Required<Omit<spec.RendererOptions, 'textu
|
|
|
14
15
|
order: number;
|
|
15
16
|
mask: number;
|
|
16
17
|
texture: Texture;
|
|
18
|
+
shape?: GeometryFromShape;
|
|
17
19
|
anchor?: spec.vec2;
|
|
18
20
|
particleOrigin?: spec.ParticleOrigin;
|
|
19
21
|
}
|
|
@@ -30,6 +32,9 @@ export interface ItemRenderInfo {
|
|
|
30
32
|
cacheId: string;
|
|
31
33
|
wireframe?: boolean;
|
|
32
34
|
}
|
|
35
|
+
/**
|
|
36
|
+
* @since 2.1.0
|
|
37
|
+
*/
|
|
33
38
|
export declare class BaseRenderComponent extends RendererComponent {
|
|
34
39
|
interaction?: {
|
|
35
40
|
behavior: spec.InteractBehavior;
|
|
@@ -51,6 +56,10 @@ export declare class BaseRenderComponent extends RendererComponent {
|
|
|
51
56
|
protected visible: boolean;
|
|
52
57
|
protected isManualTimeSet: boolean;
|
|
53
58
|
protected frameAnimationTime: number;
|
|
59
|
+
/**
|
|
60
|
+
*
|
|
61
|
+
* @param engine
|
|
62
|
+
*/
|
|
54
63
|
constructor(engine: Engine);
|
|
55
64
|
/**
|
|
56
65
|
* 设置当前 Mesh 的可见性。
|
|
@@ -1,43 +1,11 @@
|
|
|
1
|
-
import { Matrix4 } from '@galacean/effects-math/es/core/matrix4';
|
|
2
1
|
import type { Engine } from '../engine';
|
|
3
|
-
import
|
|
4
|
-
import type { BoundingBoxTriangle, HitTestTriangleParams } from '../plugins';
|
|
5
|
-
import type { MeshDestroyOptions, Renderer } from '../render';
|
|
6
|
-
import type { Geometry } from '../render';
|
|
7
|
-
import { DestroyOptions } from '../utils';
|
|
8
|
-
import { RendererComponent } from './renderer-component';
|
|
2
|
+
import { MeshComponent } from './mesh-component';
|
|
9
3
|
/**
|
|
10
4
|
* @since 2.0.0
|
|
11
5
|
*/
|
|
12
|
-
export declare class EffectComponent extends
|
|
13
|
-
/**
|
|
14
|
-
* Mesh 的世界矩阵
|
|
15
|
-
*/
|
|
16
|
-
worldMatrix: Matrix4;
|
|
17
|
-
/**
|
|
18
|
-
* Mesh 的 Geometry
|
|
19
|
-
*/
|
|
20
|
-
geometry: Geometry;
|
|
21
|
-
private triangles;
|
|
22
|
-
private destroyed;
|
|
23
|
-
private hitTestGeometry;
|
|
6
|
+
export declare class EffectComponent extends MeshComponent {
|
|
24
7
|
constructor(engine: Engine);
|
|
25
8
|
onStart(): void;
|
|
26
9
|
onUpdate(dt: number): void;
|
|
27
|
-
render(renderer: Renderer): void;
|
|
28
|
-
/**
|
|
29
|
-
* 设置当前 Mesh 的材质
|
|
30
|
-
* @param material - 要设置的材质
|
|
31
|
-
* @param destroy - 可选的材质销毁选项
|
|
32
|
-
*/
|
|
33
|
-
setMaterial(material: Material, destroy?: MaterialDestroyOptions | DestroyOptions.keep): void;
|
|
34
|
-
getHitTestParams: (force?: boolean) => HitTestTriangleParams | void;
|
|
35
|
-
getBoundingBox(): BoundingBoxTriangle | void;
|
|
36
10
|
fromData(data: unknown): void;
|
|
37
|
-
toData(): void;
|
|
38
|
-
/**
|
|
39
|
-
* 销毁当前资源
|
|
40
|
-
* @param options - 可选的销毁选项
|
|
41
|
-
*/
|
|
42
|
-
dispose(options?: MeshDestroyOptions): void;
|
|
43
11
|
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Component } from './component';
|
|
2
|
+
import { EffectComponent } from './effect-component';
|
|
3
|
+
export declare class Fake3DComponent extends Component {
|
|
4
|
+
loop: boolean;
|
|
5
|
+
amountOfMotion: number;
|
|
6
|
+
animationLength: number;
|
|
7
|
+
mode: Fake3DAnimationMode;
|
|
8
|
+
startPositionX: number;
|
|
9
|
+
startPositionY: number;
|
|
10
|
+
startPositionZ: number;
|
|
11
|
+
endPositionX: number;
|
|
12
|
+
endPositionY: number;
|
|
13
|
+
endPositionZ: number;
|
|
14
|
+
amplitudeX: number;
|
|
15
|
+
amplitudeY: number;
|
|
16
|
+
amplitudeZ: number;
|
|
17
|
+
phaseX: number;
|
|
18
|
+
phaseY: number;
|
|
19
|
+
phaseZ: number;
|
|
20
|
+
effectComponent: EffectComponent;
|
|
21
|
+
onStart(): void;
|
|
22
|
+
onUpdate(dt: number): void;
|
|
23
|
+
updateFake3D(): void;
|
|
24
|
+
}
|
|
25
|
+
export declare enum Fake3DAnimationMode {
|
|
26
|
+
Circular = 0,
|
|
27
|
+
Linear = 1
|
|
28
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { BoundingBoxTriangle, HitTestTriangleParams } from '../plugins';
|
|
2
|
+
import { MeshCollider } from '../plugins';
|
|
3
|
+
import type { Geometry } from '../render/geometry';
|
|
4
|
+
import type { Renderer } from '../render/renderer';
|
|
5
|
+
import { RendererComponent } from './renderer-component';
|
|
6
|
+
/**
|
|
7
|
+
* Mesh 组件
|
|
8
|
+
*/
|
|
9
|
+
export declare class MeshComponent extends RendererComponent {
|
|
10
|
+
/**
|
|
11
|
+
* 渲染的 Geometry
|
|
12
|
+
*/
|
|
13
|
+
protected geometry: Geometry;
|
|
14
|
+
/**
|
|
15
|
+
* 用于点击测试的碰撞器
|
|
16
|
+
*/
|
|
17
|
+
protected meshCollider: MeshCollider;
|
|
18
|
+
render(renderer: Renderer): void;
|
|
19
|
+
getHitTestParams: (force?: boolean) => HitTestTriangleParams | void;
|
|
20
|
+
getBoundingBox(): BoundingBoxTriangle | void;
|
|
21
|
+
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
+
import * as spec from '@galacean/effects-specification';
|
|
1
2
|
import { Behaviour } from './component';
|
|
3
|
+
import type { Engine } from '../engine';
|
|
4
|
+
/**
|
|
5
|
+
* @since 2.1.0
|
|
6
|
+
*/
|
|
2
7
|
export declare class PostProcessVolume extends Behaviour {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
contrast: number;
|
|
9
|
-
vignetteIntensity: number;
|
|
10
|
-
vignetteSmoothness: number;
|
|
11
|
-
vignetteRoundness: number;
|
|
12
|
-
toneMappingEnabled: boolean;
|
|
8
|
+
bloom: spec.Bloom;
|
|
9
|
+
vignette: spec.Vignette;
|
|
10
|
+
tonemapping: spec.Tonemapping;
|
|
11
|
+
colorAdjustments: spec.ColorAdjustments;
|
|
12
|
+
constructor(engine: Engine);
|
|
13
13
|
onStart(): void;
|
|
14
14
|
}
|
|
@@ -1,24 +1,27 @@
|
|
|
1
1
|
import type * as spec from '@galacean/effects-specification';
|
|
2
2
|
import type { Engine } from '../engine';
|
|
3
|
-
import
|
|
4
|
-
import { RendererComponent } from './renderer-component';
|
|
3
|
+
import { MeshComponent } from './mesh-component';
|
|
5
4
|
/**
|
|
6
5
|
* 图形组件
|
|
7
6
|
* @since 2.1.0
|
|
8
7
|
*/
|
|
9
|
-
export declare class ShapeComponent extends
|
|
8
|
+
export declare class ShapeComponent extends MeshComponent {
|
|
10
9
|
private path;
|
|
11
10
|
private curveValues;
|
|
12
|
-
private geometry;
|
|
13
11
|
private data;
|
|
14
12
|
private animated;
|
|
15
13
|
private vert;
|
|
16
14
|
private frag;
|
|
15
|
+
/**
|
|
16
|
+
*
|
|
17
|
+
* @param engine
|
|
18
|
+
*/
|
|
17
19
|
constructor(engine: Engine);
|
|
20
|
+
onStart(): void;
|
|
18
21
|
onUpdate(dt: number): void;
|
|
19
|
-
render(renderer: Renderer): void;
|
|
20
22
|
private buildGeometryFromPath;
|
|
21
23
|
private buildPath;
|
|
24
|
+
private setFillColor;
|
|
22
25
|
fromData(data: ShapeComponentData): void;
|
|
23
26
|
}
|
|
24
27
|
/************************** Test Interface **********************************/
|
|
@@ -29,62 +32,53 @@ export interface ShapeComponentData extends spec.ComponentData {
|
|
|
29
32
|
/**
|
|
30
33
|
* 矢量类型
|
|
31
34
|
*/
|
|
32
|
-
type:
|
|
35
|
+
type: ShapePrimitiveType;
|
|
33
36
|
}
|
|
34
37
|
/**
|
|
35
38
|
* 矢量图形类型
|
|
36
39
|
*/
|
|
37
|
-
export declare enum
|
|
40
|
+
export declare enum ShapePrimitiveType {
|
|
38
41
|
/**
|
|
39
42
|
* 自定义图形
|
|
40
43
|
*/
|
|
41
|
-
|
|
44
|
+
Custom = 0,
|
|
42
45
|
/**
|
|
43
46
|
* 矩形
|
|
44
47
|
*/
|
|
45
|
-
|
|
48
|
+
Rectangle = 1,
|
|
46
49
|
/**
|
|
47
50
|
* 椭圆
|
|
48
51
|
*/
|
|
49
|
-
|
|
52
|
+
Ellipse = 2,
|
|
50
53
|
/**
|
|
51
54
|
* 多边形
|
|
52
55
|
*/
|
|
53
|
-
|
|
56
|
+
Polygon = 3,
|
|
54
57
|
/**
|
|
55
58
|
* 星形
|
|
56
59
|
*/
|
|
57
|
-
|
|
60
|
+
Star = 4
|
|
58
61
|
}
|
|
59
62
|
/**
|
|
60
63
|
* 自定义图形组件
|
|
61
64
|
*/
|
|
62
|
-
export interface
|
|
65
|
+
export interface CustomShapeData extends ShapeComponentData {
|
|
63
66
|
/**
|
|
64
67
|
* 矢量类型 - 形状
|
|
65
68
|
*/
|
|
66
|
-
type:
|
|
67
|
-
/**
|
|
68
|
-
* 矢量参数 - 形状
|
|
69
|
-
*/
|
|
70
|
-
param: ShapeCustomParam;
|
|
71
|
-
}
|
|
72
|
-
/**
|
|
73
|
-
* 矢量路径参数
|
|
74
|
-
*/
|
|
75
|
-
export interface ShapeCustomParam {
|
|
69
|
+
type: ShapePrimitiveType.Custom;
|
|
76
70
|
/**
|
|
77
71
|
* 路径点
|
|
78
72
|
*/
|
|
79
|
-
points: spec.
|
|
73
|
+
points: spec.Vector2Data[];
|
|
80
74
|
/**
|
|
81
75
|
* 入射控制点
|
|
82
76
|
*/
|
|
83
|
-
|
|
77
|
+
easingIns: spec.Vector2Data[];
|
|
84
78
|
/**
|
|
85
79
|
* 入射控制点
|
|
86
80
|
*/
|
|
87
|
-
|
|
81
|
+
easingOuts: spec.Vector2Data[];
|
|
88
82
|
/**
|
|
89
83
|
* 自定义形状
|
|
90
84
|
*/
|
|
@@ -94,10 +88,6 @@ export interface ShapeCustomParam {
|
|
|
94
88
|
* 自定义形状参数
|
|
95
89
|
*/
|
|
96
90
|
export interface CustomShape {
|
|
97
|
-
/**
|
|
98
|
-
* 是否垂直与平面 - 用于减少实时运算
|
|
99
|
-
*/
|
|
100
|
-
verticalToPlane: 'x' | 'y' | 'z' | 'none';
|
|
101
91
|
/**
|
|
102
92
|
* 点索引 - 用于构成闭合图形
|
|
103
93
|
*/
|
|
@@ -143,7 +133,7 @@ export interface ShapeFillParam {
|
|
|
143
133
|
/**
|
|
144
134
|
* 填充颜色
|
|
145
135
|
*/
|
|
146
|
-
color: spec.
|
|
136
|
+
color: spec.ColorData;
|
|
147
137
|
}
|
|
148
138
|
/**
|
|
149
139
|
* 矢量描边参数
|
|
@@ -156,7 +146,7 @@ export interface ShapeStrokeParam {
|
|
|
156
146
|
/**
|
|
157
147
|
* 线颜色
|
|
158
148
|
*/
|
|
159
|
-
color: spec.
|
|
149
|
+
color: spec.ColorData;
|
|
160
150
|
/**
|
|
161
151
|
* 连接类型
|
|
162
152
|
*/
|
|
@@ -171,24 +161,18 @@ export declare enum ShapeConnectType {
|
|
|
171
161
|
export declare enum ShapePointType {
|
|
172
162
|
}
|
|
173
163
|
/**
|
|
174
|
-
*
|
|
175
|
-
*/
|
|
176
|
-
export interface ShapeEllipseComponent extends ShapeComponentData {
|
|
177
|
-
type: ComponentShapeType.ELLIPSE;
|
|
178
|
-
param: ShapeEllipseParam;
|
|
179
|
-
}
|
|
180
|
-
/**
|
|
181
|
-
* @description 椭圆参数
|
|
164
|
+
* 椭圆组件参数
|
|
182
165
|
*/
|
|
183
|
-
export interface
|
|
166
|
+
export interface EllipseData extends ShapeComponentData {
|
|
167
|
+
type: ShapePrimitiveType.Ellipse;
|
|
184
168
|
/**
|
|
185
|
-
*
|
|
169
|
+
* x 轴半径
|
|
186
170
|
* -- TODO 后续完善类型
|
|
187
171
|
* -- TODO 可以看一下用xRadius/yRadius 还是 width/height
|
|
188
172
|
*/
|
|
189
173
|
xRadius: number;
|
|
190
174
|
/**
|
|
191
|
-
*
|
|
175
|
+
* y 轴半径
|
|
192
176
|
*/
|
|
193
177
|
yRadius: number;
|
|
194
178
|
/**
|
|
@@ -204,3 +188,98 @@ export interface ShapeEllipseParam {
|
|
|
204
188
|
*/
|
|
205
189
|
transform?: spec.TransformData;
|
|
206
190
|
}
|
|
191
|
+
/**
|
|
192
|
+
* 星形参数
|
|
193
|
+
*/
|
|
194
|
+
export interface StarData extends ShapeComponentData {
|
|
195
|
+
/**
|
|
196
|
+
* 顶点数 - 内外顶点同数
|
|
197
|
+
*/
|
|
198
|
+
pointCount: number;
|
|
199
|
+
/**
|
|
200
|
+
* 内径
|
|
201
|
+
*/
|
|
202
|
+
innerRadius: number;
|
|
203
|
+
/**
|
|
204
|
+
* 外径
|
|
205
|
+
*/
|
|
206
|
+
outerRadius: number;
|
|
207
|
+
/**
|
|
208
|
+
* 内径点圆度
|
|
209
|
+
*/
|
|
210
|
+
innerRoundness: number;
|
|
211
|
+
/**
|
|
212
|
+
* 外径点圆度
|
|
213
|
+
*/
|
|
214
|
+
outerRoundness: number;
|
|
215
|
+
/**
|
|
216
|
+
* 填充属性
|
|
217
|
+
*/
|
|
218
|
+
fill?: ShapeFillParam;
|
|
219
|
+
/**
|
|
220
|
+
* 描边属性
|
|
221
|
+
*/
|
|
222
|
+
stroke?: ShapeStrokeParam;
|
|
223
|
+
/**
|
|
224
|
+
* 空间变换
|
|
225
|
+
*/
|
|
226
|
+
transform?: spec.TransformData;
|
|
227
|
+
}
|
|
228
|
+
/**
|
|
229
|
+
* 多边形参数
|
|
230
|
+
*/
|
|
231
|
+
export interface PolygonData extends ShapeComponentData {
|
|
232
|
+
/**
|
|
233
|
+
* 顶点数
|
|
234
|
+
*/
|
|
235
|
+
pointCount: number;
|
|
236
|
+
/**
|
|
237
|
+
* 外切圆半径
|
|
238
|
+
*/
|
|
239
|
+
radius: number;
|
|
240
|
+
/**
|
|
241
|
+
* 角点圆度
|
|
242
|
+
*/
|
|
243
|
+
roundness: number;
|
|
244
|
+
/**
|
|
245
|
+
* 填充属性
|
|
246
|
+
*/
|
|
247
|
+
fill?: ShapeFillParam;
|
|
248
|
+
/**
|
|
249
|
+
* 描边属性
|
|
250
|
+
*/
|
|
251
|
+
stroke?: ShapeStrokeParam;
|
|
252
|
+
/**
|
|
253
|
+
* 空间变换
|
|
254
|
+
*/
|
|
255
|
+
transform?: spec.TransformData;
|
|
256
|
+
}
|
|
257
|
+
/**
|
|
258
|
+
* 矩形参数
|
|
259
|
+
*/
|
|
260
|
+
export interface RectangleData extends ShapeComponentData {
|
|
261
|
+
/**
|
|
262
|
+
* 宽度
|
|
263
|
+
*/
|
|
264
|
+
width: number;
|
|
265
|
+
/**
|
|
266
|
+
* 高度
|
|
267
|
+
*/
|
|
268
|
+
height: number;
|
|
269
|
+
/**
|
|
270
|
+
* 角点元素
|
|
271
|
+
*/
|
|
272
|
+
roundness: number;
|
|
273
|
+
/**
|
|
274
|
+
* 填充属性
|
|
275
|
+
*/
|
|
276
|
+
fill?: ShapeFillParam;
|
|
277
|
+
/**
|
|
278
|
+
* 描边属性
|
|
279
|
+
*/
|
|
280
|
+
stroke?: ShapeStrokeParam;
|
|
281
|
+
/**
|
|
282
|
+
* 空间变换
|
|
283
|
+
*/
|
|
284
|
+
transform?: spec.TransformData;
|
|
285
|
+
}
|
|
@@ -1,9 +1,23 @@
|
|
|
1
1
|
import { Component } from '../components';
|
|
2
|
+
/**
|
|
3
|
+
*
|
|
4
|
+
*/
|
|
2
5
|
export declare class SceneTicking {
|
|
3
6
|
update: UpdateTickData;
|
|
4
7
|
lateUpdate: LateUpdateTickData;
|
|
8
|
+
/**
|
|
9
|
+
*
|
|
10
|
+
* @param obj
|
|
11
|
+
*/
|
|
5
12
|
addComponent(obj: Component): void;
|
|
13
|
+
/**
|
|
14
|
+
*
|
|
15
|
+
* @param obj
|
|
16
|
+
*/
|
|
6
17
|
removeComponent(obj: Component): void;
|
|
18
|
+
/**
|
|
19
|
+
*
|
|
20
|
+
*/
|
|
7
21
|
clear(): void;
|
|
8
22
|
}
|
|
9
23
|
declare class TickData {
|
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';
|
|
@@ -17,6 +16,9 @@ import type { CompositionEvent } from './events';
|
|
|
17
16
|
import { EventEmitter } from './events';
|
|
18
17
|
import type { PostProcessVolume } from './components';
|
|
19
18
|
import { SceneTicking } from './composition/scene-ticking';
|
|
19
|
+
/**
|
|
20
|
+
* 合成统计信息
|
|
21
|
+
*/
|
|
20
22
|
export interface CompositionStatistic {
|
|
21
23
|
loadStart: number;
|
|
22
24
|
loadTime: number;
|
|
@@ -29,18 +31,15 @@ export interface CompositionStatistic {
|
|
|
29
31
|
*/
|
|
30
32
|
firstFrameTime: number;
|
|
31
33
|
}
|
|
34
|
+
/**
|
|
35
|
+
* 合成消息对象
|
|
36
|
+
*/
|
|
32
37
|
export interface MessageItem {
|
|
33
38
|
id: string;
|
|
34
39
|
name: string;
|
|
35
40
|
phrase: number;
|
|
36
41
|
compositionId: string;
|
|
37
42
|
}
|
|
38
|
-
export interface CompItemClickedData {
|
|
39
|
-
name: string;
|
|
40
|
-
id: string;
|
|
41
|
-
hitPositions: Vector3[];
|
|
42
|
-
position: Vector3;
|
|
43
|
-
}
|
|
44
43
|
/**
|
|
45
44
|
*
|
|
46
45
|
*/
|
|
@@ -49,6 +48,9 @@ export interface CompositionHitTestOptions {
|
|
|
49
48
|
stop?: (region: Region) => boolean;
|
|
50
49
|
skip?: (item: VFXItem) => boolean;
|
|
51
50
|
}
|
|
51
|
+
/**
|
|
52
|
+
*
|
|
53
|
+
*/
|
|
52
54
|
export interface CompositionProps {
|
|
53
55
|
reusable?: boolean;
|
|
54
56
|
baseRenderOrder?: number;
|
|
@@ -66,6 +68,9 @@ export interface CompositionProps {
|
|
|
66
68
|
*/
|
|
67
69
|
export declare class Composition extends EventEmitter<CompositionEvent<Composition>> implements Disposable, LostHandler {
|
|
68
70
|
renderer: Renderer;
|
|
71
|
+
/**
|
|
72
|
+
*
|
|
73
|
+
*/
|
|
69
74
|
sceneTicking: SceneTicking;
|
|
70
75
|
/**
|
|
71
76
|
* 当前帧的渲染数据对象
|
|
@@ -97,6 +102,10 @@ export declare class Composition extends EventEmitter<CompositionEvent<Compositi
|
|
|
97
102
|
* @since 1.6.0
|
|
98
103
|
*/
|
|
99
104
|
interactive: boolean;
|
|
105
|
+
/**
|
|
106
|
+
* 合成是否结束
|
|
107
|
+
*/
|
|
108
|
+
isEnded: boolean;
|
|
100
109
|
compositionSourceManager: CompositionSourceManager;
|
|
101
110
|
/**
|
|
102
111
|
* 合成id
|
|
@@ -121,7 +130,7 @@ export declare class Composition extends EventEmitter<CompositionEvent<Compositi
|
|
|
121
130
|
/**
|
|
122
131
|
* 是否在合成结束时自动销毁引用的纹理,合成重播时不销毁
|
|
123
132
|
*/
|
|
124
|
-
autoRefTex: boolean;
|
|
133
|
+
readonly autoRefTex: boolean;
|
|
125
134
|
/**
|
|
126
135
|
* 当前合成名称
|
|
127
136
|
*/
|
|
@@ -149,7 +158,7 @@ export declare class Composition extends EventEmitter<CompositionEvent<Compositi
|
|
|
149
158
|
/**
|
|
150
159
|
* 预合成的合成属性,在 content 中会被其元素属性覆盖
|
|
151
160
|
*/
|
|
152
|
-
refCompositionProps: Map<string, spec.CompositionData>;
|
|
161
|
+
readonly refCompositionProps: Map<string, spec.CompositionData>;
|
|
153
162
|
/**
|
|
154
163
|
* 合成的相机对象
|
|
155
164
|
*/
|
|
@@ -179,6 +188,7 @@ export declare class Composition extends EventEmitter<CompositionEvent<Compositi
|
|
|
179
188
|
*/
|
|
180
189
|
private paused;
|
|
181
190
|
private lastVideoUpdateTime;
|
|
191
|
+
private isEndCalled;
|
|
182
192
|
private readonly texInfo;
|
|
183
193
|
/**
|
|
184
194
|
* 合成中消息元素创建/销毁时触发的回调
|
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
|
/**
|