@galacean/effects-core 2.8.8 → 2.9.0-alpha.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/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/camera.d.ts +3 -17
- 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 +2 -1
- package/dist/components/frame-component.d.ts +16 -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 +11 -2
- package/dist/components/shape-component.d.ts +2 -6
- package/dist/composition/scene-ticking.d.ts +4 -0
- package/dist/composition.d.ts +2 -0
- 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.js +21872 -20185
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +21868 -20185
- 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 +1 -15
- package/dist/plugins/text/text-item.d.ts +16 -13
- package/dist/plugins/text/text-layout.d.ts +4 -5
- package/dist/plugins/timeline/timeline-asset.d.ts +0 -1
- package/dist/plugins/timeline/track.d.ts +0 -3
- 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/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/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
|
/**
|
|
@@ -69,15 +62,8 @@ export interface CameraOptionsEx extends CameraOptionsBase {
|
|
|
69
62
|
* 合成的相机对象,采用透视投影
|
|
70
63
|
*/
|
|
71
64
|
export declare class Camera {
|
|
65
|
+
engine: Engine;
|
|
72
66
|
name: string;
|
|
73
|
-
/**
|
|
74
|
-
* 画布的像素宽度
|
|
75
|
-
*/
|
|
76
|
-
pixelWidth: number;
|
|
77
|
-
/**
|
|
78
|
-
* 画布的像素高度
|
|
79
|
-
*/
|
|
80
|
-
pixelHeight: number;
|
|
81
67
|
/**
|
|
82
68
|
* 编辑器用于缩放画布
|
|
83
69
|
*/
|
|
@@ -95,7 +81,7 @@ export declare class Camera {
|
|
|
95
81
|
* @param name - 相机名称
|
|
96
82
|
* @param options
|
|
97
83
|
*/
|
|
98
|
-
constructor(name: string, options?: Partial<CameraOptions>);
|
|
84
|
+
constructor(engine: Engine, name: string, options?: Partial<CameraOptions>);
|
|
99
85
|
/**
|
|
100
86
|
* 设置相机近平面
|
|
101
87
|
* @param near
|
|
@@ -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;
|
|
@@ -21,7 +21,8 @@ export declare class CompositionComponent extends Component {
|
|
|
21
21
|
private reusable;
|
|
22
22
|
private sceneBindings;
|
|
23
23
|
private timelineAsset;
|
|
24
|
-
private
|
|
24
|
+
private _timelineInstance;
|
|
25
|
+
private get timelineInstance();
|
|
25
26
|
onStart(): void;
|
|
26
27
|
getReusable(): boolean;
|
|
27
28
|
pause(): void;
|
|
@@ -0,0 +1,16 @@
|
|
|
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
|
+
onPreRender(): void;
|
|
11
|
+
render(renderer: Renderer): void;
|
|
12
|
+
onDestroy(): void;
|
|
13
|
+
drawStencilMask(maskRef: number): void;
|
|
14
|
+
private setClipRectangle;
|
|
15
|
+
private setClipRectangleRecursive;
|
|
16
|
+
}
|
|
@@ -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,6 +1,7 @@
|
|
|
1
1
|
import type { Material } from '../material';
|
|
2
|
-
import
|
|
2
|
+
import { BoundingBoxInfo } from '../plugins/interact/mesh-collider';
|
|
3
3
|
import { Component } from './component';
|
|
4
|
+
import type { Renderer } from '../render/renderer';
|
|
4
5
|
/**
|
|
5
6
|
* 所有渲染组件的基类
|
|
6
7
|
* @since 2.0.0
|
|
@@ -8,11 +9,19 @@ import { Component } from './component';
|
|
|
8
9
|
export declare class RendererComponent extends Component {
|
|
9
10
|
materials: Material[];
|
|
10
11
|
protected _priority: number;
|
|
12
|
+
/**
|
|
13
|
+
* 用于点击测试的碰撞器
|
|
14
|
+
*/
|
|
15
|
+
protected boundingBoxInfo: BoundingBoxInfo;
|
|
11
16
|
get priority(): number;
|
|
12
17
|
set priority(value: number);
|
|
13
18
|
get material(): Material;
|
|
14
19
|
set material(material: Material);
|
|
15
|
-
render(renderer: Renderer): void;
|
|
16
20
|
onEnable(): void;
|
|
17
21
|
onDisable(): void;
|
|
22
|
+
/**
|
|
23
|
+
* 获取包围盒信息
|
|
24
|
+
*/
|
|
25
|
+
getBoundingBoxInfo(): BoundingBoxInfo;
|
|
26
|
+
render(renderer: Renderer): void;
|
|
18
27
|
}
|
|
@@ -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
|
@@ -439,10 +439,12 @@ export declare class Composition extends EventEmitter<CompositionEvent<Compositi
|
|
|
439
439
|
setScale(x: number, y: number, z: number): void;
|
|
440
440
|
/**
|
|
441
441
|
* 卸载贴图纹理方法,减少内存
|
|
442
|
+
* @deprecated
|
|
442
443
|
*/
|
|
443
444
|
offloadTexture(): void;
|
|
444
445
|
/**
|
|
445
446
|
* 重新加载纹理
|
|
447
|
+
* @deprecated
|
|
446
448
|
*/
|
|
447
449
|
reloadTexture(): Promise<void>;
|
|
448
450
|
}
|
|
@@ -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;
|