@galacean/effects-core 1.0.0 → 1.1.0-alpha.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/camera.d.ts +37 -21
- package/dist/comp-vfx-item.d.ts +6 -1
- package/dist/composition-source-manager.d.ts +3 -0
- package/dist/composition.d.ts +17 -9
- package/dist/constants.d.ts +0 -3
- package/dist/index.d.ts +1 -0
- package/dist/index.js +6604 -1464
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +6603 -1427
- package/dist/index.mjs.map +1 -1
- package/dist/material/material.d.ts +23 -12
- package/dist/material/types.d.ts +2 -1
- package/dist/math/index.d.ts +1 -6
- package/dist/math/translate.d.ts +2 -2
- package/dist/math/utils.d.ts +15 -4
- package/dist/plugins/cal/calculate-item.d.ts +10 -9
- package/dist/plugins/camera/camera-controller-node.d.ts +3 -3
- package/dist/plugins/camera/camera-vfx-item.d.ts +1 -1
- package/dist/plugins/interact/click-handler.d.ts +16 -17
- package/dist/plugins/particle/particle-loader.d.ts +1 -1
- package/dist/plugins/particle/particle-mesh.d.ts +11 -9
- package/dist/plugins/particle/particle-system.d.ts +8 -6
- package/dist/plugins/particle/trail-mesh.d.ts +9 -7
- package/dist/plugins/sprite/sprite-group.d.ts +1 -1
- package/dist/plugins/sprite/sprite-item.d.ts +2 -1
- package/dist/plugins/sprite/sprite-loader.d.ts +1 -1
- package/dist/plugins/sprite/sprite-mesh.d.ts +2 -1
- package/dist/plugins/sprite/sprite-vfx-item.d.ts +2 -1
- package/dist/plugins/text/text-layout.d.ts +1 -1
- package/dist/plugins/text/text-vfx-item.d.ts +2 -1
- package/dist/render/mesh.d.ts +3 -3
- package/dist/render/render-frame.d.ts +6 -6
- package/dist/render/renderer.d.ts +2 -2
- package/dist/semantic-map.d.ts +1 -1
- package/dist/shape/shape.d.ts +4 -4
- package/dist/transform.d.ts +27 -27
- package/dist/utils/timeline-component.d.ts +1 -0
- package/dist/vfx-item.d.ts +18 -2
- package/package.json +3 -2
- package/dist/math/matrix.d.ts +0 -32
- package/dist/math/quat.d.ts +0 -23
- package/dist/math/raycast.d.ts +0 -16
- package/dist/math/types.d.ts +0 -30
- package/dist/math/vec.d.ts +0 -24
package/dist/camera.d.ts
CHANGED
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
import type { vec3 } from '@galacean/effects-specification';
|
|
2
1
|
import * as spec from '@galacean/effects-specification';
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
*
|
|
6
|
-
*/
|
|
7
|
-
export interface CameraOptions {
|
|
2
|
+
import { Matrix4, Vector3, Euler, Quaternion } from '@galacean/effects-math/es/core/index';
|
|
3
|
+
interface CameraOptionsBase {
|
|
8
4
|
/**
|
|
9
5
|
* 相机近平面
|
|
10
6
|
*/
|
|
@@ -25,6 +21,11 @@ export interface CameraOptions {
|
|
|
25
21
|
* 相机的裁剪模式
|
|
26
22
|
*/
|
|
27
23
|
clipMode: spec.CameraClipMode;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
*
|
|
27
|
+
*/
|
|
28
|
+
export interface CameraOptions extends CameraOptionsBase {
|
|
28
29
|
/**
|
|
29
30
|
* 相机的位置
|
|
30
31
|
*/
|
|
@@ -38,6 +39,20 @@ export interface CameraOptions {
|
|
|
38
39
|
*/
|
|
39
40
|
quat?: spec.vec4;
|
|
40
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
|
+
}
|
|
41
56
|
/**
|
|
42
57
|
* 合成的相机对象,采用透视投影
|
|
43
58
|
*/
|
|
@@ -91,69 +106,69 @@ export declare class Camera {
|
|
|
91
106
|
* 设置相机的位置
|
|
92
107
|
* @param value
|
|
93
108
|
*/
|
|
94
|
-
set position(value:
|
|
95
|
-
get position():
|
|
109
|
+
set position(value: Vector3);
|
|
110
|
+
get position(): Vector3;
|
|
96
111
|
/**
|
|
97
112
|
* 设置相机的旋转角度
|
|
98
113
|
* @param value
|
|
99
114
|
*/
|
|
100
|
-
set rotation(value:
|
|
101
|
-
get rotation():
|
|
115
|
+
set rotation(value: Euler);
|
|
116
|
+
get rotation(): Euler;
|
|
102
117
|
/**
|
|
103
118
|
* 获取相机的视图变换矩阵
|
|
104
119
|
* @return
|
|
105
120
|
*/
|
|
106
|
-
getViewMatrix():
|
|
121
|
+
getViewMatrix(): Matrix4;
|
|
107
122
|
/**
|
|
108
123
|
* 获取视图变换的逆矩阵
|
|
109
124
|
*/
|
|
110
|
-
getInverseViewMatrix():
|
|
125
|
+
getInverseViewMatrix(): Matrix4;
|
|
111
126
|
/**
|
|
112
127
|
* 获取相机的投影矩阵
|
|
113
128
|
* @return
|
|
114
129
|
*/
|
|
115
|
-
getProjectionMatrix():
|
|
130
|
+
getProjectionMatrix(): Matrix4;
|
|
116
131
|
/**
|
|
117
132
|
* 获取相机投影矩阵的逆矩阵
|
|
118
133
|
* @return
|
|
119
134
|
*/
|
|
120
|
-
getInverseProjectionMatrix():
|
|
135
|
+
getInverseProjectionMatrix(): Matrix4;
|
|
121
136
|
/**
|
|
122
137
|
* 获取相机的 VP 矩阵
|
|
123
138
|
* @return
|
|
124
139
|
*/
|
|
125
|
-
getViewProjectionMatrix():
|
|
140
|
+
getViewProjectionMatrix(): Matrix4;
|
|
126
141
|
/**
|
|
127
142
|
* 获取相机 VP 矩阵的逆矩阵
|
|
128
143
|
* @return
|
|
129
144
|
*/
|
|
130
|
-
getInverseViewProjectionMatrix():
|
|
145
|
+
getInverseViewProjectionMatrix(): Matrix4;
|
|
131
146
|
/**
|
|
132
147
|
* 根据相机的视图投影矩阵对指定模型矩阵做变换
|
|
133
148
|
* @param out - 结果矩阵
|
|
134
149
|
* @param model - 模型变换矩阵
|
|
135
150
|
*/
|
|
136
|
-
getModelViewProjection(out:
|
|
151
|
+
getModelViewProjection(out: Matrix4, model: Matrix4): Matrix4;
|
|
137
152
|
/**
|
|
138
153
|
* 获取归一化坐标和 3D 世界坐标的换算比例
|
|
139
154
|
* @param z - 当前的位置 z
|
|
140
155
|
*/
|
|
141
|
-
getInverseVPRatio(z: number):
|
|
156
|
+
getInverseVPRatio(z: number): Vector3;
|
|
142
157
|
/**
|
|
143
158
|
* 设置相机的旋转四元数
|
|
144
159
|
* @param value - 旋转四元数
|
|
145
160
|
*/
|
|
146
|
-
setQuat(value:
|
|
161
|
+
setQuat(value: Quaternion): void;
|
|
147
162
|
/**
|
|
148
163
|
* 获取相机旋转对应的四元数
|
|
149
164
|
* @returns
|
|
150
165
|
*/
|
|
151
|
-
getQuat():
|
|
166
|
+
getQuat(): Quaternion;
|
|
152
167
|
/**
|
|
153
168
|
* 获取相机内部的 options
|
|
154
169
|
* @returns 相机 options
|
|
155
170
|
*/
|
|
156
|
-
getOptions():
|
|
171
|
+
getOptions(): CameraOptionsEx;
|
|
157
172
|
/**
|
|
158
173
|
* 复制指定相机元素的属性到当前相机
|
|
159
174
|
* @param camera
|
|
@@ -165,3 +180,4 @@ export declare class Camera {
|
|
|
165
180
|
updateMatrix(): void;
|
|
166
181
|
private setRotationByQuat;
|
|
167
182
|
}
|
|
183
|
+
export {};
|
package/dist/comp-vfx-item.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as spec from '@galacean/effects-specification';
|
|
2
|
+
import { CalculateItem } from './plugins';
|
|
2
3
|
import type { VFXItemContent, VFXItemProps } from './vfx-item';
|
|
3
4
|
import { VFXItem } from './vfx-item';
|
|
4
5
|
import type { Composition } from './composition';
|
|
@@ -8,7 +9,7 @@ export interface ItemNode {
|
|
|
8
9
|
children: ItemNode[];
|
|
9
10
|
parentId?: string;
|
|
10
11
|
}
|
|
11
|
-
export declare class CompVFXItem extends VFXItem<void> {
|
|
12
|
+
export declare class CompVFXItem extends VFXItem<void | CalculateItem> {
|
|
12
13
|
/**
|
|
13
14
|
* 创建好的元素数组
|
|
14
15
|
*/
|
|
@@ -18,6 +19,7 @@ export declare class CompVFXItem extends VFXItem<void> {
|
|
|
18
19
|
*/
|
|
19
20
|
itemTree: ItemNode[];
|
|
20
21
|
startTime: number;
|
|
22
|
+
contentProps: any;
|
|
21
23
|
timeInms: number;
|
|
22
24
|
/**
|
|
23
25
|
* id和元素的映射关系Map,方便查找
|
|
@@ -32,6 +34,7 @@ export declare class CompVFXItem extends VFXItem<void> {
|
|
|
32
34
|
get type(): spec.ItemType;
|
|
33
35
|
onConstructed(props: VFXItemProps): void;
|
|
34
36
|
createContent(): void;
|
|
37
|
+
protected doCreateContent(): CalculateItem;
|
|
35
38
|
onLifetimeBegin(): void;
|
|
36
39
|
doStop(): void;
|
|
37
40
|
onItemUpdate(dt: number, lifetime: number): void;
|
|
@@ -53,10 +56,12 @@ export declare class CompVFXItem extends VFXItem<void> {
|
|
|
53
56
|
* @return 当父元素生命周期结束时,返回空
|
|
54
57
|
*/
|
|
55
58
|
getItemCurrentParent(item: VFXItem<VFXItemContent>): VFXItem<VFXItemContent> | void;
|
|
59
|
+
getItemByName(name: string): VFXItem<VFXItemContent>[];
|
|
56
60
|
protected isEnded(now: number): boolean;
|
|
57
61
|
/**
|
|
58
62
|
* 构建父子树,同时保存到 itemCacheMap 中便于查找
|
|
59
63
|
*/
|
|
60
64
|
private buildItemTree;
|
|
61
65
|
private getParentIdWithoutSuffix;
|
|
66
|
+
private restart;
|
|
62
67
|
}
|
|
@@ -5,6 +5,7 @@ import type { Scene } from './scene';
|
|
|
5
5
|
import type { PluginSystem } from './plugin-system';
|
|
6
6
|
import type { Engine } from './engine';
|
|
7
7
|
import type { GlobalVolume } from './render';
|
|
8
|
+
import type { VFXItemProps } from './vfx-item';
|
|
8
9
|
export interface ContentOptions {
|
|
9
10
|
id: string;
|
|
10
11
|
duration: number;
|
|
@@ -20,7 +21,9 @@ export interface ContentOptions {
|
|
|
20
21
|
*/
|
|
21
22
|
export declare class CompositionSourceManager implements Disposable {
|
|
22
23
|
composition?: spec.Composition;
|
|
24
|
+
refCompositions: Map<string, spec.Composition>;
|
|
23
25
|
sourceContent?: ContentOptions;
|
|
26
|
+
refCompositionProps: Map<string, VFXItemProps>;
|
|
24
27
|
renderLevel?: spec.RenderLevel;
|
|
25
28
|
pluginSystem?: PluginSystem;
|
|
26
29
|
totalTime: number;
|
package/dist/composition.d.ts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import * as spec from '@galacean/effects-specification';
|
|
2
|
+
import type { Ray } from '@galacean/effects-math/es/core/index';
|
|
2
3
|
import type { JSONValue } from './downloader';
|
|
3
4
|
import type { Scene } from './scene';
|
|
4
5
|
import type { Disposable, LostHandler } from './utils';
|
|
5
6
|
import { Transform } from './transform';
|
|
6
|
-
import type { VFXItem, VFXItemContent } from './vfx-item';
|
|
7
|
+
import type { VFXItem, VFXItemContent, VFXItemProps } from './vfx-item';
|
|
7
8
|
import { CompVFXItem } from './comp-vfx-item';
|
|
8
|
-
import type { InteractVFXItem, EventSystem } from './plugins';
|
|
9
|
+
import type { InteractVFXItem, EventSystem, Region } from './plugins';
|
|
9
10
|
import type { PluginSystem } from './plugin-system';
|
|
10
11
|
import type { MeshRendererOptions, Renderer } from './render';
|
|
11
|
-
import type { Texture } from './texture';
|
|
12
12
|
import { RenderFrame } from './render';
|
|
13
|
+
import type { Texture } from './texture';
|
|
13
14
|
import { Camera } from './camera';
|
|
14
|
-
import type { Region } from './plugins';
|
|
15
15
|
import { CompositionSourceManager } from './composition-source-manager';
|
|
16
16
|
export interface CompositionStatistic {
|
|
17
17
|
loadTime: number;
|
|
@@ -109,6 +109,10 @@ export declare class Composition implements Disposable, LostHandler {
|
|
|
109
109
|
* 插件系统,保存当前加载的插件对象,负责插件事件和创建插件的 Item 对象
|
|
110
110
|
*/
|
|
111
111
|
readonly pluginSystem: PluginSystem;
|
|
112
|
+
/**
|
|
113
|
+
* 是否在合成结束时自动销毁引用的纹理,合成重播时不销毁
|
|
114
|
+
*/
|
|
115
|
+
autoRefTex: boolean;
|
|
112
116
|
/**
|
|
113
117
|
* 当前合成名称
|
|
114
118
|
*/
|
|
@@ -133,6 +137,14 @@ export declare class Composition implements Disposable, LostHandler {
|
|
|
133
137
|
* 合成对象
|
|
134
138
|
*/
|
|
135
139
|
readonly content: CompVFXItem;
|
|
140
|
+
/**
|
|
141
|
+
* 预合成数组
|
|
142
|
+
*/
|
|
143
|
+
readonly refContent: CompVFXItem[];
|
|
144
|
+
/**
|
|
145
|
+
* 预合成的合成属性,在 content 中会被其元素属性覆盖
|
|
146
|
+
*/
|
|
147
|
+
refCompositionProps: Map<string, VFXItemProps>;
|
|
136
148
|
/**
|
|
137
149
|
* 合成的相机对象
|
|
138
150
|
*/
|
|
@@ -157,7 +169,6 @@ export declare class Composition implements Disposable, LostHandler {
|
|
|
157
169
|
*/
|
|
158
170
|
private readonly globalVolume;
|
|
159
171
|
private readonly texInfo;
|
|
160
|
-
private readonly autoRefTex;
|
|
161
172
|
private readonly postLoaders;
|
|
162
173
|
private readonly handleMessageItem?;
|
|
163
174
|
/**
|
|
@@ -303,10 +314,7 @@ export declare class Composition implements Disposable, LostHandler {
|
|
|
303
314
|
* @param y
|
|
304
315
|
* @returns
|
|
305
316
|
*/
|
|
306
|
-
getHitTestRay(x: number, y: number):
|
|
307
|
-
center: spec.vec3;
|
|
308
|
-
direction: spec.vec3;
|
|
309
|
-
};
|
|
317
|
+
getHitTestRay(x: number, y: number): Ray;
|
|
310
318
|
/**
|
|
311
319
|
* 获取 engine 对象
|
|
312
320
|
* @returns
|
package/dist/constants.d.ts
CHANGED
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
import type * as spec from '@galacean/effects-specification';
|
|
2
1
|
export declare const SPRITE_VERTEX_STRIDE = 6;
|
|
3
|
-
export declare const VFX_ITEM_TYPE_TREE: spec.ItemType;
|
|
4
2
|
export declare const SEMANTIC_PRE_COLOR_ATTACHMENT_0 = "PRE_COLOR_0";
|
|
5
3
|
export declare const SEMANTIC_PRE_COLOR_ATTACHMENT_SIZE_0 = "PRE_COLOR_SIZE_0";
|
|
6
4
|
export declare const SEMANTIC_MAIN_PRE_COLOR_ATTACHMENT_0 = "PRE_MAIN_COLOR_0";
|
|
7
5
|
export declare const SEMANTIC_MAIN_PRE_COLOR_ATTACHMENT_SIZE_0 = "PRE_MAIN_COLOR_SIZE_0";
|
|
8
6
|
export declare const PLAYER_OPTIONS_ENV_EDITOR = "editor";
|
|
9
7
|
export declare const FILTER_NAME_NONE = "none";
|
|
10
|
-
export declare const DEG2RAD = 0.017453292519943295;
|
|
11
8
|
export declare const HELP_LINK: {
|
|
12
9
|
'Filter not imported': string;
|
|
13
10
|
'Item duration can\'t be less than 0': string;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import './polyfill';
|
|
2
2
|
export * as spec from '@galacean/effects-specification';
|
|
3
3
|
export { getStandardJSON, getStandardImage, getStandardComposition, getStandardItem, } from '@galacean/effects-specification/dist/fallback';
|
|
4
|
+
export * as math from '@galacean/effects-math/es/core/index';
|
|
4
5
|
export * from './gl';
|
|
5
6
|
export * from './constants';
|
|
6
7
|
export * from './config';
|