@galacean/effects-core 2.4.0-alpha.0 → 2.4.0-beta.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/asset-loader.d.ts +1 -2
- package/dist/binary-asset.d.ts +0 -2
- package/dist/comp-vfx-item.d.ts +2 -2
- package/dist/components/base-render-component.d.ts +17 -36
- package/dist/components/component.d.ts +1 -0
- package/dist/components/post-process-volume.d.ts +2 -2
- package/dist/components/renderer-component.d.ts +0 -5
- package/dist/components/shape-component.d.ts +2 -5
- package/dist/composition.d.ts +1 -11
- package/dist/effects-object.d.ts +1 -1
- package/dist/engine.d.ts +10 -4
- package/dist/fallback/migration.d.ts +1 -0
- package/dist/index.d.ts +0 -1
- package/dist/index.js +23693 -24276
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +22862 -23439
- package/dist/index.mjs.map +1 -1
- package/dist/material/utils.d.ts +1 -1
- package/dist/plugins/camera/camera-controller-node.d.ts +2 -2
- package/dist/plugins/interact/mesh-collider.d.ts +2 -2
- package/dist/plugins/particle/trail-mesh.d.ts +1 -1
- package/dist/plugins/sprite/sprite-item.d.ts +3 -5
- package/dist/plugins/sprite/sprite-mesh.d.ts +1 -8
- package/dist/render/shader.d.ts +1 -27
- package/dist/serialization-helper.d.ts +0 -4
- package/dist/vfx-item.d.ts +10 -4
- package/package.json +2 -2
- package/dist/composition-source-manager.d.ts +0 -36
package/dist/material/utils.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import * as spec from '@galacean/effects-specification';
|
|
|
2
2
|
import { MaskMode } from './types';
|
|
3
3
|
import type { Material } from './material';
|
|
4
4
|
export declare function valIfUndefined<T>(val: any, def: T): T;
|
|
5
|
-
export declare function getPreMultiAlpha(blending?:
|
|
5
|
+
export declare function getPreMultiAlpha(blending?: spec.BlendingMode): number;
|
|
6
6
|
export declare function setBlendMode(material: Material, blendMode?: number): void;
|
|
7
7
|
export declare function setSideMode(material: Material, side: spec.SideMode): void;
|
|
8
8
|
export declare function setMaskMode(material: Material, maskMode: MaskMode, colorMask?: boolean): void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as spec from '@galacean/effects-specification';
|
|
2
|
-
import {
|
|
2
|
+
import { Component } from '../../components';
|
|
3
3
|
import type { Engine } from '../../engine';
|
|
4
|
-
export declare class CameraController extends
|
|
4
|
+
export declare class CameraController extends Component {
|
|
5
5
|
private options;
|
|
6
6
|
constructor(engine: Engine, props?: spec.CameraContent);
|
|
7
7
|
onUpdate(): void;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
+
import { Matrix4 } from '@galacean/effects-math/es/core/matrix4';
|
|
1
2
|
import type { Geometry } from '../../render/geometry';
|
|
2
3
|
import type { BoundingBoxTriangle } from './click-handler';
|
|
3
|
-
import { Matrix4 } from '@galacean/effects-math/es/core/matrix4';
|
|
4
4
|
/**
|
|
5
5
|
*
|
|
6
6
|
*/
|
|
7
7
|
export declare class MeshCollider {
|
|
8
8
|
private boundingBoxData;
|
|
9
|
-
private geometry;
|
|
10
9
|
private triangles;
|
|
11
10
|
private worldMatrix;
|
|
12
11
|
getBoundingBoxData(): BoundingBoxTriangle;
|
|
13
12
|
getBoundingBox(): BoundingBoxTriangle;
|
|
14
13
|
setGeometry(geometry: Geometry, worldMatrix?: Matrix4): void;
|
|
15
14
|
private geometryToTriangles;
|
|
15
|
+
private assemblyTriangles;
|
|
16
16
|
private applyWorldMatrix;
|
|
17
17
|
}
|
|
@@ -11,7 +11,7 @@ export type TrailMeshProps = {
|
|
|
11
11
|
maxTrailCount: number;
|
|
12
12
|
pointCountPerTrail: number;
|
|
13
13
|
colorOverLifetime?: Array<GradientStop>;
|
|
14
|
-
texture
|
|
14
|
+
texture?: Texture;
|
|
15
15
|
minimumVertexDistance: number;
|
|
16
16
|
blending: number;
|
|
17
17
|
widthOverTrail: ValueGetter<number>;
|
|
@@ -3,9 +3,8 @@ import type { ColorPlayableAssetData } from '../../animation';
|
|
|
3
3
|
import { BaseRenderComponent } from '../../components';
|
|
4
4
|
import type { Engine } from '../../engine';
|
|
5
5
|
import type { MaskProps } from '../../material';
|
|
6
|
-
import type {
|
|
7
|
-
import {
|
|
8
|
-
import type { GeometryFromShape } from '../../shape';
|
|
6
|
+
import type { Geometry } from '../../render';
|
|
7
|
+
import { type GeometryFromShape } from '../../shape';
|
|
9
8
|
import { type Texture } from '../../texture';
|
|
10
9
|
import type { Playable, PlayableGraph } from '../cal/playable-graph';
|
|
11
10
|
import { PlayableAsset } from '../cal/playable-graph';
|
|
@@ -39,8 +38,7 @@ export declare class SpriteComponent extends BaseRenderComponent {
|
|
|
39
38
|
constructor(engine: Engine, props?: SpriteItemProps);
|
|
40
39
|
onUpdate(dt: number): void;
|
|
41
40
|
onDestroy(): void;
|
|
42
|
-
|
|
43
|
-
getItemGeometryData(): {
|
|
41
|
+
getItemGeometryData(geometry: Geometry): {
|
|
44
42
|
index: number[];
|
|
45
43
|
atlasOffset: number[];
|
|
46
44
|
};
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import type { Vector3 } from '@galacean/effects-math/es/core/vector3';
|
|
2
2
|
import type * as spec from '@galacean/effects-specification';
|
|
3
|
-
import type { GPUCapabilityDetail
|
|
3
|
+
import type { GPUCapabilityDetail } from '../../render';
|
|
4
4
|
import type { Transform } from '../../transform';
|
|
5
|
-
import type { ItemRenderInfo } from '../../components';
|
|
6
5
|
export type SpriteRenderData = {
|
|
7
6
|
life: number;
|
|
8
7
|
transform: Transform;
|
|
@@ -21,10 +20,4 @@ export type SpriteRegionData = {
|
|
|
21
20
|
};
|
|
22
21
|
export declare let maxSpriteMeshItemCount: number;
|
|
23
22
|
export declare function setSpriteMeshMaxItemCountByGPU(gpuCapability: GPUCapabilityDetail): 16 | 32 | undefined;
|
|
24
|
-
export declare function spriteMeshShaderFromFilter(level: number, options?: {
|
|
25
|
-
wireframe?: boolean;
|
|
26
|
-
env?: string;
|
|
27
|
-
}): SharedShaderWithSource;
|
|
28
|
-
export declare function spriteMeshShaderIdFromRenderInfo(renderInfo: ItemRenderInfo, count: number): string;
|
|
29
|
-
export declare function spriteMeshShaderFromRenderInfo(renderInfo: ItemRenderInfo, count: number, level: number, env?: string): SharedShaderWithSource;
|
|
30
23
|
export declare function setMaxSpriteMeshItemCount(count: number): void;
|
package/dist/render/shader.d.ts
CHANGED
|
@@ -19,32 +19,6 @@ export declare enum GLSLVersion {
|
|
|
19
19
|
'GLSL1' = "100",
|
|
20
20
|
'GLSL3' = "300 es"
|
|
21
21
|
}
|
|
22
|
-
export interface InstancedShaderWithSource {
|
|
23
|
-
/**
|
|
24
|
-
* fragment shader字符串
|
|
25
|
-
*/
|
|
26
|
-
fragment: string;
|
|
27
|
-
/**
|
|
28
|
-
* vertex shader字符串
|
|
29
|
-
*/
|
|
30
|
-
vertex: string;
|
|
31
|
-
/**
|
|
32
|
-
* shader 字符串的版本,用于添加版本头
|
|
33
|
-
*/
|
|
34
|
-
glslVersion?: GLSLVersion;
|
|
35
|
-
/**
|
|
36
|
-
* shader的name
|
|
37
|
-
*/
|
|
38
|
-
name?: string;
|
|
39
|
-
/**
|
|
40
|
-
* shader的宏定义
|
|
41
|
-
*/
|
|
42
|
-
macros?: ShaderMacros;
|
|
43
|
-
/**
|
|
44
|
-
* shader是否共享
|
|
45
|
-
*/
|
|
46
|
-
shared?: boolean;
|
|
47
|
-
}
|
|
48
22
|
export interface SharedShaderWithSource {
|
|
49
23
|
/**
|
|
50
24
|
* fragment shader字符串
|
|
@@ -78,7 +52,7 @@ export interface SharedShaderWithSource {
|
|
|
78
52
|
*/
|
|
79
53
|
cacheId?: string;
|
|
80
54
|
}
|
|
81
|
-
export type ShaderWithSource =
|
|
55
|
+
export type ShaderWithSource = SharedShaderWithSource;
|
|
82
56
|
export declare abstract class ShaderVariant extends EffectsObject {
|
|
83
57
|
readonly source: ShaderWithSource;
|
|
84
58
|
shader: Shader;
|
|
@@ -1,17 +1,13 @@
|
|
|
1
1
|
import type * as spec from '@galacean/effects-specification';
|
|
2
2
|
import { EffectsObject } from './effects-object';
|
|
3
3
|
export declare class SerializationHelper {
|
|
4
|
-
static collectSerializableObject(effectsObject: EffectsObject, res: Record<string, EffectsObject>): void;
|
|
5
|
-
static serializeEffectObject(effectsObject: EffectsObject): Record<string, any>;
|
|
6
4
|
static serialize(effectsObject: EffectsObject, serializedData?: Record<string, any>): Record<string, any>;
|
|
7
5
|
static deserialize(serializedData: spec.EffectsObjectData, effectsObject: EffectsObject): void;
|
|
8
|
-
static deserializeAsync(serializedData: spec.EffectsObjectData, effectsObject: EffectsObject): Promise<void>;
|
|
9
6
|
static checkTypedArray(obj: unknown): boolean;
|
|
10
7
|
static checkDataPath(value: unknown): value is spec.DataPath;
|
|
11
8
|
static checkGLTFNode(value: any): boolean;
|
|
12
9
|
static checkImageSource(value: HTMLCanvasElement): boolean;
|
|
13
10
|
private static deserializeProperty;
|
|
14
|
-
private static deserializePropertyAsync;
|
|
15
11
|
private static serializeObjectProperty;
|
|
16
12
|
private static serializeArrayProperty;
|
|
17
13
|
}
|
package/dist/vfx-item.d.ts
CHANGED
|
@@ -1,8 +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 { Component } from './components';
|
|
4
|
-
import {
|
|
5
|
-
import type { Composition } from './composition';
|
|
4
|
+
import { Composition } from './composition';
|
|
6
5
|
import { EffectsObject } from './effects-object';
|
|
7
6
|
import type { Engine } from './engine';
|
|
8
7
|
import type { EventEmitterListener, EventEmitterOptions, ItemEvent } from './events';
|
|
@@ -61,9 +60,8 @@ export declare class VFXItem extends EffectsObject implements Disposable {
|
|
|
61
60
|
_content?: VFXItemContent;
|
|
62
61
|
type: spec.ItemType;
|
|
63
62
|
props: spec.VFXItemData;
|
|
64
|
-
isDuringPlay: boolean;
|
|
65
63
|
components: Component[];
|
|
66
|
-
|
|
64
|
+
isDuringPlay: boolean;
|
|
67
65
|
/**
|
|
68
66
|
* 元素是否激活
|
|
69
67
|
*/
|
|
@@ -295,6 +293,12 @@ export declare class VFXItem extends EffectsObject implements Disposable {
|
|
|
295
293
|
*/
|
|
296
294
|
getCurrentPosition(): Vector3;
|
|
297
295
|
find(name: string): VFXItem | undefined;
|
|
296
|
+
/**
|
|
297
|
+
* 复制 VFXItem,返回一个新的 VFXItem
|
|
298
|
+
* @since 2.4.0
|
|
299
|
+
* @returns 复制的新 VFXItem
|
|
300
|
+
*/
|
|
301
|
+
duplicate(): VFXItem;
|
|
298
302
|
fromData(data: spec.VFXItemData): void;
|
|
299
303
|
toData(): void;
|
|
300
304
|
translateByPixel(x: number, y: number): void;
|
|
@@ -304,6 +308,8 @@ export declare class VFXItem extends EffectsObject implements Disposable {
|
|
|
304
308
|
dispose(): void;
|
|
305
309
|
private resetChildrenParent;
|
|
306
310
|
private instantiatePreComposition;
|
|
311
|
+
private resetGUID;
|
|
312
|
+
private gatherPreviousObjectID;
|
|
307
313
|
}
|
|
308
314
|
export declare namespace Item {
|
|
309
315
|
function is<T extends spec.Item>(item: spec.Item, type: spec.ItemType): item is T;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@galacean/effects-core",
|
|
3
|
-
"version": "2.4.0-
|
|
3
|
+
"version": "2.4.0-beta.1",
|
|
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.3.
|
|
45
|
+
"@galacean/effects-specification": "2.3.1",
|
|
46
46
|
"@galacean/effects-math": "1.1.0",
|
|
47
47
|
"flatbuffers": "24.3.25",
|
|
48
48
|
"uuid": "9.0.1",
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import * as spec from '@galacean/effects-specification';
|
|
2
|
-
import type { SceneBindingData } from './comp-vfx-item';
|
|
3
|
-
import type { Engine } from './engine';
|
|
4
|
-
import type { Scene, SceneRenderLevel } from './scene';
|
|
5
|
-
import type { Texture } from './texture';
|
|
6
|
-
import type { Disposable } from './utils';
|
|
7
|
-
export interface ContentOptions {
|
|
8
|
-
id: string;
|
|
9
|
-
duration: number;
|
|
10
|
-
name: string;
|
|
11
|
-
endBehavior: spec.EndBehavior;
|
|
12
|
-
items: spec.DataPath[];
|
|
13
|
-
camera: spec.CameraOptions;
|
|
14
|
-
startTime: number;
|
|
15
|
-
timelineAsset: spec.DataPath;
|
|
16
|
-
sceneBindings: SceneBindingData[];
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* 合成资源管理
|
|
20
|
-
*/
|
|
21
|
-
export declare class CompositionSourceManager implements Disposable {
|
|
22
|
-
engine: Engine;
|
|
23
|
-
sourceContent?: spec.CompositionData;
|
|
24
|
-
renderLevel?: SceneRenderLevel;
|
|
25
|
-
imgUsage: Record<string, number>;
|
|
26
|
-
textures: Texture[];
|
|
27
|
-
jsonScene?: spec.JSONScene;
|
|
28
|
-
mask: number;
|
|
29
|
-
constructor(scene: Scene, engine: Engine);
|
|
30
|
-
private getContent;
|
|
31
|
-
private assembleItems;
|
|
32
|
-
private preProcessItemContent;
|
|
33
|
-
private changeTex;
|
|
34
|
-
private addTextureUsage;
|
|
35
|
-
dispose(): void;
|
|
36
|
-
}
|