@galacean/engine-loader 2.0.0-alpha.2 → 2.0.0-alpha.6
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 +541 -516
- package/dist/main.js.map +1 -1
- package/dist/module.js +543 -518
- package/dist/module.js.map +1 -1
- package/package.json +4 -4
- package/types/HDRDecoder.d.ts +23 -0
- package/types/gltf/extensions/GLTFExtensionSchema.d.ts +1 -1
- package/types/index.d.ts +1 -1
- 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/schema/BasicSchema.d.ts +3 -3
- package/types/resource-deserialize/resources/texture2D/TextureDecoder.d.ts +4 -0
- package/types/resource-deserialize/utils/FileHeader.d.ts +5 -0
- package/types/HDRLoader.d.ts +0 -1
- 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/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.6",
|
|
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.6",
|
|
23
|
+
"@galacean/engine-rhi-webgl": "2.0.0-alpha.6",
|
|
24
|
+
"@galacean/engine-math": "2.0.0-alpha.6"
|
|
25
25
|
},
|
|
26
26
|
"scripts": {
|
|
27
27
|
"b:types": "tsc"
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @internal
|
|
3
|
+
* HDR panorama to cubemap decoder.
|
|
4
|
+
*/
|
|
5
|
+
export declare class HDRDecoder {
|
|
6
|
+
private static _float2HalfTables;
|
|
7
|
+
private static _floatView;
|
|
8
|
+
private static _uint32View;
|
|
9
|
+
private static _one;
|
|
10
|
+
private static _faces;
|
|
11
|
+
static parseHeader(uint8array: Uint8Array): IHDRHeader;
|
|
12
|
+
static decodeFaces(bufferArray: Uint8Array, header: IHDRHeader, onFace: (faceIndex: number, data: Uint16Array) => void): void;
|
|
13
|
+
private static _generateFloat2HalfTables;
|
|
14
|
+
private static _createCubemapData;
|
|
15
|
+
private static _readStringLine;
|
|
16
|
+
private static _readPixels;
|
|
17
|
+
}
|
|
18
|
+
interface IHDRHeader {
|
|
19
|
+
width: number;
|
|
20
|
+
height: number;
|
|
21
|
+
dataPosition: number;
|
|
22
|
+
}
|
|
23
|
+
export {};
|
package/types/index.d.ts
CHANGED
|
@@ -5,7 +5,6 @@ import "./EnvLoader";
|
|
|
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";
|
|
@@ -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
|
}
|
|
@@ -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;
|
|
@@ -86,7 +86,7 @@ export type IClassType = {
|
|
|
86
86
|
export type IBasicType = string | number | boolean | null | undefined | IAssetRef | IClass | IClassType | IMethodParams | IEntityRef;
|
|
87
87
|
export type IAssetRef = {
|
|
88
88
|
key?: string;
|
|
89
|
-
|
|
89
|
+
url: string;
|
|
90
90
|
};
|
|
91
91
|
export type IEntityRef = {
|
|
92
92
|
entityId: string;
|
|
@@ -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
|
}
|
package/types/HDRLoader.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -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
|
-
}
|