@galacean/engine-loader 2.0.0-alpha.5 → 2.0.0-alpha.50
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/README.md +3 -1
- package/dist/main.js +3139 -3376
- package/dist/main.js.map +1 -1
- package/dist/module.js +3139 -3377
- package/dist/module.js.map +1 -1
- package/package.json +4 -4
- package/types/GLTFContentRestorer.d.ts +13 -13
- package/types/HDRDecoder.d.ts +43 -0
- package/types/SceneLoader.d.ts +8 -1
- package/types/{Texture2DLoader.d.ts → TextureLoader.d.ts} +4 -4
- package/types/gltf/GLTFResource.d.ts +4 -4
- package/types/gltf/GLTFUtils.d.ts +6 -6
- package/types/gltf/extensions/GLTFExtensionParser.d.ts +1 -1
- package/types/gltf/extensions/GLTFExtensionSchema.d.ts +2 -3
- package/types/gltf/extensions/MeshoptDecoder.d.ts +1 -1
- package/types/gltf/parser/GLTFAnimatorControllerParser.d.ts +1 -1
- package/types/gltf/parser/GLTFParser.d.ts +2 -2
- package/types/gltf/parser/GLTFParserContext.d.ts +4 -3
- package/types/gltf/parser/GLTFSceneParser.d.ts +1 -1
- package/types/gltf/parser/GLTFSkinParser.d.ts +4 -0
- package/types/gltf/parser/GLTFValidator.d.ts +1 -1
- package/types/index.d.ts +6 -7
- package/types/ktx2/KTX2Container.d.ts +1 -0
- package/types/ktx2/KTX2Loader.d.ts +1 -1
- package/types/ktx2/WorkerPool.d.ts +1 -1
- package/types/prefab/PrefabParser.d.ts +9 -6
- package/types/prefab/PrefabResource.d.ts +2 -2
- package/types/resource-deserialize/index.d.ts +3 -3
- package/types/resource-deserialize/resources/mesh/IModelMesh.d.ts +123 -0
- package/types/resource-deserialize/resources/parser/HierarchyParser.d.ts +22 -27
- package/types/resource-deserialize/resources/parser/ParserContext.d.ts +12 -12
- package/types/resource-deserialize/resources/parser/ReflectionParser.d.ts +42 -17
- package/types/resource-deserialize/resources/scene/SceneParser.d.ts +6 -7
- package/types/resource-deserialize/resources/textureCube/TextureCubeDecoder.d.ts +1 -0
- package/types/resource-deserialize/utils/BufferReader.d.ts +3 -1
- package/types/resource-deserialize/utils/FileHeader.d.ts +5 -0
- package/types/schema/BasicSchema.d.ts +21 -0
- package/types/schema/CommonSchema.d.ts +45 -0
- package/types/schema/HierarchySchema.d.ts +71 -0
- package/types/schema/MaterialSchema.d.ts +27 -0
- package/types/schema/PrefabSchema.d.ts +4 -0
- package/types/schema/ProjectSchema.d.ts +7 -0
- package/types/schema/SceneSchema.d.ts +59 -0
- package/types/{resource-deserialize/resources/schema → schema}/index.d.ts +4 -1
- package/types/schema/refs.d.ts +2 -0
- package/types/ShaderChunkLoader.d.ts +0 -9
- package/types/Texture2DContentRestorer.d.ts +0 -10
- package/types/TextureCubeContentRestorer.d.ts +0 -10
- package/types/resource-deserialize/resources/scene/EditorTextureLoader.d.ts +0 -4
- package/types/resource-deserialize/resources/schema/BasicSchema.d.ts +0 -97
- package/types/resource-deserialize/resources/schema/MaterialSchema.d.ts +0 -102
- package/types/resource-deserialize/resources/schema/ProjectSchema.d.ts +0 -10
- package/types/resource-deserialize/resources/schema/SceneSchema.d.ts +0 -80
- package/types/resource-deserialize/resources/texture2D/TextureDecoder.d.ts +0 -5
- /package/types/{EnvLoader.d.ts → AmbientLightLoader.d.ts} +0 -0
- /package/types/{HDRLoader.d.ts → RenderTargetLoader.d.ts} +0 -0
- /package/types/{TextureCubeLoader.d.ts → resource-deserialize/resources/texture2D/Texture2DDecoder.d.ts} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AssetPromise, Component, Engine,
|
|
2
|
-
import type {
|
|
1
|
+
import { AssetPromise, Component, Engine, Entity, ReferResource, ResourceManager, Scene } from "@galacean/engine-core";
|
|
2
|
+
import type { ComponentSchema } from "../../../schema/HierarchySchema";
|
|
3
3
|
export declare enum ParserType {
|
|
4
4
|
Prefab = 0,
|
|
5
5
|
Scene = 1
|
|
@@ -7,24 +7,24 @@ export declare enum ParserType {
|
|
|
7
7
|
/**
|
|
8
8
|
* @internal
|
|
9
9
|
*/
|
|
10
|
-
export declare class ParserContext
|
|
10
|
+
export declare class ParserContext {
|
|
11
11
|
readonly engine: Engine;
|
|
12
12
|
readonly type: ParserType;
|
|
13
13
|
readonly resource: ReferResource | Scene;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
14
|
+
/** Runtime Entity instances, indexed by the flat entities[] position. */
|
|
15
|
+
entityInstances: Entity[];
|
|
16
|
+
/** Components waiting for props/calls application (Stage 4). */
|
|
17
|
+
pendingComponents: Array<{
|
|
18
|
+
instance: Component;
|
|
19
|
+
config: ComponentSchema;
|
|
20
|
+
}>;
|
|
20
21
|
readonly resourceManager: ResourceManager;
|
|
21
|
-
private _tasks;
|
|
22
22
|
private _loaded;
|
|
23
23
|
private _total;
|
|
24
|
-
constructor(engine: Engine, type: ParserType, resource: ReferResource | Scene);
|
|
24
|
+
constructor(engine: Engine, type: ParserType | undefined, resource: ReferResource | Scene);
|
|
25
25
|
clear(): void;
|
|
26
26
|
/** @internal */
|
|
27
27
|
_setTaskCompleteProgress: (loaded: number, total: number) => void;
|
|
28
28
|
/** @internal */
|
|
29
|
-
_addDependentAsset(
|
|
29
|
+
_addDependentAsset(promise: AssetPromise<any>): void;
|
|
30
30
|
}
|
|
@@ -1,21 +1,46 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type {
|
|
1
|
+
import { Component } from "@galacean/engine-core";
|
|
2
|
+
import type { CallSpec, MutationBlock, RefItem } from "../../../schema/CommonSchema";
|
|
3
3
|
import { ParserContext } from "./ParserContext";
|
|
4
4
|
export declare class ReflectionParser {
|
|
5
5
|
private readonly _context;
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
6
|
+
private readonly _refs;
|
|
7
|
+
/** @internal shared with HierarchyParser; each use must length=0 -> getComponents -> read -> length=0 synchronously. */
|
|
8
|
+
static _componentBuffer: Component[];
|
|
9
|
+
constructor(_context: ParserContext, _refs: RefItem[]);
|
|
10
|
+
/**
|
|
11
|
+
* Apply v2 props to a component/object instance.
|
|
12
|
+
* Each prop value is resolved recursively (handling $ref, $number, $type, $class, $entity, $component, $signal).
|
|
13
|
+
*/
|
|
14
|
+
parseProps(instance: any, props?: Record<string, unknown>): Promise<any>;
|
|
15
|
+
/**
|
|
16
|
+
* Execute calls sequentially on a target instance.
|
|
17
|
+
* Call args are resolved with the same v2 value rules as props.
|
|
18
|
+
*/
|
|
19
|
+
parseCalls(instance: any, calls?: CallSpec[]): Promise<any>;
|
|
20
|
+
/**
|
|
21
|
+
* Apply props before executing calls from the same mutation block.
|
|
22
|
+
*/
|
|
23
|
+
parseMutationBlock(target: any, block?: MutationBlock): Promise<any>;
|
|
24
|
+
/**
|
|
25
|
+
* Resolve a v2 value with $ prefix detection.
|
|
26
|
+
*
|
|
27
|
+
* Priority:
|
|
28
|
+
* 1. null/undefined/primitive → passthrough
|
|
29
|
+
* 2. Array → recurse each element
|
|
30
|
+
* 3. { $ref } → asset reference
|
|
31
|
+
* 4. { $number } → JSON-safe special number
|
|
32
|
+
* 5. { $type, $args? } → polymorphic type construct
|
|
33
|
+
* 6. { $class } → registered class constructor
|
|
34
|
+
* 7. { $entity } → entity reference by path (flat index + optional children descent)
|
|
35
|
+
* 8. { $component } → component reference
|
|
36
|
+
* 9. { $signal } → signal binding
|
|
37
|
+
* 10. plain object → recurse values (modify originValue in place if exists)
|
|
38
|
+
*/
|
|
39
|
+
private _resolveValue;
|
|
40
|
+
private _getRegisteredClass;
|
|
41
|
+
/** Promise-adapt {@link _getRegisteredClass} so $type/$class branches can fold into the resolver chain. */
|
|
42
|
+
private _resolveRegisteredClass;
|
|
43
|
+
private _resolveSignal;
|
|
44
|
+
private _resolveComponent;
|
|
45
|
+
private _resolveEntityRef;
|
|
21
46
|
}
|
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
import { Scene } from "@galacean/engine-core";
|
|
2
|
+
import type { SceneFile } from "../../../schema/SceneSchema";
|
|
2
3
|
import { HierarchyParser } from "../parser/HierarchyParser";
|
|
3
4
|
import { ParserContext } from "../parser/ParserContext";
|
|
4
|
-
import { type IScene } from "../schema";
|
|
5
5
|
/** @Internal */
|
|
6
|
-
export declare class SceneParser extends HierarchyParser<Scene, ParserContext
|
|
6
|
+
export declare class SceneParser extends HierarchyParser<Scene, ParserContext> {
|
|
7
7
|
readonly scene: Scene;
|
|
8
|
-
constructor(data:
|
|
8
|
+
constructor(data: SceneFile, context: ParserContext, scene: Scene);
|
|
9
9
|
/**
|
|
10
10
|
* @internal
|
|
11
11
|
*/
|
|
12
|
-
_collectDependentAssets(data:
|
|
13
|
-
protected
|
|
12
|
+
_collectDependentAssets(data: SceneFile): void;
|
|
13
|
+
protected _getRootIndices(): number[];
|
|
14
|
+
protected _handleRootEntity(index: number): void;
|
|
14
15
|
protected _clearAndResolve(): Scene;
|
|
15
|
-
private _parseDependentAssets;
|
|
16
|
-
private _searchDependentAssets;
|
|
17
16
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
+
import type { FileHeader } from "./FileHeader";
|
|
1
2
|
export declare class BufferReader {
|
|
2
3
|
data: Uint8Array;
|
|
4
|
+
readonly header?: Readonly<FileHeader> | undefined;
|
|
3
5
|
private _dataView;
|
|
4
6
|
private _littleEndian;
|
|
5
7
|
private _position;
|
|
6
8
|
private _baseOffset;
|
|
7
|
-
constructor(data: Uint8Array, byteOffset?: number, byteLength?: number, littleEndian?: boolean);
|
|
9
|
+
constructor(data: Uint8Array, byteOffset?: number, byteLength?: number, littleEndian?: boolean, header?: Readonly<FileHeader> | undefined);
|
|
8
10
|
get position(): number;
|
|
9
11
|
get offset(): number;
|
|
10
12
|
nextUint8(): number;
|
|
@@ -1,9 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Binary format: [MAGIC(4B)] [totalLength(4B)] [version(1B)] [typeLen(2B)] [type] [nameLen(2B)] [name] [data...]
|
|
3
|
+
*/
|
|
1
4
|
export declare class FileHeader {
|
|
5
|
+
static readonly MAGIC = 1313033287;
|
|
2
6
|
totalLength: number;
|
|
3
7
|
version: number;
|
|
4
8
|
type: string;
|
|
5
9
|
name: string;
|
|
6
10
|
headerLength: number;
|
|
11
|
+
static checkMagic(arrayBuffer: ArrayBuffer): boolean;
|
|
7
12
|
static decode(arrayBuffer: ArrayBuffer): FileHeader;
|
|
8
13
|
get dataLength(): number;
|
|
9
14
|
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export interface IVector3 {
|
|
2
|
+
x: number;
|
|
3
|
+
y: number;
|
|
4
|
+
z: number;
|
|
5
|
+
}
|
|
6
|
+
export interface IVector2 {
|
|
7
|
+
x: number;
|
|
8
|
+
y: number;
|
|
9
|
+
}
|
|
10
|
+
export interface IVector4 {
|
|
11
|
+
x: number;
|
|
12
|
+
y: number;
|
|
13
|
+
z: number;
|
|
14
|
+
w: number;
|
|
15
|
+
}
|
|
16
|
+
export interface IColor {
|
|
17
|
+
r: number;
|
|
18
|
+
g: number;
|
|
19
|
+
b: number;
|
|
20
|
+
a: number;
|
|
21
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
export type Vec3Tuple = [number, number, number];
|
|
2
|
+
export type Vec4Tuple = [number, number, number, number];
|
|
3
|
+
export interface RefItem {
|
|
4
|
+
url: string;
|
|
5
|
+
key?: string;
|
|
6
|
+
}
|
|
7
|
+
/** path[0] = flat index into top-level entities[]; subsequent indices descend via children. */
|
|
8
|
+
export type EntityRef = number[];
|
|
9
|
+
export interface ComponentRef {
|
|
10
|
+
entity: EntityRef;
|
|
11
|
+
type: string;
|
|
12
|
+
index: number;
|
|
13
|
+
}
|
|
14
|
+
/** Reference to a registered runtime class constructor. */
|
|
15
|
+
export interface ClassRef {
|
|
16
|
+
$class: string;
|
|
17
|
+
}
|
|
18
|
+
/** Registered runtime value with optional recursively-resolved constructor arguments. */
|
|
19
|
+
export interface TypeValue {
|
|
20
|
+
$type: string;
|
|
21
|
+
$args?: unknown[];
|
|
22
|
+
[key: string]: unknown;
|
|
23
|
+
}
|
|
24
|
+
/** JSON-safe encoding for positive infinity. */
|
|
25
|
+
export interface SpecialNumberValue {
|
|
26
|
+
$number: "Infinity";
|
|
27
|
+
}
|
|
28
|
+
export interface SignalListener {
|
|
29
|
+
target: {
|
|
30
|
+
$component: ComponentRef;
|
|
31
|
+
};
|
|
32
|
+
methodName: string;
|
|
33
|
+
args?: unknown[];
|
|
34
|
+
}
|
|
35
|
+
export interface CallSpec {
|
|
36
|
+
/** Optional property path from the mutation root to the method owner. */
|
|
37
|
+
target?: string[];
|
|
38
|
+
method: string;
|
|
39
|
+
args?: unknown[];
|
|
40
|
+
result?: MutationBlock;
|
|
41
|
+
}
|
|
42
|
+
export interface MutationBlock {
|
|
43
|
+
props?: Record<string, unknown>;
|
|
44
|
+
calls?: CallSpec[];
|
|
45
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import type { MutationBlock, RefItem, Vec3Tuple } from "./CommonSchema";
|
|
2
|
+
export interface ComponentSchema extends MutationBlock {
|
|
3
|
+
type: string;
|
|
4
|
+
script?: number;
|
|
5
|
+
}
|
|
6
|
+
export interface EntityOverrideProps {
|
|
7
|
+
name?: string;
|
|
8
|
+
isActive?: boolean;
|
|
9
|
+
layer?: number;
|
|
10
|
+
position?: Vec3Tuple;
|
|
11
|
+
rotation?: Vec3Tuple;
|
|
12
|
+
scale?: Vec3Tuple;
|
|
13
|
+
}
|
|
14
|
+
export interface AddedEntityOverride {
|
|
15
|
+
/** Parent path from prefab instance root via children indices. `[]` = instance root. */
|
|
16
|
+
parent: number[];
|
|
17
|
+
/** Index into the top-level entities[] array. */
|
|
18
|
+
entity: number;
|
|
19
|
+
}
|
|
20
|
+
export interface AddedComponentOverride {
|
|
21
|
+
/** Target entity path from prefab instance root via children indices. `[]` = instance root. */
|
|
22
|
+
target: number[];
|
|
23
|
+
/** Index into the top-level components[] array. */
|
|
24
|
+
component: number;
|
|
25
|
+
}
|
|
26
|
+
export interface EntityPropOverride extends EntityOverrideProps {
|
|
27
|
+
/** Path from prefab instance root via children indices. `[]` = instance root. */
|
|
28
|
+
path: number[];
|
|
29
|
+
}
|
|
30
|
+
export interface ComponentSelector {
|
|
31
|
+
type: string;
|
|
32
|
+
index: number;
|
|
33
|
+
}
|
|
34
|
+
export interface ComponentOverride extends MutationBlock {
|
|
35
|
+
/** Path from prefab instance root via children indices. `[]` = instance root. */
|
|
36
|
+
path: number[];
|
|
37
|
+
selector: ComponentSelector;
|
|
38
|
+
}
|
|
39
|
+
export interface RemovedComponentOverride {
|
|
40
|
+
/** Path from prefab instance root via children indices. `[]` = instance root. */
|
|
41
|
+
path: number[];
|
|
42
|
+
selectors: ComponentSelector[];
|
|
43
|
+
}
|
|
44
|
+
export interface InstanceOverrides {
|
|
45
|
+
entityProps?: EntityPropOverride[];
|
|
46
|
+
componentProps?: ComponentOverride[];
|
|
47
|
+
/** Each element is a path from prefab instance root via children indices. */
|
|
48
|
+
removedEntities?: number[][];
|
|
49
|
+
removedComponents?: RemovedComponentOverride[];
|
|
50
|
+
addedEntities?: AddedEntityOverride[];
|
|
51
|
+
addedComponents?: AddedComponentOverride[];
|
|
52
|
+
}
|
|
53
|
+
export interface InstanceSchema {
|
|
54
|
+
asset: number;
|
|
55
|
+
overrides?: InstanceOverrides;
|
|
56
|
+
}
|
|
57
|
+
export interface NormalEntitySchema extends EntityOverrideProps {
|
|
58
|
+
children?: number[];
|
|
59
|
+
components?: number[];
|
|
60
|
+
}
|
|
61
|
+
export interface PrefabInstanceEntitySchema {
|
|
62
|
+
instance: InstanceSchema;
|
|
63
|
+
}
|
|
64
|
+
export type EntitySchema = NormalEntitySchema | PrefabInstanceEntitySchema;
|
|
65
|
+
/** Common base for v2 scene and prefab files. */
|
|
66
|
+
export interface HierarchyFile {
|
|
67
|
+
version: "2.0";
|
|
68
|
+
refs: RefItem[];
|
|
69
|
+
entities: EntitySchema[];
|
|
70
|
+
components: ComponentSchema[];
|
|
71
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { RefItem } from "./CommonSchema";
|
|
2
|
+
import type { IColor, IVector2, IVector3 } from "./BasicSchema";
|
|
3
|
+
export interface IMaterialSchema {
|
|
4
|
+
name: string;
|
|
5
|
+
shader: string;
|
|
6
|
+
shaderData: {
|
|
7
|
+
[key: string]: {
|
|
8
|
+
type: MaterialLoaderType;
|
|
9
|
+
value: IVector3 | IVector2 | IColor | number | RefItem;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
macros: Array<{
|
|
13
|
+
name: string;
|
|
14
|
+
value?: string;
|
|
15
|
+
}>;
|
|
16
|
+
shaderRef: RefItem;
|
|
17
|
+
}
|
|
18
|
+
export declare enum MaterialLoaderType {
|
|
19
|
+
Vector2 = "Vector2",
|
|
20
|
+
Vector3 = "Vector3",
|
|
21
|
+
Vector4 = "Vector4",
|
|
22
|
+
Color = "Color",
|
|
23
|
+
Float = "Float",
|
|
24
|
+
Texture = "Texture",
|
|
25
|
+
Boolean = "Boolean",
|
|
26
|
+
Integer = "Integer"
|
|
27
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { BackgroundMode, BackgroundTextureFillMode, DiffuseMode, FogMode, ShadowCascadesMode, ShadowResolution } from "@galacean/engine-core";
|
|
2
|
+
import type { HierarchyFile } from "./HierarchySchema";
|
|
3
|
+
import type { Vec3Tuple, Vec4Tuple } from "./CommonSchema";
|
|
4
|
+
export declare enum SpecularMode {
|
|
5
|
+
Sky = 0,
|
|
6
|
+
Custom = 1
|
|
7
|
+
}
|
|
8
|
+
export interface SceneFile extends HierarchyFile {
|
|
9
|
+
scene: {
|
|
10
|
+
name?: string;
|
|
11
|
+
rootEntities: number[];
|
|
12
|
+
background: {
|
|
13
|
+
mode: BackgroundMode;
|
|
14
|
+
color: Vec4Tuple;
|
|
15
|
+
texture?: number;
|
|
16
|
+
textureFillMode?: BackgroundTextureFillMode;
|
|
17
|
+
skyMesh?: number;
|
|
18
|
+
skyMaterial?: number;
|
|
19
|
+
};
|
|
20
|
+
ambient?: {
|
|
21
|
+
diffuseMode: DiffuseMode;
|
|
22
|
+
ambientLight?: number;
|
|
23
|
+
customAmbientLight?: number;
|
|
24
|
+
diffuseSolidColor?: Vec4Tuple;
|
|
25
|
+
diffuseIntensity: number;
|
|
26
|
+
specularIntensity: number;
|
|
27
|
+
specularMode: SpecularMode;
|
|
28
|
+
};
|
|
29
|
+
shadow?: {
|
|
30
|
+
castShadows?: boolean;
|
|
31
|
+
enableTransparentShadow?: boolean;
|
|
32
|
+
shadowResolution?: ShadowResolution;
|
|
33
|
+
shadowDistance?: number;
|
|
34
|
+
shadowCascades?: ShadowCascadesMode;
|
|
35
|
+
shadowTwoCascadeSplits?: number;
|
|
36
|
+
shadowFourCascadeSplits?: Vec3Tuple;
|
|
37
|
+
shadowFadeBorder?: number;
|
|
38
|
+
};
|
|
39
|
+
fog?: {
|
|
40
|
+
fogMode?: FogMode;
|
|
41
|
+
fogStart?: number;
|
|
42
|
+
fogEnd?: number;
|
|
43
|
+
fogDensity?: number;
|
|
44
|
+
fogColor?: Vec4Tuple;
|
|
45
|
+
};
|
|
46
|
+
ambientOcclusion?: {
|
|
47
|
+
enabledAmbientOcclusion?: boolean;
|
|
48
|
+
quality?: number;
|
|
49
|
+
intensity?: number;
|
|
50
|
+
radius?: number;
|
|
51
|
+
bias?: number;
|
|
52
|
+
power?: number;
|
|
53
|
+
bilateralThreshold?: number;
|
|
54
|
+
minHorizonAngle?: number;
|
|
55
|
+
};
|
|
56
|
+
/** Not supported in scene yet; presence triggers a warning. */
|
|
57
|
+
postProcess?: unknown;
|
|
58
|
+
};
|
|
59
|
+
}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
+
export * from "./CommonSchema";
|
|
2
|
+
export * from "./HierarchySchema";
|
|
3
|
+
export * from "./SceneSchema";
|
|
4
|
+
export * from "./PrefabSchema";
|
|
1
5
|
export * from "./BasicSchema";
|
|
2
6
|
export * from "./MaterialSchema";
|
|
3
7
|
export * from "./ProjectSchema";
|
|
4
|
-
export * from "./SceneSchema";
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { AssetPromise, LoadItem, Loader, ResourceManager } from "@galacean/engine-core";
|
|
2
|
-
export declare class ShaderChunkLoader extends Loader<void[]> {
|
|
3
|
-
private static _shaderIncludeRegex;
|
|
4
|
-
/**
|
|
5
|
-
* @internal
|
|
6
|
-
*/
|
|
7
|
-
static _loadChunksInCode(code: string, basePath: string, resourceManager: ResourceManager): Promise<void[]>;
|
|
8
|
-
load(item: LoadItem, resourceManager: ResourceManager): AssetPromise<void[]>;
|
|
9
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { AssetPromise, ContentRestorer, RequestConfig, Texture2D } from "@galacean/engine-core";
|
|
2
|
-
/**
|
|
3
|
-
* @internal
|
|
4
|
-
*/
|
|
5
|
-
export declare class Texture2DContentRestorer extends ContentRestorer<Texture2D> {
|
|
6
|
-
url: string;
|
|
7
|
-
requestConfig: RequestConfig;
|
|
8
|
-
constructor(resource: Texture2D, url: string, requestConfig: RequestConfig);
|
|
9
|
-
restoreContent(): AssetPromise<Texture2D>;
|
|
10
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { AssetPromise, ContentRestorer, RequestConfig, TextureCube } from "@galacean/engine-core";
|
|
2
|
-
/**
|
|
3
|
-
* @internal
|
|
4
|
-
*/
|
|
5
|
-
export declare class TextureCubeContentRestorer extends ContentRestorer<TextureCube> {
|
|
6
|
-
urls: string[];
|
|
7
|
-
requestConfig: RequestConfig;
|
|
8
|
-
constructor(resource: TextureCube, urls: string[], requestConfig: RequestConfig);
|
|
9
|
-
restoreContent(): AssetPromise<TextureCube>;
|
|
10
|
-
}
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
import { Layer } from "@galacean/engine-core";
|
|
2
|
-
export interface IVector3 {
|
|
3
|
-
x: number;
|
|
4
|
-
y: number;
|
|
5
|
-
z: number;
|
|
6
|
-
}
|
|
7
|
-
export interface IVector2 {
|
|
8
|
-
x: number;
|
|
9
|
-
y: number;
|
|
10
|
-
}
|
|
11
|
-
export interface IVector4 {
|
|
12
|
-
x: number;
|
|
13
|
-
y: number;
|
|
14
|
-
z: number;
|
|
15
|
-
w: number;
|
|
16
|
-
}
|
|
17
|
-
export interface IColor {
|
|
18
|
-
r: number;
|
|
19
|
-
g: number;
|
|
20
|
-
b: number;
|
|
21
|
-
a: number;
|
|
22
|
-
}
|
|
23
|
-
export interface IHierarchyFile {
|
|
24
|
-
entities: Array<IEntity>;
|
|
25
|
-
}
|
|
26
|
-
export type IMethod = {
|
|
27
|
-
params: Array<IBasicType>;
|
|
28
|
-
result?: IInstance;
|
|
29
|
-
};
|
|
30
|
-
export type IMethodParams = Array<IBasicType> | IMethod;
|
|
31
|
-
export interface IBasicEntity {
|
|
32
|
-
name?: string;
|
|
33
|
-
id?: string;
|
|
34
|
-
transform?: IComponent;
|
|
35
|
-
components?: Array<IComponent>;
|
|
36
|
-
isActive?: boolean;
|
|
37
|
-
position?: IVector3;
|
|
38
|
-
rotation?: IVector3;
|
|
39
|
-
scale?: IVector3;
|
|
40
|
-
children?: Array<string>;
|
|
41
|
-
parent?: string;
|
|
42
|
-
layer?: Layer;
|
|
43
|
-
}
|
|
44
|
-
export type IEntity = IBasicEntity | IRefEntity | IStrippedEntity;
|
|
45
|
-
export interface IRefEntity extends IBasicEntity {
|
|
46
|
-
assetRefId: string;
|
|
47
|
-
key?: string;
|
|
48
|
-
isClone?: boolean;
|
|
49
|
-
modifications: (IInstance & {
|
|
50
|
-
target: IPrefabModifyTarget;
|
|
51
|
-
})[];
|
|
52
|
-
removedEntities: IPrefabModifyTarget[];
|
|
53
|
-
removedComponents: IPrefabModifyTarget[];
|
|
54
|
-
}
|
|
55
|
-
export interface IPrefabModifyTarget {
|
|
56
|
-
entityId?: string;
|
|
57
|
-
componentId?: string;
|
|
58
|
-
}
|
|
59
|
-
export interface IStrippedEntity extends IBasicEntity {
|
|
60
|
-
strippedId: string;
|
|
61
|
-
prefabInstanceId: string;
|
|
62
|
-
prefabSource: {
|
|
63
|
-
assetId: string;
|
|
64
|
-
entityId: string;
|
|
65
|
-
};
|
|
66
|
-
}
|
|
67
|
-
export type IComponent = {
|
|
68
|
-
id: string;
|
|
69
|
-
refId?: string;
|
|
70
|
-
} & IClass;
|
|
71
|
-
export type IClass = {
|
|
72
|
-
class: string;
|
|
73
|
-
constructParams?: Array<IBasicType>;
|
|
74
|
-
} & IInstance;
|
|
75
|
-
export interface IInstance {
|
|
76
|
-
methods?: {
|
|
77
|
-
[methodName: string]: Array<IMethodParams>;
|
|
78
|
-
};
|
|
79
|
-
props?: {
|
|
80
|
-
[key: string]: IBasicType | IMethodParams;
|
|
81
|
-
};
|
|
82
|
-
}
|
|
83
|
-
export type IClassType = {
|
|
84
|
-
classType: string;
|
|
85
|
-
};
|
|
86
|
-
export type IBasicType = string | number | boolean | null | undefined | IAssetRef | IClass | IClassType | IMethodParams | IEntityRef;
|
|
87
|
-
export type IAssetRef = {
|
|
88
|
-
key?: string;
|
|
89
|
-
refId: string;
|
|
90
|
-
};
|
|
91
|
-
export type IEntityRef = {
|
|
92
|
-
entityId: string;
|
|
93
|
-
};
|
|
94
|
-
export type IComponentRef = {
|
|
95
|
-
ownerId: string;
|
|
96
|
-
componentId: string;
|
|
97
|
-
};
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
import { BlendFactor, BlendOperation, ColorWriteMask, CompareFunction, CullMode, RenderQueueType, StencilOperation } from "@galacean/engine-core";
|
|
2
|
-
import type { IAssetRef, IColor, IVector2, IVector3 } from "./BasicSchema";
|
|
3
|
-
export interface IRenderState {
|
|
4
|
-
/** Blend state. */
|
|
5
|
-
blendState: {
|
|
6
|
-
/** The blend state of the render target. */
|
|
7
|
-
targetBlendState: {
|
|
8
|
-
/** Whether to enable blend. */
|
|
9
|
-
enabled: boolean;
|
|
10
|
-
/** color (RGB) blend operation. */
|
|
11
|
-
colorBlendOperation: BlendOperation;
|
|
12
|
-
/** alpha (A) blend operation. */
|
|
13
|
-
alphaBlendOperation: BlendOperation;
|
|
14
|
-
/** color blend factor (RGB) for source. */
|
|
15
|
-
sourceColorBlendFactor: BlendFactor;
|
|
16
|
-
/** alpha blend factor (A) for source. */
|
|
17
|
-
sourceAlphaBlendFactor: BlendFactor;
|
|
18
|
-
/** color blend factor (RGB) for destination. */
|
|
19
|
-
destinationColorBlendFactor: BlendFactor;
|
|
20
|
-
/** alpha blend factor (A) for destination. */
|
|
21
|
-
destinationAlphaBlendFactor: BlendFactor;
|
|
22
|
-
/** color mask. */
|
|
23
|
-
colorWriteMask: ColorWriteMask;
|
|
24
|
-
};
|
|
25
|
-
blendColor: IColor;
|
|
26
|
-
/** Whether to use (Alpha-to-Coverage) technology. */
|
|
27
|
-
alphaToCoverage: boolean;
|
|
28
|
-
};
|
|
29
|
-
/** Depth state. */
|
|
30
|
-
depthState: {
|
|
31
|
-
/** Whether to enable the depth test. */
|
|
32
|
-
enabled: boolean;
|
|
33
|
-
/** Whether the depth value can be written.*/
|
|
34
|
-
writeEnabled: boolean;
|
|
35
|
-
/** Depth comparison function. */
|
|
36
|
-
compareFunction: CompareFunction;
|
|
37
|
-
};
|
|
38
|
-
/** Stencil state. */
|
|
39
|
-
stencilState: {
|
|
40
|
-
/** Whether to enable stencil test. */
|
|
41
|
-
enabled: boolean;
|
|
42
|
-
/** Write the reference value of the stencil buffer. */
|
|
43
|
-
referenceValue: number;
|
|
44
|
-
/** Specifying a bit-wise mask that is used to AND the reference value and the stored stencil value when the test is done. */
|
|
45
|
-
mask: number;
|
|
46
|
-
/** Specifying a bit mask to enable or disable writing of individual bits in the stencil planes. */
|
|
47
|
-
writeMask: number;
|
|
48
|
-
/** The comparison function of the reference value of the front face of the geometry and the current buffer storage value. */
|
|
49
|
-
compareFunctionFront: CompareFunction;
|
|
50
|
-
/** The comparison function of the reference value of the back of the geometry and the current buffer storage value. */
|
|
51
|
-
compareFunctionBack: CompareFunction;
|
|
52
|
-
/** specifying the function to use for front face when both the stencil test and the depth test pass. */
|
|
53
|
-
passOperationFront: StencilOperation;
|
|
54
|
-
/** specifying the function to use for back face when both the stencil test and the depth test pass. */
|
|
55
|
-
passOperationBack: StencilOperation;
|
|
56
|
-
/** specifying the function to use for front face when the stencil test fails. */
|
|
57
|
-
failOperationFront: StencilOperation;
|
|
58
|
-
/** specifying the function to use for back face when the stencil test fails. */
|
|
59
|
-
failOperationBack: StencilOperation;
|
|
60
|
-
/** specifying the function to use for front face when the stencil test passes, but the depth test fails. */
|
|
61
|
-
zFailOperationFront: StencilOperation;
|
|
62
|
-
/** specifying the function to use for back face when the stencil test passes, but the depth test fails. */
|
|
63
|
-
zFailOperationBack: StencilOperation;
|
|
64
|
-
};
|
|
65
|
-
/** Raster state. */
|
|
66
|
-
rasterState: {
|
|
67
|
-
/** Specifies whether or not front- and/or back-facing polygons can be culled. */
|
|
68
|
-
cullMode: CullMode;
|
|
69
|
-
/** The multiplier by which an implementation-specific value is multiplied with to create a constant depth offset. */
|
|
70
|
-
depthBias: number;
|
|
71
|
-
/** The scale factor for the variable depth offset for each polygon. */
|
|
72
|
-
slopeScaledDepthBias: number;
|
|
73
|
-
};
|
|
74
|
-
/** Render queue type. */
|
|
75
|
-
renderQueueType: RenderQueueType;
|
|
76
|
-
}
|
|
77
|
-
export interface IMaterialSchema {
|
|
78
|
-
name: string;
|
|
79
|
-
shader: string;
|
|
80
|
-
shaderData: {
|
|
81
|
-
[key: string]: {
|
|
82
|
-
type: MaterialLoaderType;
|
|
83
|
-
value: IVector3 | IVector2 | IColor | number | IAssetRef;
|
|
84
|
-
};
|
|
85
|
-
};
|
|
86
|
-
macros: Array<{
|
|
87
|
-
name: string;
|
|
88
|
-
value?: string;
|
|
89
|
-
}>;
|
|
90
|
-
renderState: IRenderState;
|
|
91
|
-
shaderRef: IAssetRef;
|
|
92
|
-
}
|
|
93
|
-
export declare enum MaterialLoaderType {
|
|
94
|
-
Vector2 = "Vector2",
|
|
95
|
-
Vector3 = "Vector3",
|
|
96
|
-
Vector4 = "Vector4",
|
|
97
|
-
Color = "Color",
|
|
98
|
-
Float = "Float",
|
|
99
|
-
Texture = "Texture",
|
|
100
|
-
Boolean = "Boolean",
|
|
101
|
-
Integer = "Integer"
|
|
102
|
-
}
|