@galacean/effects-core 2.8.9 → 2.9.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/animation/animation-clip.d.ts +2 -0
- package/dist/animation/animation-events.d.ts +29 -0
- package/dist/animation/index.d.ts +1 -0
- package/dist/asset-manager.d.ts +2 -0
- package/dist/asset-service.d.ts +0 -1
- package/dist/camera.d.ts +2 -16
- package/dist/components/base-render-component.d.ts +5 -8
- package/dist/components/component.d.ts +4 -0
- package/dist/components/composition-component.d.ts +26 -6
- package/dist/components/frame-component.d.ts +19 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/mesh-component.d.ts +5 -11
- package/dist/components/renderer-component.d.ts +18 -2
- package/dist/components/shape-component.d.ts +2 -6
- package/dist/composition/scene-ticking.d.ts +4 -0
- package/dist/composition.d.ts +8 -5
- package/dist/culling/bounding-box.d.ts +114 -0
- package/dist/engine.d.ts +2 -1
- package/dist/events/types.d.ts +11 -0
- package/dist/fallback/migration.d.ts +9 -8
- package/dist/fallback/utils.d.ts +0 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +23738 -21775
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +23732 -21775
- package/dist/index.mjs.map +1 -1
- package/dist/material/mask-ref-manager.d.ts +1 -16
- package/dist/material/types.d.ts +14 -2
- package/dist/math/index.d.ts +6 -0
- package/dist/math/shape/circle.d.ts +196 -0
- package/dist/{plugins → math}/shape/graphics-path.d.ts +29 -1
- package/dist/{plugins → math}/shape/shape-path.d.ts +28 -0
- package/dist/math/utils.d.ts +20 -0
- package/dist/plugins/animation-graph/graph-context.d.ts +2 -0
- package/dist/plugins/animation-graph/graph-instance.d.ts +2 -0
- package/dist/plugins/animation-graph/nodes/animation-clip-node.d.ts +1 -0
- package/dist/plugins/index.d.ts +0 -6
- package/dist/plugins/interact/mesh-collider.d.ts +28 -5
- package/dist/plugins/particle/particle-system-renderer.d.ts +0 -2
- package/dist/plugins/particle/particle-system.d.ts +4 -3
- package/dist/plugins/particle/particle-vfx-item.d.ts +2 -3
- package/dist/plugins/text/text-component-base.d.ts +50 -14
- package/dist/plugins/text/text-item.d.ts +52 -52
- package/dist/plugins/text/text-layout.d.ts +4 -5
- package/dist/plugins/timeline/playable.d.ts +2 -1
- package/dist/plugins/timeline/timeline-asset.d.ts +1 -5
- package/dist/plugins/timeline/track.d.ts +0 -3
- package/dist/precompositions/index.d.ts +2 -0
- package/dist/precompositions/precomposition-manager.d.ts +13 -0
- package/dist/precompositions/precomposition.d.ts +7 -0
- package/dist/render/graphics.d.ts +136 -0
- package/dist/render/index.d.ts +1 -0
- package/dist/render/render-frame.d.ts +1 -2
- package/dist/scene-loader.d.ts +3 -0
- package/dist/scene.d.ts +0 -1
- package/dist/vfx-item.d.ts +11 -7
- package/package.json +2 -2
- /package/dist/{plugins → math}/shape/build-adaptive-bezier.d.ts +0 -0
- /package/dist/{plugins → math}/shape/build-line.d.ts +0 -0
- /package/dist/{plugins → math}/shape/ellipse.d.ts +0 -0
- /package/dist/{plugins → math}/shape/point-data.d.ts +0 -0
- /package/dist/{plugins → math}/shape/point-like.d.ts +0 -0
- /package/dist/{plugins → math}/shape/point.d.ts +0 -0
- /package/dist/{plugins → math}/shape/poly-star.d.ts +0 -0
- /package/dist/{plugins → math}/shape/polygon.d.ts +0 -0
- /package/dist/{plugins → math}/shape/rectangle.d.ts +0 -0
- /package/dist/{plugins → math}/shape/shape-primitive.d.ts +0 -0
- /package/dist/{plugins → math}/shape/triangle.d.ts +0 -0
- /package/dist/{plugins → math}/shape/triangulate.d.ts +0 -0
|
@@ -4,6 +4,7 @@ import * as spec from '@galacean/effects-specification';
|
|
|
4
4
|
import { EffectsObject } from '../effects-object';
|
|
5
5
|
import type { ValueGetter, Vector3Curve, BezierCurve, ColorCurve } from '../math';
|
|
6
6
|
import type { VFXItem } from '../vfx-item';
|
|
7
|
+
import { type AnimationEventInfo } from './animation-events';
|
|
7
8
|
export interface AnimationCurve {
|
|
8
9
|
path: string;
|
|
9
10
|
keyFrames: ValueGetter<any>;
|
|
@@ -38,6 +39,7 @@ export declare class AnimationClip extends EffectsObject {
|
|
|
38
39
|
scaleCurves: ScaleAnimationCurve[];
|
|
39
40
|
floatCurves: FloatAnimationCurve[];
|
|
40
41
|
colorCurves: ColorAnimationCurve[];
|
|
42
|
+
events: AnimationEventInfo[];
|
|
41
43
|
sampleAnimation(vfxItem: VFXItem, time: number): void;
|
|
42
44
|
fromData(data: spec.AnimationClipData): void;
|
|
43
45
|
private findTarget;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { AnimationClip } from './animation-clip';
|
|
2
|
+
import type { VFXItem } from '../vfx-item';
|
|
3
|
+
export interface AnimationEventReference {
|
|
4
|
+
event: AnimationEventInfo;
|
|
5
|
+
currentTime: number;
|
|
6
|
+
deltaTime: number;
|
|
7
|
+
}
|
|
8
|
+
export interface AnimationEventInfo {
|
|
9
|
+
name: string;
|
|
10
|
+
startTime: number;
|
|
11
|
+
duration: number;
|
|
12
|
+
event: AnimationEvent;
|
|
13
|
+
clip: AnimationClip;
|
|
14
|
+
}
|
|
15
|
+
export interface AnimationEventData {
|
|
16
|
+
typeName: string;
|
|
17
|
+
}
|
|
18
|
+
export interface AnimationEventInfoData {
|
|
19
|
+
name: string;
|
|
20
|
+
startTime: number;
|
|
21
|
+
duration?: number;
|
|
22
|
+
eventData?: AnimationEventData;
|
|
23
|
+
}
|
|
24
|
+
export declare class AnimationEvent {
|
|
25
|
+
onEvent(item: VFXItem, animation: AnimationClip, eventReference: AnimationEventReference): void;
|
|
26
|
+
}
|
|
27
|
+
export declare class NotifyEvent extends AnimationEvent {
|
|
28
|
+
onEvent(item: VFXItem, animation: AnimationClip, eventReference: AnimationEventReference): void;
|
|
29
|
+
}
|
package/dist/asset-manager.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ import type { ImageLike, SceneLoadOptions } from './scene';
|
|
|
4
4
|
import { Scene } from './scene';
|
|
5
5
|
import type { Disposable } from './utils';
|
|
6
6
|
import type { Renderer } from './render';
|
|
7
|
+
import { Precomposition } from './precompositions/precomposition';
|
|
7
8
|
/**
|
|
8
9
|
* 资源管理器
|
|
9
10
|
* 用于加载和动效中所有的资源文件,包括图片、插件、图层粒子数据等
|
|
@@ -44,6 +45,7 @@ export declare class AssetManager implements Disposable {
|
|
|
44
45
|
* @returns
|
|
45
46
|
*/
|
|
46
47
|
static loadFontFamily(fonts: spec.FontDefine[], baseUrl?: string): Promise<void[] | undefined>;
|
|
48
|
+
static loadPrecomposition(jsonScene: spec.JSONScene | string, options?: SceneLoadOptions): Promise<Precomposition>;
|
|
47
49
|
/**
|
|
48
50
|
* 构造函数
|
|
49
51
|
* @param options - 场景加载参数
|
package/dist/asset-service.d.ts
CHANGED
|
@@ -29,7 +29,6 @@ export declare class AssetService implements Disposable {
|
|
|
29
29
|
* @param options
|
|
30
30
|
*/
|
|
31
31
|
updateTextVariables(scene: Scene, variables?: spec.TemplateVariables): void;
|
|
32
|
-
initializeTexture(scene: Scene): void;
|
|
33
32
|
prepareAssets(scene: Scene, assets: Record<string, ImageLike>): void;
|
|
34
33
|
createShaderVariant(): void;
|
|
35
34
|
private destroyBuiltinObjects;
|
package/dist/camera.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ import { Matrix4 } from '@galacean/effects-math/es/core/matrix4';
|
|
|
4
4
|
import { Euler } from '@galacean/effects-math/es/core/euler';
|
|
5
5
|
import * as spec from '@galacean/effects-specification';
|
|
6
6
|
import { Transform } from './transform';
|
|
7
|
+
import type { Engine } from './engine';
|
|
7
8
|
interface CameraOptionsBase {
|
|
8
9
|
/**
|
|
9
10
|
* 相机近平面
|
|
@@ -42,14 +43,6 @@ export interface CameraOptions extends CameraOptionsBase {
|
|
|
42
43
|
* 相机的旋转,四元数
|
|
43
44
|
*/
|
|
44
45
|
quat?: spec.vec4;
|
|
45
|
-
/**
|
|
46
|
-
* 画布的像素宽度
|
|
47
|
-
*/
|
|
48
|
-
pixelWidth: number;
|
|
49
|
-
/**
|
|
50
|
-
* 画布的像素高度
|
|
51
|
-
*/
|
|
52
|
-
pixelHeight: number;
|
|
53
46
|
}
|
|
54
47
|
export interface CameraOptionsEx extends CameraOptionsBase {
|
|
55
48
|
/**
|
|
@@ -70,14 +63,7 @@ export interface CameraOptionsEx extends CameraOptionsBase {
|
|
|
70
63
|
*/
|
|
71
64
|
export declare class Camera {
|
|
72
65
|
name: string;
|
|
73
|
-
|
|
74
|
-
* 画布的像素宽度
|
|
75
|
-
*/
|
|
76
|
-
pixelWidth: number;
|
|
77
|
-
/**
|
|
78
|
-
* 画布的像素高度
|
|
79
|
-
*/
|
|
80
|
-
pixelHeight: number;
|
|
66
|
+
engine: Engine;
|
|
81
67
|
/**
|
|
82
68
|
* 编辑器用于缩放画布
|
|
83
69
|
*/
|
|
@@ -2,9 +2,7 @@ import { Color } from '@galacean/effects-math/es/core/color';
|
|
|
2
2
|
import * as spec from '@galacean/effects-specification';
|
|
3
3
|
import type { Engine } from '../engine';
|
|
4
4
|
import type { Maskable } from '../material';
|
|
5
|
-
import {
|
|
6
|
-
import type { BoundingBoxTriangle, HitTestTriangleParams } from '../plugins';
|
|
7
|
-
import { MeshCollider } from '../plugins';
|
|
5
|
+
import type { BoundingBoxInfo, BoundingBoxTriangle, HitTestTriangleParams } from '../plugins';
|
|
8
6
|
import type { Renderer } from '../render';
|
|
9
7
|
import { Geometry } from '../render';
|
|
10
8
|
import { Texture } from '../texture';
|
|
@@ -26,11 +24,6 @@ export declare class MaskableGraphic extends RendererComponent implements Maskab
|
|
|
26
24
|
renderer: ItemRenderer;
|
|
27
25
|
geometry: Geometry;
|
|
28
26
|
protected visible: boolean;
|
|
29
|
-
protected readonly maskManager: MaskProcessor;
|
|
30
|
-
/**
|
|
31
|
-
* 用于点击测试的碰撞器
|
|
32
|
-
*/
|
|
33
|
-
protected meshCollider: MeshCollider;
|
|
34
27
|
protected defaultGeometry: Geometry;
|
|
35
28
|
private _color;
|
|
36
29
|
/**
|
|
@@ -89,7 +82,11 @@ export declare class MaskableGraphic extends RendererComponent implements Maskab
|
|
|
89
82
|
render(renderer: Renderer): void;
|
|
90
83
|
onStart(): void;
|
|
91
84
|
getHitTestParams: (force?: boolean) => HitTestTriangleParams | undefined;
|
|
85
|
+
/**
|
|
86
|
+
* @deprecated 2.9.0 Please use getBoundingBoxInfo
|
|
87
|
+
*/
|
|
92
88
|
getBoundingBox(): BoundingBoxTriangle;
|
|
89
|
+
getBoundingBoxInfo(): BoundingBoxInfo;
|
|
93
90
|
private configureMaterial;
|
|
94
91
|
private draw;
|
|
95
92
|
fromData(data: unknown): void;
|
|
@@ -12,25 +12,45 @@ export interface SceneBindingData {
|
|
|
12
12
|
key: spec.DataPath;
|
|
13
13
|
value: spec.DataPath;
|
|
14
14
|
}
|
|
15
|
+
export declare enum UpdateModes {
|
|
16
|
+
EveryUpdate = 0,
|
|
17
|
+
Manual = 1
|
|
18
|
+
}
|
|
15
19
|
/**
|
|
16
20
|
* @since 2.0.0
|
|
17
21
|
*/
|
|
18
22
|
export declare class CompositionComponent extends Component {
|
|
19
|
-
time: number;
|
|
20
23
|
items: VFXItem[];
|
|
21
|
-
|
|
24
|
+
/**
|
|
25
|
+
* 更新模式,决定了组件更新时间的方式
|
|
26
|
+
* - EveryUpdate:每帧自动更新,适用于大多数情况
|
|
27
|
+
* - Manual:需要手动调用 tick 接口更新,适用于需要精确控制更新时间的情况
|
|
28
|
+
*/
|
|
29
|
+
updateMode: UpdateModes;
|
|
30
|
+
playOnStart: boolean;
|
|
31
|
+
endBehavior: spec.EndBehavior;
|
|
32
|
+
private time;
|
|
33
|
+
private lastTime;
|
|
22
34
|
private sceneBindings;
|
|
23
35
|
private timelineAsset;
|
|
24
|
-
private
|
|
36
|
+
private _timelineInstance;
|
|
37
|
+
private nestedCompositions;
|
|
38
|
+
private get timelineInstance();
|
|
25
39
|
onStart(): void;
|
|
26
|
-
getReusable(): boolean;
|
|
27
40
|
pause(): void;
|
|
28
|
-
|
|
41
|
+
play(): void;
|
|
42
|
+
stop(): void;
|
|
43
|
+
getTime(): number;
|
|
44
|
+
setTime(time: number): void;
|
|
29
45
|
onUpdate(dt: number): void;
|
|
46
|
+
tick(deltaTime: number): void;
|
|
30
47
|
onEnable(): void;
|
|
31
48
|
onDisable(): void;
|
|
32
49
|
onDestroy(): void;
|
|
33
50
|
hitTest(ray: Ray, x: number, y: number, regions: Region[], force?: boolean, options?: CompositionHitTestOptions): boolean;
|
|
34
|
-
|
|
51
|
+
/**
|
|
52
|
+
* 递归收集场景树中的直接子元素(DFS 前序)
|
|
53
|
+
*/
|
|
54
|
+
private collectChildren;
|
|
35
55
|
fromData(data: any): void;
|
|
36
56
|
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { RendererComponent } from './renderer-component';
|
|
2
|
+
import { type Maskable } from '../material';
|
|
3
|
+
import type { Renderer } from '../render';
|
|
4
|
+
import { Color } from '@galacean/effects-math/es/core/color';
|
|
5
|
+
export declare class FrameComponent extends RendererComponent implements Maskable {
|
|
6
|
+
color: Color;
|
|
7
|
+
private clipGeometry;
|
|
8
|
+
private worldMatrix;
|
|
9
|
+
onAwake(): void;
|
|
10
|
+
onStart(): void;
|
|
11
|
+
onPreRender(): void;
|
|
12
|
+
render(renderer: Renderer): void;
|
|
13
|
+
onDestroy(): void;
|
|
14
|
+
drawStencilMask(maskRef: number): void;
|
|
15
|
+
fromData(data: any): void;
|
|
16
|
+
private getHitTestParams;
|
|
17
|
+
private setClipRectangle;
|
|
18
|
+
private setClipRectangleRecursive;
|
|
19
|
+
}
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import type { Engine } from '../engine';
|
|
2
|
-
import type { Maskable } from '../material
|
|
3
|
-
import type { BoundingBoxTriangle, HitTestTriangleParams } from '../plugins';
|
|
4
|
-
import {
|
|
5
|
-
import type { Geometry } from '../render/geometry';
|
|
6
|
-
import type { Renderer } from '../render/renderer';
|
|
2
|
+
import type { Maskable } from '../material';
|
|
3
|
+
import type { BoundingBoxTriangle, HitTestTriangleParams, BoundingBoxInfo } from '../plugins';
|
|
4
|
+
import type { Geometry, Renderer } from '../render';
|
|
7
5
|
import { RendererComponent } from './renderer-component';
|
|
8
6
|
/**
|
|
9
7
|
* Mesh 组件
|
|
@@ -13,15 +11,11 @@ export declare class MeshComponent extends RendererComponent implements Maskable
|
|
|
13
11
|
* 渲染的 Geometry
|
|
14
12
|
*/
|
|
15
13
|
protected geometry: Geometry;
|
|
16
|
-
/**
|
|
17
|
-
* 用于点击测试的碰撞器
|
|
18
|
-
*/
|
|
19
|
-
protected meshCollider: MeshCollider;
|
|
20
|
-
private readonly maskManager;
|
|
21
14
|
constructor(engine: Engine);
|
|
22
15
|
render(renderer: Renderer): void;
|
|
23
|
-
drawStencilMask(
|
|
16
|
+
drawStencilMask(maskRef: number): void;
|
|
24
17
|
getHitTestParams: (force?: boolean) => HitTestTriangleParams | void;
|
|
25
18
|
getBoundingBox(): BoundingBoxTriangle | void;
|
|
19
|
+
getBoundingBoxInfo(): BoundingBoxInfo;
|
|
26
20
|
fromData(data: any): void;
|
|
27
21
|
}
|
|
@@ -1,18 +1,34 @@
|
|
|
1
1
|
import type { Material } from '../material';
|
|
2
|
-
import
|
|
2
|
+
import { MaskProcessor } from '../material';
|
|
3
|
+
import { BoundingBoxInfo } from '../plugins/interact/mesh-collider';
|
|
3
4
|
import { Component } from './component';
|
|
5
|
+
import type { Renderer } from '../render/renderer';
|
|
4
6
|
/**
|
|
5
7
|
* 所有渲染组件的基类
|
|
6
8
|
* @since 2.0.0
|
|
7
9
|
*/
|
|
8
10
|
export declare class RendererComponent extends Component {
|
|
9
11
|
materials: Material[];
|
|
12
|
+
/**
|
|
13
|
+
* @hidden
|
|
14
|
+
* Internal utility.
|
|
15
|
+
* Not part of the public API — do not rely on this in your code.
|
|
16
|
+
*/
|
|
17
|
+
maskManager: MaskProcessor;
|
|
10
18
|
protected _priority: number;
|
|
19
|
+
/**
|
|
20
|
+
* 用于点击测试的碰撞器
|
|
21
|
+
*/
|
|
22
|
+
protected boundingBoxInfo: BoundingBoxInfo;
|
|
11
23
|
get priority(): number;
|
|
12
24
|
set priority(value: number);
|
|
13
25
|
get material(): Material;
|
|
14
26
|
set material(material: Material);
|
|
15
|
-
render(renderer: Renderer): void;
|
|
16
27
|
onEnable(): void;
|
|
17
28
|
onDisable(): void;
|
|
29
|
+
/**
|
|
30
|
+
* 获取包围盒信息
|
|
31
|
+
*/
|
|
32
|
+
getBoundingBoxInfo(): BoundingBoxInfo;
|
|
33
|
+
render(renderer: Renderer): void;
|
|
18
34
|
}
|
|
@@ -3,7 +3,7 @@ import { Vector2 } from '@galacean/effects-math/es/core/vector2';
|
|
|
3
3
|
import * as spec from '@galacean/effects-specification';
|
|
4
4
|
import type { Engine } from '../engine';
|
|
5
5
|
import type { Maskable } from '../material';
|
|
6
|
-
import type { BoundingBoxTriangle, HitTestTriangleParams } from '../plugins';
|
|
6
|
+
import type { BoundingBoxTriangle, HitTestTriangleParams, BoundingBoxInfo } from '../plugins';
|
|
7
7
|
import type { Renderer } from '../render';
|
|
8
8
|
import type { GradientValue } from '../math';
|
|
9
9
|
import { RendererComponent } from './renderer-component';
|
|
@@ -133,15 +133,10 @@ export declare class ShapeComponent extends RendererComponent implements Maskabl
|
|
|
133
133
|
private strokeJoin;
|
|
134
134
|
private strokes;
|
|
135
135
|
private shapeAttributes;
|
|
136
|
-
/**
|
|
137
|
-
* 用于点击测试的碰撞器
|
|
138
|
-
*/
|
|
139
|
-
private meshCollider;
|
|
140
136
|
private rendererOptions;
|
|
141
137
|
private geometry;
|
|
142
138
|
private fillMaterials;
|
|
143
139
|
private strokeMaterials;
|
|
144
|
-
private readonly maskManager;
|
|
145
140
|
get shape(): ShapeAttributes;
|
|
146
141
|
/**
|
|
147
142
|
*
|
|
@@ -154,6 +149,7 @@ export declare class ShapeComponent extends RendererComponent implements Maskabl
|
|
|
154
149
|
private draw;
|
|
155
150
|
getHitTestParams: (force?: boolean) => HitTestTriangleParams | undefined;
|
|
156
151
|
getBoundingBox(): BoundingBoxTriangle;
|
|
152
|
+
getBoundingBoxInfo(): BoundingBoxInfo;
|
|
157
153
|
private buildGeometryFromPath;
|
|
158
154
|
private buildPath;
|
|
159
155
|
private updateMaterials;
|
|
@@ -5,6 +5,7 @@ import { Component } from '../components';
|
|
|
5
5
|
export declare class SceneTicking {
|
|
6
6
|
update: UpdateTickData;
|
|
7
7
|
lateUpdate: LateUpdateTickData;
|
|
8
|
+
preRender: PreRenderTickData;
|
|
8
9
|
/**
|
|
9
10
|
*
|
|
10
11
|
* @param obj
|
|
@@ -37,4 +38,7 @@ declare class UpdateTickData extends TickData {
|
|
|
37
38
|
declare class LateUpdateTickData extends TickData {
|
|
38
39
|
tickComponents(components: Component[], dt: number): void;
|
|
39
40
|
}
|
|
41
|
+
declare class PreRenderTickData extends TickData {
|
|
42
|
+
tickComponents(components: Component[], dt: number): void;
|
|
43
|
+
}
|
|
40
44
|
export {};
|
package/dist/composition.d.ts
CHANGED
|
@@ -143,6 +143,7 @@ export declare class Composition extends EventEmitter<CompositionEvent<Compositi
|
|
|
143
143
|
renderOrder: number;
|
|
144
144
|
/**
|
|
145
145
|
* 播放完成后是否需要再使用,是的话生命周期结束后不会自动 dispose
|
|
146
|
+
* @deprecated
|
|
146
147
|
*/
|
|
147
148
|
reusable: boolean;
|
|
148
149
|
/**
|
|
@@ -190,10 +191,6 @@ export declare class Composition extends EventEmitter<CompositionEvent<Compositi
|
|
|
190
191
|
* 合成根元素
|
|
191
192
|
*/
|
|
192
193
|
readonly rootItem: VFXItem;
|
|
193
|
-
/**
|
|
194
|
-
* 预合成数组
|
|
195
|
-
*/
|
|
196
|
-
readonly refContent: VFXItem[];
|
|
197
194
|
/**
|
|
198
195
|
* 合成的相机对象
|
|
199
196
|
*/
|
|
@@ -202,6 +199,10 @@ export declare class Composition extends EventEmitter<CompositionEvent<Compositi
|
|
|
202
199
|
* 合成开始渲染的时间
|
|
203
200
|
*/
|
|
204
201
|
readonly startTime: number;
|
|
202
|
+
/**
|
|
203
|
+
* 场景中视频列表
|
|
204
|
+
*/
|
|
205
|
+
videos: HTMLVideoElement[];
|
|
205
206
|
/**
|
|
206
207
|
* 后处理渲染配置
|
|
207
208
|
*/
|
|
@@ -225,13 +226,13 @@ export declare class Composition extends EventEmitter<CompositionEvent<Compositi
|
|
|
225
226
|
private paused;
|
|
226
227
|
private isEndCalled;
|
|
227
228
|
private _textures;
|
|
228
|
-
private videos;
|
|
229
229
|
/**
|
|
230
230
|
* Composition 构造函数
|
|
231
231
|
* @param props - composition 的创建参数
|
|
232
232
|
* @param scene
|
|
233
233
|
*/
|
|
234
234
|
constructor(props: CompositionProps, scene: Scene);
|
|
235
|
+
get engine(): import("@galacean/effects-core").Engine;
|
|
235
236
|
/**
|
|
236
237
|
* 所有合成 Item 的根变换
|
|
237
238
|
*/
|
|
@@ -439,10 +440,12 @@ export declare class Composition extends EventEmitter<CompositionEvent<Compositi
|
|
|
439
440
|
setScale(x: number, y: number, z: number): void;
|
|
440
441
|
/**
|
|
441
442
|
* 卸载贴图纹理方法,减少内存
|
|
443
|
+
* @deprecated
|
|
442
444
|
*/
|
|
443
445
|
offloadTexture(): void;
|
|
444
446
|
/**
|
|
445
447
|
* 重新加载纹理
|
|
448
|
+
* @deprecated
|
|
446
449
|
*/
|
|
447
450
|
reloadTexture(): Promise<void>;
|
|
448
451
|
}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { Matrix4 } from '@galacean/effects-math/es/core/matrix4';
|
|
2
|
+
import { Vector3 } from '@galacean/effects-math/es/core/vector3';
|
|
3
|
+
/**
|
|
4
|
+
* 包围盒类,用于存储和操作物体的边界信息
|
|
5
|
+
*/
|
|
6
|
+
export declare class BoundingBox {
|
|
7
|
+
/**
|
|
8
|
+
* 临时向量,用于避免频繁创建对象
|
|
9
|
+
*/
|
|
10
|
+
private static tempVector0;
|
|
11
|
+
private static tempVector1;
|
|
12
|
+
private static tempVector2;
|
|
13
|
+
/**
|
|
14
|
+
* 局部空间的 8 个顶点
|
|
15
|
+
*/
|
|
16
|
+
readonly vectors: Vector3[];
|
|
17
|
+
/**
|
|
18
|
+
* 世界空间的 8 个顶点
|
|
19
|
+
*/
|
|
20
|
+
readonly vectorsWorld: Vector3[];
|
|
21
|
+
/**
|
|
22
|
+
* 局部空间的最小点
|
|
23
|
+
*/
|
|
24
|
+
readonly minimum: Vector3;
|
|
25
|
+
/**
|
|
26
|
+
* 局部空间的最大点
|
|
27
|
+
*/
|
|
28
|
+
readonly maximum: Vector3;
|
|
29
|
+
/**
|
|
30
|
+
* 世界空间的最小点
|
|
31
|
+
*/
|
|
32
|
+
readonly minimumWorld: Vector3;
|
|
33
|
+
/**
|
|
34
|
+
* 世界空间的最大点
|
|
35
|
+
*/
|
|
36
|
+
readonly maximumWorld: Vector3;
|
|
37
|
+
/**
|
|
38
|
+
* 局部空间的中心点
|
|
39
|
+
*/
|
|
40
|
+
readonly center: Vector3;
|
|
41
|
+
/**
|
|
42
|
+
* 世界空间的中心点
|
|
43
|
+
*/
|
|
44
|
+
readonly centerWorld: Vector3;
|
|
45
|
+
/**
|
|
46
|
+
* 局部空间的半尺寸(从中心到边界)
|
|
47
|
+
*/
|
|
48
|
+
readonly extendSize: Vector3;
|
|
49
|
+
/**
|
|
50
|
+
* 世界空间的半尺寸
|
|
51
|
+
*/
|
|
52
|
+
readonly extendSizeWorld: Vector3;
|
|
53
|
+
/**
|
|
54
|
+
* OBB 的方向向量
|
|
55
|
+
*/
|
|
56
|
+
readonly directions: Vector3[];
|
|
57
|
+
private worldMatrix;
|
|
58
|
+
/**
|
|
59
|
+
* 创建包围盒
|
|
60
|
+
* @param minimum - 局部空间最小点
|
|
61
|
+
* @param maximum - 局部空间最大点
|
|
62
|
+
* @param worldMatrix - 世界变换矩阵
|
|
63
|
+
*/
|
|
64
|
+
constructor(minimum: Vector3, maximum: Vector3, worldMatrix?: Matrix4);
|
|
65
|
+
/**
|
|
66
|
+
* 重新构建包围盒
|
|
67
|
+
* @param min - 新的最小点(局部空间)
|
|
68
|
+
* @param max - 新的最大点(局部空间)
|
|
69
|
+
* @param worldMatrix - 新的世界矩阵
|
|
70
|
+
*/
|
|
71
|
+
reConstruct(min: Vector3, max: Vector3, worldMatrix?: Matrix4): void;
|
|
72
|
+
/**
|
|
73
|
+
* 更新世界空间数据
|
|
74
|
+
* @param world - 世界变换矩阵
|
|
75
|
+
*/
|
|
76
|
+
update(world: Matrix4): void;
|
|
77
|
+
/**
|
|
78
|
+
* 缩放包围盒
|
|
79
|
+
* @param factor - 缩放因子
|
|
80
|
+
* @returns 返回自身以支持链式调用
|
|
81
|
+
*/
|
|
82
|
+
scale(factor: number): BoundingBox;
|
|
83
|
+
/**
|
|
84
|
+
* 获取世界变换矩阵
|
|
85
|
+
* @returns 世界矩阵
|
|
86
|
+
*/
|
|
87
|
+
getWorldMatrix(): Matrix4;
|
|
88
|
+
/**
|
|
89
|
+
* 测试点是否在包围盒内
|
|
90
|
+
* @param point - 要测试的点
|
|
91
|
+
* @returns 如果点在包围盒内返回 true
|
|
92
|
+
*/
|
|
93
|
+
intersectsPoint(point: Vector3): boolean;
|
|
94
|
+
/**
|
|
95
|
+
* 测试包围盒是否与另一个包围盒相交
|
|
96
|
+
* @param box - 另一个包围盒
|
|
97
|
+
* @returns 如果相交返回 true
|
|
98
|
+
*/
|
|
99
|
+
intersectsBox(box: BoundingBox): boolean;
|
|
100
|
+
/**
|
|
101
|
+
* 测试包围盒是否与 min/max 定义的区域相交
|
|
102
|
+
* @param min - 最小点
|
|
103
|
+
* @param max - 最大点
|
|
104
|
+
* @returns 如果相交返回 true
|
|
105
|
+
*/
|
|
106
|
+
intersectsMinMax(min: Vector3, max: Vector3): boolean;
|
|
107
|
+
/**
|
|
108
|
+
* 静态方法:测试两个包围盒是否相交
|
|
109
|
+
* @param box0 - 第一个包围盒
|
|
110
|
+
* @param box1 - 第二个包围盒
|
|
111
|
+
* @returns 如果相交返回 true
|
|
112
|
+
*/
|
|
113
|
+
static intersects(box0: BoundingBox, box1: BoundingBox): boolean;
|
|
114
|
+
}
|
package/dist/engine.d.ts
CHANGED
|
@@ -89,6 +89,7 @@ export declare class Engine extends EventEmitter<EngineEvent> implements Disposa
|
|
|
89
89
|
protected meshes: Mesh[];
|
|
90
90
|
protected renderPasses: RenderPass[];
|
|
91
91
|
private assetLoader;
|
|
92
|
+
private clearAction;
|
|
92
93
|
get disposed(): boolean;
|
|
93
94
|
/**
|
|
94
95
|
*
|
|
@@ -109,7 +110,7 @@ export declare class Engine extends EventEmitter<EngineEvent> implements Disposa
|
|
|
109
110
|
removeInstance(id: string): void;
|
|
110
111
|
addPackageDatas(scene: Scene): void;
|
|
111
112
|
runRenderLoop(renderFunction: (dt: number) => void): void;
|
|
112
|
-
|
|
113
|
+
mainLoop(dt: number): void;
|
|
113
114
|
/**
|
|
114
115
|
* 将渲染器重新和父容器大小对齐
|
|
115
116
|
*/
|
package/dist/events/types.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { AnimationEventReference } from '../animation';
|
|
1
2
|
import type { MessageItem } from '../composition';
|
|
2
3
|
import type { PointerEventData, Region } from '../plugins';
|
|
3
4
|
export type PointerEvent = {
|
|
@@ -27,6 +28,11 @@ export type ItemEvent = PointerEvent & {
|
|
|
27
28
|
* 注意:仅对交互元素有效
|
|
28
29
|
*/
|
|
29
30
|
['message']: [message: Omit<MessageItem, 'compositionId'>];
|
|
31
|
+
/**
|
|
32
|
+
* 动画事件
|
|
33
|
+
* @since 2.9.0
|
|
34
|
+
*/
|
|
35
|
+
['animationevent']: [eventData: AnimationEventReference];
|
|
30
36
|
};
|
|
31
37
|
/**
|
|
32
38
|
* Composition 可以绑定的事件
|
|
@@ -79,4 +85,9 @@ export type CompositionEvent<C> = PointerEvent & {
|
|
|
79
85
|
['goto']: [gotoInfo: {
|
|
80
86
|
time: number;
|
|
81
87
|
}];
|
|
88
|
+
/**
|
|
89
|
+
* 动画事件
|
|
90
|
+
* @since 2.9.0
|
|
91
|
+
*/
|
|
92
|
+
['animationevent']: [eventData: AnimationEventReference];
|
|
82
93
|
};
|
|
@@ -8,6 +8,14 @@ export declare function version21Migration(json: JSONSceneLegacy): JSONSceneLega
|
|
|
8
8
|
* 2.2 以下版本数据适配(mars-player@2.5.0 及以上版本支持 2.2 以下数据的适配)
|
|
9
9
|
*/
|
|
10
10
|
export declare function version22Migration(json: JSONSceneLegacy): JSONSceneLegacy;
|
|
11
|
+
/**
|
|
12
|
+
* 2.5 以下版本 赫尔米特数据转换成贝塞尔数据
|
|
13
|
+
*/
|
|
14
|
+
export declare function version24Migration(json: JSONScene): JSONScene;
|
|
15
|
+
/**
|
|
16
|
+
* 3.0 以下版本数据适配(runtime 2.0及以上版本支持)
|
|
17
|
+
*/
|
|
18
|
+
export declare function version30Migration(json: JSONSceneLegacy): JSONScene;
|
|
11
19
|
/**
|
|
12
20
|
* 3.1 版本数据适配
|
|
13
21
|
* - 富文本插件名称的适配
|
|
@@ -17,16 +25,9 @@ export declare function version32Migration(json: JSONScene): JSONScene;
|
|
|
17
25
|
export declare function version33Migration(json: JSONScene): JSONScene;
|
|
18
26
|
export declare function version34Migration(json: JSONScene): JSONScene;
|
|
19
27
|
export declare function version35Migration(json: JSONScene): JSONScene;
|
|
28
|
+
export declare function version36Migration(json: JSONScene): JSONScene;
|
|
20
29
|
export declare function processContent(composition: spec.CompositionData): void;
|
|
21
30
|
export declare function processMask(renderContent: any): void;
|
|
22
|
-
/**
|
|
23
|
-
* 3.0 以下版本数据适配(runtime 2.0及以上版本支持)
|
|
24
|
-
*/
|
|
25
|
-
export declare function version30Migration(json: JSONSceneLegacy): JSONScene;
|
|
26
|
-
/**
|
|
27
|
-
* 2.5 以下版本 赫尔米特数据转换成贝塞尔数据
|
|
28
|
-
*/
|
|
29
|
-
export declare function version24Migration(json: JSONScene): JSONScene;
|
|
30
31
|
export declare function convertParam(content?: BaseContent): void;
|
|
31
32
|
export declare function convertBinaryAsset(bins: BinaryFile[], jsonScene: JSONScene): void;
|
|
32
33
|
export declare function convertSpineData(resource: SpineResource, content: SpineContent, jsonScene: JSONScene): void;
|
package/dist/fallback/utils.d.ts
CHANGED
|
@@ -6,7 +6,6 @@ export declare function ensureFixedNumberWithRandom(a: any, p: number): FixedNum
|
|
|
6
6
|
export declare function ensureRGBAValue(a: any): RGBAColorValue;
|
|
7
7
|
export declare function ensureColorExpression(a: any, normalized?: boolean): ColorExpression | undefined;
|
|
8
8
|
export declare function ensureNumberExpression(a: any): NumberExpression | undefined;
|
|
9
|
-
export declare function ensureValueGetter(a: any): any;
|
|
10
9
|
export declare function ensureGradient(a: any, normalized?: boolean): GradientColor | undefined;
|
|
11
10
|
export declare function colorToArr(hex: string | number[], normalized?: boolean): vec4;
|
|
12
11
|
export declare function normalizeColor(a: number[]): number[] | undefined;
|