@galacean/effects-core 2.0.0-alpha.15 → 2.0.0-alpha.17
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/comp-vfx-item.d.ts +1 -1
- package/dist/components/component.d.ts +2 -2
- package/dist/components/effect-component.d.ts +1 -1
- package/dist/components/renderer-component.d.ts +1 -1
- package/dist/composition-source-manager.d.ts +2 -2
- package/dist/composition.d.ts +0 -4
- package/dist/decorators.d.ts +4 -3
- package/dist/effects-object.d.ts +1 -0
- package/dist/fallback/migration.d.ts +3 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +240 -208
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +238 -207
- package/dist/index.mjs.map +1 -1
- package/dist/pass-render-level.d.ts +3 -1
- package/dist/plugins/cal/calculate-item.d.ts +0 -3
- package/dist/plugins/cal/calculate-vfx-item.d.ts +1 -1
- package/dist/plugins/index.d.ts +1 -2
- package/dist/plugins/interact/interact-item.d.ts +1 -1
- package/dist/plugins/particle/particle-system.d.ts +2 -2
- package/dist/plugins/sprite/sprite-item.d.ts +1 -1
- package/dist/plugins/text/index.d.ts +4 -0
- package/dist/plugins/timeline/playables/activation-mixer-playable.d.ts +0 -1
- package/dist/plugins/timeline/track.d.ts +14 -14
- package/dist/scene.d.ts +5 -3
- package/dist/serialization-helper.d.ts +6 -5
- package/dist/shape/shape.d.ts +1 -1
- package/dist/transform.d.ts +3 -3
- package/dist/utils/index.d.ts +21 -13
- package/dist/vfx-item.d.ts +7 -7
- package/package.json +2 -2
|
@@ -1 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
import * as spec from '@galacean/effects-specification';
|
|
2
|
+
import type { SceneRenderLevel } from './scene';
|
|
3
|
+
export declare function passRenderLevel(l?: spec.RenderLevel, renderLevel?: SceneRenderLevel): boolean;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { Euler, Vector3 } from '@galacean/effects-math/es/core/index';
|
|
2
|
-
import type * as spec from '@galacean/effects-specification';
|
|
3
2
|
import type { ValueGetter } from '../../math';
|
|
4
3
|
import { TrackAsset } from '../timeline/track';
|
|
5
4
|
import type { TimelineAsset } from './timeline-asset';
|
|
@@ -24,7 +23,5 @@ export type ItemLinearVelOverLifetime = {
|
|
|
24
23
|
* @internal
|
|
25
24
|
*/
|
|
26
25
|
export declare class ObjectBindingTrack extends TrackAsset {
|
|
27
|
-
data: spec.EffectsObjectData;
|
|
28
26
|
create(timelineAsset: TimelineAsset): void;
|
|
29
|
-
fromData(data: spec.EffectsObjectData): void;
|
|
30
27
|
}
|
|
@@ -7,7 +7,7 @@ import type { ItemBasicTransform, ItemLinearVelOverLifetime } from './calculate-
|
|
|
7
7
|
import type { FrameContext, PlayableGraph } from './playable-graph';
|
|
8
8
|
import { Playable, PlayableAsset } from './playable-graph';
|
|
9
9
|
import { EffectsObject } from '../../effects-object';
|
|
10
|
-
import
|
|
10
|
+
import { VFXItem } from '../../vfx-item';
|
|
11
11
|
/**
|
|
12
12
|
* @since 2.0.0
|
|
13
13
|
* @internal
|
package/dist/plugins/index.d.ts
CHANGED
|
@@ -25,5 +25,4 @@ export * from './timeline/tracks/sprite-color-track';
|
|
|
25
25
|
export * from './timeline/tracks/sub-composition-track';
|
|
26
26
|
export * from './timeline/playables/sub-composition-playable-asset';
|
|
27
27
|
export * from './cal/timeline-asset';
|
|
28
|
-
export * from './text
|
|
29
|
-
export * from './text/text-loader';
|
|
28
|
+
export * from './text';
|
|
@@ -24,5 +24,5 @@ export declare class InteractComponent extends RendererComponent {
|
|
|
24
24
|
beginDragTarget(options: spec.DragInteractOption, eventSystem: EventSystem): void;
|
|
25
25
|
getHitTestParams: (force?: boolean) => HitTestTriangleParams | void;
|
|
26
26
|
getBoundingBox(): BoundingBoxTriangle | void;
|
|
27
|
-
fromData(data:
|
|
27
|
+
fromData(data: spec.InteractContent): void;
|
|
28
28
|
}
|
|
@@ -48,7 +48,7 @@ type ParticleOptions = {
|
|
|
48
48
|
maxCount: number;
|
|
49
49
|
gravity: vec3;
|
|
50
50
|
gravityModifier: ValueGetter<number>;
|
|
51
|
-
renderLevel?:
|
|
51
|
+
renderLevel?: spec.RenderLevel;
|
|
52
52
|
particleFollowParent?: boolean;
|
|
53
53
|
forceTarget?: {
|
|
54
54
|
curve: ValueGetter<number>;
|
|
@@ -192,6 +192,6 @@ export declare class ParticleSystem extends Component {
|
|
|
192
192
|
resumeParticleEmission(): void;
|
|
193
193
|
getBoundingBox(): void | BoundingBoxSphere;
|
|
194
194
|
getHitTestParams: (force?: boolean) => void | HitTestCustomParams;
|
|
195
|
-
fromData(data:
|
|
195
|
+
fromData(data: unknown): void;
|
|
196
196
|
}
|
|
197
197
|
export {};
|
|
@@ -28,7 +28,7 @@ export interface SpriteItemProps extends Omit<spec.SpriteContent, 'renderer'> {
|
|
|
28
28
|
*/
|
|
29
29
|
export type SpriteItemOptions = {
|
|
30
30
|
startColor: vec4;
|
|
31
|
-
renderLevel?:
|
|
31
|
+
renderLevel?: spec.RenderLevel;
|
|
32
32
|
};
|
|
33
33
|
/**
|
|
34
34
|
* 图层元素渲染属性, 经过处理后的 spec.SpriteContent.renderer
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { FrameContext } from '../../cal/playable-graph';
|
|
2
2
|
import { Playable } from '../../cal/playable-graph';
|
|
3
3
|
export declare class ActivationMixerPlayable extends Playable {
|
|
4
|
-
private bindingItem;
|
|
5
4
|
processFrame(context: FrameContext): void;
|
|
6
5
|
private hideRendererComponents;
|
|
7
6
|
private showRendererComponents;
|
|
@@ -2,6 +2,20 @@ import { ItemEndBehavior } from '@galacean/effects-specification';
|
|
|
2
2
|
import type { Engine } from '../../engine';
|
|
3
3
|
import type { PlayableGraph } from '../cal/playable-graph';
|
|
4
4
|
import { Playable, PlayableAsset, PlayableOutput } from '../cal/playable-graph';
|
|
5
|
+
/**
|
|
6
|
+
* @since 2.0.0
|
|
7
|
+
* @internal
|
|
8
|
+
*/
|
|
9
|
+
export declare class TimelineClip {
|
|
10
|
+
id: string;
|
|
11
|
+
name: string;
|
|
12
|
+
start: number;
|
|
13
|
+
duration: number;
|
|
14
|
+
asset: PlayableAsset;
|
|
15
|
+
endBehaviour: ItemEndBehavior;
|
|
16
|
+
constructor();
|
|
17
|
+
toLocalTime(time: number): number;
|
|
18
|
+
}
|
|
5
19
|
/**
|
|
6
20
|
* @since 2.0.0
|
|
7
21
|
* @internal
|
|
@@ -38,20 +52,6 @@ export declare enum TrackType {
|
|
|
38
52
|
MasterTrack = 0,
|
|
39
53
|
ObjectTrack = 1
|
|
40
54
|
}
|
|
41
|
-
/**
|
|
42
|
-
* @since 2.0.0
|
|
43
|
-
* @internal
|
|
44
|
-
*/
|
|
45
|
-
export declare class TimelineClip {
|
|
46
|
-
id: string;
|
|
47
|
-
name: string;
|
|
48
|
-
start: number;
|
|
49
|
-
duration: number;
|
|
50
|
-
asset: PlayableAsset;
|
|
51
|
-
endBehaviour: ItemEndBehavior;
|
|
52
|
-
constructor();
|
|
53
|
-
toLocalTime(time: number): number;
|
|
54
|
-
}
|
|
55
55
|
export declare class RuntimeClip {
|
|
56
56
|
clip: TimelineClip;
|
|
57
57
|
playable: Playable;
|
package/dist/scene.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import type * as spec from '@galacean/effects-specification';
|
|
2
2
|
import type { Texture } from './texture';
|
|
3
3
|
import type { PluginSystem } from './plugin-system';
|
|
4
|
+
import type { PickEnum } from './utils';
|
|
4
5
|
export type ImageSource = spec.TemplateImage | spec.Image | spec.CompressedImage;
|
|
6
|
+
export type SceneRenderLevel = PickEnum<spec.RenderLevel, spec.RenderLevel.A | spec.RenderLevel.B | spec.RenderLevel.S>;
|
|
5
7
|
/**
|
|
6
8
|
* 场景类型
|
|
7
9
|
*/
|
|
@@ -9,7 +11,7 @@ export interface Scene {
|
|
|
9
11
|
readonly jsonScene: spec.JSONScene;
|
|
10
12
|
readonly bins: ArrayBuffer[];
|
|
11
13
|
readonly pluginSystem: PluginSystem;
|
|
12
|
-
readonly renderLevel?:
|
|
14
|
+
readonly renderLevel?: SceneRenderLevel;
|
|
13
15
|
readonly storage: Record<string, any>;
|
|
14
16
|
textureOptions: Record<string, any>[];
|
|
15
17
|
images: ImageSource[];
|
|
@@ -57,9 +59,9 @@ export interface SceneLoadOptions {
|
|
|
57
59
|
* 渲染分级。
|
|
58
60
|
* 分级之后,只会加载当前渲染等级的资源。
|
|
59
61
|
* 当渲染等级被设置为 B 后,player 的 fps 会降到 30 帧
|
|
60
|
-
* @default '
|
|
62
|
+
* @default 'S'
|
|
61
63
|
*/
|
|
62
|
-
renderLevel?:
|
|
64
|
+
renderLevel?: SceneRenderLevel;
|
|
63
65
|
/**
|
|
64
66
|
* 资源加载超时,时间单位秒
|
|
65
67
|
* @default 10s
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
+
import type * as spec from '@galacean/effects-specification';
|
|
1
2
|
import { EffectsObject } from './effects-object';
|
|
2
3
|
export declare class SerializationHelper {
|
|
3
4
|
static collectSerializableObject(effectsObject: EffectsObject, res: Record<string, EffectsObject>): void;
|
|
4
5
|
static serializeEffectObject(effectsObject: EffectsObject): Record<string, any>;
|
|
5
6
|
static serializeTaggedProperties(effectsObject: EffectsObject, serializedData?: Record<string, any>): Record<string, any>;
|
|
6
|
-
static deserializeTaggedProperties(serializedData:
|
|
7
|
-
static deserializeTaggedPropertiesAsync(serializedData:
|
|
8
|
-
static checkTypedArray(obj:
|
|
9
|
-
static checkDataPath(value:
|
|
7
|
+
static deserializeTaggedProperties(serializedData: spec.EffectsObjectData, effectsObject: EffectsObject): void;
|
|
8
|
+
static deserializeTaggedPropertiesAsync(serializedData: spec.EffectsObjectData, effectsObject: EffectsObject): Promise<void>;
|
|
9
|
+
static checkTypedArray(obj: unknown): boolean;
|
|
10
|
+
static checkDataPath(value: unknown): value is spec.DataPath;
|
|
10
11
|
static checkGLTFNode(value: any): boolean;
|
|
11
|
-
static checkImageSource(value:
|
|
12
|
+
static checkImageSource(value: HTMLCanvasElement): boolean;
|
|
12
13
|
private static deserializeProperty;
|
|
13
14
|
private static deserializePropertyAsync;
|
|
14
15
|
private static serializeObjectProperty;
|
package/dist/shape/shape.d.ts
CHANGED
package/dist/transform.d.ts
CHANGED
|
@@ -22,7 +22,7 @@ export declare class Transform implements Disposable {
|
|
|
22
22
|
static getRotation(quat: Quaternion, out: Euler): Euler;
|
|
23
23
|
engine: Engine;
|
|
24
24
|
name: string;
|
|
25
|
-
taggedProperties:
|
|
25
|
+
taggedProperties: spec.TransformData;
|
|
26
26
|
/**
|
|
27
27
|
* 自身位移
|
|
28
28
|
*/
|
|
@@ -223,8 +223,8 @@ export declare class Transform implements Disposable {
|
|
|
223
223
|
* 获取 Transform 是否生效
|
|
224
224
|
*/
|
|
225
225
|
getValid(): boolean;
|
|
226
|
-
toData():
|
|
227
|
-
fromData(data:
|
|
226
|
+
toData(): spec.TransformData;
|
|
227
|
+
fromData(data: spec.TransformData): void;
|
|
228
228
|
dispose(): void;
|
|
229
229
|
private updateTRSCache;
|
|
230
230
|
private dispatchValueChange;
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -9,6 +9,9 @@ export * from './logger';
|
|
|
9
9
|
export type Immutable<O> = O extends Record<any, any> ? {
|
|
10
10
|
readonly [key in keyof O]: Immutable<O[key]>;
|
|
11
11
|
} : O extends Array<infer X> ? ReadonlyArray<X> : O;
|
|
12
|
+
export type PickEnum<T, K extends T> = {
|
|
13
|
+
[P in keyof K]: P extends K ? P : never;
|
|
14
|
+
};
|
|
12
15
|
export declare enum DestroyOptions {
|
|
13
16
|
destroy = 0,
|
|
14
17
|
keep = 1,
|
|
@@ -32,17 +35,17 @@ export declare function noop(): void;
|
|
|
32
35
|
*
|
|
33
36
|
* @static
|
|
34
37
|
* @function isString
|
|
35
|
-
* @param
|
|
36
|
-
* @return
|
|
38
|
+
* @param obj - 要判断的对象
|
|
39
|
+
* @return
|
|
37
40
|
*/
|
|
38
|
-
export declare function isString(obj:
|
|
41
|
+
export declare function isString(obj: unknown): obj is string;
|
|
39
42
|
/**
|
|
40
43
|
* 判断对象是否是`Array`类型
|
|
41
44
|
*
|
|
42
45
|
* @static
|
|
43
46
|
* @function isArray
|
|
44
|
-
* @param
|
|
45
|
-
* @return
|
|
47
|
+
* @param obj - 要判断的对象
|
|
48
|
+
* @return
|
|
46
49
|
*/
|
|
47
50
|
export declare const isArray: (arg: any) => arg is any[];
|
|
48
51
|
/**
|
|
@@ -50,22 +53,27 @@ export declare const isArray: (arg: any) => arg is any[];
|
|
|
50
53
|
*
|
|
51
54
|
* @static
|
|
52
55
|
* @function isFunction
|
|
53
|
-
* @param
|
|
54
|
-
* @return
|
|
56
|
+
* @param obj - 要判断的对象
|
|
57
|
+
* @return
|
|
55
58
|
*/
|
|
56
|
-
export declare function isFunction(obj:
|
|
59
|
+
export declare function isFunction(obj: unknown): boolean;
|
|
57
60
|
/**
|
|
58
61
|
* 判断对象是否是`Object`类型
|
|
59
62
|
*
|
|
60
63
|
* @static
|
|
61
64
|
* @function isObject
|
|
62
|
-
* @param
|
|
63
|
-
* @return
|
|
65
|
+
* @param obj - 要判断的对象
|
|
66
|
+
* @return
|
|
64
67
|
*/
|
|
65
|
-
export declare function isObject(obj:
|
|
68
|
+
export declare function isObject(obj: unknown): obj is Record<string | symbol, unknown>;
|
|
66
69
|
export declare function isCanvas(canvas: HTMLCanvasElement): boolean;
|
|
67
|
-
|
|
68
|
-
|
|
70
|
+
/**
|
|
71
|
+
* 生成一个位于 min 和 max 之间的随机数
|
|
72
|
+
* @param min
|
|
73
|
+
* @param max
|
|
74
|
+
* @returns
|
|
75
|
+
*/
|
|
76
|
+
export declare function randomInRange(min: number, max: number): number;
|
|
69
77
|
export declare function throwDestroyedError(): void;
|
|
70
78
|
export declare function generateGUID(): string;
|
|
71
79
|
export declare function base64ToFile(base64: string, filename?: string, contentType?: string): File;
|
package/dist/vfx-item.d.ts
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { Vector3 } from '@galacean/effects-math/es/core/vector3';
|
|
2
2
|
import * as spec from '@galacean/effects-specification';
|
|
3
3
|
import type { VFXItemData } from './asset-loader';
|
|
4
|
-
import { RendererComponent } from './components';
|
|
5
|
-
import type { Component } from './components/component';
|
|
6
|
-
import { ItemBehaviour } from './components/component';
|
|
4
|
+
import type { Component, RendererComponent, ItemBehaviour } from './components';
|
|
7
5
|
import type { Composition } from './composition';
|
|
8
6
|
import { EffectsObject } from './effects-object';
|
|
9
7
|
import type { Engine } from './engine';
|
|
@@ -60,10 +58,6 @@ export declare class VFXItem extends EffectsObject implements Disposable {
|
|
|
60
58
|
* 元素是否可用
|
|
61
59
|
*/
|
|
62
60
|
ended: boolean;
|
|
63
|
-
/**
|
|
64
|
-
* 元素在合成中的索引
|
|
65
|
-
*/
|
|
66
|
-
listIndex: number;
|
|
67
61
|
/**
|
|
68
62
|
* 元素名称
|
|
69
63
|
*/
|
|
@@ -92,6 +86,7 @@ export declare class VFXItem extends EffectsObject implements Disposable {
|
|
|
92
86
|
* 元素动画的速度
|
|
93
87
|
*/
|
|
94
88
|
private speed;
|
|
89
|
+
private listIndex;
|
|
95
90
|
static isComposition(item: VFXItem): boolean;
|
|
96
91
|
static isSprite(item: VFXItem): boolean;
|
|
97
92
|
static isParticle(item: VFXItem): boolean;
|
|
@@ -108,6 +103,11 @@ export declare class VFXItem extends EffectsObject implements Disposable {
|
|
|
108
103
|
* 播放完成后是否需要再使用,是的话生命周期结束后不会 dispose
|
|
109
104
|
*/
|
|
110
105
|
get compositionReusable(): boolean;
|
|
106
|
+
/**
|
|
107
|
+
* 元素在合成中的索引
|
|
108
|
+
*/
|
|
109
|
+
get renderOrder(): number;
|
|
110
|
+
set renderOrder(value: number);
|
|
111
111
|
/**
|
|
112
112
|
* 设置元素的动画速度
|
|
113
113
|
* @param speed - 速度
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@galacean/effects-core",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.17",
|
|
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.0.0-alpha.
|
|
45
|
+
"@galacean/effects-specification": "2.0.0-alpha.19",
|
|
46
46
|
"@galacean/effects-math": "1.1.0",
|
|
47
47
|
"uuid": "9.0.1"
|
|
48
48
|
},
|