@galacean/effects-core 2.7.0-alpha.1 → 2.7.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/camera.d.ts +30 -0
- package/dist/components/shape-component.d.ts +16 -43
- package/dist/composition.d.ts +2 -5
- package/dist/effects-object.d.ts +1 -1
- package/dist/engine.d.ts +1 -1
- package/dist/index.js +451 -273
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +452 -274
- package/dist/index.mjs.map +1 -1
- package/dist/material/material.d.ts +0 -4
- package/dist/plugin-system.d.ts +3 -2
- package/dist/plugins/animation-graph/pose.d.ts +1 -1
- package/dist/plugins/animation-graph/skeleton.d.ts +1 -1
- package/dist/plugins/interact/interact-item.d.ts +25 -0
- package/dist/plugins/interact/interact-mesh.d.ts +1 -2
- package/dist/plugins/sprite/sprite-item.d.ts +1 -1
- package/dist/plugins/text/text-item.d.ts +2 -0
- package/dist/plugins/text/text-layout.d.ts +12 -0
- package/dist/render/index.d.ts +0 -1
- package/dist/render/render-frame.d.ts +0 -8
- package/dist/texture/texture.d.ts +0 -4
- package/dist/vfx-item.d.ts +7 -20
- package/package.json +2 -2
- package/dist/render/types.d.ts +0 -5
package/dist/camera.d.ts
CHANGED
|
@@ -42,6 +42,14 @@ export interface CameraOptions extends CameraOptionsBase {
|
|
|
42
42
|
* 相机的旋转,四元数
|
|
43
43
|
*/
|
|
44
44
|
quat?: spec.vec4;
|
|
45
|
+
/**
|
|
46
|
+
* 画布的像素宽度
|
|
47
|
+
*/
|
|
48
|
+
pixelWidth: number;
|
|
49
|
+
/**
|
|
50
|
+
* 画布的像素高度
|
|
51
|
+
*/
|
|
52
|
+
pixelHeight: number;
|
|
45
53
|
}
|
|
46
54
|
export interface CameraOptionsEx extends CameraOptionsBase {
|
|
47
55
|
/**
|
|
@@ -62,6 +70,14 @@ export interface CameraOptionsEx extends CameraOptionsBase {
|
|
|
62
70
|
*/
|
|
63
71
|
export declare class Camera {
|
|
64
72
|
name: string;
|
|
73
|
+
/**
|
|
74
|
+
* 画布的像素宽度
|
|
75
|
+
*/
|
|
76
|
+
pixelWidth: number;
|
|
77
|
+
/**
|
|
78
|
+
* 画布的像素高度
|
|
79
|
+
*/
|
|
80
|
+
pixelHeight: number;
|
|
65
81
|
/**
|
|
66
82
|
* 编辑器用于缩放画布
|
|
67
83
|
*/
|
|
@@ -202,5 +218,19 @@ export declare class Camera {
|
|
|
202
218
|
* 更新相机相关的矩阵,获取矩阵前会自动调用
|
|
203
219
|
*/
|
|
204
220
|
updateMatrix(): void;
|
|
221
|
+
/**
|
|
222
|
+
* 将世界坐标转换为屏幕像素坐标
|
|
223
|
+
* @param position - 世界坐标
|
|
224
|
+
* @param out - 输出的屏幕坐标,如果不传则创建新的 Vector3
|
|
225
|
+
* @returns 屏幕坐标 (x, y 为像素坐标,左下角为(0,0),右上角为(width,height),z 为深度比例 [0,1],0=近平面,1=远平面)
|
|
226
|
+
*/
|
|
227
|
+
worldToScreenPoint(position: Vector3, out?: Vector3): Vector3;
|
|
228
|
+
/**
|
|
229
|
+
* 将屏幕像素坐标转换为世界坐标
|
|
230
|
+
* @param position - 屏幕坐标 (x, y 为像素坐标,左下角为(0,0),z 为深度比例 [0,1],0=近平面,1=远平面)
|
|
231
|
+
* @param out - 输出的世界坐标,如果不传则创建新的 Vector3
|
|
232
|
+
* @returns 世界坐标
|
|
233
|
+
*/
|
|
234
|
+
screenToWorldPoint(position: Vector3, out?: Vector3): Vector3;
|
|
205
235
|
}
|
|
206
236
|
export {};
|
|
@@ -8,29 +8,28 @@ import type { Renderer } from '../render';
|
|
|
8
8
|
import type { GradientValue } from '../math';
|
|
9
9
|
import { RendererComponent } from './renderer-component';
|
|
10
10
|
import type { Texture } from '../texture/texture';
|
|
11
|
-
export declare enum FillType {
|
|
12
|
-
Solid = 0,
|
|
13
|
-
GradientLinear = 1,
|
|
14
|
-
GradientRadial = 2,
|
|
15
|
-
GradientAngular = 3,
|
|
16
|
-
Texture = 4
|
|
17
|
-
}
|
|
18
11
|
export interface SolidPaint {
|
|
19
|
-
type: FillType.Solid;
|
|
12
|
+
type: spec.FillType.Solid;
|
|
20
13
|
color: Color;
|
|
21
14
|
}
|
|
22
15
|
export interface GradientPaint {
|
|
23
|
-
type: FillType.GradientLinear | FillType.GradientAngular | FillType.GradientRadial;
|
|
16
|
+
type: spec.FillType.GradientLinear | spec.FillType.GradientAngular | spec.FillType.GradientRadial;
|
|
24
17
|
gradientStops: GradientValue;
|
|
25
18
|
startPoint: Vector2;
|
|
26
19
|
endPoint: Vector2;
|
|
27
20
|
}
|
|
21
|
+
export interface TextureTransform {
|
|
22
|
+
offset: Vector2;
|
|
23
|
+
rotation: number;
|
|
24
|
+
scale: Vector2;
|
|
25
|
+
}
|
|
28
26
|
export interface TexturePaint {
|
|
29
|
-
type: FillType.Texture;
|
|
27
|
+
type: spec.FillType.Texture;
|
|
30
28
|
texture: Texture;
|
|
31
29
|
scaleMode: TexturePaintScaleMode;
|
|
32
30
|
scalingFactor: number;
|
|
33
31
|
opacity: number;
|
|
32
|
+
textureTransform: TextureTransform;
|
|
34
33
|
}
|
|
35
34
|
export declare enum TexturePaintScaleMode {
|
|
36
35
|
Fill = 0,
|
|
@@ -124,21 +123,24 @@ export interface PolygonAttribute extends ShapeAttributes {
|
|
|
124
123
|
* @since 2.1.0
|
|
125
124
|
*/
|
|
126
125
|
export declare class ShapeComponent extends RendererComponent implements Maskable {
|
|
127
|
-
private hasStroke;
|
|
128
|
-
private hasFill;
|
|
129
126
|
private shapeDirty;
|
|
130
127
|
private materialDirty;
|
|
131
128
|
private graphicsPath;
|
|
132
129
|
private fills;
|
|
133
130
|
private strokeAttributes;
|
|
131
|
+
private strokeWidth;
|
|
132
|
+
private strokeCap;
|
|
133
|
+
private strokeJoin;
|
|
134
134
|
private strokes;
|
|
135
135
|
private shapeAttributes;
|
|
136
136
|
/**
|
|
137
137
|
* 用于点击测试的碰撞器
|
|
138
138
|
*/
|
|
139
139
|
private meshCollider;
|
|
140
|
-
private
|
|
140
|
+
private rendererOptions;
|
|
141
141
|
private geometry;
|
|
142
|
+
private fillMaterials;
|
|
143
|
+
private strokeMaterials;
|
|
142
144
|
private readonly maskManager;
|
|
143
145
|
get shape(): ShapeAttributes;
|
|
144
146
|
/**
|
|
@@ -157,38 +159,9 @@ export declare class ShapeComponent extends RendererComponent implements Maskabl
|
|
|
157
159
|
private updateMaterials;
|
|
158
160
|
private updatePaintMaterial;
|
|
159
161
|
private updateGradientMaterial;
|
|
162
|
+
private createMaterialFromRendererOptions;
|
|
160
163
|
fromData(data: spec.ShapeComponentData): void;
|
|
161
164
|
private createPaint;
|
|
162
165
|
onApplyAnimationProperties(): void;
|
|
163
166
|
}
|
|
164
|
-
export type PaintData = SolidPaintData | GradientPaintData | TexturePaintData;
|
|
165
|
-
export interface SolidPaintData {
|
|
166
|
-
type: FillType.Solid;
|
|
167
|
-
/**
|
|
168
|
-
* 填充颜色
|
|
169
|
-
*/
|
|
170
|
-
color: spec.ColorData;
|
|
171
|
-
}
|
|
172
|
-
export interface GradientPaintData {
|
|
173
|
-
type: FillType.GradientLinear | FillType.GradientAngular | FillType.GradientRadial;
|
|
174
|
-
/**
|
|
175
|
-
* 渐变颜色
|
|
176
|
-
*/
|
|
177
|
-
gradientStops: spec.GradientColor;
|
|
178
|
-
/**
|
|
179
|
-
* 渐变起点
|
|
180
|
-
*/
|
|
181
|
-
startPoint: spec.Vector2Data;
|
|
182
|
-
/**
|
|
183
|
-
* 渐变终点
|
|
184
|
-
*/
|
|
185
|
-
endPoint: spec.Vector2Data;
|
|
186
|
-
}
|
|
187
|
-
export interface TexturePaintData {
|
|
188
|
-
type: FillType.Texture;
|
|
189
|
-
texture: spec.DataPath;
|
|
190
|
-
scaleMode: TexturePaintScaleMode;
|
|
191
|
-
scalingFactor?: number;
|
|
192
|
-
opacity?: number;
|
|
193
|
-
}
|
|
194
167
|
export {};
|
package/dist/composition.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { Camera } from './camera';
|
|
|
5
5
|
import { CompositionComponent } from './comp-vfx-item';
|
|
6
6
|
import type { PluginSystem } from './plugin-system';
|
|
7
7
|
import type { EventSystem, Plugin, Region } from './plugins';
|
|
8
|
-
import type {
|
|
8
|
+
import type { Renderer } from './render';
|
|
9
9
|
import { RenderFrame } from './render';
|
|
10
10
|
import type { Scene } from './scene';
|
|
11
11
|
import type { Texture } from './texture';
|
|
@@ -215,7 +215,6 @@ export declare class Composition extends EventEmitter<CompositionEvent<Compositi
|
|
|
215
215
|
* 是否开启后处理
|
|
216
216
|
*/
|
|
217
217
|
postProcessingEnabled: boolean;
|
|
218
|
-
protected rendererOptions: MeshRendererOptions | null;
|
|
219
218
|
/**
|
|
220
219
|
* 销毁状态位
|
|
221
220
|
*/
|
|
@@ -359,7 +358,6 @@ export declare class Composition extends EventEmitter<CompositionEvent<Compositi
|
|
|
359
358
|
*/
|
|
360
359
|
update(deltaTime: number): void;
|
|
361
360
|
private shouldDispose;
|
|
362
|
-
private callAwake;
|
|
363
361
|
/**
|
|
364
362
|
* 更新相机
|
|
365
363
|
* @override
|
|
@@ -393,7 +391,7 @@ export declare class Composition extends EventEmitter<CompositionEvent<Compositi
|
|
|
393
391
|
*/
|
|
394
392
|
getEngine(): import("@galacean/effects-core").Engine;
|
|
395
393
|
/**
|
|
396
|
-
* Item 求交测试,返回求交结果列表,x 和 y 是归一化到[-1, 1]
|
|
394
|
+
* Item 求交测试,返回求交结果列表,x 和 y 是归一化到[-1, 1]区间的值,x 向右,y 向上
|
|
397
395
|
* @param x - 鼠标或触点的 x,已经归一化到[-1, 1]
|
|
398
396
|
* @param y - 鼠标或触点的 y,已经归一化到[-1, 1]
|
|
399
397
|
* @param force - 是否强制求交,没有交互信息的 Item 也要进行求交测试
|
|
@@ -458,7 +456,6 @@ export declare class Composition extends EventEmitter<CompositionEvent<Compositi
|
|
|
458
456
|
* 卸载贴图纹理方法,减少内存
|
|
459
457
|
*/
|
|
460
458
|
offloadTexture(): void;
|
|
461
|
-
getRendererOptions(): MeshRendererOptions;
|
|
462
459
|
/**
|
|
463
460
|
* 重新加载纹理
|
|
464
461
|
*/
|
package/dist/effects-object.d.ts
CHANGED