@galacean/effects-core 2.1.0-alpha.1 → 2.1.0-alpha.11
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 +4 -7
- package/dist/components/base-render-component.d.ts +108 -0
- package/dist/components/effect-component.d.ts +3 -34
- package/dist/components/fake-3d-component.d.ts +28 -0
- package/dist/components/index.d.ts +3 -0
- package/dist/components/mesh-component.d.ts +21 -0
- package/dist/components/post-process-volume.d.ts +10 -11
- package/dist/components/shape-component.d.ts +285 -0
- package/dist/composition/scene-ticking.d.ts +15 -1
- package/dist/composition-source-manager.d.ts +5 -6
- package/dist/composition.d.ts +34 -23
- package/dist/downloader.d.ts +0 -3
- package/dist/effects-object.d.ts +23 -0
- package/dist/engine.d.ts +9 -0
- package/dist/events/event-emitter.d.ts +6 -0
- package/dist/events/types.d.ts +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +20858 -17794
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +20852 -17790
- package/dist/index.mjs.map +1 -1
- package/dist/material/material.d.ts +4 -1
- package/dist/math/index.d.ts +1 -1
- package/dist/math/translate.d.ts +1 -1
- package/dist/math/value-getters/color-curve.d.ts +12 -0
- package/dist/math/value-getters/index.d.ts +4 -0
- package/dist/math/value-getters/value-getter-map.d.ts +2 -0
- package/dist/math/{value-getter.d.ts → value-getters/value-getter.d.ts} +6 -4
- package/dist/math/value-getters/vector4-curve.d.ts +12 -0
- package/dist/plugin-system.d.ts +7 -5
- package/dist/plugins/cal/calculate-item.d.ts +5 -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/cal/playable-graph.d.ts +4 -2
- package/dist/plugins/camera/camera-vfx-item-loader.d.ts +1 -1
- package/dist/plugins/index.d.ts +2 -7
- package/dist/plugins/interact/interact-item.d.ts +14 -1
- package/dist/plugins/interact/interact-loader.d.ts +1 -1
- package/dist/plugins/interact/mesh-collider.d.ts +15 -0
- package/dist/plugins/particle/burst.d.ts +2 -0
- package/dist/plugins/particle/particle-mesh.d.ts +8 -5
- package/dist/plugins/particle/particle-system.d.ts +3 -4
- 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 +65 -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/poly-star.d.ts +42 -0
- package/dist/plugins/shape/polygon.d.ts +67 -0
- package/dist/plugins/shape/rectangle.d.ts +129 -0
- package/dist/plugins/shape/shape-path.d.ts +75 -0
- package/dist/plugins/shape/shape-primitive.d.ts +15 -0
- package/dist/plugins/shape/triangle.d.ts +89 -0
- package/dist/plugins/shape/triangulate.d.ts +1 -0
- package/dist/plugins/sprite/sprite-item.d.ts +15 -116
- 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/color-property-playable-asset.d.ts +7 -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 +9 -9
- package/dist/plugins/timeline/playable-assets/vector4-property-playable-asset.d.ts +7 -0
- package/dist/plugins/timeline/playables/activation-mixer-playable.d.ts +0 -2
- package/dist/plugins/timeline/playables/color-property-mixer-playable.d.ts +6 -0
- package/dist/plugins/timeline/playables/float-property-mixer-playable.d.ts +6 -0
- package/dist/plugins/timeline/playables/index.d.ts +7 -0
- package/dist/plugins/timeline/playables/property-clip-playable.d.ts +8 -0
- package/dist/plugins/timeline/playables/vector4-property-mixer-playable.d.ts +6 -0
- package/dist/plugins/timeline/track-instance.d.ts +14 -0
- package/dist/plugins/timeline/track.d.ts +6 -4
- package/dist/plugins/timeline/tracks/color-property-track.d.ts +5 -0
- package/dist/plugins/timeline/tracks/float-property-track.d.ts +6 -0
- package/dist/plugins/timeline/tracks/index.d.ts +9 -0
- package/dist/plugins/timeline/tracks/material-track.d.ts +5 -0
- package/dist/plugins/timeline/tracks/property-track.d.ts +8 -0
- package/dist/plugins/timeline/tracks/sub-composition-track.d.ts +1 -1
- package/dist/plugins/timeline/tracks/vector4-property-track.d.ts +5 -0
- package/dist/render/gpu-capability.d.ts +1 -1
- package/dist/render/index.d.ts +0 -1
- package/dist/render/mesh.d.ts +1 -1
- package/dist/render/render-frame.d.ts +5 -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 +4 -4
- package/dist/texture/texture.d.ts +11 -2
- package/dist/texture/utils.d.ts +1 -2
- package/dist/transform.d.ts +8 -0
- package/dist/utils/color.d.ts +4 -5
- package/dist/utils/index.d.ts +1 -1
- package/dist/vfx-item.d.ts +67 -31
- package/package.json +4 -3
- package/dist/image-asset.d.ts +0 -5
- package/dist/render/global-volume.d.ts +0 -17
- /package/dist/plugins/timeline/{playables → playable-assets}/sub-composition-playable-asset.d.ts +0 -0
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import * as spec from '@galacean/effects-specification';
|
|
2
|
+
import { type ValueGetter } from '../math';
|
|
3
|
+
import type { FrameContext } from '../plugins/cal/playable-graph';
|
|
4
|
+
import { Playable } from '../plugins/cal/playable-graph';
|
|
5
|
+
import { VFXItem } from '../vfx-item';
|
|
6
|
+
import type { Material } from '../material';
|
|
7
|
+
import type { ColorStop } from '../utils';
|
|
8
|
+
import { BaseRenderComponent } from '../components';
|
|
9
|
+
export interface ColorPlayableAssetData extends spec.EffectsObjectData {
|
|
10
|
+
colorOverLifetime?: spec.ColorOverLifetime;
|
|
11
|
+
}
|
|
12
|
+
export declare class ColorPlayable extends Playable {
|
|
13
|
+
clipData: {
|
|
14
|
+
colorOverLifetime?: spec.ColorOverLifetime;
|
|
15
|
+
startColor?: spec.RGBAColorValue;
|
|
16
|
+
};
|
|
17
|
+
colorOverLifetime: ColorStop[];
|
|
18
|
+
opacityOverLifetime: ValueGetter<number>;
|
|
19
|
+
startColor: spec.RGBAColorValue;
|
|
20
|
+
renderColor: spec.vec4;
|
|
21
|
+
activeComponent?: BaseRenderComponent;
|
|
22
|
+
activeMaterial?: Material;
|
|
23
|
+
processFrame(context: FrameContext): void;
|
|
24
|
+
create(clipData: ColorPlayableAssetData): this;
|
|
25
|
+
getActiveComponent(boundObject: VFXItem): BaseRenderComponent;
|
|
26
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './color-playable';
|
package/dist/asset-manager.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Downloader } from './downloader';
|
|
2
|
-
import type {
|
|
2
|
+
import type { SceneLoadOptions } from './scene';
|
|
3
|
+
import { Scene } from './scene';
|
|
3
4
|
import type { Disposable } from './utils';
|
|
4
5
|
import type { Renderer } from './render';
|
|
5
6
|
/**
|
|
@@ -7,20 +8,24 @@ import type { Renderer } from './render';
|
|
|
7
8
|
* 用于加载和动效中所有的资源文件,包括图片、插件、图层粒子数据等
|
|
8
9
|
*/
|
|
9
10
|
export declare class AssetManager implements Disposable {
|
|
10
|
-
|
|
11
|
+
options: Omit<SceneLoadOptions, 'speed' | 'autoplay' | 'reusable'>;
|
|
11
12
|
private readonly downloader;
|
|
12
13
|
/**
|
|
13
|
-
* 相对url的基本路径
|
|
14
|
+
* 相对 url 的基本路径
|
|
14
15
|
*/
|
|
15
16
|
private baseUrl;
|
|
16
17
|
/**
|
|
17
|
-
* 图像资源,用于创建和释放GPU纹理资源
|
|
18
|
+
* 图像资源,用于创建和释放 GPU 纹理资源
|
|
18
19
|
*/
|
|
19
20
|
private assets;
|
|
21
|
+
/**
|
|
22
|
+
* TextureSource 来源
|
|
23
|
+
*/
|
|
24
|
+
private sourceFrom;
|
|
20
25
|
/**
|
|
21
26
|
* 自定义文本缓存,随页面销毁而销毁
|
|
22
27
|
*/
|
|
23
|
-
static
|
|
28
|
+
private static fontCache;
|
|
24
29
|
private id;
|
|
25
30
|
/**
|
|
26
31
|
* 加载超时时间
|
|
@@ -36,7 +41,7 @@ export declare class AssetManager implements Disposable {
|
|
|
36
41
|
* @param options - 场景加载参数
|
|
37
42
|
* @param downloader - 资源下载对象
|
|
38
43
|
*/
|
|
39
|
-
constructor(options?: SceneLoadOptions, downloader?: Downloader);
|
|
44
|
+
constructor(options?: Omit<SceneLoadOptions, 'speed' | 'autoplay' | 'reusable'>, downloader?: Downloader);
|
|
40
45
|
updateOptions(options?: SceneLoadOptions): void;
|
|
41
46
|
/**
|
|
42
47
|
* 场景创建,通过 json 创建出场景对象,并进行提前编译等工作
|
|
@@ -45,7 +50,7 @@ export declare class AssetManager implements Disposable {
|
|
|
45
50
|
* @param options - 扩展参数
|
|
46
51
|
* @returns
|
|
47
52
|
*/
|
|
48
|
-
loadScene(url:
|
|
53
|
+
loadScene(url: Scene.LoadType, renderer?: Renderer, options?: {
|
|
49
54
|
env: string;
|
|
50
55
|
}): Promise<Scene>;
|
|
51
56
|
private precompile;
|
|
@@ -53,9 +58,12 @@ export declare class AssetManager implements Disposable {
|
|
|
53
58
|
private processBins;
|
|
54
59
|
private processFontURL;
|
|
55
60
|
private processImages;
|
|
61
|
+
private processPluginAssets;
|
|
62
|
+
private prepareAssets;
|
|
56
63
|
private processTextures;
|
|
57
64
|
private loadJSON;
|
|
58
65
|
private loadBins;
|
|
66
|
+
private assignImagesToAssets;
|
|
59
67
|
private removeTimer;
|
|
60
68
|
/**
|
|
61
69
|
* 销毁方法
|
package/dist/asset.d.ts
ADDED
package/dist/binary-asset.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as spec from '@galacean/effects-specification';
|
|
2
2
|
import { EffectsObject } from './effects-object';
|
|
3
3
|
export declare class BinaryAsset extends EffectsObject {
|
|
4
4
|
buffer: ArrayBuffer;
|
|
5
|
-
fromData(data: EffectsObjectData): void;
|
|
5
|
+
fromData(data: spec.EffectsObjectData): void;
|
|
6
6
|
}
|
package/dist/comp-vfx-item.d.ts
CHANGED
|
@@ -2,7 +2,6 @@ import type { Ray } from '@galacean/effects-math/es/core/ray';
|
|
|
2
2
|
import * as spec from '@galacean/effects-specification';
|
|
3
3
|
import { Behaviour } from './components';
|
|
4
4
|
import type { CompositionHitTestOptions } from './composition';
|
|
5
|
-
import type { ContentOptions } from './composition-source-manager';
|
|
6
5
|
import type { Region, TrackAsset } from './plugins';
|
|
7
6
|
import { VFXItem } from './vfx-item';
|
|
8
7
|
export interface SceneBinding {
|
|
@@ -19,9 +18,7 @@ export interface SceneBindingData {
|
|
|
19
18
|
export declare class CompositionComponent extends Behaviour {
|
|
20
19
|
time: number;
|
|
21
20
|
startTime: number;
|
|
22
|
-
refId: string;
|
|
23
21
|
items: VFXItem[];
|
|
24
|
-
data: ContentOptions;
|
|
25
22
|
private reusable;
|
|
26
23
|
private sceneBindings;
|
|
27
24
|
private timelineAsset;
|
|
@@ -32,11 +29,11 @@ export declare class CompositionComponent extends Behaviour {
|
|
|
32
29
|
getReusable(): boolean;
|
|
33
30
|
onUpdate(dt: number): void;
|
|
34
31
|
createContent(): void;
|
|
35
|
-
|
|
36
|
-
|
|
32
|
+
onEnable(): void;
|
|
33
|
+
onDisable(): void;
|
|
37
34
|
onDestroy(): void;
|
|
38
35
|
hitTest(ray: Ray, x: number, y: number, regions: Region[], force?: boolean, options?: CompositionHitTestOptions): Region[];
|
|
39
|
-
fromData(data:
|
|
36
|
+
fromData(data: any): void;
|
|
40
37
|
private resolveBindings;
|
|
41
|
-
private
|
|
38
|
+
private updateTrackAnimatedObject;
|
|
42
39
|
}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import * as spec from '@galacean/effects-specification';
|
|
2
|
+
import { Matrix4 } from '@galacean/effects-math/es/core/matrix4';
|
|
3
|
+
import { RendererComponent } from './renderer-component';
|
|
4
|
+
import type { Texture } from '../texture';
|
|
5
|
+
import type { GeometryDrawMode, Renderer } from '../render';
|
|
6
|
+
import { Geometry } from '../render';
|
|
7
|
+
import type { Engine } from '../engine';
|
|
8
|
+
import type { BoundingBoxTriangle, HitTestTriangleParams } from '../plugins';
|
|
9
|
+
import { Material } from '../material';
|
|
10
|
+
import type { GeometryFromShape } from '../shape';
|
|
11
|
+
/**
|
|
12
|
+
* 图层元素渲染属性, 经过处理后的 spec.SpriteContent.renderer
|
|
13
|
+
*/
|
|
14
|
+
export interface ItemRenderer extends Required<Omit<spec.RendererOptions, 'texture' | 'shape' | 'anchor' | 'particleOrigin'>> {
|
|
15
|
+
order: number;
|
|
16
|
+
mask: number;
|
|
17
|
+
texture: Texture;
|
|
18
|
+
shape?: GeometryFromShape;
|
|
19
|
+
anchor?: spec.vec2;
|
|
20
|
+
particleOrigin?: spec.ParticleOrigin;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* 图层的渲染属性,用于 Mesh 的合并判断
|
|
24
|
+
*/
|
|
25
|
+
export interface ItemRenderInfo {
|
|
26
|
+
side: number;
|
|
27
|
+
occlusion: boolean;
|
|
28
|
+
blending: number;
|
|
29
|
+
cachePrefix: string;
|
|
30
|
+
mask: number;
|
|
31
|
+
maskMode: number;
|
|
32
|
+
cacheId: string;
|
|
33
|
+
wireframe?: boolean;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* @since 2.1.0
|
|
37
|
+
*/
|
|
38
|
+
export declare class BaseRenderComponent extends RendererComponent {
|
|
39
|
+
interaction?: {
|
|
40
|
+
behavior: spec.InteractBehavior;
|
|
41
|
+
};
|
|
42
|
+
cachePrefix: string;
|
|
43
|
+
geoData: {
|
|
44
|
+
atlasOffset: number[] | spec.TypedArray;
|
|
45
|
+
index: number[] | spec.TypedArray;
|
|
46
|
+
};
|
|
47
|
+
anchor?: spec.vec2;
|
|
48
|
+
renderer: ItemRenderer;
|
|
49
|
+
emptyTexture: Texture;
|
|
50
|
+
color: spec.vec4;
|
|
51
|
+
worldMatrix: Matrix4;
|
|
52
|
+
geometry: Geometry;
|
|
53
|
+
protected renderInfo: ItemRenderInfo;
|
|
54
|
+
protected readonly wireframe?: boolean;
|
|
55
|
+
protected preMultiAlpha: number;
|
|
56
|
+
protected visible: boolean;
|
|
57
|
+
protected isManualTimeSet: boolean;
|
|
58
|
+
protected frameAnimationTime: number;
|
|
59
|
+
/**
|
|
60
|
+
*
|
|
61
|
+
* @param engine
|
|
62
|
+
*/
|
|
63
|
+
constructor(engine: Engine);
|
|
64
|
+
/**
|
|
65
|
+
* 设置当前 Mesh 的可见性。
|
|
66
|
+
* @param visible - true:可见,false:不可见
|
|
67
|
+
*/
|
|
68
|
+
setVisible(visible: boolean): void;
|
|
69
|
+
/**
|
|
70
|
+
* 获取当前 Mesh 的可见性。
|
|
71
|
+
*/
|
|
72
|
+
getVisible(): boolean;
|
|
73
|
+
/**
|
|
74
|
+
* 设置当前图层的颜色
|
|
75
|
+
* > Tips: 透明度也属于颜色的一部分,当有透明度/颜色 K 帧变化时,该 API 会失效
|
|
76
|
+
* @since 2.0.0
|
|
77
|
+
* @param color - 颜色值
|
|
78
|
+
*/
|
|
79
|
+
setColor(color: spec.vec4): void;
|
|
80
|
+
/**
|
|
81
|
+
* 设置当前 Mesh 的纹理
|
|
82
|
+
* @since 2.0.0
|
|
83
|
+
* @param texture - 纹理对象
|
|
84
|
+
*/
|
|
85
|
+
setTexture(texture: Texture): void;
|
|
86
|
+
render(renderer: Renderer): void;
|
|
87
|
+
onStart(): void;
|
|
88
|
+
onDestroy(): void;
|
|
89
|
+
protected getItemInitData(): {
|
|
90
|
+
atlasOffset: spec.TypedArray | number[];
|
|
91
|
+
index: number[];
|
|
92
|
+
};
|
|
93
|
+
protected setItem(): void;
|
|
94
|
+
protected getItemGeometryData(): {
|
|
95
|
+
index: number[];
|
|
96
|
+
atlasOffset: number[];
|
|
97
|
+
};
|
|
98
|
+
protected createGeometry(mode: GeometryDrawMode): Geometry;
|
|
99
|
+
protected createMaterial(renderInfo: ItemRenderInfo, count: number): Material;
|
|
100
|
+
getTextures(): Texture[];
|
|
101
|
+
/**
|
|
102
|
+
* 获取图层包围盒的类型和世界坐标
|
|
103
|
+
* @returns
|
|
104
|
+
*/
|
|
105
|
+
getBoundingBox(): BoundingBoxTriangle | void;
|
|
106
|
+
getHitTestParams: (force?: boolean) => HitTestTriangleParams | undefined;
|
|
107
|
+
}
|
|
108
|
+
export declare function getImageItemRenderInfo(item: BaseRenderComponent): ItemRenderInfo;
|
|
@@ -1,42 +1,11 @@
|
|
|
1
|
-
import { Matrix4 } from '@galacean/effects-math/es/core/matrix4';
|
|
2
1
|
import type { Engine } from '../engine';
|
|
3
|
-
import
|
|
4
|
-
import type { BoundingBoxTriangle, HitTestTriangleParams } from '../plugins';
|
|
5
|
-
import type { MeshDestroyOptions, Renderer } from '../render';
|
|
6
|
-
import type { Geometry } from '../render';
|
|
7
|
-
import { DestroyOptions } from '../utils';
|
|
8
|
-
import { RendererComponent } from './renderer-component';
|
|
2
|
+
import { MeshComponent } from './mesh-component';
|
|
9
3
|
/**
|
|
10
4
|
* @since 2.0.0
|
|
11
5
|
*/
|
|
12
|
-
export declare class EffectComponent extends
|
|
13
|
-
/**
|
|
14
|
-
* Mesh 的世界矩阵
|
|
15
|
-
*/
|
|
16
|
-
worldMatrix: Matrix4;
|
|
17
|
-
/**
|
|
18
|
-
* Mesh 的 Geometry
|
|
19
|
-
*/
|
|
20
|
-
geometry: Geometry;
|
|
21
|
-
private triangles;
|
|
22
|
-
private destroyed;
|
|
23
|
-
private hitTestGeometry;
|
|
6
|
+
export declare class EffectComponent extends MeshComponent {
|
|
24
7
|
constructor(engine: Engine);
|
|
25
8
|
onStart(): void;
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* 设置当前 Mesh 的材质
|
|
29
|
-
* @param material - 要设置的材质
|
|
30
|
-
* @param destroy - 可选的材质销毁选项
|
|
31
|
-
*/
|
|
32
|
-
setMaterial(material: Material, destroy?: MaterialDestroyOptions | DestroyOptions.keep): void;
|
|
33
|
-
getHitTestParams: (force?: boolean) => HitTestTriangleParams | void;
|
|
34
|
-
getBoundingBox(): BoundingBoxTriangle | void;
|
|
9
|
+
onUpdate(dt: number): void;
|
|
35
10
|
fromData(data: unknown): void;
|
|
36
|
-
toData(): void;
|
|
37
|
-
/**
|
|
38
|
-
* 销毁当前资源
|
|
39
|
-
* @param options - 可选的销毁选项
|
|
40
|
-
*/
|
|
41
|
-
dispose(options?: MeshDestroyOptions): void;
|
|
42
11
|
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Component } from './component';
|
|
2
|
+
import { EffectComponent } from './effect-component';
|
|
3
|
+
export declare class Fake3DComponent extends Component {
|
|
4
|
+
loop: boolean;
|
|
5
|
+
amountOfMotion: number;
|
|
6
|
+
animationLength: number;
|
|
7
|
+
mode: Fake3DAnimationMode;
|
|
8
|
+
startPositionX: number;
|
|
9
|
+
startPositionY: number;
|
|
10
|
+
startPositionZ: number;
|
|
11
|
+
endPositionX: number;
|
|
12
|
+
endPositionY: number;
|
|
13
|
+
endPositionZ: number;
|
|
14
|
+
amplitudeX: number;
|
|
15
|
+
amplitudeY: number;
|
|
16
|
+
amplitudeZ: number;
|
|
17
|
+
phaseX: number;
|
|
18
|
+
phaseY: number;
|
|
19
|
+
phaseZ: number;
|
|
20
|
+
effectComponent: EffectComponent;
|
|
21
|
+
onStart(): void;
|
|
22
|
+
onUpdate(dt: number): void;
|
|
23
|
+
updateFake3D(): void;
|
|
24
|
+
}
|
|
25
|
+
export declare enum Fake3DAnimationMode {
|
|
26
|
+
Circular = 0,
|
|
27
|
+
Linear = 1
|
|
28
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { BoundingBoxTriangle, HitTestTriangleParams } from '../plugins';
|
|
2
|
+
import { MeshCollider } from '../plugins';
|
|
3
|
+
import type { Geometry } from '../render/geometry';
|
|
4
|
+
import type { Renderer } from '../render/renderer';
|
|
5
|
+
import { RendererComponent } from './renderer-component';
|
|
6
|
+
/**
|
|
7
|
+
* Mesh 组件
|
|
8
|
+
*/
|
|
9
|
+
export declare class MeshComponent extends RendererComponent {
|
|
10
|
+
/**
|
|
11
|
+
* 渲染的 Geometry
|
|
12
|
+
*/
|
|
13
|
+
protected geometry: Geometry;
|
|
14
|
+
/**
|
|
15
|
+
* 用于点击测试的碰撞器
|
|
16
|
+
*/
|
|
17
|
+
protected meshCollider: MeshCollider;
|
|
18
|
+
render(renderer: Renderer): void;
|
|
19
|
+
getHitTestParams: (force?: boolean) => HitTestTriangleParams | void;
|
|
20
|
+
getBoundingBox(): BoundingBoxTriangle | void;
|
|
21
|
+
}
|
|
@@ -1,15 +1,14 @@
|
|
|
1
|
+
import * as spec from '@galacean/effects-specification';
|
|
1
2
|
import { Behaviour } from './component';
|
|
3
|
+
import type { Engine } from '../engine';
|
|
4
|
+
/**
|
|
5
|
+
* @since 2.1.0
|
|
6
|
+
*/
|
|
2
7
|
export declare class PostProcessVolume extends Behaviour {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
saturation: number;
|
|
9
|
-
contrast: number;
|
|
10
|
-
vignetteIntensity: number;
|
|
11
|
-
vignetteSmoothness: number;
|
|
12
|
-
vignetteRoundness: number;
|
|
13
|
-
useToneMapping: boolean;
|
|
8
|
+
bloom: spec.Bloom;
|
|
9
|
+
vignette: spec.Vignette;
|
|
10
|
+
tonemapping: spec.Tonemapping;
|
|
11
|
+
colorAdjustments: spec.ColorAdjustments;
|
|
12
|
+
constructor(engine: Engine);
|
|
14
13
|
onStart(): void;
|
|
15
14
|
}
|
|
@@ -0,0 +1,285 @@
|
|
|
1
|
+
import type * as spec from '@galacean/effects-specification';
|
|
2
|
+
import type { Engine } from '../engine';
|
|
3
|
+
import { MeshComponent } from './mesh-component';
|
|
4
|
+
/**
|
|
5
|
+
* 图形组件
|
|
6
|
+
* @since 2.1.0
|
|
7
|
+
*/
|
|
8
|
+
export declare class ShapeComponent extends MeshComponent {
|
|
9
|
+
private path;
|
|
10
|
+
private curveValues;
|
|
11
|
+
private data;
|
|
12
|
+
private animated;
|
|
13
|
+
private vert;
|
|
14
|
+
private frag;
|
|
15
|
+
/**
|
|
16
|
+
*
|
|
17
|
+
* @param engine
|
|
18
|
+
*/
|
|
19
|
+
constructor(engine: Engine);
|
|
20
|
+
onStart(): void;
|
|
21
|
+
onUpdate(dt: number): void;
|
|
22
|
+
private buildGeometryFromPath;
|
|
23
|
+
private buildPath;
|
|
24
|
+
private setFillColor;
|
|
25
|
+
fromData(data: ShapeComponentData): void;
|
|
26
|
+
}
|
|
27
|
+
/************************** Test Interface **********************************/
|
|
28
|
+
/**
|
|
29
|
+
* 矢量图形组件
|
|
30
|
+
*/
|
|
31
|
+
export interface ShapeComponentData extends spec.ComponentData {
|
|
32
|
+
/**
|
|
33
|
+
* 矢量类型
|
|
34
|
+
*/
|
|
35
|
+
type: ShapePrimitiveType;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* 矢量图形类型
|
|
39
|
+
*/
|
|
40
|
+
export declare enum ShapePrimitiveType {
|
|
41
|
+
/**
|
|
42
|
+
* 自定义图形
|
|
43
|
+
*/
|
|
44
|
+
Custom = 0,
|
|
45
|
+
/**
|
|
46
|
+
* 矩形
|
|
47
|
+
*/
|
|
48
|
+
Rectangle = 1,
|
|
49
|
+
/**
|
|
50
|
+
* 椭圆
|
|
51
|
+
*/
|
|
52
|
+
Ellipse = 2,
|
|
53
|
+
/**
|
|
54
|
+
* 多边形
|
|
55
|
+
*/
|
|
56
|
+
Polygon = 3,
|
|
57
|
+
/**
|
|
58
|
+
* 星形
|
|
59
|
+
*/
|
|
60
|
+
Star = 4
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* 自定义图形组件
|
|
64
|
+
*/
|
|
65
|
+
export interface CustomShapeData extends ShapeComponentData {
|
|
66
|
+
/**
|
|
67
|
+
* 矢量类型 - 形状
|
|
68
|
+
*/
|
|
69
|
+
type: ShapePrimitiveType.Custom;
|
|
70
|
+
/**
|
|
71
|
+
* 路径点
|
|
72
|
+
*/
|
|
73
|
+
points: spec.Vector2Data[];
|
|
74
|
+
/**
|
|
75
|
+
* 入射控制点
|
|
76
|
+
*/
|
|
77
|
+
easingIns: spec.Vector2Data[];
|
|
78
|
+
/**
|
|
79
|
+
* 入射控制点
|
|
80
|
+
*/
|
|
81
|
+
easingOuts: spec.Vector2Data[];
|
|
82
|
+
/**
|
|
83
|
+
* 自定义形状
|
|
84
|
+
*/
|
|
85
|
+
shapes: CustomShape[];
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* 自定义形状参数
|
|
89
|
+
*/
|
|
90
|
+
export interface CustomShape {
|
|
91
|
+
/**
|
|
92
|
+
* 点索引 - 用于构成闭合图形
|
|
93
|
+
*/
|
|
94
|
+
indexes: CustomShapePoint[];
|
|
95
|
+
/**
|
|
96
|
+
* 是否为闭合图形 - 用于Stroke
|
|
97
|
+
*/
|
|
98
|
+
close: boolean;
|
|
99
|
+
/**
|
|
100
|
+
* 填充属性
|
|
101
|
+
*/
|
|
102
|
+
fill?: ShapeFillParam;
|
|
103
|
+
/**
|
|
104
|
+
* 描边属性
|
|
105
|
+
*/
|
|
106
|
+
stroke?: ShapeStrokeParam;
|
|
107
|
+
/**
|
|
108
|
+
* 空间变换
|
|
109
|
+
*/
|
|
110
|
+
transform?: spec.TransformData;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* 自定义形状点
|
|
114
|
+
*/
|
|
115
|
+
export interface CustomShapePoint {
|
|
116
|
+
/**
|
|
117
|
+
* 顶点索引
|
|
118
|
+
*/
|
|
119
|
+
point: number;
|
|
120
|
+
/**
|
|
121
|
+
* 入射点索引
|
|
122
|
+
*/
|
|
123
|
+
easingIn: number;
|
|
124
|
+
/**
|
|
125
|
+
* 出射点索引
|
|
126
|
+
*/
|
|
127
|
+
easingOut: number;
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* 矢量填充参数
|
|
131
|
+
*/
|
|
132
|
+
export interface ShapeFillParam {
|
|
133
|
+
/**
|
|
134
|
+
* 填充颜色
|
|
135
|
+
*/
|
|
136
|
+
color: spec.ColorData;
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* 矢量描边参数
|
|
140
|
+
*/
|
|
141
|
+
export interface ShapeStrokeParam {
|
|
142
|
+
/**
|
|
143
|
+
* 线宽
|
|
144
|
+
*/
|
|
145
|
+
width: number;
|
|
146
|
+
/**
|
|
147
|
+
* 线颜色
|
|
148
|
+
*/
|
|
149
|
+
color: spec.ColorData;
|
|
150
|
+
/**
|
|
151
|
+
* 连接类型
|
|
152
|
+
*/
|
|
153
|
+
connectType: ShapeConnectType;
|
|
154
|
+
/**
|
|
155
|
+
* 点类型
|
|
156
|
+
*/
|
|
157
|
+
pointType: ShapePointType;
|
|
158
|
+
}
|
|
159
|
+
export declare enum ShapeConnectType {
|
|
160
|
+
}
|
|
161
|
+
export declare enum ShapePointType {
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* 椭圆组件参数
|
|
165
|
+
*/
|
|
166
|
+
export interface EllipseData extends ShapeComponentData {
|
|
167
|
+
type: ShapePrimitiveType.Ellipse;
|
|
168
|
+
/**
|
|
169
|
+
* x 轴半径
|
|
170
|
+
* -- TODO 后续完善类型
|
|
171
|
+
* -- TODO 可以看一下用xRadius/yRadius 还是 width/height
|
|
172
|
+
*/
|
|
173
|
+
xRadius: number;
|
|
174
|
+
/**
|
|
175
|
+
* y 轴半径
|
|
176
|
+
*/
|
|
177
|
+
yRadius: number;
|
|
178
|
+
/**
|
|
179
|
+
* 填充属性
|
|
180
|
+
*/
|
|
181
|
+
fill?: ShapeFillParam;
|
|
182
|
+
/**
|
|
183
|
+
* 描边属性
|
|
184
|
+
*/
|
|
185
|
+
stroke?: ShapeStrokeParam;
|
|
186
|
+
/**
|
|
187
|
+
* 空间变换
|
|
188
|
+
*/
|
|
189
|
+
transform?: spec.TransformData;
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* 星形参数
|
|
193
|
+
*/
|
|
194
|
+
export interface StarData extends ShapeComponentData {
|
|
195
|
+
/**
|
|
196
|
+
* 顶点数 - 内外顶点同数
|
|
197
|
+
*/
|
|
198
|
+
pointCount: number;
|
|
199
|
+
/**
|
|
200
|
+
* 内径
|
|
201
|
+
*/
|
|
202
|
+
innerRadius: number;
|
|
203
|
+
/**
|
|
204
|
+
* 外径
|
|
205
|
+
*/
|
|
206
|
+
outerRadius: number;
|
|
207
|
+
/**
|
|
208
|
+
* 内径点圆度
|
|
209
|
+
*/
|
|
210
|
+
innerRoundness: number;
|
|
211
|
+
/**
|
|
212
|
+
* 外径点圆度
|
|
213
|
+
*/
|
|
214
|
+
outerRoundness: number;
|
|
215
|
+
/**
|
|
216
|
+
* 填充属性
|
|
217
|
+
*/
|
|
218
|
+
fill?: ShapeFillParam;
|
|
219
|
+
/**
|
|
220
|
+
* 描边属性
|
|
221
|
+
*/
|
|
222
|
+
stroke?: ShapeStrokeParam;
|
|
223
|
+
/**
|
|
224
|
+
* 空间变换
|
|
225
|
+
*/
|
|
226
|
+
transform?: spec.TransformData;
|
|
227
|
+
}
|
|
228
|
+
/**
|
|
229
|
+
* 多边形参数
|
|
230
|
+
*/
|
|
231
|
+
export interface PolygonData extends ShapeComponentData {
|
|
232
|
+
/**
|
|
233
|
+
* 顶点数
|
|
234
|
+
*/
|
|
235
|
+
pointCount: number;
|
|
236
|
+
/**
|
|
237
|
+
* 外切圆半径
|
|
238
|
+
*/
|
|
239
|
+
radius: number;
|
|
240
|
+
/**
|
|
241
|
+
* 角点圆度
|
|
242
|
+
*/
|
|
243
|
+
roundness: number;
|
|
244
|
+
/**
|
|
245
|
+
* 填充属性
|
|
246
|
+
*/
|
|
247
|
+
fill?: ShapeFillParam;
|
|
248
|
+
/**
|
|
249
|
+
* 描边属性
|
|
250
|
+
*/
|
|
251
|
+
stroke?: ShapeStrokeParam;
|
|
252
|
+
/**
|
|
253
|
+
* 空间变换
|
|
254
|
+
*/
|
|
255
|
+
transform?: spec.TransformData;
|
|
256
|
+
}
|
|
257
|
+
/**
|
|
258
|
+
* 矩形参数
|
|
259
|
+
*/
|
|
260
|
+
export interface RectangleData extends ShapeComponentData {
|
|
261
|
+
/**
|
|
262
|
+
* 宽度
|
|
263
|
+
*/
|
|
264
|
+
width: number;
|
|
265
|
+
/**
|
|
266
|
+
* 高度
|
|
267
|
+
*/
|
|
268
|
+
height: number;
|
|
269
|
+
/**
|
|
270
|
+
* 角点元素
|
|
271
|
+
*/
|
|
272
|
+
roundness: number;
|
|
273
|
+
/**
|
|
274
|
+
* 填充属性
|
|
275
|
+
*/
|
|
276
|
+
fill?: ShapeFillParam;
|
|
277
|
+
/**
|
|
278
|
+
* 描边属性
|
|
279
|
+
*/
|
|
280
|
+
stroke?: ShapeStrokeParam;
|
|
281
|
+
/**
|
|
282
|
+
* 空间变换
|
|
283
|
+
*/
|
|
284
|
+
transform?: spec.TransformData;
|
|
285
|
+
}
|
|
@@ -1,9 +1,23 @@
|
|
|
1
|
-
import { Component } from '../components
|
|
1
|
+
import { Component } from '../components';
|
|
2
|
+
/**
|
|
3
|
+
*
|
|
4
|
+
*/
|
|
2
5
|
export declare class SceneTicking {
|
|
3
6
|
update: UpdateTickData;
|
|
4
7
|
lateUpdate: LateUpdateTickData;
|
|
8
|
+
/**
|
|
9
|
+
*
|
|
10
|
+
* @param obj
|
|
11
|
+
*/
|
|
5
12
|
addComponent(obj: Component): void;
|
|
13
|
+
/**
|
|
14
|
+
*
|
|
15
|
+
* @param obj
|
|
16
|
+
*/
|
|
6
17
|
removeComponent(obj: Component): void;
|
|
18
|
+
/**
|
|
19
|
+
*
|
|
20
|
+
*/
|
|
7
21
|
clear(): void;
|
|
8
22
|
}
|
|
9
23
|
declare class TickData {
|