@galacean/engine-loader 2.0.0-alpha.2 → 2.0.0-alpha.20
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 +2455 -2403
- package/dist/main.js.map +1 -1
- package/dist/module.js +2457 -2406
- package/dist/module.js.map +1 -1
- package/package.json +4 -4
- package/types/HDRDecoder.d.ts +22 -0
- package/types/gltf/extensions/GLTFExtensionSchema.d.ts +1 -1
- package/types/index.d.ts +4 -2
- package/types/ktx2/KTX2Container.d.ts +1 -0
- package/types/resource-deserialize/index.d.ts +0 -1
- package/types/resource-deserialize/resources/parser/ParserContext.d.ts +1 -1
- package/types/resource-deserialize/resources/parser/ReflectionParser.d.ts +5 -4
- package/types/resource-deserialize/resources/schema/BasicSchema.d.ts +15 -7
- package/types/resource-deserialize/resources/texture2D/TextureDecoder.d.ts +4 -0
- package/types/resource-deserialize/utils/FileHeader.d.ts +5 -0
- 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/{EnvLoader.d.ts → AmbientLightLoader.d.ts} +0 -0
- /package/types/{HDRLoader.d.ts → RenderTargetLoader.d.ts} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@galacean/engine-loader",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.20",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"registry": "https://registry.npmjs.org"
|
|
@@ -19,9 +19,9 @@
|
|
|
19
19
|
"libs/**/*"
|
|
20
20
|
],
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@galacean/engine-
|
|
23
|
-
"@galacean/engine-
|
|
24
|
-
"@galacean/engine-math": "2.0.0-alpha.
|
|
22
|
+
"@galacean/engine-core": "2.0.0-alpha.20",
|
|
23
|
+
"@galacean/engine-rhi-webgl": "2.0.0-alpha.20",
|
|
24
|
+
"@galacean/engine-math": "2.0.0-alpha.20"
|
|
25
25
|
},
|
|
26
26
|
"scripts": {
|
|
27
27
|
"b:types": "tsc"
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* HDR panorama to cubemap decoder.
|
|
3
|
+
*/
|
|
4
|
+
export declare class HDRDecoder {
|
|
5
|
+
private static _float2HalfTables;
|
|
6
|
+
private static _floatView;
|
|
7
|
+
private static _uint32View;
|
|
8
|
+
private static _one;
|
|
9
|
+
private static _faces;
|
|
10
|
+
static parseHeader(uint8array: Uint8Array): IHDRHeader;
|
|
11
|
+
static decodeFaces(bufferArray: Uint8Array, header: IHDRHeader, onFace: (faceIndex: number, data: Uint16Array) => void): void;
|
|
12
|
+
private static _generateFloat2HalfTables;
|
|
13
|
+
private static _createCubemapData;
|
|
14
|
+
private static _readStringLine;
|
|
15
|
+
private static _readPixels;
|
|
16
|
+
}
|
|
17
|
+
interface IHDRHeader {
|
|
18
|
+
width: number;
|
|
19
|
+
height: number;
|
|
20
|
+
dataPosition: number;
|
|
21
|
+
}
|
|
22
|
+
export {};
|
package/types/index.d.ts
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import "./AnimationClipLoader";
|
|
2
2
|
import "./AnimatorControllerLoader";
|
|
3
3
|
import "./BufferLoader";
|
|
4
|
-
import "./
|
|
4
|
+
import "./AmbientLightLoader";
|
|
5
5
|
import "./FontLoader";
|
|
6
6
|
import "./GLTFLoader";
|
|
7
7
|
import "./PrefabLoader";
|
|
8
|
-
import "./HDRLoader";
|
|
9
8
|
import "./JSONLoader";
|
|
10
9
|
import "./KTXCubeLoader";
|
|
11
10
|
import "./KTXLoader";
|
|
@@ -16,6 +15,7 @@ import "./ProjectLoader";
|
|
|
16
15
|
import "./SourceFontLoader";
|
|
17
16
|
import "./SpriteAtlasLoader";
|
|
18
17
|
import "./SpriteLoader";
|
|
18
|
+
import "./TextLoader";
|
|
19
19
|
import "./Texture2DLoader";
|
|
20
20
|
import "./TextureCubeLoader";
|
|
21
21
|
import "./AudioLoader";
|
|
@@ -23,6 +23,7 @@ import "./ktx2/KTX2Loader";
|
|
|
23
23
|
import "./ShaderLoader";
|
|
24
24
|
import "./ShaderChunkLoader";
|
|
25
25
|
import "./PhysicsMaterialLoader";
|
|
26
|
+
import "./RenderTargetLoader";
|
|
26
27
|
export { GLTFLoader } from "./GLTFLoader";
|
|
27
28
|
export type { GLTFParams } from "./GLTFLoader";
|
|
28
29
|
export * from "./SceneLoader";
|
|
@@ -33,3 +34,4 @@ export { KTX2Loader } from "./ktx2/KTX2Loader";
|
|
|
33
34
|
export { KTX2TargetFormat } from "./ktx2/KTX2TargetFormat";
|
|
34
35
|
export * from "./resource-deserialize";
|
|
35
36
|
export * from "./prefab/PrefabResource";
|
|
37
|
+
export { HDRDecoder } from "./HDRDecoder";
|
|
@@ -13,7 +13,6 @@ export { Texture2DDecoder } from "./resources/texture2D/TextureDecoder";
|
|
|
13
13
|
export declare function decode<T>(arrayBuffer: ArrayBuffer, engine: Engine, ...args: any[]): AssetPromise<T>;
|
|
14
14
|
export * from "./resources/parser/HierarchyParser";
|
|
15
15
|
export * from "./resources/parser/ParserContext";
|
|
16
|
-
export * from "./resources/scene/EditorTextureLoader";
|
|
17
16
|
export * from "./resources/scene/SceneParser";
|
|
18
17
|
export * from "./resources/schema";
|
|
19
18
|
export * from "./utils/BufferReader";
|
|
@@ -26,5 +26,5 @@ export declare class ParserContext<T extends IHierarchyFile, I extends EngineObj
|
|
|
26
26
|
/** @internal */
|
|
27
27
|
_setTaskCompleteProgress: (loaded: number, total: number) => void;
|
|
28
28
|
/** @internal */
|
|
29
|
-
_addDependentAsset(
|
|
29
|
+
_addDependentAsset(url: string, promise: AssetPromise<any>): void;
|
|
30
30
|
}
|
|
@@ -1,21 +1,22 @@
|
|
|
1
|
-
import { EngineObject, Entity } from "@galacean/engine-core";
|
|
2
|
-
import type { IBasicType, IClass, IEntity, IHierarchyFile, IMethodParams } from "../schema";
|
|
1
|
+
import { EngineObject, Entity, Signal } from "@galacean/engine-core";
|
|
2
|
+
import type { IBasicType, IClass, IEntity, IHierarchyFile, IMethodParams, ISignalRef } from "../schema";
|
|
3
3
|
import { ParserContext } from "./ParserContext";
|
|
4
4
|
export declare class ReflectionParser {
|
|
5
5
|
private readonly _context;
|
|
6
|
-
static customParseComponentHandles: Map<string, Function>;
|
|
7
|
-
static registerCustomParseComponent(componentType: string, handle: Function): void;
|
|
8
6
|
constructor(_context: ParserContext<IHierarchyFile, EngineObject>);
|
|
9
7
|
parseEntity(entityConfig: IEntity): Promise<Entity>;
|
|
10
8
|
parseClassObject(item: IClass): Promise<any>;
|
|
11
9
|
parsePropsAndMethods(instance: any, item: Omit<IClass, "class">): Promise<any>;
|
|
12
10
|
parseMethod(instance: any, methodName: string, methodParams: IMethodParams): Promise<any>;
|
|
11
|
+
parseSignal(signalRef: ISignalRef): Promise<Signal>;
|
|
13
12
|
parseBasicType(value: IBasicType, originValue?: any): Promise<any>;
|
|
14
13
|
private _getEntityByConfig;
|
|
14
|
+
private _resolveEntityByPath;
|
|
15
15
|
private static _isClass;
|
|
16
16
|
private static _isClassType;
|
|
17
17
|
private static _isAssetRef;
|
|
18
18
|
private static _isEntityRef;
|
|
19
19
|
private static _isComponentRef;
|
|
20
|
+
private static _isSignalRef;
|
|
20
21
|
private static _isMethodObject;
|
|
21
22
|
}
|
|
@@ -43,7 +43,7 @@ export interface IBasicEntity {
|
|
|
43
43
|
}
|
|
44
44
|
export type IEntity = IBasicEntity | IRefEntity | IStrippedEntity;
|
|
45
45
|
export interface IRefEntity extends IBasicEntity {
|
|
46
|
-
|
|
46
|
+
assetUrl: string;
|
|
47
47
|
key?: string;
|
|
48
48
|
isClone?: boolean;
|
|
49
49
|
modifications: (IInstance & {
|
|
@@ -66,7 +66,7 @@ export interface IStrippedEntity extends IBasicEntity {
|
|
|
66
66
|
}
|
|
67
67
|
export type IComponent = {
|
|
68
68
|
id: string;
|
|
69
|
-
|
|
69
|
+
url?: string;
|
|
70
70
|
} & IClass;
|
|
71
71
|
export type IClass = {
|
|
72
72
|
class: string;
|
|
@@ -83,15 +83,23 @@ export interface IInstance {
|
|
|
83
83
|
export type IClassType = {
|
|
84
84
|
classType: string;
|
|
85
85
|
};
|
|
86
|
-
export type IBasicType = string | number | boolean | null | undefined | IAssetRef | IClass | IClassType | IMethodParams | IEntityRef;
|
|
86
|
+
export type IBasicType = string | number | boolean | null | undefined | IAssetRef | IClass | IClassType | IMethodParams | IEntityRef | IComponentRef | ISignalRef;
|
|
87
87
|
export type IAssetRef = {
|
|
88
88
|
key?: string;
|
|
89
|
-
|
|
89
|
+
url: string;
|
|
90
90
|
};
|
|
91
91
|
export type IEntityRef = {
|
|
92
|
-
|
|
92
|
+
entityPath: number[];
|
|
93
93
|
};
|
|
94
94
|
export type IComponentRef = {
|
|
95
|
-
|
|
96
|
-
|
|
95
|
+
entityPath: number[];
|
|
96
|
+
componentType: string;
|
|
97
|
+
componentIndex: number;
|
|
98
|
+
};
|
|
99
|
+
export type ISignalRef = {
|
|
100
|
+
listeners: Array<{
|
|
101
|
+
target: IComponentRef;
|
|
102
|
+
methodName: string;
|
|
103
|
+
arguments?: Array<IBasicType>;
|
|
104
|
+
}>;
|
|
97
105
|
};
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { AssetPromise, Engine, Texture2D } from "@galacean/engine-core";
|
|
2
2
|
import { BufferReader } from "../../utils/BufferReader";
|
|
3
|
+
/**
|
|
4
|
+
* Data format: [url] [mipmap(1B)] [filterMode(1B)] [anisoLevel(1B)] [wrapModeU(1B)] [wrapModeV(1B)]
|
|
5
|
+
* [format(1B)] [width(2B)] [height(2B)] [isPixelBuffer(1B)] [isSRGBColorSpace(1B)] [mipCount(1B)] [imageData...]
|
|
6
|
+
*/
|
|
3
7
|
export declare class Texture2DDecoder {
|
|
4
8
|
static decode(engine: Engine, bufferReader: BufferReader, restoredTexture?: Texture2D): AssetPromise<Texture2D>;
|
|
5
9
|
}
|
|
@@ -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
|
}
|
|
@@ -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
|
-
}
|
|
File without changes
|
|
File without changes
|