@galacean/engine-loader 1.2.0-beta.6 → 1.3.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/main.js +492 -414
- package/dist/main.js.map +1 -1
- package/dist/miniprogram.js +492 -414
- package/dist/module.js +493 -415
- package/dist/module.js.map +1 -1
- package/package.json +4 -4
- package/types/PrefabLoader.d.ts +5 -0
- package/types/gltf/GLTFParser.d.ts +9 -0
- package/types/gltf/GLTFPipeline.d.ts +23 -0
- package/types/gltf/GLTFResource.d.ts +1 -1
- package/types/gltf/GLTFSchema.d.ts +1 -1
- package/types/gltf/GLTFUtil.d.ts +53 -0
- package/types/gltf/Schema.d.ts +814 -0
- package/types/gltf/extensions/ExtensionParser.d.ts +8 -0
- package/types/gltf/extensions/Schema.d.ts +142 -0
- package/types/gltf/parser/AnimationParser.d.ts +7 -0
- package/types/gltf/parser/BufferParser.d.ts +7 -0
- package/types/gltf/parser/EntityParser.d.ts +9 -0
- package/types/gltf/parser/MaterialParser.d.ts +8 -0
- package/types/gltf/parser/MeshParser.d.ts +13 -0
- package/types/gltf/parser/Parser.d.ts +21 -0
- package/types/gltf/parser/ParserContext.d.ts +46 -0
- package/types/gltf/parser/SceneParser.d.ts +11 -0
- package/types/gltf/parser/SkinParser.d.ts +6 -0
- package/types/gltf/parser/TextureParser.d.ts +8 -0
- package/types/gltf/parser/Validator.d.ts +5 -0
- package/types/index.d.ts +3 -0
- package/types/ktx2/BinomialLLCTranscoder/BinomialLLCTranscoder.d.ts +13 -0
- package/types/ktx2/BinomialLLCTranscoder/TranscodeWorkerCode.d.ts +33 -0
- package/types/ktx2/KhronosTranscoder/KhronosTranscoder.d.ts +17 -0
- package/types/ktx2/KhronosTranscoder/TranscoderWorkerCode.d.ts +34 -0
- package/types/ktx2/TranscodeResult.d.ts +10 -0
- package/types/ktx2/constants.d.ts +7 -0
- package/types/ktx2/zstddec.d.ts +62 -0
- package/types/prefab/PrefabParser.d.ts +11 -0
- package/types/prefab/PrefabResource.d.ts +25 -0
- package/types/resource-deserialize/index.d.ts +0 -1
- package/types/resource-deserialize/resources/parser/HierarchyParser.d.ts +12 -10
- package/types/resource-deserialize/resources/parser/ParserContext.d.ts +13 -12
- package/types/resource-deserialize/resources/parser/ReflectionParser.d.ts +2 -2
- package/types/resource-deserialize/resources/prefab/PrefabDesign.d.ts +70 -0
- package/types/resource-deserialize/resources/prefab/ReflectionParser.d.ts +14 -0
- package/types/resource-deserialize/resources/scene/SceneParser.d.ts +7 -4
- package/types/resource-deserialize/resources/schema/BasicSchema.d.ts +1 -1
- package/types/resource-deserialize/resources/schema/SceneSchema.d.ts +4 -3
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import type { BackgroundMode } from "@galacean/engine-core";
|
|
2
|
+
import { IRefObject } from "@galacean/engine-core/types/asset/IRefObject";
|
|
3
|
+
import { IColor } from "../mesh/IModelMesh";
|
|
4
|
+
export interface IPrefabFile {
|
|
5
|
+
entities: Array<IEntity>;
|
|
6
|
+
}
|
|
7
|
+
export interface IScene extends IPrefabFile {
|
|
8
|
+
scene: {
|
|
9
|
+
background: {
|
|
10
|
+
mode: BackgroundMode;
|
|
11
|
+
color: IColor;
|
|
12
|
+
texture?: IRefObject;
|
|
13
|
+
sky?: IRefObject;
|
|
14
|
+
};
|
|
15
|
+
ambient: {
|
|
16
|
+
ambientLight: IRefObject;
|
|
17
|
+
diffuseSolidColor: IColor;
|
|
18
|
+
diffuseIntensity: number;
|
|
19
|
+
specularIntensity: number;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
files: Array<{
|
|
23
|
+
id: string;
|
|
24
|
+
type: string;
|
|
25
|
+
virtualPath: string;
|
|
26
|
+
path: string;
|
|
27
|
+
}>;
|
|
28
|
+
}
|
|
29
|
+
export interface IVector3 {
|
|
30
|
+
x: number;
|
|
31
|
+
y: number;
|
|
32
|
+
z: number;
|
|
33
|
+
}
|
|
34
|
+
export interface IBasicEntity {
|
|
35
|
+
name?: string;
|
|
36
|
+
id?: string;
|
|
37
|
+
components?: Array<IComponent>;
|
|
38
|
+
isActive?: boolean;
|
|
39
|
+
position?: IVector3;
|
|
40
|
+
rotation?: IVector3;
|
|
41
|
+
scale?: IVector3;
|
|
42
|
+
children?: Array<string>;
|
|
43
|
+
parent?: string;
|
|
44
|
+
}
|
|
45
|
+
export type IEntity = IBasicEntity | IRefEntity;
|
|
46
|
+
export interface IRefEntity extends IBasicEntity {
|
|
47
|
+
assetRefId: string;
|
|
48
|
+
key?: string;
|
|
49
|
+
isClone?: boolean;
|
|
50
|
+
}
|
|
51
|
+
export type IComponent = {
|
|
52
|
+
id: string;
|
|
53
|
+
refId?: string;
|
|
54
|
+
} & IClassObject;
|
|
55
|
+
export type IMethodParams = Array<IBasicType>;
|
|
56
|
+
export type IClassObject = {
|
|
57
|
+
class: string;
|
|
58
|
+
constructParams?: IMethodParams;
|
|
59
|
+
methods?: {
|
|
60
|
+
[methodName: string]: Array<IMethodParams>;
|
|
61
|
+
};
|
|
62
|
+
props?: {
|
|
63
|
+
[key: string]: IBasicType | IMethodParams;
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
export type IBasicType = string | number | boolean | null | undefined | IAssetRef | IClassObject | IMethodParams;
|
|
67
|
+
export type IAssetRef = {
|
|
68
|
+
key?: string;
|
|
69
|
+
refId: string;
|
|
70
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Engine, Entity } from "@galacean/engine-core";
|
|
2
|
+
import { IBasicType, IClassObject, IEntity } from "./PrefabDesign";
|
|
3
|
+
export declare class ReflectionParser {
|
|
4
|
+
static customParseComponentHandles: Map<string, Function>;
|
|
5
|
+
static registerCustomParseComponent(componentType: string, handle: Function): void;
|
|
6
|
+
static parseEntity(entityConfig: IEntity, engine: Engine): Promise<Entity>;
|
|
7
|
+
private static getEntityByConfig;
|
|
8
|
+
static parseClassObject(item: IClassObject, engine: Engine, resourceManager?: any): Promise<any>;
|
|
9
|
+
static parseBasicType(value: IBasicType, engine: Engine, resourceManager?: any): Promise<any>;
|
|
10
|
+
static parsePropsAndMethods(instance: any, item: Omit<IClassObject, "class">, engine: Engine, resourceManager?: any): Promise<any>;
|
|
11
|
+
static parseMethod(instance: any, methodName: string, methodParams: Array<IBasicType>, engine: Engine, resourceManager?: any): Promise<any>;
|
|
12
|
+
private static _isClass;
|
|
13
|
+
private static _isRef;
|
|
14
|
+
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { Engine, Scene } from "@galacean/engine-core";
|
|
2
2
|
import type { IScene } from "../schema";
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
3
|
+
import { HierarchyParser } from "../parser/HierarchyParser";
|
|
4
|
+
import { ParserContext } from "../parser/ParserContext";
|
|
5
5
|
/** @Internal */
|
|
6
|
-
export declare class SceneParser extends HierarchyParser<Scene,
|
|
6
|
+
export declare class SceneParser extends HierarchyParser<Scene, ParserContext<IScene, Scene>> {
|
|
7
|
+
readonly scene: Scene;
|
|
7
8
|
/**
|
|
8
9
|
* Parse scene data.
|
|
9
10
|
* @param engine - the engine of the parser context
|
|
@@ -11,5 +12,7 @@ export declare class SceneParser extends HierarchyParser<Scene, SceneParserConte
|
|
|
11
12
|
* @returns a promise of scene
|
|
12
13
|
*/
|
|
13
14
|
static parse(engine: Engine, sceneData: IScene): Promise<Scene>;
|
|
14
|
-
|
|
15
|
+
constructor(data: IScene, context: ParserContext<IScene, Scene>, scene: Scene);
|
|
16
|
+
protected _handleRootEntity(id: string): void;
|
|
17
|
+
protected _clearAndResolve(): Scene;
|
|
15
18
|
}
|
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
import { BackgroundMode, DiffuseMode, FogMode, ShadowCascadesMode, ShadowResolution } from "@galacean/engine-core";
|
|
1
|
+
import { BackgroundMode, BackgroundTextureFillMode, DiffuseMode, FogMode, ShadowCascadesMode, ShadowResolution } from "@galacean/engine-core";
|
|
2
2
|
import type { IReferable } from "@galacean/engine-core/types/asset/IReferable";
|
|
3
|
-
import type { IColor,
|
|
3
|
+
import type { IColor, IHierarchyFile, IVector3 } from "./BasicSchema";
|
|
4
4
|
export declare enum SpecularMode {
|
|
5
5
|
Sky = "Sky",
|
|
6
6
|
Custom = "Custom"
|
|
7
7
|
}
|
|
8
|
-
export interface IScene extends
|
|
8
|
+
export interface IScene extends IHierarchyFile {
|
|
9
9
|
scene: {
|
|
10
10
|
background: {
|
|
11
11
|
mode: BackgroundMode;
|
|
12
12
|
color: IColor;
|
|
13
13
|
texture?: IReferable;
|
|
14
|
+
textureFillMode?: BackgroundTextureFillMode;
|
|
14
15
|
skyMesh?: IReferable;
|
|
15
16
|
skyMaterial?: IReferable;
|
|
16
17
|
};
|