@galacean/engine-loader 0.0.0-experimental-double11.3 → 0.0.0-experimental-double11.5
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 +4999 -3902
- package/dist/main.js.map +1 -1
- package/dist/miniprogram.js +5011 -3914
- package/dist/module.js +4993 -3887
- package/dist/module.js.map +1 -1
- package/package.json +5 -5
- package/types/GLTFLoader.d.ts +2 -5
- package/types/gltf/GLTFSchema.d.ts +7 -1
- package/types/gltf/GLTFUtils.d.ts +4 -3
- package/types/gltf/extensions/GLTFExtensionParser.d.ts +0 -6
- package/types/gltf/extensions/KHR_texture_basisu.d.ts +1 -0
- package/types/gltf/extensions/index.d.ts +1 -1
- package/types/gltf/index.d.ts +0 -1
- package/types/gltf/parser/GLTFAnimationParser.d.ts +3 -3
- package/types/gltf/parser/GLTFBufferParser.d.ts +2 -3
- package/types/gltf/parser/GLTFEntityParser.d.ts +2 -5
- package/types/gltf/parser/GLTFMaterialParser.d.ts +5 -2
- package/types/gltf/parser/GLTFMeshParser.d.ts +2 -2
- package/types/gltf/parser/GLTFParser.d.ts +3 -9
- package/types/gltf/parser/GLTFParserContext.d.ts +29 -28
- package/types/gltf/parser/GLTFSceneParser.d.ts +5 -4
- package/types/gltf/parser/GLTFSkinParser.d.ts +3 -3
- package/types/gltf/parser/GLTFTextureParser.d.ts +9 -6
- package/types/gltf/parser/GLTFValidator.d.ts +1 -2
- package/types/gltf/parser/index.d.ts +2 -1
- package/types/index.d.ts +7 -3
- package/types/resource-deserialize/resources/animationClip/AnimationClipDecoder.d.ts +3 -1
- package/types/resource-deserialize/resources/parser/ReflectionParser.d.ts +12 -8
- package/types/resource-deserialize/resources/scene/SceneParser.d.ts +1 -0
- package/types/resource-deserialize/resources/scene/SceneParserContext.d.ts +3 -1
- package/types/resource-deserialize/resources/schema/BasicSchema.d.ts +18 -15
- package/types/resource-deserialize/resources/schema/index.d.ts +1 -0
- package/types/resource-deserialize/utils/BufferReader.d.ts +6 -10
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@galacean/engine-loader",
|
|
3
|
-
"version": "0.0.0-experimental-double11.
|
|
3
|
+
"version": "0.0.0-experimental-double11.5",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"registry": "https://registry.npmjs.org"
|
|
@@ -15,10 +15,10 @@
|
|
|
15
15
|
"types/**/*"
|
|
16
16
|
],
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@galacean/engine-core": "0.0.0-experimental-double11.
|
|
19
|
-
"@galacean/engine-draco": "0.0.0-experimental-double11.
|
|
20
|
-
"@galacean/engine-math": "0.0.0-experimental-double11.
|
|
21
|
-
"@galacean/engine-rhi-webgl": "0.0.0-experimental-double11.
|
|
18
|
+
"@galacean/engine-core": "0.0.0-experimental-double11.5",
|
|
19
|
+
"@galacean/engine-draco": "0.0.0-experimental-double11.5",
|
|
20
|
+
"@galacean/engine-math": "0.0.0-experimental-double11.5",
|
|
21
|
+
"@galacean/engine-rhi-webgl": "0.0.0-experimental-double11.5"
|
|
22
22
|
},
|
|
23
23
|
"scripts": {
|
|
24
24
|
"b:types": "tsc"
|
package/types/GLTFLoader.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { AssetPromise, Loader, LoadItem, ResourceManager } from "@galacean/engine-core";
|
|
2
|
-
import { GLTFPipeline } from "./gltf/GLTFPipeline";
|
|
3
2
|
import { GLTFResource } from "./gltf/GLTFResource";
|
|
4
3
|
export declare class GLTFLoader extends Loader<GLTFResource> {
|
|
5
|
-
load(item: LoadItem, resourceManager: ResourceManager):
|
|
4
|
+
load(item: LoadItem, resourceManager: ResourceManager): AssetPromise<GLTFResource>;
|
|
6
5
|
}
|
|
7
6
|
/**
|
|
8
7
|
* GlTF loader params.
|
|
@@ -12,7 +11,5 @@ export interface GLTFParams {
|
|
|
12
11
|
* @beta Now only contains vertex information, need to improve.
|
|
13
12
|
* Keep raw mesh data for glTF parser, default is false.
|
|
14
13
|
*/
|
|
15
|
-
keepMeshData
|
|
16
|
-
/** Custom glTF pipeline. */
|
|
17
|
-
pipeline: GLTFPipeline;
|
|
14
|
+
keepMeshData?: boolean;
|
|
18
15
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Module for glTF 2.0 Interface
|
|
3
3
|
*/
|
|
4
|
-
import { MeshTopology } from "@galacean/engine-core";
|
|
4
|
+
import type { MeshTopology, TextureFilterMode, TextureWrapMode as EngineTextureWrapMode } from "@galacean/engine-core";
|
|
5
5
|
/**
|
|
6
6
|
* The datatype of the components in the attribute
|
|
7
7
|
*/
|
|
@@ -814,3 +814,9 @@ export interface IGLTF extends IProperty {
|
|
|
814
814
|
}
|
|
815
815
|
/** glTF extensible owner schema. */
|
|
816
816
|
export type GLTFExtensionOwnerSchema = IMeshPrimitive | IMaterial | ITextureInfo | INode;
|
|
817
|
+
export interface ISamplerInfo {
|
|
818
|
+
filterMode?: TextureFilterMode;
|
|
819
|
+
wrapModeU?: EngineTextureWrapMode;
|
|
820
|
+
wrapModeV?: EngineTextureWrapMode;
|
|
821
|
+
mipmap?: boolean;
|
|
822
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { IndexFormat, TypedArray, VertexElementFormat } from "@galacean/engine-core";
|
|
1
|
+
import { IndexFormat, Texture2D, TypedArray, VertexElementFormat } from "@galacean/engine-core";
|
|
2
2
|
import { Color, Vector2, Vector3, Vector4 } from "@galacean/engine-math";
|
|
3
|
-
import { AccessorComponentType, AccessorType, IAccessor, IBufferView, IGLTF } from "./GLTFSchema";
|
|
3
|
+
import { AccessorComponentType, AccessorType, IAccessor, IBufferView, IGLTF, ISampler, ISamplerInfo } from "./GLTFSchema";
|
|
4
4
|
import { BufferInfo, GLTFParserContext } from "./parser/GLTFParserContext";
|
|
5
5
|
/**
|
|
6
6
|
* @internal
|
|
@@ -44,5 +44,6 @@ export declare class GLTFUtils {
|
|
|
44
44
|
glTF: IGLTF;
|
|
45
45
|
buffers: ArrayBuffer[];
|
|
46
46
|
};
|
|
47
|
-
|
|
47
|
+
static parseSampler(texture: Texture2D, samplerInfo: ISamplerInfo): void;
|
|
48
|
+
static getSamplerInfo(sampler: ISampler): ISamplerInfo;
|
|
48
49
|
}
|
|
@@ -11,12 +11,6 @@ export declare abstract class GLTFExtensionParser {
|
|
|
11
11
|
* The extension mode.
|
|
12
12
|
*/
|
|
13
13
|
_mode: GLTFExtensionMode;
|
|
14
|
-
/**
|
|
15
|
-
* Initialize the parser.
|
|
16
|
-
* @remarks Some plugins require initialization.
|
|
17
|
-
* @returns The void or promise
|
|
18
|
-
*/
|
|
19
|
-
initialize(): void | Promise<void>;
|
|
20
14
|
/**
|
|
21
15
|
* Create and parse the resource.
|
|
22
16
|
* @remarks This method overrides the default resource creation.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -6,7 +6,7 @@ import "./KHR_materials_pbrSpecularGlossiness";
|
|
|
6
6
|
import "./KHR_materials_sheen";
|
|
7
7
|
import "./KHR_materials_transmission";
|
|
8
8
|
import "./KHR_materials_unlit";
|
|
9
|
-
|
|
9
|
+
import "./KHR_materials_variants";
|
|
10
10
|
import "./KHR_materials_volume";
|
|
11
11
|
import "./KHR_mesh_quantization";
|
|
12
12
|
import "./KHR_texture_basisu";
|
package/types/gltf/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AnimationClip
|
|
1
|
+
import { AnimationClip } from "@galacean/engine-core";
|
|
2
2
|
import { IAnimation } from "../GLTFSchema";
|
|
3
3
|
import { GLTFParser } from "./GLTFParser";
|
|
4
4
|
import { GLTFParserContext } from "./GLTFParserContext";
|
|
@@ -6,7 +6,7 @@ export declare class GLTFAnimationParser extends GLTFParser {
|
|
|
6
6
|
/**
|
|
7
7
|
* @internal
|
|
8
8
|
*/
|
|
9
|
-
static _parseStandardProperty(context: GLTFParserContext, animationClip: AnimationClip, animationInfo: IAnimation): Promise<
|
|
9
|
+
static _parseStandardProperty(context: GLTFParserContext, animationClip: AnimationClip, animationInfo: IAnimation): Promise<AnimationClip>;
|
|
10
10
|
private static _addCurve;
|
|
11
|
-
parse(context: GLTFParserContext):
|
|
11
|
+
parse(context: GLTFParserContext, index: number): Promise<AnimationClip>;
|
|
12
12
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { AssetPromise } from "@galacean/engine-core";
|
|
2
1
|
import { GLTFParser } from "./GLTFParser";
|
|
3
2
|
import { GLTFParserContext } from "./GLTFParserContext";
|
|
4
3
|
export declare class GLTFBufferParser extends GLTFParser {
|
|
5
|
-
parse(context: GLTFParserContext):
|
|
6
|
-
private
|
|
4
|
+
parse(context: GLTFParserContext, index: number): Promise<ArrayBuffer>;
|
|
5
|
+
private _parseSingleBuffer;
|
|
7
6
|
}
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
+
import { Entity } from "@galacean/engine-core";
|
|
1
2
|
import { GLTFParser } from "./GLTFParser";
|
|
2
3
|
import { GLTFParserContext } from "./GLTFParserContext";
|
|
3
4
|
export declare class GLTFEntityParser extends GLTFParser {
|
|
4
|
-
|
|
5
|
-
static _defaultName: String;
|
|
6
|
-
parse(context: GLTFParserContext): void;
|
|
7
|
-
private _buildEntityTree;
|
|
8
|
-
private _createSceneRoots;
|
|
5
|
+
parse(context: GLTFParserContext, index: number): Entity;
|
|
9
6
|
}
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BlinnPhongMaterial, Engine, Material, PBRMaterial, PBRSpecularMaterial, UnlitMaterial } from "@galacean/engine-core";
|
|
2
2
|
import { IMaterial, ITextureInfo } from "../GLTFSchema";
|
|
3
3
|
import { GLTFParser } from "./GLTFParser";
|
|
4
4
|
import { GLTFParserContext } from "./GLTFParserContext";
|
|
5
5
|
export declare class GLTFMaterialParser extends GLTFParser {
|
|
6
|
+
/** @internal */
|
|
7
|
+
static _getDefaultMaterial(engine: Engine): BlinnPhongMaterial;
|
|
8
|
+
private static _defaultMaterial;
|
|
6
9
|
/**
|
|
7
10
|
* @internal
|
|
8
11
|
*/
|
|
@@ -11,5 +14,5 @@ export declare class GLTFMaterialParser extends GLTFParser {
|
|
|
11
14
|
* @internal
|
|
12
15
|
*/
|
|
13
16
|
static _parseStandardProperty(context: GLTFParserContext, material: UnlitMaterial | PBRMaterial | PBRSpecularMaterial, materialInfo: IMaterial): void;
|
|
14
|
-
parse(context: GLTFParserContext):
|
|
17
|
+
parse(context: GLTFParserContext, index: number): Promise<Material>;
|
|
15
18
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ModelMesh, TypedArray } from "@galacean/engine-core";
|
|
2
2
|
import { ModelMeshRestoreInfo } from "../../GLTFContentRestorer";
|
|
3
3
|
import type { IAccessor, IGLTF, IMesh, IMeshPrimitive } from "../GLTFSchema";
|
|
4
4
|
import { GLTFParser } from "./GLTFParser";
|
|
@@ -15,5 +15,5 @@ export declare class GLTFMeshParser extends GLTFParser {
|
|
|
15
15
|
static _createBlendShape(mesh: ModelMesh, meshRestoreInfo: ModelMeshRestoreInfo, glTFMesh: IMesh, accessors: IAccessor[], glTFTargets: {
|
|
16
16
|
[name: string]: number;
|
|
17
17
|
}[], getBlendShapeData: (semantic: string, shapeIndex: number) => Promise<BufferInfo>): Promise<void[]>;
|
|
18
|
-
parse(context: GLTFParserContext):
|
|
18
|
+
parse(context: GLTFParserContext, index: number): Promise<ModelMesh[]>;
|
|
19
19
|
}
|
|
@@ -1,18 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { GLTFExtensionMode, GLTFExtensionParser } from "../extensions/GLTFExtensionParser";
|
|
1
|
+
import { EngineObject } from "@galacean/engine-core";
|
|
3
2
|
import type { GLTFExtensionOwnerSchema } from "../GLTFSchema";
|
|
3
|
+
import { GLTFExtensionMode, GLTFExtensionParser } from "../extensions/GLTFExtensionParser";
|
|
4
4
|
import { GLTFParserContext } from "./GLTFParserContext";
|
|
5
5
|
/**
|
|
6
6
|
* Base class of glTF parser.
|
|
7
7
|
*/
|
|
8
8
|
export declare abstract class GLTFParser {
|
|
9
9
|
private static readonly _extensionParsers;
|
|
10
|
-
/**
|
|
11
|
-
* Execute all parses of extension to initialize plugin.
|
|
12
|
-
* @remarks Some plugins require initialization.
|
|
13
|
-
* @returns The void or promise
|
|
14
|
-
*/
|
|
15
|
-
static executeExtensionsInitialize(extensionName: string): void | Promise<void>;
|
|
16
10
|
/**
|
|
17
11
|
* Execute all parses of extension to create resource.
|
|
18
12
|
* @param extensions - Related extensions field
|
|
@@ -54,7 +48,7 @@ export declare abstract class GLTFParser {
|
|
|
54
48
|
static _addExtensionParser(extensionName: string, extensionParser: GLTFExtensionParser): void;
|
|
55
49
|
private static _createAndParse;
|
|
56
50
|
private static _additiveParse;
|
|
57
|
-
abstract parse(context: GLTFParserContext):
|
|
51
|
+
abstract parse(context: GLTFParserContext, index?: number): any;
|
|
58
52
|
}
|
|
59
53
|
/**
|
|
60
54
|
* Declare ExtensionParser's decorator.
|
|
@@ -1,33 +1,31 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Buffer, Entity, ResourceManager, TypedArray } from "@galacean/engine-core";
|
|
2
2
|
import { BufferDataRestoreInfo, GLTFContentRestorer } from "../../GLTFContentRestorer";
|
|
3
3
|
import { GLTFResource } from "../GLTFResource";
|
|
4
4
|
import type { IGLTF } from "../GLTFSchema";
|
|
5
|
+
import { GLTFParser } from "./GLTFParser";
|
|
5
6
|
/**
|
|
6
7
|
* @internal
|
|
7
8
|
*/
|
|
8
9
|
export declare class GLTFParserContext {
|
|
9
|
-
glTF: IGLTF;
|
|
10
10
|
glTFResource: GLTFResource;
|
|
11
|
+
resourceManager: ResourceManager;
|
|
11
12
|
keepMeshData: boolean;
|
|
12
|
-
|
|
13
|
-
|
|
13
|
+
private static readonly _parsers;
|
|
14
|
+
static addParser(parserType: GLTFParserType, parser: GLTFParser): void;
|
|
15
|
+
glTF: IGLTF;
|
|
14
16
|
accessorBufferCache: Record<string, BufferInfo>;
|
|
15
|
-
texturesPromiseInfo: PromiseInfo<Texture2D[]>;
|
|
16
|
-
materialsPromiseInfo: PromiseInfo<Material[]>;
|
|
17
|
-
meshesPromiseInfo: PromiseInfo<ModelMesh[][]>;
|
|
18
|
-
animationClipsPromiseInfo: PromiseInfo<AnimationClip[]>;
|
|
19
|
-
defaultSceneRootPromiseInfo: PromiseInfo<Entity>;
|
|
20
|
-
masterPromiseInfo: PromiseInfo<GLTFResource>;
|
|
21
|
-
promiseMap: Record<string, AssetPromise<any>>;
|
|
22
17
|
contentRestorer: GLTFContentRestorer;
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
constructor(
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
18
|
+
buffers?: ArrayBuffer[];
|
|
19
|
+
private _resourceCache;
|
|
20
|
+
constructor(glTFResource: GLTFResource, resourceManager: ResourceManager, keepMeshData: boolean);
|
|
21
|
+
get<T>(type: GLTFParserType.Entity, index: number): Entity;
|
|
22
|
+
get<T>(type: GLTFParserType.Entity): Entity[];
|
|
23
|
+
get<T>(type: GLTFParserType.Schema): Promise<T>;
|
|
24
|
+
get<T>(type: GLTFParserType.Validator): Promise<T>;
|
|
25
|
+
get<T>(type: GLTFParserType, index: number): Promise<T>;
|
|
26
|
+
get<T>(type: GLTFParserType): Promise<T[]>;
|
|
27
|
+
parse(): Promise<GLTFResource>;
|
|
28
|
+
private _handleSubAsset;
|
|
31
29
|
}
|
|
32
30
|
/**
|
|
33
31
|
* @internal
|
|
@@ -41,13 +39,16 @@ export declare class BufferInfo {
|
|
|
41
39
|
restoreInfo: BufferDataRestoreInfo;
|
|
42
40
|
constructor(data: TypedArray, interleaved: boolean, stride: number);
|
|
43
41
|
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
42
|
+
export declare enum GLTFParserType {
|
|
43
|
+
Schema = 0,
|
|
44
|
+
Validator = 1,
|
|
45
|
+
Scene = 2,
|
|
46
|
+
Buffer = 3,
|
|
47
|
+
Texture = 4,
|
|
48
|
+
Material = 5,
|
|
49
|
+
Mesh = 6,
|
|
50
|
+
Entity = 7,
|
|
51
|
+
Skin = 8,
|
|
52
|
+
Animation = 9
|
|
53
53
|
}
|
|
54
|
+
export declare function registerGLTFParser(pipeline: GLTFParserType): (Parser: new () => GLTFParser) => void;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Entity } from "@galacean/engine-core";
|
|
2
2
|
import { GLTFParser } from "./GLTFParser";
|
|
3
3
|
import { GLTFParserContext } from "./GLTFParserContext";
|
|
4
4
|
export declare class GLTFSceneParser extends GLTFParser {
|
|
5
|
-
|
|
6
|
-
private
|
|
7
|
-
parse(context: GLTFParserContext): AssetPromise<Entity> | void;
|
|
5
|
+
parse(context: GLTFParserContext, index: number): Promise<Entity>;
|
|
6
|
+
private _parseEntityComponent;
|
|
8
7
|
private _createCamera;
|
|
9
8
|
private _createRenderer;
|
|
10
9
|
private _createAnimator;
|
|
10
|
+
private _computeLocalBounds;
|
|
11
|
+
private _computeApproximateBindMatrix;
|
|
11
12
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { GLTFParserContext } from ".";
|
|
1
|
+
import { Skin } from "@galacean/engine-core";
|
|
3
2
|
import { GLTFParser } from "./GLTFParser";
|
|
3
|
+
import { GLTFParserContext } from "./GLTFParserContext";
|
|
4
4
|
export declare class GLTFSkinParser extends GLTFParser {
|
|
5
|
-
parse(context: GLTFParserContext):
|
|
5
|
+
parse(context: GLTFParserContext, index: number): Promise<Skin>;
|
|
6
6
|
private _findSkeletonRootBone;
|
|
7
7
|
}
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { GLTFParserContext } from ".";
|
|
1
|
+
import { Texture, TextureWrapMode } from "@galacean/engine-core";
|
|
3
2
|
import { GLTFParser } from "./GLTFParser";
|
|
3
|
+
import { GLTFParserContext } from "./GLTFParserContext";
|
|
4
4
|
export declare class GLTFTextureParser extends GLTFParser {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
/** @internal */
|
|
6
|
+
static _wrapMap: {
|
|
7
|
+
33071: TextureWrapMode;
|
|
8
|
+
33648: TextureWrapMode;
|
|
9
|
+
10497: TextureWrapMode;
|
|
10
|
+
};
|
|
11
|
+
parse(context: GLTFParserContext, index: number): Promise<Texture>;
|
|
9
12
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { AssetPromise } from "@galacean/engine-core";
|
|
2
1
|
import { GLTFParser } from "./GLTFParser";
|
|
3
2
|
import { GLTFParserContext } from "./GLTFParserContext";
|
|
4
3
|
export declare class GLTFValidator extends GLTFParser {
|
|
5
|
-
parse(context: GLTFParserContext):
|
|
4
|
+
parse(context: GLTFParserContext): Promise<void>;
|
|
6
5
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export { GLTFSchemaParser } from "./GLTFSchemaParser";
|
|
1
2
|
export { GLTFAnimationParser } from "./GLTFAnimationParser";
|
|
2
3
|
export { GLTFBufferParser } from "./GLTFBufferParser";
|
|
3
4
|
export { GLTFEntityParser } from "./GLTFEntityParser";
|
|
@@ -8,4 +9,4 @@ export { GLTFSceneParser } from "./GLTFSceneParser";
|
|
|
8
9
|
export { GLTFSkinParser } from "./GLTFSkinParser";
|
|
9
10
|
export { GLTFTextureParser } from "./GLTFTextureParser";
|
|
10
11
|
export { GLTFValidator } from "./GLTFValidator";
|
|
11
|
-
export { GLTFParserContext } from "./GLTFParserContext";
|
|
12
|
+
export { GLTFParserContext, GLTFParserType, registerGLTFParser } from "./GLTFParserContext";
|
package/types/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import "./AnimationClipLoader";
|
|
1
2
|
import "./AnimatorControllerLoader";
|
|
2
3
|
import "./BufferLoader";
|
|
3
4
|
import "./EnvLoader";
|
|
@@ -14,10 +15,13 @@ import "./SpriteAtlasLoader";
|
|
|
14
15
|
import "./SpriteLoader";
|
|
15
16
|
import "./Texture2DLoader";
|
|
16
17
|
import "./TextureCubeLoader";
|
|
17
|
-
import "./
|
|
18
|
-
|
|
18
|
+
import "./ProjectLoader";
|
|
19
|
+
import "./ktx2/KTX2Loader";
|
|
19
20
|
export type { GLTFParams } from "./GLTFLoader";
|
|
20
|
-
export * from "./resource-deserialize";
|
|
21
21
|
export * from "./SceneLoader";
|
|
22
22
|
export type { Texture2DParams } from "./Texture2DLoader";
|
|
23
|
+
export { parseSingleKTX } from "./compressed-texture";
|
|
23
24
|
export * from "./gltf";
|
|
25
|
+
export { KTX2Loader } from "./ktx2/KTX2Loader";
|
|
26
|
+
export { KTX2TargetFormat } from "./ktx2/KTX2TargetFormat";
|
|
27
|
+
export * from "./resource-deserialize";
|
|
@@ -10,7 +10,9 @@ export declare enum InterpolableValueType {
|
|
|
10
10
|
Quaternion = 5,
|
|
11
11
|
Color = 6,
|
|
12
12
|
Array = 7,
|
|
13
|
-
Boolean = 8
|
|
13
|
+
Boolean = 8,
|
|
14
|
+
Rect = 9,
|
|
15
|
+
ReferResource = 10
|
|
14
16
|
}
|
|
15
17
|
export declare class AnimationClipDecoder {
|
|
16
18
|
static decode(engine: Engine, bufferReader: BufferReader): Promise<AnimationClip>;
|
|
@@ -1,14 +1,18 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Entity } from "@galacean/engine-core";
|
|
2
2
|
import type { IBasicType, IClassObject, IEntity } from "../schema";
|
|
3
|
+
import { SceneParserContext } from "../scene/SceneParserContext";
|
|
3
4
|
export declare class ReflectionParser {
|
|
5
|
+
private readonly _context;
|
|
4
6
|
static customParseComponentHandles: Map<string, Function>;
|
|
5
7
|
static registerCustomParseComponent(componentType: string, handle: Function): void;
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
constructor(_context: SceneParserContext);
|
|
9
|
+
parseEntity(entityConfig: IEntity): Promise<Entity>;
|
|
10
|
+
parseClassObject(item: IClassObject): Promise<any>;
|
|
11
|
+
parsePropsAndMethods(instance: any, item: Omit<IClassObject, "class">): Promise<any>;
|
|
12
|
+
parseMethod(instance: any, methodName: string, methodParams: Array<IBasicType>): Promise<any>;
|
|
13
|
+
parseBasicType(value: IBasicType): Promise<any>;
|
|
14
|
+
private _getEntityByConfig;
|
|
12
15
|
private static _isClass;
|
|
13
|
-
private static
|
|
16
|
+
private static _isAssetRef;
|
|
17
|
+
private static _isEntityRef;
|
|
14
18
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Component, Entity, Scene } from "@galacean/engine-core";
|
|
1
|
+
import { Component, Engine, Entity, ResourceManager, Scene } from "@galacean/engine-core";
|
|
2
2
|
import type { IEntity, IScene } from "../schema";
|
|
3
3
|
export declare class SceneParserContext {
|
|
4
4
|
readonly originalData: IScene;
|
|
@@ -8,6 +8,8 @@ export declare class SceneParserContext {
|
|
|
8
8
|
assets: Map<string, any>;
|
|
9
9
|
entityConfigMap: Map<string, IEntity>;
|
|
10
10
|
rootIds: string[];
|
|
11
|
+
readonly engine: Engine;
|
|
12
|
+
readonly resourceManager: ResourceManager;
|
|
11
13
|
constructor(originalData: IScene, scene: Scene);
|
|
12
14
|
destroy(): void;
|
|
13
15
|
}
|
|
@@ -23,21 +23,6 @@ export interface IPrefabFile {
|
|
|
23
23
|
entities: Array<IEntity>;
|
|
24
24
|
}
|
|
25
25
|
export type IMethodParams = Array<IBasicType>;
|
|
26
|
-
export type IClassObject = {
|
|
27
|
-
class: string;
|
|
28
|
-
constructParams?: IMethodParams;
|
|
29
|
-
methods?: {
|
|
30
|
-
[methodName: string]: Array<IMethodParams>;
|
|
31
|
-
};
|
|
32
|
-
props?: {
|
|
33
|
-
[key: string]: IBasicType | IMethodParams;
|
|
34
|
-
};
|
|
35
|
-
};
|
|
36
|
-
export type IBasicType = string | number | boolean | null | undefined | IAssetRef | IClassObject | IMethodParams;
|
|
37
|
-
export type IAssetRef = {
|
|
38
|
-
key?: string;
|
|
39
|
-
refId: string;
|
|
40
|
-
};
|
|
41
26
|
export interface IBasicEntity {
|
|
42
27
|
name?: string;
|
|
43
28
|
id?: string;
|
|
@@ -59,3 +44,21 @@ export type IComponent = {
|
|
|
59
44
|
id: string;
|
|
60
45
|
refId?: string;
|
|
61
46
|
} & IClassObject;
|
|
47
|
+
export type IClassObject = {
|
|
48
|
+
class: string;
|
|
49
|
+
constructParams?: IMethodParams;
|
|
50
|
+
methods?: {
|
|
51
|
+
[methodName: string]: Array<IMethodParams>;
|
|
52
|
+
};
|
|
53
|
+
props?: {
|
|
54
|
+
[key: string]: IBasicType | IMethodParams;
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
export type IBasicType = string | number | boolean | null | undefined | IAssetRef | IClassObject | IMethodParams | IEntityRef;
|
|
58
|
+
export type IAssetRef = {
|
|
59
|
+
key?: string;
|
|
60
|
+
refId: string;
|
|
61
|
+
};
|
|
62
|
+
export type IEntityRef = {
|
|
63
|
+
entityId: string;
|
|
64
|
+
};
|
|
@@ -1,15 +1,11 @@
|
|
|
1
1
|
export declare class BufferReader {
|
|
2
|
-
|
|
2
|
+
data: Uint8Array;
|
|
3
3
|
private _dataView;
|
|
4
4
|
private _littleEndian;
|
|
5
5
|
private _offset;
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
2: string;
|
|
10
|
-
3: string;
|
|
11
|
-
};
|
|
12
|
-
constructor(buffer: ArrayBuffer, byteOffset?: number, byteLength?: number, littleEndian?: boolean);
|
|
6
|
+
private _baseOffset;
|
|
7
|
+
constructor(data: Uint8Array, byteOffset?: number, byteLength?: number, littleEndian?: boolean);
|
|
8
|
+
get position(): number;
|
|
13
9
|
get offset(): number;
|
|
14
10
|
nextUint8(): number;
|
|
15
11
|
nextUint16(): number;
|
|
@@ -25,8 +21,8 @@ export declare class BufferReader {
|
|
|
25
21
|
/**
|
|
26
22
|
* image data 放在最后
|
|
27
23
|
*/
|
|
28
|
-
nextImageData(count?: number):
|
|
29
|
-
nextImagesData(count: number):
|
|
24
|
+
nextImageData(count?: number): Uint8Array;
|
|
25
|
+
nextImagesData(count: number): Uint8Array[];
|
|
30
26
|
skip(bytes: number): this;
|
|
31
27
|
scan(maxByteLength: number, term?: number): Uint8Array;
|
|
32
28
|
}
|