@galacean/effects-core 2.8.9 → 2.9.0-alpha.1
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/animation/animation-clip.d.ts +2 -0
- package/dist/animation/animation-events.d.ts +29 -0
- package/dist/animation/index.d.ts +1 -0
- package/dist/asset-manager.d.ts +2 -0
- package/dist/asset-service.d.ts +0 -1
- package/dist/camera.d.ts +2 -16
- package/dist/components/base-render-component.d.ts +5 -8
- package/dist/components/component.d.ts +4 -0
- package/dist/components/composition-component.d.ts +26 -6
- package/dist/components/frame-component.d.ts +19 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/mesh-component.d.ts +5 -11
- package/dist/components/renderer-component.d.ts +18 -2
- package/dist/components/shape-component.d.ts +2 -6
- package/dist/composition/scene-ticking.d.ts +4 -0
- package/dist/composition.d.ts +8 -5
- package/dist/culling/bounding-box.d.ts +114 -0
- package/dist/engine.d.ts +2 -1
- package/dist/events/types.d.ts +11 -0
- package/dist/fallback/migration.d.ts +9 -8
- package/dist/fallback/utils.d.ts +0 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +23738 -21775
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +23732 -21775
- package/dist/index.mjs.map +1 -1
- package/dist/material/mask-ref-manager.d.ts +1 -16
- package/dist/material/types.d.ts +14 -2
- package/dist/math/index.d.ts +6 -0
- package/dist/math/shape/circle.d.ts +196 -0
- package/dist/{plugins → math}/shape/graphics-path.d.ts +29 -1
- package/dist/{plugins → math}/shape/shape-path.d.ts +28 -0
- package/dist/math/utils.d.ts +20 -0
- package/dist/plugins/animation-graph/graph-context.d.ts +2 -0
- package/dist/plugins/animation-graph/graph-instance.d.ts +2 -0
- package/dist/plugins/animation-graph/nodes/animation-clip-node.d.ts +1 -0
- package/dist/plugins/index.d.ts +0 -6
- package/dist/plugins/interact/mesh-collider.d.ts +28 -5
- package/dist/plugins/particle/particle-system-renderer.d.ts +0 -2
- package/dist/plugins/particle/particle-system.d.ts +4 -3
- package/dist/plugins/particle/particle-vfx-item.d.ts +2 -3
- package/dist/plugins/text/text-component-base.d.ts +50 -14
- package/dist/plugins/text/text-item.d.ts +52 -52
- package/dist/plugins/text/text-layout.d.ts +4 -5
- package/dist/plugins/timeline/playable.d.ts +2 -1
- package/dist/plugins/timeline/timeline-asset.d.ts +1 -5
- package/dist/plugins/timeline/track.d.ts +0 -3
- 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/render/graphics.d.ts +136 -0
- package/dist/render/index.d.ts +1 -0
- package/dist/render/render-frame.d.ts +1 -2
- package/dist/scene-loader.d.ts +3 -0
- package/dist/scene.d.ts +0 -1
- package/dist/vfx-item.d.ts +11 -7
- package/package.json +2 -2
- /package/dist/{plugins → math}/shape/build-adaptive-bezier.d.ts +0 -0
- /package/dist/{plugins → math}/shape/build-line.d.ts +0 -0
- /package/dist/{plugins → math}/shape/ellipse.d.ts +0 -0
- /package/dist/{plugins → math}/shape/point-data.d.ts +0 -0
- /package/dist/{plugins → math}/shape/point-like.d.ts +0 -0
- /package/dist/{plugins → math}/shape/point.d.ts +0 -0
- /package/dist/{plugins → math}/shape/poly-star.d.ts +0 -0
- /package/dist/{plugins → math}/shape/polygon.d.ts +0 -0
- /package/dist/{plugins → math}/shape/rectangle.d.ts +0 -0
- /package/dist/{plugins → math}/shape/shape-primitive.d.ts +0 -0
- /package/dist/{plugins → math}/shape/triangle.d.ts +0 -0
- /package/dist/{plugins → math}/shape/triangulate.d.ts +0 -0
|
@@ -1,16 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import type * as spec from '@galacean/effects-specification';
|
|
3
|
-
import type { Maskable } from './types';
|
|
4
|
-
import { MaskMode } from './types';
|
|
5
|
-
import type { Renderer } from '../render/renderer';
|
|
6
|
-
export declare class MaskProcessor {
|
|
7
|
-
engine: Engine;
|
|
8
|
-
alphaMaskEnabled: boolean;
|
|
9
|
-
maskMode: MaskMode;
|
|
10
|
-
maskable: Maskable | null;
|
|
11
|
-
private stencilClearAction;
|
|
12
|
-
constructor(engine: Engine);
|
|
13
|
-
getRefValue(): number;
|
|
14
|
-
setMaskOptions(data: spec.MaskOptions): void;
|
|
15
|
-
drawStencilMask(renderer: Renderer): void;
|
|
16
|
-
}
|
|
1
|
+
export {};
|
package/dist/material/types.d.ts
CHANGED
|
@@ -2,7 +2,6 @@ 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 { Renderer } from '../render';
|
|
6
5
|
export type UniformSemantic = 'VIEW' | 'MODEL' | 'MODELVIEW' | 'PROJECTION' | 'VIEWPROJECTION' | 'VIEWINVERSE' | 'EDITOR_TRANSFORM' | 'MODELVIEWPROJECTION';
|
|
7
6
|
export interface MaterialBlendingStates {
|
|
8
7
|
blending?: boolean;
|
|
@@ -64,7 +63,20 @@ export declare enum ShaderType {
|
|
|
64
63
|
*
|
|
65
64
|
*/
|
|
66
65
|
export interface Maskable {
|
|
67
|
-
drawStencilMask(
|
|
66
|
+
drawStencilMask(maskRef: number): void;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* 蒙版引用信息,支持正面和反面蒙版
|
|
70
|
+
*/
|
|
71
|
+
export interface MaskReference {
|
|
72
|
+
/**
|
|
73
|
+
* 蒙版对象
|
|
74
|
+
*/
|
|
75
|
+
maskable: Maskable;
|
|
76
|
+
/**
|
|
77
|
+
* 是否反向蒙版(true: 反向遮挡,false: 正向遮挡)
|
|
78
|
+
*/
|
|
79
|
+
inverted: boolean;
|
|
68
80
|
}
|
|
69
81
|
export declare enum MaskMode {
|
|
70
82
|
/**
|
package/dist/math/index.d.ts
CHANGED
|
@@ -2,3 +2,9 @@ export * from './float16array-wrapper';
|
|
|
2
2
|
export * from './translate';
|
|
3
3
|
export * from './utils';
|
|
4
4
|
export * from './value-getters';
|
|
5
|
+
export * from './shape/build-line';
|
|
6
|
+
export * from './shape/graphics-path';
|
|
7
|
+
export * from './shape/ellipse';
|
|
8
|
+
export * from './shape/poly-star';
|
|
9
|
+
export * from './shape/polygon';
|
|
10
|
+
export * from './shape/shape-path';
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
import { Rectangle } from './rectangle';
|
|
2
|
+
import { ShapePrimitive } from './shape-primitive';
|
|
3
|
+
/**
|
|
4
|
+
* The Circle object represents a circle shape in a two-dimensional coordinate system.
|
|
5
|
+
* Used for drawing graphics and specifying hit areas for containers.
|
|
6
|
+
* @example
|
|
7
|
+
* ```ts
|
|
8
|
+
* // Basic circle creation
|
|
9
|
+
* const circle = new Circle(100, 100, 50);
|
|
10
|
+
*
|
|
11
|
+
* // Use as hit area
|
|
12
|
+
* container.hitArea = new Circle(0, 0, 100);
|
|
13
|
+
*
|
|
14
|
+
* // Check point containment
|
|
15
|
+
* const isInside = circle.contains(mouseX, mouseY);
|
|
16
|
+
*
|
|
17
|
+
* // Get bounding box
|
|
18
|
+
* const bounds = circle.getBounds();
|
|
19
|
+
* ```
|
|
20
|
+
* @remarks
|
|
21
|
+
* - Defined by center (x,y) and radius
|
|
22
|
+
* - Supports point containment tests
|
|
23
|
+
* - Can check stroke intersections
|
|
24
|
+
* @see {@link Rectangle} For rectangular shapes
|
|
25
|
+
* @standard
|
|
26
|
+
*/
|
|
27
|
+
export declare class Circle extends ShapePrimitive {
|
|
28
|
+
/**
|
|
29
|
+
* The X coordinate of the center of this circle
|
|
30
|
+
* @example
|
|
31
|
+
* ```ts
|
|
32
|
+
* // Basic x position
|
|
33
|
+
* const circle = new Circle();
|
|
34
|
+
* circle.x = 100;
|
|
35
|
+
*
|
|
36
|
+
* // Center circle on point
|
|
37
|
+
* circle.x = point.x;
|
|
38
|
+
* ```
|
|
39
|
+
* @default 0
|
|
40
|
+
*/
|
|
41
|
+
x: number;
|
|
42
|
+
/**
|
|
43
|
+
* The Y coordinate of the center of this circle
|
|
44
|
+
* @example
|
|
45
|
+
* ```ts
|
|
46
|
+
* // Basic y position
|
|
47
|
+
* const circle = new Circle();
|
|
48
|
+
* circle.y = 200;
|
|
49
|
+
*
|
|
50
|
+
* // Center circle on point
|
|
51
|
+
* circle.y = point.y;
|
|
52
|
+
* ```
|
|
53
|
+
* @default 0
|
|
54
|
+
*/
|
|
55
|
+
y: number;
|
|
56
|
+
/**
|
|
57
|
+
* The radius of the circle
|
|
58
|
+
* @example
|
|
59
|
+
* ```ts
|
|
60
|
+
* // Basic radius setting
|
|
61
|
+
* const circle = new Circle(100, 100);
|
|
62
|
+
* circle.radius = 50;
|
|
63
|
+
*
|
|
64
|
+
* // Calculate area
|
|
65
|
+
* const area = Math.PI * circle.radius * circle.radius;
|
|
66
|
+
* ```
|
|
67
|
+
* @default 0
|
|
68
|
+
*/
|
|
69
|
+
radius: number;
|
|
70
|
+
/**
|
|
71
|
+
* @param x - The X coordinate of the center of this circle
|
|
72
|
+
* @param y - The Y coordinate of the center of this circle
|
|
73
|
+
* @param radius - The radius of the circle
|
|
74
|
+
*/
|
|
75
|
+
constructor(x?: number, y?: number, radius?: number);
|
|
76
|
+
/**
|
|
77
|
+
* Creates a clone of this Circle instance.
|
|
78
|
+
* @example
|
|
79
|
+
* ```ts
|
|
80
|
+
* // Basic circle cloning
|
|
81
|
+
* const original = new Circle(100, 100, 50);
|
|
82
|
+
* const copy = original.clone();
|
|
83
|
+
*
|
|
84
|
+
* // Clone and modify
|
|
85
|
+
* const modified = original.clone();
|
|
86
|
+
* modified.radius = 75;
|
|
87
|
+
*
|
|
88
|
+
* // Verify independence
|
|
89
|
+
* console.log(original.radius); // 50
|
|
90
|
+
* console.log(modified.radius); // 75
|
|
91
|
+
* ```
|
|
92
|
+
* @returns A copy of the Circle
|
|
93
|
+
* @see {@link Circle.copyFrom} For copying into existing circle
|
|
94
|
+
* @see {@link Circle.copyTo} For copying to another circle
|
|
95
|
+
*/
|
|
96
|
+
clone(): Circle;
|
|
97
|
+
/**
|
|
98
|
+
* Checks whether the x and y coordinates given are contained within this circle.
|
|
99
|
+
*
|
|
100
|
+
* Uses the distance formula to determine if a point is inside the circle's radius.
|
|
101
|
+
*
|
|
102
|
+
* Commonly used for hit testing in PixiJS events and graphics.
|
|
103
|
+
* @example
|
|
104
|
+
* ```ts
|
|
105
|
+
* // Basic containment check
|
|
106
|
+
* const circle = new Circle(100, 100, 50);
|
|
107
|
+
* const isInside = circle.contains(120, 120);
|
|
108
|
+
*
|
|
109
|
+
* // Check mouse position
|
|
110
|
+
* const circle = new Circle(0, 0, 100);
|
|
111
|
+
* container.hitArea = circle;
|
|
112
|
+
* container.on('pointermove', (e) => {
|
|
113
|
+
* // only called if pointer is within circle
|
|
114
|
+
* });
|
|
115
|
+
* ```
|
|
116
|
+
* @param x - The X coordinate of the point to test
|
|
117
|
+
* @param y - The Y coordinate of the point to test
|
|
118
|
+
* @returns Whether the x/y coordinates are within this Circle
|
|
119
|
+
* @see {@link Circle.strokeContains} For checking stroke intersection
|
|
120
|
+
* @see {@link Circle.getBounds} For getting bounding box
|
|
121
|
+
*/
|
|
122
|
+
contains(x: number, y: number): boolean;
|
|
123
|
+
/**
|
|
124
|
+
* Checks whether the x and y coordinates given are contained within this circle including the stroke.
|
|
125
|
+
* @example
|
|
126
|
+
* ```ts
|
|
127
|
+
* // Basic stroke check
|
|
128
|
+
* const circle = new Circle(100, 100, 50);
|
|
129
|
+
* const isOnStroke = circle.strokeContains(150, 100, 4); // 4px line width
|
|
130
|
+
*
|
|
131
|
+
* // Check with different alignments
|
|
132
|
+
* const innerStroke = circle.strokeContains(150, 100, 4, 1); // Inside
|
|
133
|
+
* const centerStroke = circle.strokeContains(150, 100, 4, 0.5); // Centered
|
|
134
|
+
* const outerStroke = circle.strokeContains(150, 100, 4, 0); // Outside
|
|
135
|
+
* ```
|
|
136
|
+
* @param x - The X coordinate of the point to test
|
|
137
|
+
* @param y - The Y coordinate of the point to test
|
|
138
|
+
* @param width - The width of the line to check
|
|
139
|
+
* @param alignment - The alignment of the stroke, 0.5 by default
|
|
140
|
+
* @returns Whether the x/y coordinates are within this Circle's stroke
|
|
141
|
+
* @see {@link Circle.contains} For checking fill containment
|
|
142
|
+
* @see {@link Circle.getBounds} For getting stroke bounds
|
|
143
|
+
*/
|
|
144
|
+
strokeContains(x: number, y: number, width: number, alignment?: number): boolean;
|
|
145
|
+
/**
|
|
146
|
+
* Returns the framing rectangle of the circle as a Rectangle object.
|
|
147
|
+
* @example
|
|
148
|
+
* ```ts
|
|
149
|
+
* // Basic bounds calculation
|
|
150
|
+
* const circle = new Circle(100, 100, 50);
|
|
151
|
+
* const bounds = circle.getBounds();
|
|
152
|
+
* // bounds: x=50, y=50, width=100, height=100
|
|
153
|
+
*
|
|
154
|
+
* // Reuse existing rectangle
|
|
155
|
+
* const rect = new Rectangle();
|
|
156
|
+
* circle.getBounds(rect);
|
|
157
|
+
* ```
|
|
158
|
+
* @param out - Optional Rectangle object to store the result
|
|
159
|
+
* @returns The framing rectangle
|
|
160
|
+
* @see {@link Rectangle} For rectangle properties
|
|
161
|
+
* @see {@link Circle.contains} For point containment
|
|
162
|
+
*/
|
|
163
|
+
getBounds(out?: Rectangle): Rectangle;
|
|
164
|
+
/**
|
|
165
|
+
* Copies another circle to this one.
|
|
166
|
+
* @example
|
|
167
|
+
* ```ts
|
|
168
|
+
* // Basic copying
|
|
169
|
+
* const source = new Circle(100, 100, 50);
|
|
170
|
+
* const target = new Circle();
|
|
171
|
+
* target.copyFrom(source);
|
|
172
|
+
* ```
|
|
173
|
+
* @param circle - The circle to copy from
|
|
174
|
+
* @returns Returns itself
|
|
175
|
+
* @see {@link Circle.copyTo} For copying to another circle
|
|
176
|
+
* @see {@link Circle.clone} For creating new circle copy
|
|
177
|
+
*/
|
|
178
|
+
copyFrom(circle: Circle): this;
|
|
179
|
+
/**
|
|
180
|
+
* Copies this circle to another one.
|
|
181
|
+
* @example
|
|
182
|
+
* ```ts
|
|
183
|
+
* // Basic copying
|
|
184
|
+
* const source = new Circle(100, 100, 50);
|
|
185
|
+
* const target = new Circle();
|
|
186
|
+
* source.copyTo(target);
|
|
187
|
+
* ```
|
|
188
|
+
* @param circle - The circle to copy to
|
|
189
|
+
* @returns Returns given parameter
|
|
190
|
+
* @see {@link Circle.copyFrom} For copying from another circle
|
|
191
|
+
* @see {@link Circle.clone} For creating new circle copy
|
|
192
|
+
*/
|
|
193
|
+
copyTo(circle: Circle): Circle;
|
|
194
|
+
build(points: number[]): void;
|
|
195
|
+
triangulate(points: number[], vertices: number[], verticesOffset: number, indices: number[], indicesOffset: number): void;
|
|
196
|
+
}
|
|
@@ -24,6 +24,13 @@ export declare class GraphicsPath {
|
|
|
24
24
|
* @returns The instance of the current object for chaining.
|
|
25
25
|
*/
|
|
26
26
|
bezierCurveTo(cp1x: number, cp1y: number, cp2x: number, cp2y: number, x: number, y: number, smoothness?: number): GraphicsPath;
|
|
27
|
+
/**
|
|
28
|
+
* Connects the current point to a new point with a straight line. This method updates the current path.
|
|
29
|
+
* @param x - The x-coordinate of the new point to connect to.
|
|
30
|
+
* @param y - The y-coordinate of the new point to connect to.
|
|
31
|
+
* @returns The instance of the current object for chaining.
|
|
32
|
+
*/
|
|
33
|
+
lineTo(x: number, y: number): GraphicsPath;
|
|
27
34
|
/**
|
|
28
35
|
* Sets the starting point for a new sub-path. Any subsequent drawing commands are considered part of this path.
|
|
29
36
|
* @param x - The x-coordinate for the starting point.
|
|
@@ -48,6 +55,15 @@ export declare class GraphicsPath {
|
|
|
48
55
|
* @returns The instance of the current object for chaining.
|
|
49
56
|
*/
|
|
50
57
|
ellipse(x: number, y: number, radiusX: number, radiusY: number, transform?: Matrix4): this;
|
|
58
|
+
/**
|
|
59
|
+
* Draws a circle shape. This method adds a new circle path to the current drawing.
|
|
60
|
+
* @param x - The x-coordinate of the center of the circle.
|
|
61
|
+
* @param y - The y-coordinate of the center of the circle.
|
|
62
|
+
* @param radius - The radius of the circle.
|
|
63
|
+
* @param transform - An optional `Matrix` object to apply a transformation to the circle.
|
|
64
|
+
* @returns The instance of the current object for chaining.
|
|
65
|
+
*/
|
|
66
|
+
circle(x: number, y: number, radius: number, transform?: Matrix4): this;
|
|
51
67
|
/**
|
|
52
68
|
* Draws a rectangle shape. This method adds a new rectangle path to the current drawing.
|
|
53
69
|
* @param x - The x-coordinate of the upper-left corner of the rectangle.
|
|
@@ -58,10 +74,22 @@ export declare class GraphicsPath {
|
|
|
58
74
|
* @returns The instance of the current object for chaining.
|
|
59
75
|
*/
|
|
60
76
|
rect(x: number, y: number, w: number, h: number, roundness: number, transform?: Matrix4): this;
|
|
77
|
+
/**
|
|
78
|
+
* Draws a triangle shape. This method adds a new triangle path to the current drawing.
|
|
79
|
+
* @param x1 - The x-coordinate of the first vertex of the triangle.
|
|
80
|
+
* @param y1 - The y-coordinate of the first vertex of the triangle.
|
|
81
|
+
* @param x2 - The x-coordinate of the second vertex of the triangle.
|
|
82
|
+
* @param y2 - The y-coordinate of the second vertex of the triangle.
|
|
83
|
+
* @param x3 - The x-coordinate of the third vertex of the triangle.
|
|
84
|
+
* @param y3 - The y-coordinate of the third vertex of the triangle.
|
|
85
|
+
* @param transform - An optional `Matrix` object to apply a transformation to the triangle.
|
|
86
|
+
* @returns The instance of the current object for chaining.
|
|
87
|
+
*/
|
|
88
|
+
triangle(x1: number, y1: number, x2: number, y2: number, x3: number, y3: number, transform?: Matrix4): this;
|
|
61
89
|
polyStar(pointCount: number, outerRadius: number, innerRadius: number, outerRoundness: number, innerRoundness: number, starType: StarType, transform?: Matrix4): this;
|
|
62
90
|
clear(): GraphicsPath;
|
|
63
91
|
}
|
|
64
92
|
export interface PathInstruction {
|
|
65
|
-
action: 'moveTo' | 'lineTo' | 'quadraticCurveTo' | 'bezierCurveTo' | 'arc' | 'closePath' | 'addPath' | 'arcTo' | 'ellipse' | 'rect' | 'roundRect' | 'arcToSvg' | 'poly' | 'circle' | 'regularPoly' | 'roundPoly' | 'roundShape' | 'filletRect' | 'chamferRect' | 'polyStar';
|
|
93
|
+
action: 'moveTo' | 'lineTo' | 'quadraticCurveTo' | 'bezierCurveTo' | 'arc' | 'closePath' | 'addPath' | 'arcTo' | 'ellipse' | 'rect' | 'roundRect' | 'arcToSvg' | 'poly' | 'circle' | 'regularPoly' | 'roundPoly' | 'roundShape' | 'filletRect' | 'chamferRect' | 'polyStar' | 'triangle';
|
|
66
94
|
data: any[];
|
|
67
95
|
}
|
|
@@ -28,6 +28,13 @@ export declare class ShapePath {
|
|
|
28
28
|
*/
|
|
29
29
|
bezierCurveTo(cp1x: number, cp1y: number, cp2x: number, cp2y: number, x: number, y: number, smoothness?: number): ShapePath;
|
|
30
30
|
moveTo(x: number, y: number): ShapePath;
|
|
31
|
+
/**
|
|
32
|
+
* Connects the current point to a new point with a straight line. This method updates the current path.
|
|
33
|
+
* @param x - The x-coordinate of the new point to connect to.
|
|
34
|
+
* @param y - The y-coordinate of the new point to connect to.
|
|
35
|
+
* @returns The instance of the current object for chaining.
|
|
36
|
+
*/
|
|
37
|
+
lineTo(x: number, y: number): this;
|
|
31
38
|
/**
|
|
32
39
|
* Closes the current path by drawing a straight line back to the start.
|
|
33
40
|
* If the shape is already closed or there are no points in the path, this method does nothing.
|
|
@@ -45,6 +52,15 @@ export declare class ShapePath {
|
|
|
45
52
|
* @returns The instance of the current object for chaining.
|
|
46
53
|
*/
|
|
47
54
|
ellipse(x: number, y: number, radiusX: number, radiusY: number, transform?: Matrix4): this;
|
|
55
|
+
/**
|
|
56
|
+
* Draws a circle shape. This method adds a new circle path to the current drawing.
|
|
57
|
+
* @param x - The x-coordinate of the center of the circle.
|
|
58
|
+
* @param y - The y-coordinate of the center of the circle.
|
|
59
|
+
* @param radius - The radius of the circle.
|
|
60
|
+
* @param transform - An optional `Matrix` object to apply a transformation to the circle.
|
|
61
|
+
* @returns The instance of the current object for chaining.
|
|
62
|
+
*/
|
|
63
|
+
circle(x: number, y: number, radius: number, transform?: Matrix4): this;
|
|
48
64
|
polyStar(pointCount: number, outerRadius: number, innerRadius: number, outerRoundness: number, innerRoundness: number, starType: StarType, transform?: Matrix4): this;
|
|
49
65
|
/**
|
|
50
66
|
* Draws a rectangle shape. This method adds a new rectangle path to the current drawing.
|
|
@@ -56,6 +72,18 @@ export declare class ShapePath {
|
|
|
56
72
|
* @returns The instance of the current object for chaining.
|
|
57
73
|
*/
|
|
58
74
|
rect(x: number, y: number, w: number, h: number, roundness: number, transform?: Matrix4): this;
|
|
75
|
+
/**
|
|
76
|
+
* Draws a triangle shape. This method adds a new triangle path to the current drawing.
|
|
77
|
+
* @param x1 - The x-coordinate of the first vertex of the triangle.
|
|
78
|
+
* @param y1 - The y-coordinate of the first vertex of the triangle.
|
|
79
|
+
* @param x2 - The x-coordinate of the second vertex of the triangle.
|
|
80
|
+
* @param y2 - The y-coordinate of the second vertex of the triangle.
|
|
81
|
+
* @param x3 - The x-coordinate of the third vertex of the triangle.
|
|
82
|
+
* @param y3 - The y-coordinate of the third vertex of the triangle.
|
|
83
|
+
* @param transform - An optional `Matrix` object to apply a transformation to the triangle.
|
|
84
|
+
* @returns The instance of the current object for chaining.
|
|
85
|
+
*/
|
|
86
|
+
triangle(x1: number, y1: number, x2: number, y2: number, x3: number, y3: number, transform?: Matrix4): this;
|
|
59
87
|
/**
|
|
60
88
|
* Draws a given shape on the canvas.
|
|
61
89
|
* This is a generic method that can draw any type of shape specified by the `ShapePrimitive` parameter.
|
package/dist/math/utils.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { vec2, vec3, vec4 } from '@galacean/effects-specification';
|
|
2
|
+
import type { Vector2 } from '@galacean/effects-math/es/core/vector2';
|
|
2
3
|
import { Vector3 } from '@galacean/effects-math/es/core/vector3';
|
|
3
4
|
import { Ray } from '@galacean/effects-math/es/core/ray';
|
|
4
5
|
import type { TriangleLike } from '@galacean/effects-math/es/core/type';
|
|
@@ -13,3 +14,22 @@ export declare function setRayFromCamera(x: number, y: number, camera: Camera):
|
|
|
13
14
|
export declare function trianglesFromRect(position: Vector3, halfWidth: number, halfHeight: number): TriangleLike[];
|
|
14
15
|
export declare function decimalEqual(a: number, b: number, epsilon?: number): boolean;
|
|
15
16
|
export declare function numberToFix(a: number, fixed?: number): number;
|
|
17
|
+
/**
|
|
18
|
+
* 最小最大值结果
|
|
19
|
+
*/
|
|
20
|
+
export interface MinMaxResult {
|
|
21
|
+
/** 最小值向量 */
|
|
22
|
+
minimum: Vector3;
|
|
23
|
+
/** 最大值向量 */
|
|
24
|
+
maximum: Vector3;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* 从位置数组中提取最小和最大值
|
|
28
|
+
* @param positions - 位置数据数组
|
|
29
|
+
* @param start - 起始索引
|
|
30
|
+
* @param count - 要处理的顶点数量
|
|
31
|
+
* @param bias - 可选的偏移值
|
|
32
|
+
* @param stride - 步长(默认为 3,即 x, y, z)
|
|
33
|
+
* @returns 包含 minimum 和 maximum Vector3 的对象
|
|
34
|
+
*/
|
|
35
|
+
export declare function extractMinAndMax(positions: number[] | Float32Array, start: number, count: number, bias?: Vector2 | null, stride?: number): MinMaxResult;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { AnimationEventReference } from '../../animation';
|
|
1
2
|
import type { GraphDataSet } from './graph-data-set';
|
|
2
3
|
import type { GraphNode, GraphNodeData } from './graph-node';
|
|
3
4
|
import type { Skeleton } from './skeleton';
|
|
@@ -10,6 +11,7 @@ export declare class GraphContext {
|
|
|
10
11
|
updateID: number;
|
|
11
12
|
skeleton: Skeleton;
|
|
12
13
|
branchState: BranchState;
|
|
14
|
+
activeEvents: AnimationEventReference[];
|
|
13
15
|
update(deltaTime: number): void;
|
|
14
16
|
}
|
|
15
17
|
export declare class InstantiationContext {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { AnimationEventReference } from '../../animation';
|
|
1
2
|
import type { VFXItem } from '../../vfx-item';
|
|
2
3
|
import type { AnimationGraphAsset } from './animation-graph-asset';
|
|
3
4
|
import type { GraphNode, PoseNodeDebugInfo } from './graph-node';
|
|
@@ -8,6 +9,7 @@ export declare class GraphInstance {
|
|
|
8
9
|
private graphAsset;
|
|
9
10
|
nodes: GraphNode[];
|
|
10
11
|
skeleton: Skeleton;
|
|
12
|
+
activeEvents: AnimationEventReference[];
|
|
11
13
|
private rootNode;
|
|
12
14
|
private context;
|
|
13
15
|
private result;
|
|
@@ -16,6 +16,7 @@ export declare class AnimationClipNode extends PoseNode {
|
|
|
16
16
|
animation: AnimationClip | null;
|
|
17
17
|
private animatable;
|
|
18
18
|
evaluate(context: GraphContext, result: PoseResult): PoseResult;
|
|
19
|
+
private sampleEvents;
|
|
19
20
|
protected initializeInternal(context: GraphContext): void;
|
|
20
21
|
}
|
|
21
22
|
declare enum TransformCurveType {
|
package/dist/plugins/index.d.ts
CHANGED
|
@@ -15,12 +15,6 @@ export * from './particle/particle-mesh';
|
|
|
15
15
|
export * from './particle/particle-vfx-item';
|
|
16
16
|
export * from './particle/particle-system';
|
|
17
17
|
export * from './particle/particle-system-renderer';
|
|
18
|
-
export * from './shape/build-line';
|
|
19
|
-
export * from './shape/graphics-path';
|
|
20
|
-
export * from './shape/ellipse';
|
|
21
|
-
export * from './shape/poly-star';
|
|
22
|
-
export * from './shape/polygon';
|
|
23
|
-
export * from './shape/shape-path';
|
|
24
18
|
export * from './timeline';
|
|
25
19
|
export * from './text';
|
|
26
20
|
export * from './animation-graph';
|
|
@@ -1,15 +1,38 @@
|
|
|
1
1
|
import { Matrix4 } from '@galacean/effects-math/es/core/matrix4';
|
|
2
|
+
import { Vector3 } from '@galacean/effects-math/es/core/vector3';
|
|
2
3
|
import type { Geometry } from '../../render/geometry';
|
|
3
4
|
import type { BoundingBoxTriangle } from './click-handler';
|
|
5
|
+
import type { Vector2 } from '@galacean/effects-math/es/core';
|
|
6
|
+
import { BoundingBox } from '../../culling/bounding-box';
|
|
4
7
|
/**
|
|
5
|
-
*
|
|
8
|
+
* 包围盒信息
|
|
6
9
|
*/
|
|
7
|
-
export declare class
|
|
8
|
-
|
|
10
|
+
export declare class BoundingBoxInfo {
|
|
11
|
+
/**
|
|
12
|
+
* 包围盒
|
|
13
|
+
*/
|
|
14
|
+
readonly boundingBox: BoundingBox;
|
|
9
15
|
private triangles;
|
|
16
|
+
private boundingBoxTriangle;
|
|
10
17
|
private worldMatrix;
|
|
11
|
-
|
|
12
|
-
|
|
18
|
+
/**
|
|
19
|
+
* 重新构建包围盒信息
|
|
20
|
+
* @param min - 新的最小点(局部空间)
|
|
21
|
+
* @param max - 新的最大点(局部空间)
|
|
22
|
+
* @param worldMatrix - 新的世界矩阵
|
|
23
|
+
*/
|
|
24
|
+
reConstruct(min: Vector3, max: Vector3, worldMatrix?: Matrix4): void;
|
|
25
|
+
/**
|
|
26
|
+
* @deprecated
|
|
27
|
+
*/
|
|
28
|
+
getRawBoundingBoxTriangle(): BoundingBoxTriangle;
|
|
29
|
+
/**
|
|
30
|
+
* @deprecated
|
|
31
|
+
*/
|
|
32
|
+
getBoundingBoxTriangle(size?: Vector2): BoundingBoxTriangle;
|
|
33
|
+
/**
|
|
34
|
+
* @deprecated
|
|
35
|
+
*/
|
|
13
36
|
setGeometry(geometry: Geometry, worldMatrix?: Matrix4): void;
|
|
14
37
|
private geometryToTriangles;
|
|
15
38
|
private assemblyTriangles;
|
|
@@ -7,14 +7,12 @@ import { ParticleMesh } from './particle-mesh';
|
|
|
7
7
|
import type { Mesh, Renderer } from '../../render';
|
|
8
8
|
import type { Engine } from '../../engine';
|
|
9
9
|
import { RendererComponent } from '../../components';
|
|
10
|
-
import type { MaskProcessor } from '../../material/mask-ref-manager';
|
|
11
10
|
/**
|
|
12
11
|
* @since 2.0.0
|
|
13
12
|
*/
|
|
14
13
|
export declare class ParticleSystemRenderer extends RendererComponent {
|
|
15
14
|
meshes: Mesh[];
|
|
16
15
|
particleMesh: ParticleMesh;
|
|
17
|
-
maskManager: MaskProcessor;
|
|
18
16
|
private trailMesh?;
|
|
19
17
|
constructor(engine: Engine, particleMeshProps?: ParticleMeshProps, trailMeshProps?: TrailMeshProps);
|
|
20
18
|
onStart(): void;
|
|
@@ -5,7 +5,7 @@ import * as spec from '@galacean/effects-specification';
|
|
|
5
5
|
import { Component } from '../../components';
|
|
6
6
|
import type { Engine } from '../../engine';
|
|
7
7
|
import type { ValueGetter } from '../../math';
|
|
8
|
-
import type { Mesh
|
|
8
|
+
import type { Mesh } from '../../render';
|
|
9
9
|
import type { Maskable } from '../../material';
|
|
10
10
|
import { MaskProcessor } from '../../material';
|
|
11
11
|
import type { ShapeGenerator, ShapeParticle } from '../../shape';
|
|
@@ -184,8 +184,9 @@ export declare class ParticleSystem extends Component implements Maskable {
|
|
|
184
184
|
reset(): void;
|
|
185
185
|
onStart(): void;
|
|
186
186
|
onUpdate(dt: number): void;
|
|
187
|
-
|
|
188
|
-
|
|
187
|
+
simulate(time: number): void;
|
|
188
|
+
private update;
|
|
189
|
+
drawStencilMask(maskRef: number): void;
|
|
189
190
|
onDestroy(): void;
|
|
190
191
|
getParticleBoxes(): {
|
|
191
192
|
center: Vector3;
|
|
@@ -5,9 +5,8 @@ import { ParticleSystem } from './particle-system';
|
|
|
5
5
|
* @since 2.0.0
|
|
6
6
|
*/
|
|
7
7
|
export declare class ParticleBehaviourPlayable extends Playable {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
start(context: FrameContext): void;
|
|
8
|
+
private particleSystem;
|
|
9
|
+
getParticleSystem(context: FrameContext): ParticleSystem | null;
|
|
11
10
|
processFrame(context: FrameContext): void;
|
|
12
11
|
}
|
|
13
12
|
export declare class ParticleBehaviourPlayableAsset extends PlayableAsset {
|
|
@@ -6,23 +6,13 @@ import type { VFXItem } from '../../vfx-item';
|
|
|
6
6
|
import type { BaseLayout } from './base-layout';
|
|
7
7
|
import type { TextStyle } from './text-style';
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
9
|
+
* 富文本组件特有 API
|
|
10
10
|
*/
|
|
11
|
-
export interface
|
|
12
|
-
setOutlineWidth(value: number): void;
|
|
13
|
-
setOutlineEnabled(value: boolean): void;
|
|
14
|
-
setShadowBlur(value: number): void;
|
|
15
|
-
setShadowColor(value: spec.RGBAColorValue): void;
|
|
16
|
-
setShadowOffsetX(value: number): void;
|
|
17
|
-
setShadowOffsetY(value: number): void;
|
|
18
|
-
setAutoWidth(value: boolean): void;
|
|
19
|
-
setFontSize(value: number): void;
|
|
11
|
+
export interface IRichTextComponent {
|
|
20
12
|
}
|
|
21
13
|
/**
|
|
22
|
-
*
|
|
14
|
+
* 文本组件基础类,包含文本组件和富文本组件的共有逻辑
|
|
23
15
|
*/
|
|
24
|
-
export interface IRichTextComponent extends ITextComponent {
|
|
25
|
-
}
|
|
26
16
|
export declare class TextComponentBase {
|
|
27
17
|
textStyle: TextStyle;
|
|
28
18
|
textLayout: BaseLayout;
|
|
@@ -34,23 +24,69 @@ export declare class TextComponentBase {
|
|
|
34
24
|
material: Material;
|
|
35
25
|
item: VFXItem;
|
|
36
26
|
renderer: ItemRenderer;
|
|
37
|
-
lineCount: number;
|
|
38
27
|
protected maxLineWidth: number;
|
|
39
28
|
protected readonly ALPHA_FIX_VALUE: number;
|
|
29
|
+
/**
|
|
30
|
+
* 设置文本内容
|
|
31
|
+
* @param value - 文本内容
|
|
32
|
+
*/
|
|
40
33
|
setText(value: string): void;
|
|
34
|
+
/**
|
|
35
|
+
* 设置文本水平布局
|
|
36
|
+
* @param value - 布局选项
|
|
37
|
+
*/
|
|
41
38
|
setTextAlign(value: spec.TextAlignment): void;
|
|
39
|
+
/**
|
|
40
|
+
* 设置文本垂直布局
|
|
41
|
+
* @param value - 布局选项
|
|
42
|
+
*/
|
|
42
43
|
setTextVerticalAlign(value: spec.TextVerticalAlign): void;
|
|
43
44
|
/**
|
|
44
45
|
* @deprecated 2.8.0 本方法已废弃,请使用 setTextVerticalAlign 替代。
|
|
45
46
|
*/
|
|
46
47
|
setTextBaseline(value: spec.TextBaseline): void;
|
|
48
|
+
/**
|
|
49
|
+
* 设置文本颜色
|
|
50
|
+
* @param value - 颜色内容
|
|
51
|
+
* @default [1, 1, 1, 1]
|
|
52
|
+
*/
|
|
47
53
|
setTextColor(value: spec.RGBAColorValue): void;
|
|
54
|
+
/**
|
|
55
|
+
* 设置字体
|
|
56
|
+
* @param value - 字体名称,如:"Arial", "Times New Roman" 等
|
|
57
|
+
* @default "sans-serif"
|
|
58
|
+
*/
|
|
48
59
|
setFontFamily(value: string): void;
|
|
60
|
+
/**
|
|
61
|
+
* 设置字重
|
|
62
|
+
* @param value - 字重类型
|
|
63
|
+
*/
|
|
49
64
|
setFontWeight(value: spec.TextWeight): void;
|
|
65
|
+
/**
|
|
66
|
+
* 设置字体样式
|
|
67
|
+
* @param value - 字体样式
|
|
68
|
+
* @default "normal"
|
|
69
|
+
*/
|
|
50
70
|
setFontStyle(value: spec.FontStyle): void;
|
|
71
|
+
/**
|
|
72
|
+
* 设置外描边文本颜色
|
|
73
|
+
* @param value - 颜色内容
|
|
74
|
+
*/
|
|
51
75
|
setOutlineColor(value: spec.RGBAColorValue): void;
|
|
76
|
+
/**
|
|
77
|
+
* 设置是否启用外描边
|
|
78
|
+
* @param value - 是否启用外描边
|
|
79
|
+
*/
|
|
52
80
|
setOutlineEnabled(value: boolean): void;
|
|
81
|
+
/**
|
|
82
|
+
* 设置字体清晰度
|
|
83
|
+
* @param value - 字体清晰度
|
|
84
|
+
*/
|
|
53
85
|
setFontScale(value: number): void;
|
|
86
|
+
/**
|
|
87
|
+
* 设置文本溢出方式
|
|
88
|
+
* @param overflow - 溢出方式
|
|
89
|
+
*/
|
|
54
90
|
setOverflow(overflow: spec.TextOverflow): void;
|
|
55
91
|
protected getFontDesc(size?: number): string;
|
|
56
92
|
protected setupOutline(): void;
|