@galacean/effects-core 2.1.0-alpha.6 → 2.1.0-alpha.8
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/color-playable.d.ts +26 -0
- package/dist/animation/index.d.ts +1 -0
- package/dist/asset-manager.d.ts +8 -1
- package/dist/asset.d.ts +4 -0
- package/dist/comp-vfx-item.d.ts +2 -5
- package/dist/components/base-render-component.d.ts +99 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/post-process-volume.d.ts +2 -3
- package/dist/components/shape-component.d.ts +40 -6
- package/dist/composition/scene-ticking.d.ts +1 -1
- package/dist/composition-source-manager.d.ts +4 -5
- package/dist/composition.d.ts +7 -8
- package/dist/downloader.d.ts +0 -3
- package/dist/index.d.ts +3 -1
- package/dist/index.js +19192 -18276
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +19187 -18275
- package/dist/index.mjs.map +1 -1
- package/dist/math/index.d.ts +1 -1
- package/dist/math/translate.d.ts +1 -1
- package/dist/math/value-getters/color-curve.d.ts +12 -0
- package/dist/math/value-getters/index.d.ts +4 -0
- package/dist/math/value-getters/value-getter-map.d.ts +2 -0
- package/dist/math/{value-getter.d.ts → value-getters/value-getter.d.ts} +3 -4
- package/dist/math/value-getters/vector4-curve.d.ts +12 -0
- package/dist/plugin-system.d.ts +7 -5
- package/dist/plugins/cal/calculate-item.d.ts +5 -3
- package/dist/plugins/cal/calculate-loader.d.ts +1 -1
- package/dist/plugins/cal/calculate-vfx-item.d.ts +1 -1
- package/dist/plugins/cal/playable-graph.d.ts +1 -1
- package/dist/plugins/camera/camera-vfx-item-loader.d.ts +1 -1
- package/dist/plugins/index.d.ts +1 -7
- package/dist/plugins/interact/interact-item.d.ts +11 -0
- package/dist/plugins/interact/interact-loader.d.ts +1 -1
- package/dist/plugins/particle/particle-system.d.ts +1 -2
- package/dist/plugins/plugin.d.ts +14 -3
- package/dist/plugins/shape/ellipse.d.ts +79 -0
- package/dist/plugins/shape/graphics-path.d.ts +28 -0
- package/dist/plugins/shape/point-like.d.ts +31 -0
- package/dist/plugins/shape/point.d.ts +58 -0
- package/dist/plugins/shape/polygon.d.ts +12 -5
- package/dist/plugins/shape/rectangle.d.ts +129 -0
- package/dist/plugins/shape/shape-path.d.ts +25 -3
- package/dist/plugins/shape/shape-primitive.d.ts +18 -0
- package/dist/plugins/shape/triangle.d.ts +89 -0
- package/dist/plugins/sprite/sprite-item.d.ts +17 -111
- package/dist/plugins/sprite/sprite-loader.d.ts +1 -1
- package/dist/plugins/sprite/sprite-mesh.d.ts +3 -4
- package/dist/plugins/text/text-item.d.ts +15 -5
- package/dist/plugins/timeline/index.d.ts +3 -0
- package/dist/plugins/timeline/playable-assets/color-property-playable-asset.d.ts +7 -0
- package/dist/plugins/timeline/playable-assets/float-property-playable-asset.d.ts +7 -0
- package/dist/plugins/timeline/playable-assets/index.d.ts +3 -0
- package/dist/plugins/{cal → timeline/playable-assets}/timeline-asset.d.ts +7 -4
- package/dist/plugins/timeline/playable-assets/vector4-property-playable-asset.d.ts +7 -0
- package/dist/plugins/timeline/playables/color-property-mixer-playable.d.ts +6 -0
- package/dist/plugins/timeline/playables/float-property-mixer-playable.d.ts +6 -0
- package/dist/plugins/timeline/playables/index.d.ts +7 -0
- package/dist/plugins/timeline/playables/property-clip-playable.d.ts +8 -0
- package/dist/plugins/timeline/playables/vector4-property-mixer-playable.d.ts +6 -0
- package/dist/plugins/timeline/track-instance.d.ts +14 -0
- package/dist/plugins/timeline/track.d.ts +4 -2
- package/dist/plugins/timeline/tracks/color-property-track.d.ts +5 -0
- package/dist/plugins/timeline/tracks/float-property-track.d.ts +6 -0
- package/dist/plugins/timeline/tracks/index.d.ts +9 -0
- package/dist/plugins/timeline/tracks/material-track.d.ts +5 -0
- package/dist/plugins/timeline/tracks/property-track.d.ts +8 -0
- package/dist/plugins/timeline/tracks/sub-composition-track.d.ts +1 -1
- package/dist/plugins/timeline/tracks/vector4-property-track.d.ts +5 -0
- package/dist/render/index.d.ts +0 -1
- package/dist/render/mesh.d.ts +1 -1
- package/dist/render/render-frame.d.ts +5 -1
- package/dist/render/renderer.d.ts +1 -1
- package/dist/render/semantic-map.d.ts +1 -1
- package/dist/serialization-helper.d.ts +3 -3
- package/dist/texture/texture.d.ts +9 -0
- package/dist/utils/color.d.ts +4 -5
- package/dist/utils/index.d.ts +1 -1
- package/dist/vfx-item.d.ts +0 -9
- package/package.json +2 -2
- package/dist/image-asset.d.ts +0 -5
- package/dist/render/global-volume.d.ts +0 -17
- /package/dist/plugins/timeline/{playables → playable-assets}/sub-composition-playable-asset.d.ts +0 -0
|
@@ -2,15 +2,16 @@
|
|
|
2
2
|
* Based on:
|
|
3
3
|
* https://github.com/pixijs/pixijs/blob/dev/src/scene/graphics/shared/path/ShapePath.ts
|
|
4
4
|
*/
|
|
5
|
-
import type {
|
|
5
|
+
import type { Matrix4 } from '@galacean/effects-math/es/core/matrix4';
|
|
6
6
|
import { Polygon } from './polygon';
|
|
7
7
|
import type { GraphicsPath } from './graphics-path';
|
|
8
|
+
import type { ShapePrimitive } from './shape-primitive';
|
|
8
9
|
export declare class ShapePath {
|
|
9
10
|
private graphicsPath;
|
|
10
11
|
currentPoly: Polygon | null;
|
|
11
12
|
shapePrimitives: {
|
|
12
|
-
shape:
|
|
13
|
-
transform?:
|
|
13
|
+
shape: ShapePrimitive;
|
|
14
|
+
transform?: Matrix4;
|
|
14
15
|
}[];
|
|
15
16
|
constructor(graphicsPath: GraphicsPath);
|
|
16
17
|
/** Builds the path. */
|
|
@@ -30,6 +31,27 @@ export declare class ShapePath {
|
|
|
30
31
|
*/
|
|
31
32
|
bezierCurveTo(cp1x: number, cp1y: number, cp2x: number, cp2y: number, x: number, y: number, smoothness?: number): ShapePath;
|
|
32
33
|
moveTo(x: number, y: number): ShapePath;
|
|
34
|
+
/**
|
|
35
|
+
* Draws an ellipse at the specified location and with the given x and y radii.
|
|
36
|
+
* An optional transformation can be applied, allowing for rotation, scaling, and translation.
|
|
37
|
+
* @param x - The x-coordinate of the center of the ellipse.
|
|
38
|
+
* @param y - The y-coordinate of the center of the ellipse.
|
|
39
|
+
* @param radiusX - The horizontal radius of the ellipse.
|
|
40
|
+
* @param radiusY - The vertical radius of the ellipse.
|
|
41
|
+
* @param transform - An optional `Matrix` object to apply a transformation to the ellipse. This can include rotations.
|
|
42
|
+
* @returns The instance of the current object for chaining.
|
|
43
|
+
*/
|
|
44
|
+
ellipse(x: number, y: number, radiusX: number, radiusY: number, transform?: Matrix4): this;
|
|
45
|
+
/**
|
|
46
|
+
* Draws a given shape on the canvas.
|
|
47
|
+
* This is a generic method that can draw any type of shape specified by the `ShapePrimitive` parameter.
|
|
48
|
+
* An optional transformation matrix can be applied to the shape, allowing for complex transformations.
|
|
49
|
+
* @param shape - The shape to draw, defined as a `ShapePrimitive` object.
|
|
50
|
+
* @param matrix - An optional `Matrix` for transforming the shape. This can include rotations,
|
|
51
|
+
* scaling, and translations.
|
|
52
|
+
* @returns The instance of the current object for chaining.
|
|
53
|
+
*/
|
|
54
|
+
drawShape(shape: ShapePrimitive, matrix?: Matrix4): this;
|
|
33
55
|
/**
|
|
34
56
|
* Starts a new polygon path from the specified starting point.
|
|
35
57
|
* This method initializes a new polygon or ends the current one if it exists.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export declare abstract class ShapePrimitive {
|
|
2
|
+
/** Checks whether the x and y coordinates passed to this function are contained within this ShapePrimitive. */
|
|
3
|
+
abstract contains(x: number, y: number): boolean;
|
|
4
|
+
/** Checks whether the x and y coordinates passed to this function are contained within the stroke of this shape */
|
|
5
|
+
/** Creates a clone of this ShapePrimitive instance. */
|
|
6
|
+
abstract clone(): ShapePrimitive;
|
|
7
|
+
/** Copies the properties from another ShapePrimitive to this ShapePrimitive. */
|
|
8
|
+
abstract copyFrom(source: ShapePrimitive): void;
|
|
9
|
+
/** Copies the properties from this ShapePrimitive to another ShapePrimitive. */
|
|
10
|
+
abstract copyTo(destination: ShapePrimitive): void;
|
|
11
|
+
/** Returns the framing rectangle of the ShapePrimitive as a Rectangle object. */
|
|
12
|
+
/** The X coordinate of the shape */
|
|
13
|
+
abstract getX(): number;
|
|
14
|
+
/** The Y coordinate of the shape */
|
|
15
|
+
abstract getY(): number;
|
|
16
|
+
abstract build(points: number[]): void;
|
|
17
|
+
abstract triangulate(points: number[], vertices: number[], verticesOffset: number, indices: number[], indicesOffset: number): void;
|
|
18
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { Rectangle } from './rectangle';
|
|
2
|
+
import { ShapePrimitive } from './shape-primitive';
|
|
3
|
+
/**
|
|
4
|
+
* A class to define a shape of a triangle via user defined coordinates.
|
|
5
|
+
*
|
|
6
|
+
* Create a `Triangle` object with the `x`, `y`, `x2`, `y2`, `x3`, `y3` properties.
|
|
7
|
+
*/
|
|
8
|
+
export declare class Triangle extends ShapePrimitive {
|
|
9
|
+
/**
|
|
10
|
+
* The X coord of the first point.
|
|
11
|
+
* @default 0
|
|
12
|
+
*/
|
|
13
|
+
x: number;
|
|
14
|
+
/**
|
|
15
|
+
* The Y coord of the first point.
|
|
16
|
+
* @default 0
|
|
17
|
+
*/
|
|
18
|
+
y: number;
|
|
19
|
+
/**
|
|
20
|
+
* The X coord of the second point.
|
|
21
|
+
* @default 0
|
|
22
|
+
*/
|
|
23
|
+
x2: number;
|
|
24
|
+
/**
|
|
25
|
+
* The Y coord of the second point.
|
|
26
|
+
* @default 0
|
|
27
|
+
*/
|
|
28
|
+
y2: number;
|
|
29
|
+
/**
|
|
30
|
+
* The X coord of the third point.
|
|
31
|
+
* @default 0
|
|
32
|
+
*/
|
|
33
|
+
x3: number;
|
|
34
|
+
/**
|
|
35
|
+
* The Y coord of the third point.
|
|
36
|
+
* @default 0
|
|
37
|
+
*/
|
|
38
|
+
y3: number;
|
|
39
|
+
/**
|
|
40
|
+
* @param x - The X coord of the first point.
|
|
41
|
+
* @param y - The Y coord of the first point.
|
|
42
|
+
* @param x2 - The X coord of the second point.
|
|
43
|
+
* @param y2 - The Y coord of the second point.
|
|
44
|
+
* @param x3 - The X coord of the third point.
|
|
45
|
+
* @param y3 - The Y coord of the third point.
|
|
46
|
+
*/
|
|
47
|
+
constructor(x?: number, y?: number, x2?: number, y2?: number, x3?: number, y3?: number);
|
|
48
|
+
/**
|
|
49
|
+
* Checks whether the x and y coordinates given are contained within this triangle
|
|
50
|
+
* @param x - The X coordinate of the point to test
|
|
51
|
+
* @param y - The Y coordinate of the point to test
|
|
52
|
+
* @returns Whether the x/y coordinates are within this Triangle
|
|
53
|
+
*/
|
|
54
|
+
contains(x: number, y: number): boolean;
|
|
55
|
+
/**
|
|
56
|
+
* Checks whether the x and y coordinates given are contained within this triangle including the stroke.
|
|
57
|
+
* @param pointX - The X coordinate of the point to test
|
|
58
|
+
* @param pointY - The Y coordinate of the point to test
|
|
59
|
+
* @param strokeWidth - The width of the line to check
|
|
60
|
+
* @returns Whether the x/y coordinates are within this triangle
|
|
61
|
+
*/
|
|
62
|
+
/**
|
|
63
|
+
* Creates a clone of this Triangle
|
|
64
|
+
* @returns a copy of the triangle
|
|
65
|
+
*/
|
|
66
|
+
clone(): ShapePrimitive;
|
|
67
|
+
/**
|
|
68
|
+
* Copies another triangle to this one.
|
|
69
|
+
* @param triangle - The triangle to copy from.
|
|
70
|
+
* @returns Returns itself.
|
|
71
|
+
*/
|
|
72
|
+
copyFrom(triangle: Triangle): this;
|
|
73
|
+
/**
|
|
74
|
+
* Copies this triangle to another one.
|
|
75
|
+
* @param triangle - The triangle to copy to.
|
|
76
|
+
* @returns Returns given parameter.
|
|
77
|
+
*/
|
|
78
|
+
copyTo(triangle: Triangle): Triangle;
|
|
79
|
+
/**
|
|
80
|
+
* Returns the framing rectangle of the triangle as a Rectangle object
|
|
81
|
+
* @param out - optional rectangle to store the result
|
|
82
|
+
* @returns The framing rectangle
|
|
83
|
+
*/
|
|
84
|
+
getBounds(out?: Rectangle): Rectangle;
|
|
85
|
+
getX(): number;
|
|
86
|
+
getY(): number;
|
|
87
|
+
build(points: number[]): void;
|
|
88
|
+
triangulate(points: number[], vertices: number[], verticesOffset: number, indices: number[], indicesOffset: number): void;
|
|
89
|
+
}
|
|
@@ -1,17 +1,14 @@
|
|
|
1
|
-
import { Matrix4 } from '@galacean/effects-math/es/core/index';
|
|
2
|
-
import type { vec2, vec4 } from '@galacean/effects-specification';
|
|
3
1
|
import * as spec from '@galacean/effects-specification';
|
|
4
|
-
import { RendererComponent } from '../../components/renderer-component';
|
|
5
2
|
import type { Engine } from '../../engine';
|
|
6
|
-
import {
|
|
7
|
-
import type { ValueGetter } from '../../math';
|
|
8
|
-
import type { Renderer } from '../../render';
|
|
3
|
+
import type { GeometryDrawMode } from '../../render';
|
|
9
4
|
import { Geometry } from '../../render';
|
|
10
5
|
import type { GeometryFromShape } from '../../shape';
|
|
11
6
|
import type { Texture } from '../../texture';
|
|
12
|
-
import type {
|
|
13
|
-
import {
|
|
14
|
-
import type {
|
|
7
|
+
import type { PlayableGraph, Playable } from '../cal/playable-graph';
|
|
8
|
+
import { PlayableAsset } from '../cal/playable-graph';
|
|
9
|
+
import type { ColorPlayableAssetData } from '../../animation';
|
|
10
|
+
import type { ItemRenderer } from '../../components';
|
|
11
|
+
import { BaseRenderComponent } from '../../components/base-render-component';
|
|
15
12
|
/**
|
|
16
13
|
* 用于创建 spriteItem 的数据类型, 经过处理后的 spec.SpriteContent
|
|
17
14
|
*/
|
|
@@ -27,123 +24,32 @@ export interface SpriteItemProps extends Omit<spec.SpriteContent, 'renderer'> {
|
|
|
27
24
|
* 图层元素基础属性, 经过处理后的 spec.SpriteContent.options
|
|
28
25
|
*/
|
|
29
26
|
export type SpriteItemOptions = {
|
|
30
|
-
startColor: vec4;
|
|
27
|
+
startColor: spec.vec4;
|
|
31
28
|
renderLevel?: spec.RenderLevel;
|
|
32
29
|
};
|
|
33
30
|
/**
|
|
34
31
|
* 图层元素渲染属性, 经过处理后的 spec.SpriteContent.renderer
|
|
35
32
|
*/
|
|
36
|
-
export interface SpriteItemRenderer extends
|
|
37
|
-
order: number;
|
|
38
|
-
mask: number;
|
|
39
|
-
texture: Texture;
|
|
33
|
+
export interface SpriteItemRenderer extends ItemRenderer {
|
|
40
34
|
shape?: GeometryFromShape;
|
|
41
|
-
anchor?: vec2;
|
|
42
|
-
particleOrigin?: spec.ParticleOrigin;
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* 图层的渲染属性,用于 Mesh 的合并判断
|
|
46
|
-
*/
|
|
47
|
-
export interface SpriteItemRenderInfo {
|
|
48
|
-
side: number;
|
|
49
|
-
occlusion: boolean;
|
|
50
|
-
blending: number;
|
|
51
|
-
cachePrefix: string;
|
|
52
|
-
mask: number;
|
|
53
|
-
maskMode: number;
|
|
54
|
-
cacheId: string;
|
|
55
|
-
wireframe?: boolean;
|
|
56
35
|
}
|
|
57
36
|
export type splitsDataType = [r: number, x: number, y: number, w: number, h: number | undefined][];
|
|
58
|
-
export declare class SpriteColorPlayable extends Playable {
|
|
59
|
-
clipData: {
|
|
60
|
-
colorOverLifetime?: spec.ColorOverLifetime;
|
|
61
|
-
startColor?: spec.RGBAColorValue;
|
|
62
|
-
};
|
|
63
|
-
colorOverLifetime: {
|
|
64
|
-
stop: number;
|
|
65
|
-
color: any;
|
|
66
|
-
}[];
|
|
67
|
-
opacityOverLifetime: ValueGetter<number>;
|
|
68
|
-
startColor: spec.RGBAColorValue;
|
|
69
|
-
renderColor: vec4;
|
|
70
|
-
spriteMaterial: Material;
|
|
71
|
-
spriteComponent: SpriteComponent;
|
|
72
|
-
processFrame(context: FrameContext): void;
|
|
73
|
-
create(clipData: SpriteColorPlayableAssetData): this;
|
|
74
|
-
}
|
|
75
37
|
export declare class SpriteColorPlayableAsset extends PlayableAsset {
|
|
76
|
-
data:
|
|
38
|
+
data: ColorPlayableAssetData;
|
|
77
39
|
createPlayable(graph: PlayableGraph): Playable;
|
|
78
|
-
fromData(data:
|
|
79
|
-
}
|
|
80
|
-
export interface SpriteColorPlayableAssetData extends spec.EffectsObjectData {
|
|
81
|
-
colorOverLifetime?: spec.ColorOverLifetime;
|
|
40
|
+
fromData(data: ColorPlayableAssetData): void;
|
|
82
41
|
}
|
|
83
|
-
export declare class SpriteComponent extends
|
|
84
|
-
renderer: SpriteItemRenderer;
|
|
85
|
-
interaction?: {
|
|
86
|
-
behavior: spec.InteractBehavior;
|
|
87
|
-
};
|
|
88
|
-
cachePrefix: string;
|
|
89
|
-
geoData: {
|
|
90
|
-
atlasOffset: number[] | spec.TypedArray;
|
|
91
|
-
index: number[] | spec.TypedArray;
|
|
92
|
-
};
|
|
93
|
-
anchor?: vec2;
|
|
42
|
+
export declare class SpriteComponent extends BaseRenderComponent {
|
|
94
43
|
textureSheetAnimation?: spec.TextureSheetAnimation;
|
|
95
|
-
frameAnimationLoop: boolean;
|
|
96
44
|
splits: splitsDataType;
|
|
97
|
-
|
|
98
|
-
color: vec4;
|
|
99
|
-
worldMatrix: Matrix4;
|
|
100
|
-
geometry: Geometry;
|
|
101
|
-
/***********************/
|
|
102
|
-
private renderInfo;
|
|
103
|
-
private readonly wireframe?;
|
|
104
|
-
private preMultiAlpha;
|
|
105
|
-
private visible;
|
|
106
|
-
private isManualTimeSet;
|
|
107
|
-
private frameAnimationTime;
|
|
45
|
+
frameAnimationLoop: boolean;
|
|
108
46
|
constructor(engine: Engine, props?: SpriteItemProps);
|
|
109
|
-
/**
|
|
110
|
-
* 设置当前 Mesh 的可见性。
|
|
111
|
-
* @param visible - true:可见,false:不可见
|
|
112
|
-
*/
|
|
113
|
-
setVisible(visible: boolean): void;
|
|
114
|
-
/**
|
|
115
|
-
* 获取当前 Mesh 的可见性。
|
|
116
|
-
*/
|
|
117
|
-
getVisible(): boolean;
|
|
118
|
-
/**
|
|
119
|
-
* 设置当前图层的颜色
|
|
120
|
-
* > Tips: 透明度也属于颜色的一部分,当有透明度/颜色 K 帧变化时,该 API 会失效
|
|
121
|
-
* @since 2.0.0
|
|
122
|
-
* @param color - 颜色值
|
|
123
|
-
*/
|
|
124
|
-
setColor(color: vec4): void;
|
|
125
|
-
/**
|
|
126
|
-
* 设置当前 Mesh 的纹理
|
|
127
|
-
* @since 2.0.0
|
|
128
|
-
* @param texture - 纹理对象
|
|
129
|
-
*/
|
|
130
|
-
setTexture(texture: Texture): void;
|
|
131
|
-
render(renderer: Renderer): void;
|
|
132
|
-
onStart(): void;
|
|
133
47
|
onUpdate(dt: number): void;
|
|
134
48
|
onDestroy(): void;
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
getTextures(): Texture[];
|
|
141
|
-
/**
|
|
142
|
-
* 获取图层包围盒的类型和世界坐标
|
|
143
|
-
* @returns
|
|
144
|
-
*/
|
|
145
|
-
getBoundingBox(): BoundingBoxTriangle | void;
|
|
146
|
-
getHitTestParams: (force?: boolean) => HitTestTriangleParams | void;
|
|
49
|
+
createGeometry(mode: GeometryDrawMode): Geometry;
|
|
50
|
+
getItemGeometryData(): {
|
|
51
|
+
index: number[];
|
|
52
|
+
atlasOffset: number[];
|
|
53
|
+
};
|
|
147
54
|
fromData(data: SpriteItemProps): void;
|
|
148
|
-
toData(): void;
|
|
149
55
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type * as spec from '@galacean/effects-specification';
|
|
2
2
|
import type { PrecompileOptions } from '../../plugin-system';
|
|
3
3
|
import type { Renderer } from '../../render';
|
|
4
|
-
import { AbstractPlugin } from '../
|
|
4
|
+
import { AbstractPlugin } from '../plugin';
|
|
5
5
|
export declare class SpriteLoader extends AbstractPlugin {
|
|
6
6
|
name: string;
|
|
7
7
|
static precompile(compositions: spec.Composition[], render: Renderer, options?: PrecompileOptions): Promise<any>;
|
|
@@ -2,7 +2,7 @@ import type { Vector3 } from '@galacean/effects-math/es/core/vector3';
|
|
|
2
2
|
import type * as spec from '@galacean/effects-specification';
|
|
3
3
|
import type { GPUCapabilityDetail, SharedShaderWithSource } from '../../render';
|
|
4
4
|
import type { Transform } from '../../transform';
|
|
5
|
-
import type {
|
|
5
|
+
import type { ItemRenderInfo } from '../../components';
|
|
6
6
|
export type SpriteRenderData = {
|
|
7
7
|
life: number;
|
|
8
8
|
transform: Transform;
|
|
@@ -21,11 +21,10 @@ export type SpriteRegionData = {
|
|
|
21
21
|
};
|
|
22
22
|
export declare let maxSpriteMeshItemCount: number;
|
|
23
23
|
export declare function setSpriteMeshMaxItemCountByGPU(gpuCapability: GPUCapabilityDetail): 16 | 32 | undefined;
|
|
24
|
-
export declare function getImageItemRenderInfo(item: SpriteComponent): SpriteItemRenderInfo;
|
|
25
24
|
export declare function spriteMeshShaderFromFilter(level: number, options?: {
|
|
26
25
|
wireframe?: boolean;
|
|
27
26
|
env?: string;
|
|
28
27
|
}): SharedShaderWithSource;
|
|
29
|
-
export declare function spriteMeshShaderIdFromRenderInfo(renderInfo:
|
|
30
|
-
export declare function spriteMeshShaderFromRenderInfo(renderInfo:
|
|
28
|
+
export declare function spriteMeshShaderIdFromRenderInfo(renderInfo: ItemRenderInfo, count: number): string;
|
|
29
|
+
export declare function spriteMeshShaderFromRenderInfo(renderInfo: ItemRenderInfo, count: number, level: number, env?: string): SharedShaderWithSource;
|
|
31
30
|
export declare function setMaxSpriteMeshItemCount(count: number): void;
|
|
@@ -1,26 +1,36 @@
|
|
|
1
1
|
import * as spec from '@galacean/effects-specification';
|
|
2
2
|
import type { Engine } from '../../engine';
|
|
3
|
-
import
|
|
4
|
-
import { SpriteComponent } from '../sprite/sprite-item';
|
|
3
|
+
import { Texture } from '../../texture';
|
|
5
4
|
import { TextLayout } from './text-layout';
|
|
6
5
|
import { TextStyle } from './text-style';
|
|
7
6
|
import type { Material } from '../../material';
|
|
8
7
|
import type { VFXItem } from '../../vfx-item';
|
|
8
|
+
import { BaseRenderComponent } from '../../components';
|
|
9
|
+
/**
|
|
10
|
+
* 用于创建 textItem 的数据类型, 经过处理后的 spec.TextContentOptions
|
|
11
|
+
*/
|
|
12
|
+
export interface TextItemProps extends Omit<spec.TextContent, 'renderer'> {
|
|
13
|
+
listIndex?: number;
|
|
14
|
+
renderer: {
|
|
15
|
+
mask: number;
|
|
16
|
+
texture: Texture;
|
|
17
|
+
} & Omit<spec.RendererOptions, 'texture'>;
|
|
18
|
+
}
|
|
9
19
|
export declare const DEFAULT_FONTS: string[];
|
|
10
20
|
export interface TextComponent extends TextComponentBase {
|
|
11
21
|
}
|
|
12
22
|
/**
|
|
13
23
|
* @since 2.0.0
|
|
14
24
|
*/
|
|
15
|
-
export declare class TextComponent extends
|
|
25
|
+
export declare class TextComponent extends BaseRenderComponent {
|
|
16
26
|
isDirty: boolean;
|
|
17
27
|
/**
|
|
18
28
|
* 文本行数
|
|
19
29
|
*/
|
|
20
30
|
lineCount: number;
|
|
21
|
-
constructor(engine: Engine, props?:
|
|
31
|
+
constructor(engine: Engine, props?: TextItemProps);
|
|
22
32
|
onUpdate(dt: number): void;
|
|
23
|
-
fromData(data:
|
|
33
|
+
fromData(data: TextItemProps): void;
|
|
24
34
|
updateWithOptions(options: spec.TextContentOptions): void;
|
|
25
35
|
updateTexture(flipY?: boolean): void;
|
|
26
36
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Playable, PlayableGraph } from '../../cal/playable-graph';
|
|
2
|
+
import { PlayableAsset } from '../../cal/playable-graph';
|
|
3
|
+
import * as spec from '@galacean/effects-specification';
|
|
4
|
+
export declare class ColorPropertyPlayableAsset extends PlayableAsset {
|
|
5
|
+
curveData: spec.ColorCurveData;
|
|
6
|
+
createPlayable(graph: PlayableGraph): Playable;
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { FixedNumberExpression } from '@galacean/effects-specification';
|
|
2
|
+
import type { Playable, PlayableGraph } from '../../cal/playable-graph';
|
|
3
|
+
import { PlayableAsset } from '../../cal/playable-graph';
|
|
4
|
+
export declare class FloatPropertyPlayableAsset extends PlayableAsset {
|
|
5
|
+
curveData: FixedNumberExpression;
|
|
6
|
+
createPlayable(graph: PlayableGraph): Playable;
|
|
7
|
+
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import * as spec from '@galacean/effects-specification';
|
|
2
|
-
import type { RuntimeClip, TrackAsset } from '../
|
|
3
|
-
import type { FrameContext, PlayableGraph } from '
|
|
4
|
-
import { Playable, PlayableAsset } from '
|
|
5
|
-
import type { Constructor } from '
|
|
2
|
+
import type { RuntimeClip, TrackAsset } from '../track';
|
|
3
|
+
import type { FrameContext, PlayableGraph } from '../../cal/playable-graph';
|
|
4
|
+
import { Playable, PlayableAsset } from '../../cal/playable-graph';
|
|
5
|
+
import type { Constructor } from '../../../utils';
|
|
6
|
+
import { TrackInstance } from '../track-instance';
|
|
6
7
|
export declare class TimelineAsset extends PlayableAsset {
|
|
7
8
|
tracks: TrackAsset[];
|
|
8
9
|
createPlayable(graph: PlayableGraph): Playable;
|
|
@@ -11,9 +12,11 @@ export declare class TimelineAsset extends PlayableAsset {
|
|
|
11
12
|
}
|
|
12
13
|
export declare class TimelinePlayable extends Playable {
|
|
13
14
|
clips: RuntimeClip[];
|
|
15
|
+
masterTrackInstances: TrackInstance[];
|
|
14
16
|
prepareFrame(context: FrameContext): void;
|
|
15
17
|
evaluate(): void;
|
|
16
18
|
compileTracks(graph: PlayableGraph, tracks: TrackAsset[]): void;
|
|
19
|
+
private updateTrackAnimatedObject;
|
|
17
20
|
private sortTracks;
|
|
18
21
|
private addSubTracksRecursive;
|
|
19
22
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Playable, PlayableGraph } from '../../cal/playable-graph';
|
|
2
|
+
import { PlayableAsset } from '../../cal/playable-graph';
|
|
3
|
+
import type * as spec from '@galacean/effects-specification';
|
|
4
|
+
export declare class Vector4PropertyPlayableAsset extends PlayableAsset {
|
|
5
|
+
curveData: spec.Vector4CurveData;
|
|
6
|
+
createPlayable(graph: PlayableGraph): Playable;
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export * from './activation-mixer-playable';
|
|
2
|
+
export * from './property-clip-playable';
|
|
3
|
+
export * from './float-property-mixer-playable';
|
|
4
|
+
export * from './sub-composition-clip-playable';
|
|
5
|
+
export * from './sub-composition-mixer-playable';
|
|
6
|
+
export * from './vector4-property-mixer-playable';
|
|
7
|
+
export * from './color-property-mixer-playable';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ValueGetter } from '../../../math';
|
|
2
|
+
import type { FrameContext } from '../../cal/playable-graph';
|
|
3
|
+
import { Playable } from '../../cal/playable-graph';
|
|
4
|
+
export declare class PropertyClipPlayable<T> extends Playable {
|
|
5
|
+
value: T;
|
|
6
|
+
curve: ValueGetter<T>;
|
|
7
|
+
processFrame(context: FrameContext): void;
|
|
8
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Playable, PlayableOutput } from '../cal/playable-graph';
|
|
2
|
+
import type { TrackAsset } from './track';
|
|
3
|
+
/**
|
|
4
|
+
* A class that stores track assets and the generated mixer playables and playable outputs.
|
|
5
|
+
* It is used to query the corresponding playable object based on the track asset.
|
|
6
|
+
*/
|
|
7
|
+
export declare class TrackInstance {
|
|
8
|
+
trackAsset: TrackAsset;
|
|
9
|
+
mixer: Playable;
|
|
10
|
+
output: PlayableOutput;
|
|
11
|
+
children: TrackInstance[];
|
|
12
|
+
constructor(trackAsset: TrackAsset, mixer: Playable, output: PlayableOutput);
|
|
13
|
+
addChild(trackInstance: TrackInstance): void;
|
|
14
|
+
}
|
|
@@ -21,7 +21,8 @@ export declare class TimelineClip {
|
|
|
21
21
|
*/
|
|
22
22
|
export declare class TrackAsset extends PlayableAsset {
|
|
23
23
|
name: string;
|
|
24
|
-
|
|
24
|
+
boundObject: object;
|
|
25
|
+
parent: TrackAsset;
|
|
25
26
|
trackType: TrackType;
|
|
26
27
|
private clipSeed;
|
|
27
28
|
private clips;
|
|
@@ -29,7 +30,7 @@ export declare class TrackAsset extends PlayableAsset {
|
|
|
29
30
|
/**
|
|
30
31
|
* 重写该方法以获取自定义对象绑定
|
|
31
32
|
*/
|
|
32
|
-
|
|
33
|
+
updateAnimatedObject(): void;
|
|
33
34
|
/**
|
|
34
35
|
* 重写该方法以创建自定义混合器
|
|
35
36
|
*/
|
|
@@ -46,6 +47,7 @@ export declare class TrackAsset extends PlayableAsset {
|
|
|
46
47
|
findClip(name: string): TimelineClip | undefined;
|
|
47
48
|
addClip(clip: TimelineClip): void;
|
|
48
49
|
private createClipPlayable;
|
|
50
|
+
fromData(data: spec.EffectsObjectData): void;
|
|
49
51
|
}
|
|
50
52
|
export declare enum TrackType {
|
|
51
53
|
MasterTrack = 0,
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { PlayableGraph, Playable } from '../../cal/playable-graph';
|
|
2
|
+
import { PropertyTrack } from './property-track';
|
|
3
|
+
export declare class FloatPropertyTrack extends PropertyTrack {
|
|
4
|
+
createTrackMixer(graph: PlayableGraph): Playable;
|
|
5
|
+
updateAnimatedObject(): void;
|
|
6
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from './activation-track';
|
|
2
|
+
export * from './float-property-track';
|
|
3
|
+
export * from './sprite-color-track';
|
|
4
|
+
export * from './sub-composition-track';
|
|
5
|
+
export * from './transform-track';
|
|
6
|
+
export * from './material-track';
|
|
7
|
+
export * from './property-track';
|
|
8
|
+
export * from './vector4-property-track';
|
|
9
|
+
export * from './color-property-track';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { EffectsObjectData } from '@galacean/effects-specification';
|
|
2
|
+
import { TrackAsset } from '../track';
|
|
3
|
+
export declare class PropertyTrack extends TrackAsset {
|
|
4
|
+
protected propertyNames: string[];
|
|
5
|
+
private path;
|
|
6
|
+
updateAnimatedObject(): void;
|
|
7
|
+
fromData(data: EffectsObjectData): void;
|
|
8
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { TrackAsset } from '../track';
|
|
2
2
|
import type { PlayableGraph, Playable } from '../../cal/playable-graph';
|
|
3
3
|
export declare class SubCompositionTrack extends TrackAsset {
|
|
4
|
-
|
|
4
|
+
updateAnimatedObject(): void;
|
|
5
5
|
createTrackMixer(graph: PlayableGraph): Playable;
|
|
6
6
|
}
|
package/dist/render/index.d.ts
CHANGED
package/dist/render/mesh.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import type { Material, MaterialDestroyOptions } from '../material';
|
|
|
4
4
|
import type { Geometry, Renderer } from '../render';
|
|
5
5
|
import type { Disposable } from '../utils';
|
|
6
6
|
import { DestroyOptions } from '../utils';
|
|
7
|
-
import { RendererComponent } from '../components
|
|
7
|
+
import { RendererComponent } from '../components';
|
|
8
8
|
export interface MeshOptionsBase {
|
|
9
9
|
material: Material;
|
|
10
10
|
name?: string;
|
|
@@ -128,6 +128,10 @@ export interface RenderFrameOptions {
|
|
|
128
128
|
* 后处理渲染配置
|
|
129
129
|
*/
|
|
130
130
|
globalVolume?: PostProcessVolume;
|
|
131
|
+
/**
|
|
132
|
+
* 后处理是否开启
|
|
133
|
+
*/
|
|
134
|
+
postProcessingEnabled?: boolean;
|
|
131
135
|
/**
|
|
132
136
|
* 名称
|
|
133
137
|
*/
|
|
@@ -165,7 +169,7 @@ export declare class RenderFrame implements Disposable {
|
|
|
165
169
|
/**
|
|
166
170
|
* 存放后处理的属性设置
|
|
167
171
|
*/
|
|
168
|
-
globalVolume
|
|
172
|
+
globalVolume?: PostProcessVolume;
|
|
169
173
|
renderer: Renderer;
|
|
170
174
|
resource: RenderFrameResource;
|
|
171
175
|
keepColorBuffer?: boolean;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Matrix4, Vector4 } from '@galacean/effects-math/es/core/index';
|
|
2
|
-
import type { RendererComponent } from '../components
|
|
2
|
+
import type { RendererComponent } from '../components';
|
|
3
3
|
import type { Engine } from '../engine';
|
|
4
4
|
import type { Material } from '../material';
|
|
5
5
|
import type { LostHandler, RestoreHandler } from '../utils';
|