@galacean/effects-core 2.1.0-alpha.9 → 2.1.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/README.md +1 -1
- package/dist/comp-vfx-item.d.ts +2 -2
- package/dist/components/base-render-component.d.ts +9 -0
- package/dist/components/fake-3d-component.d.ts +28 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/mesh-component.d.ts +3 -0
- package/dist/components/post-process-volume.d.ts +10 -10
- package/dist/components/renderer-component.d.ts +2 -0
- package/dist/components/shape-component.d.ts +7 -185
- package/dist/composition/scene-ticking.d.ts +14 -0
- package/dist/composition.d.ts +19 -10
- package/dist/effects-object.d.ts +23 -0
- package/dist/engine.d.ts +9 -0
- package/dist/events/event-emitter.d.ts +6 -0
- package/dist/events/types.d.ts +8 -1
- package/dist/index.js +1409 -675
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1406 -672
- package/dist/index.mjs.map +1 -1
- package/dist/material/material.d.ts +14 -1
- package/dist/plugins/cal/playable-graph.d.ts +3 -0
- package/dist/plugins/interact/interact-item.d.ts +4 -1
- package/dist/plugins/interact/mesh-collider.d.ts +4 -0
- package/dist/plugins/shape/graphics-path.d.ts +5 -3
- package/dist/plugins/shape/poly-star.d.ts +42 -0
- package/dist/plugins/shape/rectangle.d.ts +1 -1
- package/dist/plugins/shape/shape-path.d.ts +12 -0
- package/dist/plugins/shape/shape-primitive.d.ts +0 -3
- package/dist/plugins/sprite/sprite-item.d.ts +1 -8
- package/dist/plugins/text/text-item.d.ts +2 -0
- package/dist/plugins/timeline/playable-assets/color-property-playable-asset.d.ts +1 -1
- package/dist/plugins/timeline/playable-assets/index.d.ts +2 -0
- package/dist/plugins/timeline/playable-assets/timeline-asset.d.ts +8 -2
- package/dist/plugins/timeline/playable-assets/vector4-property-playable-asset.d.ts +1 -1
- package/dist/plugins/timeline/playables/activation-mixer-playable.d.ts +0 -2
- package/dist/render/render-frame.d.ts +5 -2
- package/dist/render/renderer.d.ts +2 -1
- package/dist/shape/geometry.d.ts +2 -2
- package/dist/transform.d.ts +8 -0
- package/dist/vfx-item.d.ts +63 -22
- package/package.json +2 -2
|
@@ -51,7 +51,6 @@ export interface MaterialProps {
|
|
|
51
51
|
* Material 抽象类
|
|
52
52
|
*/
|
|
53
53
|
export declare abstract class Material extends EffectsObject implements Disposable {
|
|
54
|
-
shader: Shader;
|
|
55
54
|
shaderVariant: ShaderVariant;
|
|
56
55
|
shaderSource: ShaderWithSource;
|
|
57
56
|
stringTags: Record<string, string>;
|
|
@@ -62,11 +61,25 @@ export declare abstract class Material extends EffectsObject implements Disposab
|
|
|
62
61
|
readonly props: MaterialProps;
|
|
63
62
|
protected destroyed: boolean;
|
|
64
63
|
protected initialized: boolean;
|
|
64
|
+
protected shaderDirty: boolean;
|
|
65
|
+
private _shader;
|
|
65
66
|
/**
|
|
66
67
|
*
|
|
67
68
|
* @param props - 材质属性
|
|
68
69
|
*/
|
|
69
70
|
constructor(engine: Engine, props?: MaterialProps);
|
|
71
|
+
get shader(): Shader;
|
|
72
|
+
set shader(value: Shader);
|
|
73
|
+
/**
|
|
74
|
+
* 材质的主纹理
|
|
75
|
+
*/
|
|
76
|
+
get mainTexture(): Texture;
|
|
77
|
+
set mainTexture(value: Texture);
|
|
78
|
+
/**
|
|
79
|
+
* 材质的主颜色
|
|
80
|
+
*/
|
|
81
|
+
get color(): Color;
|
|
82
|
+
set color(value: Color);
|
|
70
83
|
/******** effects-core 中会调用 引擎必须实现 ***********************/
|
|
71
84
|
/**
|
|
72
85
|
* 设置 Material 的颜色融合开关
|
|
@@ -22,6 +22,7 @@ export declare class PlayableGraph {
|
|
|
22
22
|
export declare class Playable implements Disposable {
|
|
23
23
|
onPlayablePlayFlag: boolean;
|
|
24
24
|
onPlayablePauseFlag: boolean;
|
|
25
|
+
private duration;
|
|
25
26
|
private destroyed;
|
|
26
27
|
private inputs;
|
|
27
28
|
private inputOuputPorts;
|
|
@@ -49,6 +50,8 @@ export declare class Playable implements Disposable {
|
|
|
49
50
|
setInputWeight(inputIndex: number, weight: number): void;
|
|
50
51
|
setTime(time: number): void;
|
|
51
52
|
getTime(): number;
|
|
53
|
+
setDuration(duration: number): void;
|
|
54
|
+
getDuration(): number;
|
|
52
55
|
getPlayState(): PlayState;
|
|
53
56
|
setTraversalMode(mode: PlayableTraversalMode): void;
|
|
54
57
|
getTraversalMode(): PlayableTraversalMode;
|
|
@@ -6,6 +6,7 @@ import { RendererComponent } from '../../components';
|
|
|
6
6
|
import type { DragEventType } from './interact-vfx-item';
|
|
7
7
|
import type { Renderer } from '../../render';
|
|
8
8
|
/**
|
|
9
|
+
* 交互组件
|
|
9
10
|
* @since 2.0.0
|
|
10
11
|
*/
|
|
11
12
|
export declare class InteractComponent extends RendererComponent {
|
|
@@ -29,9 +30,9 @@ export declare class InteractComponent extends RendererComponent {
|
|
|
29
30
|
dxRange: [min: number, max: number];
|
|
30
31
|
dyRange: [min: number, max: number];
|
|
31
32
|
};
|
|
33
|
+
private duringPlay;
|
|
32
34
|
/** 是否响应点击和拖拽交互事件 */
|
|
33
35
|
private _interactive;
|
|
34
|
-
private hasBeenAddedToComposition;
|
|
35
36
|
set interactive(enable: boolean);
|
|
36
37
|
get interactive(): boolean;
|
|
37
38
|
getDragRangeX(): [min: number, max: number];
|
|
@@ -39,6 +40,8 @@ export declare class InteractComponent extends RendererComponent {
|
|
|
39
40
|
getDragRangeY(): [min: number, max: number];
|
|
40
41
|
setDragRangeY(min: number, max: number): void;
|
|
41
42
|
onStart(): void;
|
|
43
|
+
onDisable(): void;
|
|
44
|
+
onEnable(): void;
|
|
42
45
|
onUpdate(dt: number): void;
|
|
43
46
|
render(renderer: Renderer): void;
|
|
44
47
|
onDestroy(): void;
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import type { Geometry } from '../../render/geometry';
|
|
2
2
|
import type { BoundingBoxTriangle } from './click-handler';
|
|
3
3
|
import type { Matrix4 } from '@galacean/effects-math/es/core/matrix4';
|
|
4
|
+
/**
|
|
5
|
+
*
|
|
6
|
+
*/
|
|
4
7
|
export declare class MeshCollider {
|
|
5
8
|
private boundingBoxData;
|
|
6
9
|
private geometry;
|
|
7
10
|
private triangles;
|
|
8
11
|
getBoundingBoxData(): BoundingBoxTriangle;
|
|
12
|
+
getBoundingBox(): BoundingBoxTriangle;
|
|
9
13
|
setGeometry(geometry: Geometry, worldMatrix?: Matrix4): void;
|
|
10
14
|
private geometryToTriangles;
|
|
11
15
|
}
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import type { Matrix4 } from '@galacean/effects-math/es/core/matrix4';
|
|
6
6
|
import { ShapePath } from './shape-path';
|
|
7
|
+
import type { StarType } from './poly-star';
|
|
7
8
|
export declare class GraphicsPath {
|
|
8
9
|
instructions: PathInstruction[];
|
|
9
10
|
private dirty;
|
|
@@ -47,17 +48,18 @@ export declare class GraphicsPath {
|
|
|
47
48
|
ellipse(x: number, y: number, radiusX: number, radiusY: number, transform?: Matrix4): this;
|
|
48
49
|
/**
|
|
49
50
|
* Draws a rectangle shape. This method adds a new rectangle path to the current drawing.
|
|
50
|
-
* @param x - The x-coordinate of the
|
|
51
|
-
* @param y - The y-coordinate of the
|
|
51
|
+
* @param x - The x-coordinate of the upper-left corner of the rectangle.
|
|
52
|
+
* @param y - The y-coordinate of the upper-left corner of the rectangle.
|
|
52
53
|
* @param w - The width of the rectangle.
|
|
53
54
|
* @param h - The height of the rectangle.
|
|
54
55
|
* @param transform - An optional `Matrix` object to apply a transformation to the rectangle.
|
|
55
56
|
* @returns The instance of the current object for chaining.
|
|
56
57
|
*/
|
|
57
58
|
rect(x: number, y: number, w: number, h: number, transform?: Matrix4): this;
|
|
59
|
+
polyStar(pointCount: number, outerRadius: number, innerRadius: number, outerRoundness: number, innerRoundness: number, starType: StarType, transform?: Matrix4): this;
|
|
58
60
|
clear(): GraphicsPath;
|
|
59
61
|
}
|
|
60
62
|
export interface PathInstruction {
|
|
61
|
-
action: 'moveTo' | 'lineTo' | 'quadraticCurveTo' | 'bezierCurveTo' | 'arc' | 'closePath' | 'addPath' | 'arcTo' | 'ellipse' | 'rect' | 'roundRect' | 'arcToSvg' | 'poly' | 'circle' | 'regularPoly' | 'roundPoly' | 'roundShape' | 'filletRect' | 'chamferRect';
|
|
63
|
+
action: 'moveTo' | 'lineTo' | 'quadraticCurveTo' | 'bezierCurveTo' | 'arc' | 'closePath' | 'addPath' | 'arcTo' | 'ellipse' | 'rect' | 'roundRect' | 'arcToSvg' | 'poly' | 'circle' | 'regularPoly' | 'roundPoly' | 'roundShape' | 'filletRect' | 'chamferRect' | 'polyStar';
|
|
62
64
|
data: any[];
|
|
63
65
|
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { ShapePrimitive } from './shape-primitive';
|
|
2
|
+
export declare enum StarType {
|
|
3
|
+
Star = 0,
|
|
4
|
+
Polygon = 1
|
|
5
|
+
}
|
|
6
|
+
export declare class PolyStar extends ShapePrimitive {
|
|
7
|
+
pointCount: number;
|
|
8
|
+
outerRadius: number;
|
|
9
|
+
innerRadius: number;
|
|
10
|
+
outerRoundness: number;
|
|
11
|
+
innerRoundness: number;
|
|
12
|
+
starType: StarType;
|
|
13
|
+
/**
|
|
14
|
+
* bezier 顶点
|
|
15
|
+
*/
|
|
16
|
+
private v;
|
|
17
|
+
/**
|
|
18
|
+
* bezier 缓入点
|
|
19
|
+
*/
|
|
20
|
+
private in;
|
|
21
|
+
/**
|
|
22
|
+
* bezier 缓出点
|
|
23
|
+
*/
|
|
24
|
+
private out;
|
|
25
|
+
/**
|
|
26
|
+
*
|
|
27
|
+
* @param pointCount - 多边形顶点数量
|
|
28
|
+
* @param outerRadius - 外半径大小
|
|
29
|
+
* @param innerRadius - 内半径大小
|
|
30
|
+
* @param outerRoundness - 外顶点圆滑度百分比
|
|
31
|
+
* @param innerRoundness - 内顶点圆滑度百分比
|
|
32
|
+
* @param starType - PolyStar 类型
|
|
33
|
+
*/
|
|
34
|
+
constructor(pointCount?: number, outerRadius?: number, innerRadius?: number, outerRoundness?: number, innerRoundness?: number, starType?: StarType);
|
|
35
|
+
clone(): ShapePrimitive;
|
|
36
|
+
copyFrom(source: PolyStar): void;
|
|
37
|
+
copyTo(destination: PolyStar): void;
|
|
38
|
+
build(points: number[]): void;
|
|
39
|
+
triangulate(points: number[], vertices: number[], verticesOffset: number, indices: number[], indicesOffset: number): void;
|
|
40
|
+
private buildStarPath;
|
|
41
|
+
private buildPolygonPath;
|
|
42
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ShapePrimitive } from './shape-primitive';
|
|
2
2
|
/**
|
|
3
|
-
* The `Rectangle` object is an area defined by its position, as indicated by its
|
|
3
|
+
* The `Rectangle` object is an area defined by its position, as indicated by its upper-left corner
|
|
4
4
|
* point (`x`, `y`) and by its `width` and its `height`.
|
|
5
5
|
*/
|
|
6
6
|
export declare class Rectangle extends ShapePrimitive {
|
|
@@ -6,6 +6,7 @@ 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
8
|
import type { ShapePrimitive } from './shape-primitive';
|
|
9
|
+
import type { StarType } from './poly-star';
|
|
9
10
|
export declare class ShapePath {
|
|
10
11
|
private graphicsPath;
|
|
11
12
|
currentPoly: Polygon | null;
|
|
@@ -42,6 +43,17 @@ export declare class ShapePath {
|
|
|
42
43
|
* @returns The instance of the current object for chaining.
|
|
43
44
|
*/
|
|
44
45
|
ellipse(x: number, y: number, radiusX: number, radiusY: number, transform?: Matrix4): this;
|
|
46
|
+
polyStar(pointCount: number, outerRadius: number, innerRadius: number, outerRoundness: number, innerRoundness: number, starType: StarType, transform?: Matrix4): this;
|
|
47
|
+
/**
|
|
48
|
+
* Draws a rectangle shape. This method adds a new rectangle path to the current drawing.
|
|
49
|
+
* @param x - The x-coordinate of the upper-left corner of the rectangle.
|
|
50
|
+
* @param y - The y-coordinate of the upper-left corner of the rectangle.
|
|
51
|
+
* @param w - The width of the rectangle.
|
|
52
|
+
* @param h - The height of the rectangle.
|
|
53
|
+
* @param transform - An optional `Matrix` object to apply a transformation to the rectangle.
|
|
54
|
+
* @returns The instance of the current object for chaining.
|
|
55
|
+
*/
|
|
56
|
+
rect(x: number, y: number, w: number, h: number, transform?: Matrix4): this;
|
|
45
57
|
/**
|
|
46
58
|
* Draws a given shape on the canvas.
|
|
47
59
|
* This is a generic method that can draw any type of shape specified by the `ShapePrimitive` parameter.
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
export declare abstract class ShapePrimitive {
|
|
2
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
3
|
/** Checks whether the x and y coordinates passed to this function are contained within the stroke of this shape */
|
|
5
4
|
/** Creates a clone of this ShapePrimitive instance. */
|
|
6
5
|
abstract clone(): ShapePrimitive;
|
|
@@ -10,9 +9,7 @@ export declare abstract class ShapePrimitive {
|
|
|
10
9
|
abstract copyTo(destination: ShapePrimitive): void;
|
|
11
10
|
/** Returns the framing rectangle of the ShapePrimitive as a Rectangle object. */
|
|
12
11
|
/** The X coordinate of the shape */
|
|
13
|
-
abstract getX(): number;
|
|
14
12
|
/** The Y coordinate of the shape */
|
|
15
|
-
abstract getY(): number;
|
|
16
13
|
abstract build(points: number[]): void;
|
|
17
14
|
abstract triangulate(points: number[], vertices: number[], verticesOffset: number, indices: number[], indicesOffset: number): void;
|
|
18
15
|
}
|
|
@@ -3,11 +3,10 @@ import type { Engine } from '../../engine';
|
|
|
3
3
|
import type { GeometryDrawMode } from '../../render';
|
|
4
4
|
import { Geometry } from '../../render';
|
|
5
5
|
import type { GeometryFromShape } from '../../shape';
|
|
6
|
-
import type
|
|
6
|
+
import { type Texture } from '../../texture';
|
|
7
7
|
import type { PlayableGraph, Playable } from '../cal/playable-graph';
|
|
8
8
|
import { PlayableAsset } from '../cal/playable-graph';
|
|
9
9
|
import type { ColorPlayableAssetData } from '../../animation';
|
|
10
|
-
import type { ItemRenderer } from '../../components';
|
|
11
10
|
import { BaseRenderComponent } from '../../components/base-render-component';
|
|
12
11
|
/**
|
|
13
12
|
* 用于创建 spriteItem 的数据类型, 经过处理后的 spec.SpriteContent
|
|
@@ -27,12 +26,6 @@ export type SpriteItemOptions = {
|
|
|
27
26
|
startColor: spec.vec4;
|
|
28
27
|
renderLevel?: spec.RenderLevel;
|
|
29
28
|
};
|
|
30
|
-
/**
|
|
31
|
-
* 图层元素渲染属性, 经过处理后的 spec.SpriteContent.renderer
|
|
32
|
-
*/
|
|
33
|
-
export interface SpriteItemRenderer extends ItemRenderer {
|
|
34
|
-
shape?: GeometryFromShape;
|
|
35
|
-
}
|
|
36
29
|
export type splitsDataType = [r: number, x: number, y: number, w: number, h: number | undefined][];
|
|
37
30
|
export declare class SpriteColorPlayableAsset extends PlayableAsset {
|
|
38
31
|
data: ColorPlayableAssetData;
|
|
@@ -28,6 +28,8 @@ export declare class TextComponent extends BaseRenderComponent {
|
|
|
28
28
|
* 文本行数
|
|
29
29
|
*/
|
|
30
30
|
lineCount: number;
|
|
31
|
+
protected readonly SCALE_FACTOR = 0.1;
|
|
32
|
+
protected readonly ALPHA_FIX_VALUE: number;
|
|
31
33
|
constructor(engine: Engine, props?: TextItemProps);
|
|
32
34
|
onUpdate(dt: number): void;
|
|
33
35
|
fromData(data: TextItemProps): void;
|
|
@@ -2,6 +2,6 @@ import type { Playable, PlayableGraph } from '../../cal/playable-graph';
|
|
|
2
2
|
import { PlayableAsset } from '../../cal/playable-graph';
|
|
3
3
|
import * as spec from '@galacean/effects-specification';
|
|
4
4
|
export declare class ColorPropertyPlayableAsset extends PlayableAsset {
|
|
5
|
-
curveData: spec.
|
|
5
|
+
curveData: spec.ColorCurveValue;
|
|
6
6
|
createPlayable(graph: PlayableGraph): Playable;
|
|
7
7
|
}
|
|
@@ -6,8 +6,16 @@ import type { Constructor } from '../../../utils';
|
|
|
6
6
|
import { TrackInstance } from '../track-instance';
|
|
7
7
|
export declare class TimelineAsset extends PlayableAsset {
|
|
8
8
|
tracks: TrackAsset[];
|
|
9
|
+
private cacheFlattenedTracks;
|
|
10
|
+
get flattenedTracks(): TrackAsset[];
|
|
9
11
|
createPlayable(graph: PlayableGraph): Playable;
|
|
10
12
|
createTrack<T extends TrackAsset>(classConstructor: Constructor<T>, parent: TrackAsset, name?: string): T;
|
|
13
|
+
/**
|
|
14
|
+
* Invalidates the asset, called when tracks data changed
|
|
15
|
+
*/
|
|
16
|
+
private invalidate;
|
|
17
|
+
private addSubTracksRecursive;
|
|
18
|
+
private sortTracks;
|
|
11
19
|
fromData(data: spec.TimelineAssetData): void;
|
|
12
20
|
}
|
|
13
21
|
export declare class TimelinePlayable extends Playable {
|
|
@@ -17,8 +25,6 @@ export declare class TimelinePlayable extends Playable {
|
|
|
17
25
|
evaluate(): void;
|
|
18
26
|
compileTracks(graph: PlayableGraph, tracks: TrackAsset[]): void;
|
|
19
27
|
private updateTrackAnimatedObject;
|
|
20
|
-
private sortTracks;
|
|
21
|
-
private addSubTracksRecursive;
|
|
22
28
|
}
|
|
23
29
|
export declare class TrackSortWrapper {
|
|
24
30
|
track: TrackAsset;
|
|
@@ -2,6 +2,6 @@ import type { Playable, PlayableGraph } from '../../cal/playable-graph';
|
|
|
2
2
|
import { PlayableAsset } from '../../cal/playable-graph';
|
|
3
3
|
import type * as spec from '@galacean/effects-specification';
|
|
4
4
|
export declare class Vector4PropertyPlayableAsset extends PlayableAsset {
|
|
5
|
-
curveData: spec.
|
|
5
|
+
curveData: spec.Vector4CurveValue;
|
|
6
6
|
createPlayable(graph: PlayableGraph): Playable;
|
|
7
7
|
}
|
|
@@ -2,6 +2,4 @@ import type { FrameContext } from '../../cal/playable-graph';
|
|
|
2
2
|
import { Playable } from '../../cal/playable-graph';
|
|
3
3
|
export declare class ActivationMixerPlayable extends Playable {
|
|
4
4
|
processFrame(context: FrameContext): void;
|
|
5
|
-
private hideRendererComponents;
|
|
6
|
-
private showRendererComponents;
|
|
7
5
|
}
|
|
@@ -15,6 +15,7 @@ import type { RenderPassClearAction, RenderPassColorAttachmentOptions, RenderPas
|
|
|
15
15
|
import { RenderPass } from './render-pass';
|
|
16
16
|
import type { Renderer } from './renderer';
|
|
17
17
|
import type { PostProcessVolume, RendererComponent } from '../components';
|
|
18
|
+
import type { Vector3 } from '@galacean/effects-math/es/core/vector3';
|
|
18
19
|
/**
|
|
19
20
|
* 渲染数据,保存了当前渲染使用到的数据。
|
|
20
21
|
*/
|
|
@@ -194,6 +195,7 @@ export declare class RenderFrame implements Disposable {
|
|
|
194
195
|
readonly transparentTexture: Texture;
|
|
195
196
|
protected destroyed: boolean;
|
|
196
197
|
protected renderPassInfoMap: WeakMap<RenderPass, RenderPassInfo>;
|
|
198
|
+
private drawObjectPass;
|
|
197
199
|
constructor(options: RenderFrameOptions);
|
|
198
200
|
get renderPasses(): RenderPass[];
|
|
199
201
|
get isDestroyed(): boolean;
|
|
@@ -201,13 +203,13 @@ export declare class RenderFrame implements Disposable {
|
|
|
201
203
|
* 根据 Mesh 优先级添加到 RenderPass
|
|
202
204
|
* @param mesh - 要添加的 Mesh 对象
|
|
203
205
|
*/
|
|
204
|
-
addMeshToDefaultRenderPass(mesh
|
|
206
|
+
addMeshToDefaultRenderPass(mesh: RendererComponent): void;
|
|
205
207
|
/**
|
|
206
208
|
* 把 Mesh 从 RenderPass 中移除,
|
|
207
209
|
* 如果 renderPass 中没有 mesh,此 renderPass 会被删除
|
|
208
210
|
* @param mesh - 要删除的 Mesh 对象
|
|
209
211
|
*/
|
|
210
|
-
removeMeshFromDefaultRenderPass(mesh:
|
|
212
|
+
removeMeshFromDefaultRenderPass(mesh: RendererComponent): void;
|
|
211
213
|
/**
|
|
212
214
|
* 销毁 RenderFrame
|
|
213
215
|
* @param options - 可以有选择销毁一些对象
|
|
@@ -262,6 +264,7 @@ export declare function findPreviousRenderPass(renderPasses: RenderPass[], rende
|
|
|
262
264
|
export declare class GlobalUniforms {
|
|
263
265
|
floats: Record<string, number>;
|
|
264
266
|
ints: Record<string, number>;
|
|
267
|
+
vector3s: Record<string, Vector3>;
|
|
265
268
|
vector4s: Record<string, Vector4>;
|
|
266
269
|
matrices: Record<string, Matrix4>;
|
|
267
270
|
samplers: string[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Matrix4, Vector4 } from '@galacean/effects-math/es/core/index';
|
|
1
|
+
import type { Matrix4, Vector3, Vector4 } from '@galacean/effects-math/es/core/index';
|
|
2
2
|
import type { RendererComponent } from '../components';
|
|
3
3
|
import type { Engine } from '../engine';
|
|
4
4
|
import type { Material } from '../material';
|
|
@@ -21,6 +21,7 @@ export declare class Renderer implements LostHandler, RestoreHandler {
|
|
|
21
21
|
setGlobalFloat(name: string, value: number): void;
|
|
22
22
|
setGlobalInt(name: string, value: number): void;
|
|
23
23
|
setGlobalVector4(name: string, value: Vector4): void;
|
|
24
|
+
setGlobalVector3(name: string, value: Vector3): void;
|
|
24
25
|
setGlobalMatrix(name: string, value: Matrix4): void;
|
|
25
26
|
getFramebuffer(): Framebuffer | null;
|
|
26
27
|
setFramebuffer(framebuffer: Framebuffer | null): void;
|
package/dist/shape/geometry.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ type ShapeGeometryPre = {
|
|
|
13
13
|
p: spec.ShapePoints[1];
|
|
14
14
|
s: spec.ShapeSplits[1];
|
|
15
15
|
};
|
|
16
|
-
export type
|
|
16
|
+
export type ShapeGeometryData = {
|
|
17
17
|
gs: ShapeGeometryPre[];
|
|
18
18
|
} | {
|
|
19
19
|
g: ShapeGeometryPre;
|
|
@@ -25,6 +25,6 @@ export declare function getGeometryTriangles(geometry: spec.ShapeGeometry, optio
|
|
|
25
25
|
aPoint: Float32Array;
|
|
26
26
|
index: Uint16Array;
|
|
27
27
|
};
|
|
28
|
-
export declare function getGeometryByShape(shape:
|
|
28
|
+
export declare function getGeometryByShape(shape: ShapeGeometryData, uvTransform?: number[]): GeometryFromShape;
|
|
29
29
|
export declare function rotateVec2(out: vec2 | number[], vec2: vec2, angleInRad: number): vec2;
|
|
30
30
|
export {};
|
package/dist/transform.d.ts
CHANGED
|
@@ -12,6 +12,9 @@ export interface TransformProps {
|
|
|
12
12
|
anchor?: spec.vec2 | Vector2;
|
|
13
13
|
valid?: boolean;
|
|
14
14
|
}
|
|
15
|
+
/**
|
|
16
|
+
*
|
|
17
|
+
*/
|
|
15
18
|
export declare class Transform implements Disposable {
|
|
16
19
|
/**
|
|
17
20
|
* 转换右手坐标系左手螺旋对应的四元数到对应的旋转角
|
|
@@ -79,6 +82,11 @@ export declare class Transform implements Disposable {
|
|
|
79
82
|
* 最终模型矩阵对应变换的缓存,当自身矩阵或父矩阵有修改时需要更新
|
|
80
83
|
*/
|
|
81
84
|
private readonly worldTRSCache;
|
|
85
|
+
/**
|
|
86
|
+
*
|
|
87
|
+
* @param props
|
|
88
|
+
* @param parent
|
|
89
|
+
*/
|
|
82
90
|
constructor(props?: TransformProps, parent?: Transform);
|
|
83
91
|
set parentTransform(transform: Transform | null);
|
|
84
92
|
get parentTransform(): Transform | null;
|
package/dist/vfx-item.d.ts
CHANGED
|
@@ -59,10 +59,6 @@ export declare class VFXItem extends EffectsObject implements Disposable {
|
|
|
59
59
|
* 元素动画结束时行为(如何处理元素)
|
|
60
60
|
*/
|
|
61
61
|
endBehavior: spec.EndBehavior;
|
|
62
|
-
/**
|
|
63
|
-
* 元素是否可用
|
|
64
|
-
*/
|
|
65
|
-
ended: boolean;
|
|
66
62
|
/**
|
|
67
63
|
* 元素名称
|
|
68
64
|
*/
|
|
@@ -75,17 +71,19 @@ export declare class VFXItem extends EffectsObject implements Disposable {
|
|
|
75
71
|
* 元素创建的数据图层/粒子/模型等
|
|
76
72
|
*/
|
|
77
73
|
_content?: VFXItemContent;
|
|
78
|
-
reusable: boolean;
|
|
79
74
|
type: spec.ItemType;
|
|
80
75
|
props: VFXItemProps;
|
|
81
76
|
isDuringPlay: boolean;
|
|
82
77
|
components: Component[];
|
|
83
78
|
rendererComponents: RendererComponent[];
|
|
84
79
|
/**
|
|
85
|
-
*
|
|
86
|
-
|
|
80
|
+
* 元素是否激活
|
|
81
|
+
*/
|
|
82
|
+
private active;
|
|
83
|
+
/**
|
|
84
|
+
* 元素组件是否显示,用于批量开关元素组件
|
|
87
85
|
*/
|
|
88
|
-
|
|
86
|
+
private visible;
|
|
89
87
|
/**
|
|
90
88
|
* 元素动画的速度
|
|
91
89
|
*/
|
|
@@ -93,13 +91,54 @@ export declare class VFXItem extends EffectsObject implements Disposable {
|
|
|
93
91
|
private listIndex;
|
|
94
92
|
private isEnabled;
|
|
95
93
|
private eventProcessor;
|
|
94
|
+
/**
|
|
95
|
+
*
|
|
96
|
+
* @param item
|
|
97
|
+
* @returns
|
|
98
|
+
*/
|
|
96
99
|
static isComposition(item: VFXItem): boolean;
|
|
100
|
+
/**
|
|
101
|
+
*
|
|
102
|
+
* @param item
|
|
103
|
+
* @returns
|
|
104
|
+
*/
|
|
97
105
|
static isSprite(item: VFXItem): boolean;
|
|
106
|
+
/**
|
|
107
|
+
*
|
|
108
|
+
* @param item
|
|
109
|
+
* @returns
|
|
110
|
+
*/
|
|
98
111
|
static isParticle(item: VFXItem): boolean;
|
|
112
|
+
/**
|
|
113
|
+
*
|
|
114
|
+
* @param item
|
|
115
|
+
* @returns
|
|
116
|
+
*/
|
|
99
117
|
static isNull(item: VFXItem): boolean;
|
|
118
|
+
/**
|
|
119
|
+
*
|
|
120
|
+
* @param item
|
|
121
|
+
* @returns
|
|
122
|
+
*/
|
|
100
123
|
static isTree(item: VFXItem): boolean;
|
|
124
|
+
/**
|
|
125
|
+
*
|
|
126
|
+
* @param item
|
|
127
|
+
* @returns
|
|
128
|
+
*/
|
|
101
129
|
static isCamera(item: VFXItem): boolean;
|
|
130
|
+
/**
|
|
131
|
+
*
|
|
132
|
+
* @param ancestorCandidate
|
|
133
|
+
* @param descendantCandidate
|
|
134
|
+
* @returns
|
|
135
|
+
*/
|
|
102
136
|
static isAncestor(ancestorCandidate: VFXItem, descendantCandidate: VFXItem): boolean;
|
|
137
|
+
/**
|
|
138
|
+
*
|
|
139
|
+
* @param engine
|
|
140
|
+
* @param props
|
|
141
|
+
*/
|
|
103
142
|
constructor(engine: Engine, props?: VFXItemProps);
|
|
104
143
|
/**
|
|
105
144
|
* 返回元素创建的数据
|
|
@@ -175,24 +214,32 @@ export declare class VFXItem extends EffectsObject implements Disposable {
|
|
|
175
214
|
*/
|
|
176
215
|
getComponents<T extends Component>(classConstructor: Constructor<T>): T[];
|
|
177
216
|
setParent(vfxItem: VFXItem): void;
|
|
178
|
-
/**
|
|
179
|
-
* 元素动画结束播放时回调函数
|
|
180
|
-
* @override
|
|
181
|
-
*/
|
|
182
|
-
onEnd(): void;
|
|
183
217
|
/**
|
|
184
218
|
* 设置元素的透明度
|
|
185
219
|
* @param opacity - 透明度值,范围 [0,1]
|
|
186
220
|
*/
|
|
187
221
|
setOpacity(opacity: number): void;
|
|
188
222
|
/**
|
|
189
|
-
*
|
|
223
|
+
* 激活或停用 VFXItem
|
|
190
224
|
*/
|
|
191
|
-
|
|
225
|
+
setActive(value: boolean): void;
|
|
192
226
|
/**
|
|
193
|
-
*
|
|
227
|
+
* 当前 VFXItem 是否激活
|
|
228
|
+
*/
|
|
229
|
+
get isActive(): boolean;
|
|
230
|
+
/**
|
|
231
|
+
* 设置元素的显隐,该设置会批量开关元素组件
|
|
194
232
|
*/
|
|
195
233
|
setVisible(visible: boolean): void;
|
|
234
|
+
/**
|
|
235
|
+
* 元素组件显隐状态
|
|
236
|
+
*/
|
|
237
|
+
get isVisible(): boolean;
|
|
238
|
+
/**
|
|
239
|
+
* 元素组件显隐状态
|
|
240
|
+
* @deprecated use isVisible instead
|
|
241
|
+
*/
|
|
242
|
+
getVisible(): boolean;
|
|
196
243
|
/**
|
|
197
244
|
* 获取元素变换包括位置、旋转、缩放
|
|
198
245
|
* @param transform 将元素变换拷贝到该对象,并将其作为返回值
|
|
@@ -247,12 +294,6 @@ export declare class VFXItem extends EffectsObject implements Disposable {
|
|
|
247
294
|
* 获取元素当前世界坐标
|
|
248
295
|
*/
|
|
249
296
|
getCurrentPosition(): Vector3;
|
|
250
|
-
/**
|
|
251
|
-
* 是否到达元素的结束时间
|
|
252
|
-
* @param now
|
|
253
|
-
* @returns
|
|
254
|
-
*/
|
|
255
|
-
isEnded(now: number): boolean;
|
|
256
297
|
find(name: string): VFXItem | undefined;
|
|
257
298
|
fromData(data: VFXItemData): void;
|
|
258
299
|
toData(): void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@galacean/effects-core",
|
|
3
|
-
"version": "2.1.0
|
|
3
|
+
"version": "2.1.0",
|
|
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.1.0
|
|
45
|
+
"@galacean/effects-specification": "2.1.0",
|
|
46
46
|
"@galacean/effects-math": "1.1.0",
|
|
47
47
|
"flatbuffers": "24.3.25",
|
|
48
48
|
"uuid": "9.0.1",
|