@galacean/effects-core 2.1.0-alpha.5 → 2.1.0-alpha.7
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 +15 -7
- package/dist/asset.d.ts +4 -0
- package/dist/binary-asset.d.ts +2 -2
- package/dist/comp-vfx-item.d.ts +1 -4
- package/dist/components/base-render-component.d.ts +99 -0
- package/dist/components/index.d.ts +2 -0
- package/dist/components/shape-component.d.ts +206 -0
- package/dist/composition/scene-ticking.d.ts +1 -1
- package/dist/composition-source-manager.d.ts +5 -6
- package/dist/composition.d.ts +12 -9
- package/dist/downloader.d.ts +0 -3
- package/dist/index.d.ts +3 -1
- package/dist/index.js +20120 -17902
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +20118 -17899
- package/dist/index.mjs.map +1 -1
- package/dist/plugin-system.d.ts +7 -5
- package/dist/plugins/cal/calculate-item.d.ts +4 -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/camera/camera-vfx-item-loader.d.ts +1 -1
- package/dist/plugins/index.d.ts +1 -7
- 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/build-adaptive-bezier.d.ts +1 -0
- package/dist/plugins/shape/ellipse.d.ts +79 -0
- package/dist/plugins/shape/graphics-path.d.ts +37 -0
- package/dist/plugins/shape/point-data.d.ts +6 -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 +67 -0
- package/dist/plugins/shape/shape-path.d.ts +73 -0
- package/dist/plugins/shape/shape-primitive.d.ts +18 -0
- package/dist/plugins/shape/triangulate.d.ts +1 -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/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 +5 -5
- package/dist/plugins/timeline/playables/float-property-clip-playable.d.ts +8 -0
- package/dist/plugins/timeline/playables/float-property-mixer-playable.d.ts +6 -0
- package/dist/plugins/timeline/playables/index.d.ts +5 -0
- package/dist/plugins/timeline/track.d.ts +6 -4
- package/dist/plugins/timeline/tracks/float-property-track.d.ts +8 -0
- package/dist/plugins/timeline/tracks/index.d.ts +5 -0
- package/dist/plugins/timeline/tracks/sub-composition-track.d.ts +1 -1
- package/dist/render/gpu-capability.d.ts +1 -1
- package/dist/render/mesh.d.ts +1 -1
- package/dist/render/renderer.d.ts +1 -1
- package/dist/render/semantic-map.d.ts +1 -1
- package/dist/render/shader.d.ts +1 -1
- package/dist/scene.d.ts +17 -18
- package/dist/serialization-helper.d.ts +3 -3
- package/dist/shape/geometry.d.ts +3 -3
- package/dist/texture/texture.d.ts +9 -0
- package/dist/texture/utils.d.ts +1 -2
- package/dist/utils/color.d.ts +4 -5
- package/dist/utils/index.d.ts +1 -1
- package/dist/vfx-item.d.ts +0 -1
- package/package.json +4 -3
- package/dist/image-asset.d.ts +0 -5
- /package/dist/plugins/timeline/{playables → playable-assets}/sub-composition-playable-asset.d.ts +0 -0
|
@@ -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 { 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,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
import type { RuntimeClip, TrackAsset } from '../
|
|
3
|
-
import type { FrameContext, PlayableGraph } from '
|
|
4
|
-
import { Playable, PlayableAsset } from '
|
|
5
|
-
import type { Constructor } from '
|
|
1
|
+
import * as spec from '@galacean/effects-specification';
|
|
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
6
|
export declare class TimelineAsset extends PlayableAsset {
|
|
7
7
|
tracks: TrackAsset[];
|
|
8
8
|
createPlayable(graph: PlayableGraph): 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 FloatPropertyClipPlayable extends Playable {
|
|
5
|
+
value: number;
|
|
6
|
+
curve: ValueGetter<number>;
|
|
7
|
+
processFrame(context: FrameContext): void;
|
|
8
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as spec from '@galacean/effects-specification';
|
|
2
2
|
import type { PlayableGraph } from '../cal/playable-graph';
|
|
3
3
|
import { Playable, PlayableAsset, PlayableOutput } from '../cal/playable-graph';
|
|
4
4
|
import { ParticleSystem } from '../particle/particle-system';
|
|
@@ -12,7 +12,7 @@ export declare class TimelineClip {
|
|
|
12
12
|
start: number;
|
|
13
13
|
duration: number;
|
|
14
14
|
asset: PlayableAsset;
|
|
15
|
-
endBehavior: EndBehavior;
|
|
15
|
+
endBehavior: spec.EndBehavior;
|
|
16
16
|
constructor();
|
|
17
17
|
toLocalTime(time: number): number;
|
|
18
18
|
}
|
|
@@ -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
|
-
resolveBinding(
|
|
33
|
+
resolveBinding(): 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,8 @@
|
|
|
1
|
+
import type { PlayableGraph, Playable } from '../../cal/playable-graph';
|
|
2
|
+
import { TrackAsset } from '../track';
|
|
3
|
+
export declare class FloatPropertyTrack extends TrackAsset {
|
|
4
|
+
path: string;
|
|
5
|
+
propertyName: string;
|
|
6
|
+
createTrackMixer(graph: PlayableGraph): Playable;
|
|
7
|
+
resolveBinding(): 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
|
-
resolveBinding(
|
|
4
|
+
resolveBinding(): void;
|
|
5
5
|
createTrackMixer(graph: PlayableGraph): Playable;
|
|
6
6
|
}
|
|
@@ -16,7 +16,7 @@ export interface GPUCapabilityDetail {
|
|
|
16
16
|
shaderTextureLod: boolean;
|
|
17
17
|
instanceDraw?: boolean;
|
|
18
18
|
drawBuffers?: boolean;
|
|
19
|
-
asyncShaderCompile
|
|
19
|
+
asyncShaderCompile: boolean;
|
|
20
20
|
intIndexElementBuffer?: boolean;
|
|
21
21
|
readableDepthStencilTextures?: boolean;
|
|
22
22
|
writableFragDepth?: boolean;
|
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;
|
|
@@ -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';
|
|
@@ -8,7 +8,7 @@ export declare class SemanticMap implements Disposable {
|
|
|
8
8
|
constructor(semantics?: Record<string, SemanticGetter>);
|
|
9
9
|
toObject(): Record<string, SemanticGetter>;
|
|
10
10
|
setSemantic(name: string, value?: SemanticGetter): void;
|
|
11
|
-
getSemanticValue(name: string, state: RenderingData):
|
|
11
|
+
getSemanticValue(name: string, state: RenderingData): UniformValue | undefined;
|
|
12
12
|
hasSemanticValue(name: string): boolean;
|
|
13
13
|
dispose(): void;
|
|
14
14
|
}
|
package/dist/render/shader.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as spec from '@galacean/effects-specification';
|
|
2
2
|
import { EffectsObject } from '../effects-object';
|
|
3
3
|
import type { Engine } from '../engine';
|
|
4
4
|
export type ShaderMacros = [key: string, value: string | number | boolean][];
|
package/dist/scene.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import type * as spec from '@galacean/effects-specification';
|
|
|
2
2
|
import type { Texture } from './texture';
|
|
3
3
|
import type { PluginSystem } from './plugin-system';
|
|
4
4
|
import type { PickEnum } from './utils';
|
|
5
|
-
export type
|
|
5
|
+
export type ImageLike = spec.HTMLImageLike | ArrayBuffer | Texture;
|
|
6
6
|
export type SceneRenderLevel = PickEnum<spec.RenderLevel, spec.RenderLevel.A | spec.RenderLevel.B | spec.RenderLevel.S>;
|
|
7
7
|
/**
|
|
8
8
|
* 场景类型
|
|
@@ -14,7 +14,7 @@ export interface Scene {
|
|
|
14
14
|
readonly renderLevel?: SceneRenderLevel;
|
|
15
15
|
readonly storage: Record<string, any>;
|
|
16
16
|
textureOptions: Record<string, any>[];
|
|
17
|
-
images:
|
|
17
|
+
images: ImageLike[];
|
|
18
18
|
consumed?: boolean;
|
|
19
19
|
textures?: Texture[];
|
|
20
20
|
/**
|
|
@@ -29,8 +29,21 @@ export interface Scene {
|
|
|
29
29
|
* 加载分段时长
|
|
30
30
|
*/
|
|
31
31
|
timeInfos: Record<string, number>;
|
|
32
|
-
url:
|
|
33
|
-
|
|
32
|
+
url: Scene.LoadType;
|
|
33
|
+
}
|
|
34
|
+
export declare namespace Scene {
|
|
35
|
+
type URLType = {
|
|
36
|
+
url: string;
|
|
37
|
+
options?: SceneLoadOptions;
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* 接受用于加载的数据类型
|
|
41
|
+
*/
|
|
42
|
+
export type LoadType = string | Scene | URLType | spec.JSONScene | Record<string, unknown>;
|
|
43
|
+
export function isJSONObject(scene: any): scene is Scene;
|
|
44
|
+
export function isURL(scene: any): scene is URLType;
|
|
45
|
+
export function isWithOptions(scene: any): scene is URLType;
|
|
46
|
+
export {};
|
|
34
47
|
}
|
|
35
48
|
/**
|
|
36
49
|
* 场景加载参数
|
|
@@ -96,17 +109,3 @@ export interface SceneLoadOptions {
|
|
|
96
109
|
*/
|
|
97
110
|
speed?: number;
|
|
98
111
|
}
|
|
99
|
-
/**
|
|
100
|
-
* 接受用于加载的数据类型
|
|
101
|
-
*/
|
|
102
|
-
export type SceneURLType = {
|
|
103
|
-
url: string;
|
|
104
|
-
};
|
|
105
|
-
export type SceneType = string | Scene | SceneURLType | Record<string, any>;
|
|
106
|
-
export type SceneWithOptionsType = {
|
|
107
|
-
options: SceneLoadOptions;
|
|
108
|
-
};
|
|
109
|
-
export type SceneLoadType = SceneType | SceneWithOptionsType;
|
|
110
|
-
export declare function isSceneJSON(scene: any): scene is Scene;
|
|
111
|
-
export declare function isSceneURL(scene: any): scene is Scene;
|
|
112
|
-
export declare function isSceneWithOptions(scene: any): scene is SceneWithOptionsType;
|
|
@@ -3,9 +3,9 @@ import { EffectsObject } from './effects-object';
|
|
|
3
3
|
export declare class SerializationHelper {
|
|
4
4
|
static collectSerializableObject(effectsObject: EffectsObject, res: Record<string, EffectsObject>): void;
|
|
5
5
|
static serializeEffectObject(effectsObject: EffectsObject): Record<string, any>;
|
|
6
|
-
static
|
|
7
|
-
static
|
|
8
|
-
static
|
|
6
|
+
static serialize(effectsObject: EffectsObject, serializedData?: Record<string, any>): Record<string, any>;
|
|
7
|
+
static deserialize(serializedData: spec.EffectsObjectData, effectsObject: EffectsObject): void;
|
|
8
|
+
static deserializeAsync(serializedData: spec.EffectsObjectData, effectsObject: EffectsObject): Promise<void>;
|
|
9
9
|
static checkTypedArray(obj: unknown): boolean;
|
|
10
10
|
static checkDataPath(value: unknown): value is spec.DataPath;
|
|
11
11
|
static checkGLTFNode(value: any): boolean;
|
package/dist/shape/geometry.d.ts
CHANGED
|
@@ -15,9 +15,9 @@ type ShapeGeometryPre = {
|
|
|
15
15
|
};
|
|
16
16
|
export type ShapeData = {
|
|
17
17
|
gs: ShapeGeometryPre[];
|
|
18
|
-
}
|
|
18
|
+
} | {
|
|
19
19
|
g: ShapeGeometryPre;
|
|
20
|
-
}
|
|
20
|
+
} | spec.ShapeGeometry;
|
|
21
21
|
export declare function getGeometryTriangles(geometry: spec.ShapeGeometry, options: {
|
|
22
22
|
indexBase?: number;
|
|
23
23
|
uvTransform?: number[];
|
|
@@ -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: ShapeData, uvTransform
|
|
28
|
+
export declare function getGeometryByShape(shape: ShapeData, uvTransform?: number[]): GeometryFromShape;
|
|
29
29
|
export declare function rotateVec2(out: vec2 | number[], vec2: vec2, angleInRad: number): vec2;
|
|
30
30
|
export {};
|
|
@@ -37,6 +37,15 @@ export declare abstract class Texture extends EffectsObject {
|
|
|
37
37
|
* @since 2.0.0
|
|
38
38
|
*/
|
|
39
39
|
static fromImage(url: string, engine: Engine, options?: TextureOptionsBase): Promise<Texture>;
|
|
40
|
+
/**
|
|
41
|
+
* 通过视频 URL 创建 Texture 对象。
|
|
42
|
+
* @param url - 要创建的 Texture URL
|
|
43
|
+
* @param engine - 引擎对象
|
|
44
|
+
* @param options - 可选的 Texture 选项
|
|
45
|
+
* @since 2.1.0
|
|
46
|
+
* @returns
|
|
47
|
+
*/
|
|
48
|
+
static fromVideo(url: string, engine: Engine, options?: TextureOptionsBase): Promise<Texture>;
|
|
40
49
|
/**
|
|
41
50
|
* 通过数据创建 Texture 对象。
|
|
42
51
|
* @param data - 要创建的 Texture 数据
|
package/dist/texture/utils.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type * as spec from '@galacean/effects-specification';
|
|
2
2
|
import type { Texture2DSourceOptions, TextureCubeSourceOptions } from './types';
|
|
3
|
-
import type { Engine } from '../engine';
|
|
4
3
|
type TextureJSONOptions = spec.SerializedTextureSource & spec.TextureConfigOptionsBase & spec.TextureFormatOptions;
|
|
5
|
-
export declare function deserializeMipmapTexture(textureOptions: TextureJSONOptions, bins: ArrayBuffer[],
|
|
4
|
+
export declare function deserializeMipmapTexture(textureOptions: TextureJSONOptions, bins: ArrayBuffer[], assets: Record<string, any>, files?: spec.BinaryFile[]): Promise<Texture2DSourceOptions | TextureCubeSourceOptions>;
|
|
6
5
|
export {};
|
package/dist/utils/color.d.ts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
export type color = [r: number, g: number, b: number, a: number];
|
|
2
1
|
export interface ColorStop {
|
|
3
2
|
stop: number;
|
|
4
|
-
color:
|
|
3
|
+
color: number[];
|
|
5
4
|
}
|
|
6
|
-
export declare function colorToArr(hex: string | number[], normalized?: boolean):
|
|
7
|
-
export declare function getColorFromGradientStops(stops: ColorStop[], key: number, normalize?: boolean):
|
|
5
|
+
export declare function colorToArr(hex: string | number[], normalized?: boolean): number[];
|
|
6
|
+
export declare function getColorFromGradientStops(stops: ColorStop[], key: number, normalize?: boolean): number[];
|
|
8
7
|
export declare function colorStopsFromGradient(gradient: number[][] | Record<string, string | number[]>): ColorStop[];
|
|
9
|
-
export declare function interpolateColor(a:
|
|
8
|
+
export declare function interpolateColor(a: number[], b: number[], s: number, origin?: boolean): number[];
|
|
10
9
|
export declare function parsePercent(c: string): number;
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -60,7 +60,7 @@ export declare const isArray: (arg: any) => arg is any[];
|
|
|
60
60
|
* @param obj - 要判断的对象
|
|
61
61
|
* @return
|
|
62
62
|
*/
|
|
63
|
-
export declare function isFunction(obj: unknown):
|
|
63
|
+
export declare function isFunction(obj: unknown): obj is Function;
|
|
64
64
|
/**
|
|
65
65
|
* 判断对象是否是`Object`类型
|
|
66
66
|
*
|
package/dist/vfx-item.d.ts
CHANGED
|
@@ -101,7 +101,6 @@ export declare class VFXItem extends EffectsObject implements Disposable {
|
|
|
101
101
|
static isNull(item: VFXItem): boolean;
|
|
102
102
|
static isTree(item: VFXItem): boolean;
|
|
103
103
|
static isCamera(item: VFXItem): boolean;
|
|
104
|
-
static isExtraCamera(item: VFXItem): boolean;
|
|
105
104
|
static isAncestor(ancestorCandidate: VFXItem, descendantCandidate: VFXItem): boolean;
|
|
106
105
|
constructor(engine: Engine, props?: VFXItemProps);
|
|
107
106
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@galacean/effects-core",
|
|
3
|
-
"version": "2.1.0-alpha.
|
|
3
|
+
"version": "2.1.0-alpha.7",
|
|
4
4
|
"description": "Galacean Effects runtime core for the web",
|
|
5
5
|
"module": "./dist/index.mjs",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -42,10 +42,11 @@
|
|
|
42
42
|
"registry": "https://registry.npmjs.org"
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@galacean/effects-specification": "2.0.
|
|
45
|
+
"@galacean/effects-specification": "2.1.0-alpha.0",
|
|
46
46
|
"@galacean/effects-math": "1.1.0",
|
|
47
47
|
"flatbuffers": "24.3.25",
|
|
48
|
-
"uuid": "9.0.1"
|
|
48
|
+
"uuid": "9.0.1",
|
|
49
|
+
"libtess": "1.2.2"
|
|
49
50
|
},
|
|
50
51
|
"scripts": {
|
|
51
52
|
"prebuild": "pnpm clean",
|
package/dist/image-asset.d.ts
DELETED
/package/dist/plugins/timeline/{playables → playable-assets}/sub-composition-playable-asset.d.ts
RENAMED
|
File without changes
|