@galacean/effects-core 1.1.2 → 1.1.4
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 +130 -0
- package/dist/camera.d.ts +183 -0
- package/dist/comp-vfx-item.d.ts +71 -0
- package/dist/composition-source-manager.d.ts +45 -0
- package/dist/composition.d.ts +406 -0
- package/dist/config.d.ts +7 -0
- package/dist/constants.d.ts +11 -0
- package/dist/downloader.d.ts +83 -0
- package/dist/engine.d.ts +38 -0
- package/dist/filter.d.ts +63 -0
- package/dist/filters/alpha-frame.d.ts +5 -0
- package/dist/filters/alpha-mask.d.ts +5 -0
- package/dist/filters/bloom.d.ts +8 -0
- package/dist/filters/camera-move.d.ts +5 -0
- package/dist/filters/delay.d.ts +14 -0
- package/dist/filters/distortion.d.ts +5 -0
- package/dist/filters/gaussian.d.ts +27 -0
- package/dist/filters/index.d.ts +2 -0
- package/dist/filters/lum.d.ts +5 -0
- package/dist/filters/utils.d.ts +7 -0
- package/dist/gl/create-gl-context.d.ts +9 -0
- package/dist/gl/gpu-time.d.ts +5 -0
- package/dist/gl/index.d.ts +6 -0
- package/dist/index.d.ts +31 -0
- package/dist/index.js +110 -81
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +110 -81
- package/dist/index.mjs.map +1 -1
- package/dist/libs/earcut.d.ts +37 -0
- package/dist/material/index.d.ts +4 -0
- package/dist/material/material-data-block.d.ts +27 -0
- package/dist/material/material.d.ts +347 -0
- package/dist/material/types.d.ts +66 -0
- package/dist/material/utils.d.ts +17 -0
- package/dist/math/float16array-wrapper.d.ts +5 -0
- package/dist/math/index.d.ts +4 -0
- package/dist/math/translate.d.ts +10 -0
- package/dist/math/utils.d.ts +19 -0
- package/dist/math/value-getter.d.ts +127 -0
- package/dist/paas-texture-cache.d.ts +24 -0
- package/dist/pass-render-level.d.ts +1 -0
- package/dist/plugin-system.d.ts +34 -0
- package/dist/plugins/cal/calculate-item.d.ts +84 -0
- package/dist/plugins/cal/calculate-loader.d.ts +3 -0
- package/dist/plugins/cal/calculate-vfx-item.d.ts +26 -0
- package/dist/plugins/camera/camera-controller-node.d.ts +17 -0
- package/dist/plugins/camera/camera-vfx-item-loader.d.ts +3 -0
- package/dist/plugins/camera/camera-vfx-item.d.ts +13 -0
- package/dist/plugins/index.d.ts +26 -0
- package/dist/plugins/interact/click-handler.d.ts +66 -0
- package/dist/plugins/interact/event-system.d.ts +37 -0
- package/dist/plugins/interact/interact-item.d.ts +2 -0
- package/dist/plugins/interact/interact-loader.d.ts +13 -0
- package/dist/plugins/interact/interact-mesh.d.ts +16 -0
- package/dist/plugins/interact/interact-vfx-item.d.ts +28 -0
- package/dist/plugins/particle/burst.d.ts +21 -0
- package/dist/plugins/particle/link.d.ts +21 -0
- package/dist/plugins/particle/particle-loader.d.ts +18 -0
- package/dist/plugins/particle/particle-mesh.d.ts +164 -0
- package/dist/plugins/particle/particle-system.d.ts +197 -0
- package/dist/plugins/particle/particle-vfx-item.d.ts +27 -0
- package/dist/plugins/particle/trail-mesh.d.ts +61 -0
- package/dist/plugins/plugin.d.ts +125 -0
- package/dist/plugins/sprite/filter-sprite-vfx-item.d.ts +13 -0
- package/dist/plugins/sprite/sprite-group.d.ts +95 -0
- package/dist/plugins/sprite/sprite-item.d.ts +106 -0
- package/dist/plugins/sprite/sprite-loader.d.ts +20 -0
- package/dist/plugins/sprite/sprite-mesh.d.ts +67 -0
- package/dist/plugins/sprite/sprite-vfx-item.d.ts +33 -0
- package/dist/plugins/text/text-item.d.ts +117 -0
- package/dist/plugins/text/text-layout.d.ts +28 -0
- package/dist/plugins/text/text-loader.d.ts +18 -0
- package/dist/plugins/text/text-mesh.d.ts +15 -0
- package/dist/plugins/text/text-style.d.ts +67 -0
- package/dist/plugins/text/text-vfx-item.d.ts +28 -0
- package/dist/polyfill.d.ts +4 -0
- package/dist/render/create-copy-shader.d.ts +6 -0
- package/dist/render/frame-buffer.d.ts +48 -0
- package/dist/render/geometry.d.ts +118 -0
- package/dist/render/global-volume.d.ts +15 -0
- package/dist/render/gpu-capability.d.ts +49 -0
- package/dist/render/index.d.ts +12 -0
- package/dist/render/mesh.d.ts +82 -0
- package/dist/render/post-process-pass.d.ts +37 -0
- package/dist/render/render-buffer.d.ts +20 -0
- package/dist/render/render-frame.d.ts +269 -0
- package/dist/render/render-pass.d.ts +309 -0
- package/dist/render/renderer.d.ts +62 -0
- package/dist/render/shader.d.ts +97 -0
- package/dist/render/types.d.ts +5 -0
- package/dist/scene.d.ts +30 -0
- package/dist/semantic-map.d.ts +14 -0
- package/dist/shader/index.d.ts +30 -0
- package/dist/shape/2d-shape.d.ts +32 -0
- package/dist/shape/cone.d.ts +11 -0
- package/dist/shape/donut.d.ts +9 -0
- package/dist/shape/earcut.d.ts +1 -0
- package/dist/shape/geometry.d.ts +30 -0
- package/dist/shape/index.d.ts +3 -0
- package/dist/shape/shape.d.ts +21 -0
- package/dist/shape/sphere.d.ts +15 -0
- package/dist/shape/texture-shape.d.ts +11 -0
- package/dist/template-image/index.d.ts +67 -0
- package/dist/template-image/qcanvas-viewer.d.ts +21 -0
- package/dist/template-image/qtext.d.ts +96 -0
- package/dist/template-image/template-v1.d.ts +27 -0
- package/dist/template-image/text-metrics.d.ts +18 -0
- package/dist/texture/index.d.ts +5 -0
- package/dist/texture/ktx-texture.d.ts +21 -0
- package/dist/texture/texture-factory.d.ts +13 -0
- package/dist/texture/texture.d.ts +78 -0
- package/dist/texture/types.d.ts +165 -0
- package/dist/texture/utils.d.ts +5 -0
- package/dist/ticker.d.ts +48 -0
- package/dist/transform.d.ts +221 -0
- package/dist/utils/array.d.ts +19 -0
- package/dist/utils/asserts.d.ts +2 -0
- package/dist/utils/color.d.ts +10 -0
- package/dist/utils/device.d.ts +4 -0
- package/dist/utils/image-data.d.ts +10 -0
- package/dist/utils/index.d.ts +67 -0
- package/dist/utils/sortable.d.ts +23 -0
- package/dist/utils/timeline-component.d.ts +39 -0
- package/dist/vfx-item.d.ts +361 -0
- package/package.json +2 -2
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import type * as spec from '@galacean/effects-specification';
|
|
2
|
+
import type { JSONValue } from './downloader';
|
|
3
|
+
import { Downloader } from './downloader';
|
|
4
|
+
import type { Disposable } from './utils';
|
|
5
|
+
import type { Scene } from './scene';
|
|
6
|
+
import type { Renderer } from './render';
|
|
7
|
+
/**
|
|
8
|
+
* 场景加载参数
|
|
9
|
+
*/
|
|
10
|
+
export interface SceneLoadOptions {
|
|
11
|
+
/**
|
|
12
|
+
* 动态数据的参数
|
|
13
|
+
* key 是 JSON 中配置的字段名
|
|
14
|
+
* value 是要使用的值,图片使用 url 链接
|
|
15
|
+
* 图片链接可以使用数组传递,如果第一个加载失败,将尝试使用第二个地址
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ``` ts
|
|
19
|
+
* {
|
|
20
|
+
* variables: {
|
|
21
|
+
* bg: ['url','fallback_url'], // 如果两个图片都失败,将会触发加载失败
|
|
22
|
+
* fg: 'url' // 如果图片加载失败,将会触发加载失败,
|
|
23
|
+
* amount: 88.8,
|
|
24
|
+
* name: 'abc'
|
|
25
|
+
* }
|
|
26
|
+
* }
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
variables?: Record<string, number | string | string[]>;
|
|
30
|
+
/**
|
|
31
|
+
* 模板图片缩放倍数
|
|
32
|
+
* @default 1 如果图片比较糊,可以用 2(但会增大图片内存)
|
|
33
|
+
*/
|
|
34
|
+
templateScale?: number;
|
|
35
|
+
/**
|
|
36
|
+
* 是否使用压缩纹理
|
|
37
|
+
*/
|
|
38
|
+
useCompressedTexture?: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* 渲染分级。
|
|
41
|
+
* 分级之后,只会加载当前渲染等级的资源。
|
|
42
|
+
* 当渲染等级被设置为 B 后,player 的 fps 会降到 30 帧
|
|
43
|
+
* @default 's'
|
|
44
|
+
*/
|
|
45
|
+
renderLevel?: spec.RenderLevel;
|
|
46
|
+
/**
|
|
47
|
+
* 资源加载超时,时间单位秒
|
|
48
|
+
* @default 10s
|
|
49
|
+
*/
|
|
50
|
+
timeout?: number;
|
|
51
|
+
/***
|
|
52
|
+
* 用于给 plugin 的加载数据
|
|
53
|
+
* key/value 的内容由 plugin 自己实现
|
|
54
|
+
*/
|
|
55
|
+
pluginData?: Record<string, any>;
|
|
56
|
+
/**
|
|
57
|
+
* 场景加载时的环境(加载后把 env 结果写入 scene)
|
|
58
|
+
* @default '' - 编辑器中为 'editor'
|
|
59
|
+
*/
|
|
60
|
+
env?: string;
|
|
61
|
+
/**
|
|
62
|
+
* 加载后是否自动播放
|
|
63
|
+
* @default true
|
|
64
|
+
*/
|
|
65
|
+
autoplay?: boolean;
|
|
66
|
+
/**
|
|
67
|
+
* 合成播放完成后是否需要再使用,是的话生命周期结束后不会 `dispose`
|
|
68
|
+
* @default false
|
|
69
|
+
*/
|
|
70
|
+
reusable?: boolean;
|
|
71
|
+
/**
|
|
72
|
+
* 播放速度,当速度为负数时,合成倒播
|
|
73
|
+
*/
|
|
74
|
+
speed?: number;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* 资源管理器
|
|
78
|
+
* 用于加载和动效中所有的资源文件,包括图片、插件、图层粒子数据等
|
|
79
|
+
*/
|
|
80
|
+
export declare class AssetManager implements Disposable {
|
|
81
|
+
private options;
|
|
82
|
+
private readonly downloader;
|
|
83
|
+
/**
|
|
84
|
+
* 相对url的基本路径
|
|
85
|
+
*/
|
|
86
|
+
private baseUrl;
|
|
87
|
+
/**
|
|
88
|
+
* 图像资源,用于创建和释放GPU纹理资源
|
|
89
|
+
*/
|
|
90
|
+
private assets;
|
|
91
|
+
/**
|
|
92
|
+
* 自定义文本缓存,随页面销毁而销毁
|
|
93
|
+
*/
|
|
94
|
+
static fonts: Set<string>;
|
|
95
|
+
private id;
|
|
96
|
+
/**
|
|
97
|
+
* 加载超时时间
|
|
98
|
+
* @default 10
|
|
99
|
+
*/
|
|
100
|
+
private timeout;
|
|
101
|
+
/**
|
|
102
|
+
* 构造函数
|
|
103
|
+
* @param options - 场景加载参数
|
|
104
|
+
* @param downloader - 资源下载对象
|
|
105
|
+
*/
|
|
106
|
+
constructor(options?: SceneLoadOptions, downloader?: Downloader);
|
|
107
|
+
updateOptions(options?: SceneLoadOptions): void;
|
|
108
|
+
/**
|
|
109
|
+
* 场景创建,通过 json 创建出场景对象,并进行提前编译等工作
|
|
110
|
+
* @param url - json 的 URL 链接或者 json 对象
|
|
111
|
+
* @param renderer - renderer 对象,用于获取管理、编译 shader 及 GPU 上下文的参数
|
|
112
|
+
* @param options - 扩展参数
|
|
113
|
+
* @returns
|
|
114
|
+
*/
|
|
115
|
+
loadScene(url: string | JSONValue | Scene, renderer?: Renderer, options?: {
|
|
116
|
+
env: string;
|
|
117
|
+
}): Promise<Scene>;
|
|
118
|
+
private precompile;
|
|
119
|
+
private processJSON;
|
|
120
|
+
private processBins;
|
|
121
|
+
private processFontURL;
|
|
122
|
+
private processImages;
|
|
123
|
+
private processTextures;
|
|
124
|
+
private loadJSON;
|
|
125
|
+
private loadBins;
|
|
126
|
+
/**
|
|
127
|
+
* 销毁方法
|
|
128
|
+
*/
|
|
129
|
+
dispose(): void;
|
|
130
|
+
}
|
package/dist/camera.d.ts
ADDED
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
import * as spec from '@galacean/effects-specification';
|
|
2
|
+
import { Matrix4, Vector3, Euler, Quaternion } from '@galacean/effects-math/es/core/index';
|
|
3
|
+
interface CameraOptionsBase {
|
|
4
|
+
/**
|
|
5
|
+
* 相机近平面
|
|
6
|
+
*/
|
|
7
|
+
near: number;
|
|
8
|
+
/**
|
|
9
|
+
* 相机远平面
|
|
10
|
+
*/
|
|
11
|
+
far: number;
|
|
12
|
+
/**
|
|
13
|
+
* 视锥体垂直视野角度
|
|
14
|
+
*/
|
|
15
|
+
fov: number;
|
|
16
|
+
/**
|
|
17
|
+
* 视锥体的长宽比
|
|
18
|
+
*/
|
|
19
|
+
aspect: number;
|
|
20
|
+
/**
|
|
21
|
+
* 相机的裁剪模式
|
|
22
|
+
*/
|
|
23
|
+
clipMode: spec.CameraClipMode;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
*
|
|
27
|
+
*/
|
|
28
|
+
export interface CameraOptions extends CameraOptionsBase {
|
|
29
|
+
/**
|
|
30
|
+
* 相机的位置
|
|
31
|
+
*/
|
|
32
|
+
position: spec.vec3;
|
|
33
|
+
/**
|
|
34
|
+
* 相机的旋转,欧拉角
|
|
35
|
+
*/
|
|
36
|
+
rotation: spec.vec3;
|
|
37
|
+
/**
|
|
38
|
+
* 相机的旋转,四元数
|
|
39
|
+
*/
|
|
40
|
+
quat?: spec.vec4;
|
|
41
|
+
}
|
|
42
|
+
export interface CameraOptionsEx extends CameraOptionsBase {
|
|
43
|
+
/**
|
|
44
|
+
* 相机的位置
|
|
45
|
+
*/
|
|
46
|
+
position: Vector3;
|
|
47
|
+
/**
|
|
48
|
+
* 相机的旋转,欧拉角
|
|
49
|
+
*/
|
|
50
|
+
rotation: Euler;
|
|
51
|
+
/**
|
|
52
|
+
* 相机的旋转,四元数
|
|
53
|
+
*/
|
|
54
|
+
quat?: Quaternion;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* 合成的相机对象,采用透视投影
|
|
58
|
+
*/
|
|
59
|
+
export declare class Camera {
|
|
60
|
+
name: string;
|
|
61
|
+
private options;
|
|
62
|
+
private viewMatrix;
|
|
63
|
+
private projectionMatrix;
|
|
64
|
+
private viewProjectionMatrix;
|
|
65
|
+
private inverseViewMatrix;
|
|
66
|
+
private inverseProjectionMatrix;
|
|
67
|
+
private inverseViewProjectionMatrix;
|
|
68
|
+
private dirty;
|
|
69
|
+
/**
|
|
70
|
+
*
|
|
71
|
+
* @param name - 相机名称
|
|
72
|
+
* @param options
|
|
73
|
+
*/
|
|
74
|
+
constructor(name: string, options?: Partial<CameraOptions>);
|
|
75
|
+
/**
|
|
76
|
+
* 设置相机近平面
|
|
77
|
+
* @param near
|
|
78
|
+
*/
|
|
79
|
+
set near(near: number);
|
|
80
|
+
get near(): number;
|
|
81
|
+
/**
|
|
82
|
+
* 设置相机远平面
|
|
83
|
+
* @param far
|
|
84
|
+
*/
|
|
85
|
+
set far(far: number);
|
|
86
|
+
get far(): number;
|
|
87
|
+
/**
|
|
88
|
+
* 设置相机视锥体垂直视野角度
|
|
89
|
+
* @param fov
|
|
90
|
+
*/
|
|
91
|
+
set fov(fov: number);
|
|
92
|
+
get fov(): number;
|
|
93
|
+
/**
|
|
94
|
+
* 设置相机视锥体的长宽比
|
|
95
|
+
* @param aspect
|
|
96
|
+
*/
|
|
97
|
+
set aspect(aspect: number);
|
|
98
|
+
get aspect(): number;
|
|
99
|
+
/**
|
|
100
|
+
* 相机的裁剪模式
|
|
101
|
+
* @param clipMode
|
|
102
|
+
*/
|
|
103
|
+
set clipMode(clipMode: spec.CameraClipMode | undefined);
|
|
104
|
+
get clipMode(): spec.CameraClipMode | undefined;
|
|
105
|
+
/**
|
|
106
|
+
* 设置相机的位置
|
|
107
|
+
* @param value
|
|
108
|
+
*/
|
|
109
|
+
set position(value: Vector3);
|
|
110
|
+
get position(): Vector3;
|
|
111
|
+
/**
|
|
112
|
+
* 设置相机的旋转角度
|
|
113
|
+
* @param value
|
|
114
|
+
*/
|
|
115
|
+
set rotation(value: Euler);
|
|
116
|
+
get rotation(): Euler;
|
|
117
|
+
/**
|
|
118
|
+
* 获取相机的视图变换矩阵
|
|
119
|
+
* @return
|
|
120
|
+
*/
|
|
121
|
+
getViewMatrix(): Matrix4;
|
|
122
|
+
/**
|
|
123
|
+
* 获取视图变换的逆矩阵
|
|
124
|
+
*/
|
|
125
|
+
getInverseViewMatrix(): Matrix4;
|
|
126
|
+
/**
|
|
127
|
+
* 获取相机的投影矩阵
|
|
128
|
+
* @return
|
|
129
|
+
*/
|
|
130
|
+
getProjectionMatrix(): Matrix4;
|
|
131
|
+
/**
|
|
132
|
+
* 获取相机投影矩阵的逆矩阵
|
|
133
|
+
* @return
|
|
134
|
+
*/
|
|
135
|
+
getInverseProjectionMatrix(): Matrix4;
|
|
136
|
+
/**
|
|
137
|
+
* 获取相机的 VP 矩阵
|
|
138
|
+
* @return
|
|
139
|
+
*/
|
|
140
|
+
getViewProjectionMatrix(): Matrix4;
|
|
141
|
+
/**
|
|
142
|
+
* 获取相机 VP 矩阵的逆矩阵
|
|
143
|
+
* @return
|
|
144
|
+
*/
|
|
145
|
+
getInverseViewProjectionMatrix(): Matrix4;
|
|
146
|
+
/**
|
|
147
|
+
* 根据相机的视图投影矩阵对指定模型矩阵做变换
|
|
148
|
+
* @param out - 结果矩阵
|
|
149
|
+
* @param model - 模型变换矩阵
|
|
150
|
+
*/
|
|
151
|
+
getModelViewProjection(out: Matrix4, model: Matrix4): Matrix4;
|
|
152
|
+
/**
|
|
153
|
+
* 获取归一化坐标和 3D 世界坐标的换算比例
|
|
154
|
+
* @param z - 当前的位置 z
|
|
155
|
+
*/
|
|
156
|
+
getInverseVPRatio(z: number): Vector3;
|
|
157
|
+
/**
|
|
158
|
+
* 设置相机的旋转四元数
|
|
159
|
+
* @param value - 旋转四元数
|
|
160
|
+
*/
|
|
161
|
+
setQuat(value: Quaternion): void;
|
|
162
|
+
/**
|
|
163
|
+
* 获取相机旋转对应的四元数
|
|
164
|
+
* @returns
|
|
165
|
+
*/
|
|
166
|
+
getQuat(): Quaternion;
|
|
167
|
+
/**
|
|
168
|
+
* 获取相机内部的 options
|
|
169
|
+
* @returns 相机 options
|
|
170
|
+
*/
|
|
171
|
+
getOptions(): CameraOptionsEx;
|
|
172
|
+
/**
|
|
173
|
+
* 复制指定相机元素的属性到当前相机
|
|
174
|
+
* @param camera
|
|
175
|
+
*/
|
|
176
|
+
copy(camera: Camera): void;
|
|
177
|
+
/**
|
|
178
|
+
* 更新相机相关的矩阵,获取矩阵前会自动调用
|
|
179
|
+
*/
|
|
180
|
+
updateMatrix(): void;
|
|
181
|
+
private setRotationByQuat;
|
|
182
|
+
}
|
|
183
|
+
export {};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import type { Ray } from '@galacean/effects-math/es';
|
|
2
|
+
import * as spec from '@galacean/effects-specification';
|
|
3
|
+
import { CalculateItem } from './plugins';
|
|
4
|
+
import type { Region } from './plugins';
|
|
5
|
+
import type { VFXItemContent, VFXItemProps } from './vfx-item';
|
|
6
|
+
import { VFXItem } from './vfx-item';
|
|
7
|
+
import type { Composition, CompositionHitTestOptions } from './composition';
|
|
8
|
+
export interface ItemNode {
|
|
9
|
+
id: string;
|
|
10
|
+
item: VFXItem<VFXItemContent>;
|
|
11
|
+
children: ItemNode[];
|
|
12
|
+
parentId?: string;
|
|
13
|
+
}
|
|
14
|
+
export declare class CompVFXItem extends VFXItem<void | CalculateItem> {
|
|
15
|
+
/**
|
|
16
|
+
* 创建好的元素数组
|
|
17
|
+
*/
|
|
18
|
+
items: VFXItem<VFXItemContent>[];
|
|
19
|
+
/**
|
|
20
|
+
* 根据父子关系构建的元素树
|
|
21
|
+
*/
|
|
22
|
+
itemTree: ItemNode[];
|
|
23
|
+
startTime: number;
|
|
24
|
+
contentProps: any;
|
|
25
|
+
timeInms: number;
|
|
26
|
+
/**
|
|
27
|
+
* id和元素的映射关系Map,方便查找
|
|
28
|
+
*/
|
|
29
|
+
readonly itemCacheMap: Map<string, ItemNode>;
|
|
30
|
+
private itemProps;
|
|
31
|
+
private freezeOnEnd;
|
|
32
|
+
private startTimeInms;
|
|
33
|
+
private itemsToRemove;
|
|
34
|
+
private tempQueue;
|
|
35
|
+
private extraCamera;
|
|
36
|
+
private refId;
|
|
37
|
+
get type(): spec.ItemType;
|
|
38
|
+
onConstructed(props: VFXItemProps): void;
|
|
39
|
+
createContent(): void;
|
|
40
|
+
protected doCreateContent(): CalculateItem;
|
|
41
|
+
onLifetimeBegin(): void;
|
|
42
|
+
doStop(): void;
|
|
43
|
+
onItemUpdate(dt: number, lifetime: number): void;
|
|
44
|
+
onItemRemoved(composition: Composition): void;
|
|
45
|
+
reset(): void;
|
|
46
|
+
handleVisibleChanged(visible: boolean): void;
|
|
47
|
+
getUpdateTime(t: number): number;
|
|
48
|
+
removeItem(item: VFXItem<VFXItemContent>): boolean;
|
|
49
|
+
/**
|
|
50
|
+
* 设置指定元素的父元素
|
|
51
|
+
* @param item
|
|
52
|
+
* @param parentItem - 为 undefined 时表示设置父变换为合成的变换
|
|
53
|
+
*/
|
|
54
|
+
setItemParent(item: VFXItem<VFXItemContent>, parentItem?: VFXItem<VFXItemContent>): void;
|
|
55
|
+
/**
|
|
56
|
+
* 获取指定元素当前时刻真正起作用的父元素, 需要在元素生命周期内获取
|
|
57
|
+
* @internal
|
|
58
|
+
* @param item - 指定元素
|
|
59
|
+
* @return 当父元素生命周期结束时,返回空
|
|
60
|
+
*/
|
|
61
|
+
getItemCurrentParent(item: VFXItem<VFXItemContent>): VFXItem<VFXItemContent> | void;
|
|
62
|
+
getItemByName(name: string): VFXItem<VFXItemContent>[];
|
|
63
|
+
hitTest(ray: Ray, x: number, y: number, regions: Region[], force?: boolean, options?: CompositionHitTestOptions): Region[];
|
|
64
|
+
protected isEnded(now: number): boolean;
|
|
65
|
+
/**
|
|
66
|
+
* 构建父子树,同时保存到 itemCacheMap 中便于查找
|
|
67
|
+
*/
|
|
68
|
+
private buildItemTree;
|
|
69
|
+
private getParentIdWithoutSuffix;
|
|
70
|
+
private restart;
|
|
71
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import * as spec from '@galacean/effects-specification';
|
|
2
|
+
import { Texture } from './texture';
|
|
3
|
+
import type { Disposable } from './utils';
|
|
4
|
+
import type { Scene } from './scene';
|
|
5
|
+
import type { PluginSystem } from './plugin-system';
|
|
6
|
+
import type { Engine } from './engine';
|
|
7
|
+
import type { GlobalVolume } from './render';
|
|
8
|
+
import type { VFXItemProps } from './vfx-item';
|
|
9
|
+
export interface ContentOptions {
|
|
10
|
+
id: string;
|
|
11
|
+
duration: number;
|
|
12
|
+
name: string;
|
|
13
|
+
endBehavior: spec.CompositionEndBehavior;
|
|
14
|
+
items: any[];
|
|
15
|
+
camera: spec.CameraOptions;
|
|
16
|
+
startTime: number;
|
|
17
|
+
globalVolume: GlobalVolume;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* 合成资源管理
|
|
21
|
+
*/
|
|
22
|
+
export declare class CompositionSourceManager implements Disposable {
|
|
23
|
+
composition?: spec.Composition;
|
|
24
|
+
refCompositions: Map<string, spec.Composition>;
|
|
25
|
+
sourceContent?: ContentOptions;
|
|
26
|
+
refCompositionProps: Map<string, VFXItemProps>;
|
|
27
|
+
renderLevel?: spec.RenderLevel;
|
|
28
|
+
pluginSystem?: PluginSystem;
|
|
29
|
+
totalTime: number;
|
|
30
|
+
imgUsage: Record<string, number[]>;
|
|
31
|
+
textures: Texture[];
|
|
32
|
+
jsonScene?: spec.JSONScene;
|
|
33
|
+
mask: number;
|
|
34
|
+
textureOptions: Record<string, any>[];
|
|
35
|
+
constructor(scene: Scene, engine: Engine);
|
|
36
|
+
private getContent;
|
|
37
|
+
private assembleItems;
|
|
38
|
+
private changeTex;
|
|
39
|
+
private addTextureUsage;
|
|
40
|
+
/**
|
|
41
|
+
* 处理蒙版和遮挡关系写入 stencil 的 ref 值
|
|
42
|
+
*/
|
|
43
|
+
private processMask;
|
|
44
|
+
dispose(): void;
|
|
45
|
+
}
|