@galacean/effects-core 2.9.0-alpha.0 → 2.9.0-alpha.2
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 +2 -0
- package/dist/asset-service.d.ts +0 -1
- package/dist/camera.d.ts +2 -2
- package/dist/components/component.d.ts +4 -0
- package/dist/components/composition-component.d.ts +25 -9
- package/dist/components/frame-component.d.ts +3 -0
- package/dist/components/renderer-component.d.ts +15 -1
- package/dist/components/shape-component.d.ts +2 -0
- package/dist/composition.d.ts +6 -5
- package/dist/effects-object.d.ts +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +13857 -13471
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +13856 -13472
- package/dist/index.mjs.map +1 -1
- package/dist/material/types.d.ts +2 -0
- package/dist/math/shape/build-adaptive-bezier.d.ts +1 -1
- package/dist/math/shape/circle.d.ts +1 -1
- package/dist/math/shape/ellipse.d.ts +1 -1
- package/dist/math/shape/graphics-path.d.ts +1 -1
- package/dist/math/shape/poly-star.d.ts +1 -1
- package/dist/math/shape/polygon.d.ts +1 -1
- package/dist/math/shape/rectangle.d.ts +1 -1
- package/dist/math/shape/shape-path.d.ts +1 -1
- package/dist/math/shape/shape-primitive.d.ts +1 -1
- package/dist/math/shape/triangle.d.ts +1 -1
- package/dist/plugins/interact/click-handler.d.ts +5 -0
- package/dist/plugins/text/text-component-base.d.ts +50 -0
- package/dist/plugins/text/text-item.d.ts +37 -40
- package/dist/plugins/timeline/playable.d.ts +2 -1
- package/dist/plugins/timeline/timeline-asset.d.ts +1 -4
- package/dist/precompositions/index.d.ts +2 -0
- package/dist/precompositions/precomposition-manager.d.ts +13 -0
- package/dist/precompositions/precomposition.d.ts +7 -0
- package/dist/scene-loader.d.ts +3 -0
- package/dist/scene.d.ts +0 -2
- package/dist/vfx-item.d.ts +27 -8
- package/package.json +2 -2
package/dist/material/types.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import type * as spec from '@galacean/effects-specification';
|
|
|
2
2
|
import type { Matrix3, Matrix4, Vector2, Vector3, Vector4 } from '@galacean/effects-math/es/core/index';
|
|
3
3
|
import type { Texture } from '../texture';
|
|
4
4
|
import type { DestroyOptions } from '../utils';
|
|
5
|
+
import type { VFXItem } from '../vfx-item';
|
|
5
6
|
export type UniformSemantic = 'VIEW' | 'MODEL' | 'MODELVIEW' | 'PROJECTION' | 'VIEWPROJECTION' | 'VIEWINVERSE' | 'EDITOR_TRANSFORM' | 'MODELVIEWPROJECTION';
|
|
6
7
|
export interface MaterialBlendingStates {
|
|
7
8
|
blending?: boolean;
|
|
@@ -63,6 +64,7 @@ export declare enum ShaderType {
|
|
|
63
64
|
*
|
|
64
65
|
*/
|
|
65
66
|
export interface Maskable {
|
|
67
|
+
item: VFXItem;
|
|
66
68
|
drawStencilMask(maskRef: number): void;
|
|
67
69
|
}
|
|
68
70
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function buildAdaptiveBezier(points: number[], sX: number, sY: number, cp1x: number, cp1y: number, cp2x: number, cp2y: number, eX: number, eY: number, smoothness?: number): number[];
|
|
1
|
+
export declare function buildAdaptiveBezier(points: number[], sX: number, sY: number, cp1x: number, cp1y: number, cp2x: number, cp2y: number, eX: number, eY: number, smoothness?: number, scale?: number): number[];
|
|
@@ -191,6 +191,6 @@ export declare class Circle extends ShapePrimitive {
|
|
|
191
191
|
* @see {@link Circle.clone} For creating new circle copy
|
|
192
192
|
*/
|
|
193
193
|
copyTo(circle: Circle): Circle;
|
|
194
|
-
build(points: number[]): void;
|
|
194
|
+
build(points: number[], screenScale?: number): void;
|
|
195
195
|
triangulate(points: number[], vertices: number[], verticesOffset: number, indices: number[], indicesOffset: number): void;
|
|
196
196
|
}
|
|
@@ -74,6 +74,6 @@ export declare class Ellipse extends ShapePrimitive {
|
|
|
74
74
|
copyTo(ellipse: Ellipse): Ellipse;
|
|
75
75
|
getX(): number;
|
|
76
76
|
getY(): number;
|
|
77
|
-
build(points: number[]): number[];
|
|
77
|
+
build(points: number[], screenScale?: number): number[];
|
|
78
78
|
triangulate(points: number[], vertices: number[], verticesOffset: number, indices: number[], indicesOffset: number): void;
|
|
79
79
|
}
|
|
@@ -23,7 +23,7 @@ export declare class GraphicsPath {
|
|
|
23
23
|
* @param smoothness - Optional parameter to adjust the smoothness of the curve.
|
|
24
24
|
* @returns The instance of the current object for chaining.
|
|
25
25
|
*/
|
|
26
|
-
bezierCurveTo(cp1x: number, cp1y: number, cp2x: number, cp2y: number, x: number, y: number, smoothness?: number): GraphicsPath;
|
|
26
|
+
bezierCurveTo(cp1x: number, cp1y: number, cp2x: number, cp2y: number, x: number, y: number, smoothness?: number, scale?: number): GraphicsPath;
|
|
27
27
|
/**
|
|
28
28
|
* Connects the current point to a new point with a straight line. This method updates the current path.
|
|
29
29
|
* @param x - The x-coordinate of the new point to connect to.
|
|
@@ -35,7 +35,7 @@ export declare class PolyStar extends ShapePrimitive {
|
|
|
35
35
|
clone(): ShapePrimitive;
|
|
36
36
|
copyFrom(source: PolyStar): void;
|
|
37
37
|
copyTo(destination: PolyStar): void;
|
|
38
|
-
build(points: number[]): void;
|
|
38
|
+
build(points: number[], screenScale?: number): void;
|
|
39
39
|
triangulate(points: number[], vertices: number[], verticesOffset: number, indices: number[], indicesOffset: number): void;
|
|
40
40
|
private buildStarPath;
|
|
41
41
|
private buildPolygonPath;
|
|
@@ -58,7 +58,7 @@ export declare class Polygon extends ShapePrimitive {
|
|
|
58
58
|
* @readonly
|
|
59
59
|
*/
|
|
60
60
|
getY(): number;
|
|
61
|
-
build(points: number[]): void;
|
|
61
|
+
build(points: number[], screenScale?: number): void;
|
|
62
62
|
triangulate(points: number[], vertices: number[], verticesOffset: number, indices: number[], indicesOffset: number): void;
|
|
63
63
|
/**
|
|
64
64
|
* 获取直线上最远的两个端点坐标组成的三角形
|
|
@@ -57,6 +57,6 @@ export declare class Rectangle extends ShapePrimitive {
|
|
|
57
57
|
* @returns Returns given parameter.
|
|
58
58
|
*/
|
|
59
59
|
copyTo(rectangle: Rectangle): Rectangle;
|
|
60
|
-
build(points: number[]): void;
|
|
60
|
+
build(points: number[], screenScale?: number): void;
|
|
61
61
|
triangulate(points: number[], vertices: number[], verticesOffset: number, indices: number[], indicesOffset: number): void;
|
|
62
62
|
}
|
|
@@ -26,7 +26,7 @@ export declare class ShapePath {
|
|
|
26
26
|
* @param smoothness - Optional parameter to adjust the smoothness of the curve.
|
|
27
27
|
* @returns The instance of the current object for chaining.
|
|
28
28
|
*/
|
|
29
|
-
bezierCurveTo(cp1x: number, cp1y: number, cp2x: number, cp2y: number, x: number, y: number, smoothness?: number): ShapePath;
|
|
29
|
+
bezierCurveTo(cp1x: number, cp1y: number, cp2x: number, cp2y: number, x: number, y: number, smoothness?: number, scale?: number): ShapePath;
|
|
30
30
|
moveTo(x: number, y: number): ShapePath;
|
|
31
31
|
/**
|
|
32
32
|
* Connects the current point to a new point with a straight line. This method updates the current path.
|
|
@@ -10,6 +10,6 @@ export declare abstract class ShapePrimitive {
|
|
|
10
10
|
/** Returns the framing rectangle of the ShapePrimitive as a Rectangle object. */
|
|
11
11
|
/** The X coordinate of the shape */
|
|
12
12
|
/** The Y coordinate of the shape */
|
|
13
|
-
abstract build(points: number[]): void;
|
|
13
|
+
abstract build(points: number[], screenScale?: number): void;
|
|
14
14
|
abstract triangulate(points: number[], vertices: number[], verticesOffset: number, indices: number[], indicesOffset: number): void;
|
|
15
15
|
}
|
|
@@ -84,6 +84,6 @@ export declare class Triangle extends ShapePrimitive {
|
|
|
84
84
|
getBounds(out?: Rectangle): Rectangle;
|
|
85
85
|
getX(): number;
|
|
86
86
|
getY(): number;
|
|
87
|
-
build(points: number[]): void;
|
|
87
|
+
build(points: number[], screenScale?: number): void;
|
|
88
88
|
triangulate(points: number[], vertices: number[], verticesOffset: number, indices: number[], indicesOffset: number): void;
|
|
89
89
|
}
|
|
@@ -3,6 +3,7 @@ import { Vector2 } from '@galacean/effects-math/es/core/vector2';
|
|
|
3
3
|
import type * as spec from '@galacean/effects-specification';
|
|
4
4
|
import type { VFXItem } from '../../vfx-item';
|
|
5
5
|
import type { Composition } from '../../composition';
|
|
6
|
+
import type { Maskable } from '../../material';
|
|
6
7
|
export declare enum HitTestType {
|
|
7
8
|
triangle = 1,
|
|
8
9
|
box = 2,
|
|
@@ -28,23 +29,27 @@ export interface HitTestTriangleParams {
|
|
|
28
29
|
type: HitTestType.triangle;
|
|
29
30
|
triangles: TriangleLike[];
|
|
30
31
|
backfaceCulling?: boolean;
|
|
32
|
+
clipMasks: Maskable[];
|
|
31
33
|
behavior?: spec.InteractBehavior;
|
|
32
34
|
}
|
|
33
35
|
export interface HitTestBoxParams {
|
|
34
36
|
type: HitTestType.box;
|
|
35
37
|
center: Vector3;
|
|
36
38
|
size: Vector3;
|
|
39
|
+
clipMasks: Maskable[];
|
|
37
40
|
behavior?: spec.InteractBehavior;
|
|
38
41
|
}
|
|
39
42
|
export interface HitTestSphereParams {
|
|
40
43
|
type: HitTestType.sphere;
|
|
41
44
|
center: Vector3;
|
|
42
45
|
radius: number;
|
|
46
|
+
clipMasks: Maskable[];
|
|
43
47
|
behavior?: spec.InteractBehavior;
|
|
44
48
|
}
|
|
45
49
|
export interface HitTestCustomParams {
|
|
46
50
|
type: HitTestType.custom;
|
|
47
51
|
collect(ray: Ray, pointInCanvas: Vector2): Vector3[] | void;
|
|
52
|
+
clipMasks: Maskable[];
|
|
48
53
|
behavior?: spec.InteractBehavior;
|
|
49
54
|
}
|
|
50
55
|
export type Region = {
|
|
@@ -10,6 +10,9 @@ import type { TextStyle } from './text-style';
|
|
|
10
10
|
*/
|
|
11
11
|
export interface IRichTextComponent {
|
|
12
12
|
}
|
|
13
|
+
/**
|
|
14
|
+
* 文本组件基础类,包含文本组件和富文本组件的共有逻辑
|
|
15
|
+
*/
|
|
13
16
|
export declare class TextComponentBase {
|
|
14
17
|
textStyle: TextStyle;
|
|
15
18
|
textLayout: BaseLayout;
|
|
@@ -23,20 +26,67 @@ export declare class TextComponentBase {
|
|
|
23
26
|
renderer: ItemRenderer;
|
|
24
27
|
protected maxLineWidth: number;
|
|
25
28
|
protected readonly ALPHA_FIX_VALUE: number;
|
|
29
|
+
/**
|
|
30
|
+
* 设置文本内容
|
|
31
|
+
* @param value - 文本内容
|
|
32
|
+
*/
|
|
26
33
|
setText(value: string): void;
|
|
34
|
+
/**
|
|
35
|
+
* 设置文本水平布局
|
|
36
|
+
* @param value - 布局选项
|
|
37
|
+
*/
|
|
27
38
|
setTextAlign(value: spec.TextAlignment): void;
|
|
39
|
+
/**
|
|
40
|
+
* 设置文本垂直布局
|
|
41
|
+
* @param value - 布局选项
|
|
42
|
+
*/
|
|
28
43
|
setTextVerticalAlign(value: spec.TextVerticalAlign): void;
|
|
29
44
|
/**
|
|
30
45
|
* @deprecated 2.8.0 本方法已废弃,请使用 setTextVerticalAlign 替代。
|
|
31
46
|
*/
|
|
32
47
|
setTextBaseline(value: spec.TextBaseline): void;
|
|
48
|
+
/**
|
|
49
|
+
* 设置文本颜色
|
|
50
|
+
* @param value - 颜色内容
|
|
51
|
+
* @default [1, 1, 1, 1]
|
|
52
|
+
*/
|
|
33
53
|
setTextColor(value: spec.RGBAColorValue): void;
|
|
54
|
+
/**
|
|
55
|
+
* 设置字体
|
|
56
|
+
* @param value - 字体名称,如:"Arial", "Times New Roman" 等
|
|
57
|
+
* @default "sans-serif"
|
|
58
|
+
*/
|
|
34
59
|
setFontFamily(value: string): void;
|
|
60
|
+
/**
|
|
61
|
+
* 设置字重
|
|
62
|
+
* @param value - 字重类型
|
|
63
|
+
*/
|
|
35
64
|
setFontWeight(value: spec.TextWeight): void;
|
|
65
|
+
/**
|
|
66
|
+
* 设置字体样式
|
|
67
|
+
* @param value - 字体样式
|
|
68
|
+
* @default "normal"
|
|
69
|
+
*/
|
|
36
70
|
setFontStyle(value: spec.FontStyle): void;
|
|
71
|
+
/**
|
|
72
|
+
* 设置外描边文本颜色
|
|
73
|
+
* @param value - 颜色内容
|
|
74
|
+
*/
|
|
37
75
|
setOutlineColor(value: spec.RGBAColorValue): void;
|
|
76
|
+
/**
|
|
77
|
+
* 设置是否启用外描边
|
|
78
|
+
* @param value - 是否启用外描边
|
|
79
|
+
*/
|
|
38
80
|
setOutlineEnabled(value: boolean): void;
|
|
81
|
+
/**
|
|
82
|
+
* 设置字体清晰度
|
|
83
|
+
* @param value - 字体清晰度
|
|
84
|
+
*/
|
|
39
85
|
setFontScale(value: number): void;
|
|
86
|
+
/**
|
|
87
|
+
* 设置文本溢出方式
|
|
88
|
+
* @param overflow - 溢出方式
|
|
89
|
+
*/
|
|
40
90
|
setOverflow(overflow: spec.TextOverflow): void;
|
|
41
91
|
protected getFontDesc(size?: number): string;
|
|
42
92
|
protected setupOutline(): void;
|
|
@@ -41,6 +41,11 @@ export declare class TextComponent extends MaskableGraphic {
|
|
|
41
41
|
* 根据配置更新文本样式和布局
|
|
42
42
|
*/
|
|
43
43
|
updateWithOptions(options: spec.TextContentOptions): void;
|
|
44
|
+
/**
|
|
45
|
+
* 获取文本行数
|
|
46
|
+
* @param text - 文本内容
|
|
47
|
+
* @returns 行数
|
|
48
|
+
*/
|
|
44
49
|
getLineCount(text: string): number;
|
|
45
50
|
/**
|
|
46
51
|
* 设置行高
|
|
@@ -48,46 +53,8 @@ export declare class TextComponent extends MaskableGraphic {
|
|
|
48
53
|
* @param value - 行高像素值
|
|
49
54
|
*/
|
|
50
55
|
setLineHeight(value: number): void;
|
|
51
|
-
/**
|
|
52
|
-
* 设置字重
|
|
53
|
-
* @param value - 字重类型
|
|
54
|
-
* @returns
|
|
55
|
-
*/
|
|
56
|
-
setFontWeight(value: spec.TextWeight): void;
|
|
57
|
-
/**
|
|
58
|
-
* 设置字体样式
|
|
59
|
-
* @param value 设置字体样式
|
|
60
|
-
* @default "normal"
|
|
61
|
-
* @returns
|
|
62
|
-
*/
|
|
63
|
-
setFontStyle(value: spec.FontStyle): void;
|
|
64
|
-
/**
|
|
65
|
-
* 设置文本水平布局
|
|
66
|
-
* @param value - 布局选项
|
|
67
|
-
* @returns
|
|
68
|
-
*/
|
|
69
|
-
setTextAlign(value: spec.TextAlignment): void;
|
|
70
|
-
/**
|
|
71
|
-
* 设置文本颜色
|
|
72
|
-
* @param value - 颜色内容
|
|
73
|
-
* @returns
|
|
74
|
-
*/
|
|
75
|
-
setTextColor(value: spec.RGBAColorValue): void;
|
|
76
|
-
/**
|
|
77
|
-
* 设置外描边文本颜色
|
|
78
|
-
* @param value - 颜色内容
|
|
79
|
-
* @returns
|
|
80
|
-
*/
|
|
81
|
-
setOutlineColor(value: spec.RGBAColorValue): void;
|
|
82
|
-
/**
|
|
83
|
-
* 设置字体清晰度
|
|
84
|
-
* @param value - 字体清晰度
|
|
85
|
-
* @returns
|
|
86
|
-
*/
|
|
87
|
-
setFontScale(value: number): void;
|
|
88
56
|
/**
|
|
89
57
|
* 更新文本
|
|
90
|
-
* @returns
|
|
91
58
|
*/
|
|
92
59
|
protected updateTexture(flipY?: boolean): void;
|
|
93
60
|
renderText(options: spec.TextContentOptions): void;
|
|
@@ -119,24 +86,54 @@ export declare class TextComponent extends MaskableGraphic {
|
|
|
119
86
|
* @param value - 文本框高度
|
|
120
87
|
*/
|
|
121
88
|
setTextHeight(value: number): void;
|
|
89
|
+
/**
|
|
90
|
+
* 设置字体大小
|
|
91
|
+
* @param value - 字体大小
|
|
92
|
+
* @default 40
|
|
93
|
+
*/
|
|
122
94
|
setFontSize(value: number): void;
|
|
95
|
+
/**
|
|
96
|
+
* 设置描边宽度
|
|
97
|
+
* @param value - 描边宽度
|
|
98
|
+
* @default 0
|
|
99
|
+
*/
|
|
123
100
|
setOutlineWidth(value: number): void;
|
|
124
101
|
/**
|
|
125
102
|
* 设置是否启用文本描边
|
|
126
103
|
* @param value - 是否启用描边
|
|
127
|
-
* @returns
|
|
128
104
|
*/
|
|
129
105
|
setOutlineEnabled(value: boolean): void;
|
|
106
|
+
/**
|
|
107
|
+
* 设置阴影模糊度
|
|
108
|
+
* @param value - 阴影模糊度
|
|
109
|
+
* @default 0
|
|
110
|
+
*/
|
|
130
111
|
setShadowBlur(value: number): void;
|
|
112
|
+
/**
|
|
113
|
+
* 设置阴影颜色
|
|
114
|
+
* > setupShadow 使用 outlineColor 作为阴影颜色,更新 shadowColor 不影响阴影颜色
|
|
115
|
+
* @param value - 阴影颜色
|
|
116
|
+
* @returns
|
|
117
|
+
*/
|
|
131
118
|
setShadowColor(value: spec.RGBAColorValue): void;
|
|
119
|
+
/**
|
|
120
|
+
* 设置阴影偏移 X
|
|
121
|
+
* @param value - 阴影偏移值
|
|
122
|
+
* @returns
|
|
123
|
+
*/
|
|
132
124
|
setShadowOffsetX(value: number): void;
|
|
125
|
+
/**
|
|
126
|
+
* 设置阴影偏移 Y
|
|
127
|
+
* @param value - 阴影偏移值
|
|
128
|
+
* @returns
|
|
129
|
+
*/
|
|
133
130
|
setShadowOffsetY(value: number): void;
|
|
134
131
|
/**
|
|
135
132
|
* 计算文本在当前样式与布局规则下的建议宽度(逻辑像素)。
|
|
136
133
|
*
|
|
137
134
|
* 说明:
|
|
138
135
|
* - 使用 Canvas 2D 的 measureText,并按当前实现的逐字符排版规则累加宽度(与 updateTexture 保持一致)。
|
|
139
|
-
* - 结果为"逻辑宽度"
|
|
136
|
+
* - 结果为"逻辑宽度"(扣除 fontOffset),可直接写回 options.textWidth。,可直接写回 options.textWidth。
|
|
140
137
|
* - 通过 padding 追加少量冗余像素,用于降低边缘裁切风险。
|
|
141
138
|
*
|
|
142
139
|
* @returns 文本宽度(>= 0)
|
|
@@ -14,12 +14,9 @@ export declare class TimelineAsset extends EffectsObject {
|
|
|
14
14
|
private addSubTracksRecursive;
|
|
15
15
|
}
|
|
16
16
|
export declare class TimelineInstance {
|
|
17
|
-
private time;
|
|
18
17
|
private clips;
|
|
19
18
|
constructor(timelineAsset: TimelineAsset, sceneBindings: SceneBinding[]);
|
|
20
|
-
|
|
21
|
-
getTime(): number;
|
|
22
|
-
evaluate(deltaTime: number): void;
|
|
19
|
+
evaluate(time: number, deltaTime: number): void;
|
|
23
20
|
compileTracks(tracks: TrackAsset[], sceneBindings: SceneBinding[]): void;
|
|
24
21
|
private tickTrack;
|
|
25
22
|
private updateTrackAnimatedObject;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Composition } from '../composition';
|
|
2
|
+
import { VFXItem } from '../vfx-item';
|
|
3
|
+
import type { Precomposition } from './precomposition';
|
|
4
|
+
export declare class PrecompositionManager {
|
|
5
|
+
/**
|
|
6
|
+
* 从预合成数据实例化一棵 VFXItem 树。
|
|
7
|
+
* 可挂载到现有合成的节点下。
|
|
8
|
+
* @param precomposition 预合成数据
|
|
9
|
+
* @param composition 目标合成
|
|
10
|
+
* @returns 实例化生成的根 VFXItem,其子树包含指定合成的所有元素
|
|
11
|
+
*/
|
|
12
|
+
static instantiate(precomposition: Precomposition, composition: Composition): VFXItem;
|
|
13
|
+
}
|
package/dist/scene-loader.d.ts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { Composition } from './composition';
|
|
2
2
|
import type { Engine } from './engine';
|
|
3
3
|
import type { Scene, SceneLoadOptions } from './scene';
|
|
4
|
+
/**
|
|
5
|
+
* @hidden
|
|
6
|
+
*/
|
|
4
7
|
export declare class SceneLoader {
|
|
5
8
|
static load(scene: Scene.LoadType, engine: Engine, options?: SceneLoadOptions): Promise<Composition>;
|
|
6
9
|
private static createComposition;
|
package/dist/scene.d.ts
CHANGED
|
@@ -12,7 +12,6 @@ export interface Scene {
|
|
|
12
12
|
readonly storage: Record<string, any>;
|
|
13
13
|
renderLevel?: SceneRenderLevel;
|
|
14
14
|
textureOptions: Record<string, any>[];
|
|
15
|
-
textures: Texture[];
|
|
16
15
|
images: ImageLike[];
|
|
17
16
|
assets: Record<string, ImageLike>;
|
|
18
17
|
consumed?: boolean;
|
|
@@ -80,7 +79,6 @@ export interface SceneLoadOptions {
|
|
|
80
79
|
/**
|
|
81
80
|
* 渲染分级。
|
|
82
81
|
* 分级之后,只会加载当前渲染等级的资源。
|
|
83
|
-
* 当渲染等级被设置为 B 后,player 的 fps 会降到 30 帧
|
|
84
82
|
* @default 'S'
|
|
85
83
|
*/
|
|
86
84
|
renderLevel?: SceneRenderLevel;
|
package/dist/vfx-item.d.ts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
|
+
import type { Ray } from '@galacean/effects-math/es/core/ray';
|
|
1
2
|
import { Vector3 } from '@galacean/effects-math/es/core/vector3';
|
|
2
3
|
import * as spec from '@galacean/effects-specification';
|
|
3
4
|
import type { Component } from './components';
|
|
4
|
-
import { Composition } from './composition';
|
|
5
|
+
import type { Composition, CompositionHitTestOptions } from './composition';
|
|
5
6
|
import { EffectsObject } from './effects-object';
|
|
6
7
|
import type { Engine } from './engine';
|
|
7
8
|
import type { EventEmitterListener, EventEmitterOptions, ItemEvent } from './events';
|
|
8
|
-
import type { BoundingBoxData, HitTestBoxParams, HitTestCustomParams, HitTestSphereParams, HitTestTriangleParams } from './plugins';
|
|
9
|
+
import type { BoundingBoxData, HitTestBoxParams, HitTestCustomParams, HitTestSphereParams, HitTestTriangleParams, Region } from './plugins';
|
|
9
10
|
import { Transform } from './transform';
|
|
10
11
|
import type { Constructor, Disposable } from './utils';
|
|
11
12
|
/**
|
|
@@ -49,10 +50,18 @@ export declare class VFXItem extends EffectsObject implements Disposable {
|
|
|
49
50
|
* @deprecated 2.7.0 Please use `getInstanceId` instead
|
|
50
51
|
*/
|
|
51
52
|
id: string;
|
|
53
|
+
/**
|
|
54
|
+
* 元素类型
|
|
55
|
+
*/
|
|
52
56
|
type: spec.ItemType;
|
|
57
|
+
/**
|
|
58
|
+
* @deprecated 2.9.0 Please use `definition` instead
|
|
59
|
+
*/
|
|
53
60
|
props: spec.VFXItemData;
|
|
61
|
+
/**
|
|
62
|
+
* 元素绑定的组件列表
|
|
63
|
+
*/
|
|
54
64
|
components: Component[];
|
|
55
|
-
isDuringPlay: boolean;
|
|
56
65
|
/**
|
|
57
66
|
* 元素是否激活
|
|
58
67
|
*/
|
|
@@ -64,9 +73,6 @@ export declare class VFXItem extends EffectsObject implements Disposable {
|
|
|
64
73
|
private listIndex;
|
|
65
74
|
private isEnabled;
|
|
66
75
|
private eventProcessor;
|
|
67
|
-
/**
|
|
68
|
-
* 合成属性
|
|
69
|
-
*/
|
|
70
76
|
private _composition;
|
|
71
77
|
/**
|
|
72
78
|
*
|
|
@@ -127,6 +133,7 @@ export declare class VFXItem extends EffectsObject implements Disposable {
|
|
|
127
133
|
set composition(value: Composition);
|
|
128
134
|
/**
|
|
129
135
|
* 播放完成后是否需要再使用,是的话生命周期结束后不会 dispose
|
|
136
|
+
* @deprecated
|
|
130
137
|
*/
|
|
131
138
|
get compositionReusable(): boolean;
|
|
132
139
|
/**
|
|
@@ -269,6 +276,19 @@ export declare class VFXItem extends EffectsObject implements Disposable {
|
|
|
269
276
|
* @param force - 元素没有开启交互也返回参数
|
|
270
277
|
*/
|
|
271
278
|
getHitTestParams(force?: boolean): void | HitTestBoxParams | HitTestTriangleParams | HitTestSphereParams | HitTestCustomParams;
|
|
279
|
+
/**
|
|
280
|
+
* 对当前元素及其子节点进行射线命中测试
|
|
281
|
+
*
|
|
282
|
+
* @param ray - 射线
|
|
283
|
+
* @param x - 归一化屏幕坐标 x
|
|
284
|
+
* @param y - 归一化屏幕坐标 y
|
|
285
|
+
* @param regions - 命中结果收集数组
|
|
286
|
+
* @param hitPositions - 共享的命中位置数组,所有 region 共享同一引用
|
|
287
|
+
* @param force - 是否强制测试无交互信息的元素
|
|
288
|
+
* @param options - 额外选项(maxCount、stop、skip)
|
|
289
|
+
* @returns 是否有任何命中
|
|
290
|
+
*/
|
|
291
|
+
hitTest(ray: Ray, x: number, y: number, regions: Region[], hitPositions: Vector3[], force?: boolean, options?: CompositionHitTestOptions): boolean;
|
|
272
292
|
/**
|
|
273
293
|
* 获取元素当前世界坐标
|
|
274
294
|
*/
|
|
@@ -280,6 +300,7 @@ export declare class VFXItem extends EffectsObject implements Disposable {
|
|
|
280
300
|
* @returns 复制的新 VFXItem
|
|
281
301
|
*/
|
|
282
302
|
duplicate(): VFXItem;
|
|
303
|
+
private onParentChanged;
|
|
283
304
|
fromData(data: spec.VFXItemData): void;
|
|
284
305
|
toData(): void;
|
|
285
306
|
/**
|
|
@@ -287,8 +308,6 @@ export declare class VFXItem extends EffectsObject implements Disposable {
|
|
|
287
308
|
*/
|
|
288
309
|
dispose(): void;
|
|
289
310
|
private resetChildrenParent;
|
|
290
|
-
private instantiatePreComposition;
|
|
291
|
-
private resetGUID;
|
|
292
311
|
private gatherPreviousObjectID;
|
|
293
312
|
private getDescendantsInternal;
|
|
294
313
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@galacean/effects-core",
|
|
3
|
-
"version": "2.9.0-alpha.
|
|
3
|
+
"version": "2.9.0-alpha.2",
|
|
4
4
|
"description": "Galacean Effects runtime core for the web",
|
|
5
5
|
"module": "./dist/index.mjs",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"registry": "https://registry.npmjs.org"
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@galacean/effects-specification": "2.
|
|
45
|
+
"@galacean/effects-specification": "2.8.0-alpha.0",
|
|
46
46
|
"@galacean/effects-math": "1.1.0",
|
|
47
47
|
"flatbuffers": "24.3.25",
|
|
48
48
|
"uuid": "9.0.1",
|