@galacean/engine-loader 2.0.0-alpha.49 → 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/dist/main.js +15 -14
- package/dist/main.js.map +1 -1
- package/dist/module.js +15 -14
- package/dist/module.js.map +1 -1
- package/package.json +4 -4
- package/types/GLTFContentRestorer.d.ts +13 -13
- package/types/gltf/GLTFUtils.d.ts +5 -5
- package/types/gltf/extensions/GLTFExtensionParser.d.ts +1 -1
- 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 +3 -3
- package/types/gltf/parser/GLTFValidator.d.ts +1 -1
- package/types/ktx2/KTX2Loader.d.ts +1 -1
- package/types/ktx2/WorkerPool.d.ts +1 -1
- package/types/resource-deserialize/resources/parser/ParserContext.d.ts +1 -1
- package/types/resource-deserialize/utils/BufferReader.d.ts +2 -2
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.50",
|
|
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-core": "2.0.0-alpha.
|
|
23
|
-
"@galacean/engine-rhi-webgl": "2.0.0-alpha.
|
|
24
|
-
"@galacean/engine-math": "2.0.0-alpha.
|
|
22
|
+
"@galacean/engine-core": "2.0.0-alpha.50",
|
|
23
|
+
"@galacean/engine-rhi-webgl": "2.0.0-alpha.50",
|
|
24
|
+
"@galacean/engine-math": "2.0.0-alpha.50"
|
|
25
25
|
},
|
|
26
26
|
"scripts": {
|
|
27
27
|
"b:types": "tsc"
|
|
@@ -53,21 +53,21 @@ export declare class BufferRestoreInfo {
|
|
|
53
53
|
*/
|
|
54
54
|
export declare class BufferDataRestoreInfo {
|
|
55
55
|
main: RestoreDataAccessor;
|
|
56
|
-
typeSize?: number;
|
|
57
|
-
sparseCount?: number;
|
|
58
|
-
sparseIndices?: RestoreDataAccessor;
|
|
59
|
-
sparseValues?: RestoreDataAccessor;
|
|
60
|
-
constructor(main: RestoreDataAccessor, typeSize?: number, sparseCount?: number, sparseIndices?: RestoreDataAccessor, sparseValues?: RestoreDataAccessor);
|
|
56
|
+
typeSize?: number | undefined;
|
|
57
|
+
sparseCount?: number | undefined;
|
|
58
|
+
sparseIndices?: RestoreDataAccessor | undefined;
|
|
59
|
+
sparseValues?: RestoreDataAccessor | undefined;
|
|
60
|
+
constructor(main: RestoreDataAccessor, typeSize?: number | undefined, sparseCount?: number | undefined, sparseIndices?: RestoreDataAccessor | undefined, sparseValues?: RestoreDataAccessor | undefined);
|
|
61
61
|
}
|
|
62
62
|
/**
|
|
63
63
|
* @internal
|
|
64
64
|
*/
|
|
65
65
|
export declare class RestoreDataAccessor {
|
|
66
|
-
bufferIndex: number;
|
|
66
|
+
bufferIndex: number | undefined;
|
|
67
67
|
TypedArray: Uint8ArrayConstructor | Int8ArrayConstructor | Int16ArrayConstructor | Uint16ArrayConstructor | Uint32ArrayConstructor | Float32ArrayConstructor;
|
|
68
|
-
byteOffset: number;
|
|
68
|
+
byteOffset: number | undefined;
|
|
69
69
|
length: number;
|
|
70
|
-
constructor(bufferIndex: number, TypedArray: Uint8ArrayConstructor | Int8ArrayConstructor | Int16ArrayConstructor | Uint16ArrayConstructor | Uint32ArrayConstructor | Float32ArrayConstructor, byteOffset: number, length: number);
|
|
70
|
+
constructor(bufferIndex: number | undefined, TypedArray: Uint8ArrayConstructor | Int8ArrayConstructor | Int16ArrayConstructor | Uint16ArrayConstructor | Uint32ArrayConstructor | Float32ArrayConstructor, byteOffset: number | undefined, length: number);
|
|
71
71
|
}
|
|
72
72
|
/**
|
|
73
73
|
* @internal
|
|
@@ -75,9 +75,9 @@ export declare class RestoreDataAccessor {
|
|
|
75
75
|
export declare class BlendShapeRestoreInfo {
|
|
76
76
|
blendShape: BlendShape;
|
|
77
77
|
position: BlendShapeDataRestoreInfo;
|
|
78
|
-
normal?: BlendShapeDataRestoreInfo;
|
|
79
|
-
tangent?: BlendShapeDataRestoreInfo;
|
|
80
|
-
constructor(blendShape: BlendShape, position: BlendShapeDataRestoreInfo, normal?: BlendShapeDataRestoreInfo, tangent?: BlendShapeDataRestoreInfo);
|
|
78
|
+
normal?: (BlendShapeDataRestoreInfo | null) | undefined;
|
|
79
|
+
tangent?: (BlendShapeDataRestoreInfo | null) | undefined;
|
|
80
|
+
constructor(blendShape: BlendShape, position: BlendShapeDataRestoreInfo, normal?: (BlendShapeDataRestoreInfo | null) | undefined, tangent?: (BlendShapeDataRestoreInfo | null) | undefined);
|
|
81
81
|
}
|
|
82
82
|
/**
|
|
83
83
|
* @internal
|
|
@@ -86,7 +86,7 @@ export declare class BlendShapeDataRestoreInfo {
|
|
|
86
86
|
buffer: BufferDataRestoreInfo;
|
|
87
87
|
byteOffset: number;
|
|
88
88
|
count: number;
|
|
89
|
-
normalized: boolean;
|
|
89
|
+
normalized: boolean | undefined;
|
|
90
90
|
componentType: AccessorComponentType;
|
|
91
|
-
constructor(buffer: BufferDataRestoreInfo, byteOffset: number, count: number, normalized: boolean, componentType: AccessorComponentType);
|
|
91
|
+
constructor(buffer: BufferDataRestoreInfo, byteOffset: number, count: number, normalized: boolean | undefined, componentType: AccessorComponentType);
|
|
92
92
|
}
|
|
@@ -19,15 +19,15 @@ export declare class GLTFUtils {
|
|
|
19
19
|
*/
|
|
20
20
|
static getComponentType(componentType: AccessorComponentType): Uint8ArrayConstructor | Float32ArrayConstructor | Uint32ArrayConstructor | Uint16ArrayConstructor | Int8ArrayConstructor | Int16ArrayConstructor;
|
|
21
21
|
static getNormalizedComponentScale(componentType: AccessorComponentType): number;
|
|
22
|
-
static getAccessorBuffer(context: GLTFParserContext, bufferViews: IBufferView[], accessor: IAccessor): AssetPromise<BufferInfo>;
|
|
23
|
-
static bufferToVector3Array(buffer: TypedArray, byteOffset: number, count: number, normalized: boolean, componentType: AccessorComponentType): Vector3[];
|
|
22
|
+
static getAccessorBuffer(context: GLTFParserContext, bufferViews: IBufferView[] | undefined, accessor: IAccessor): AssetPromise<BufferInfo>;
|
|
23
|
+
static bufferToVector3Array(buffer: TypedArray, byteOffset: number, count: number, normalized: boolean | undefined, componentType: AccessorComponentType): Vector3[];
|
|
24
24
|
static getBufferViewData(bufferView: IBufferView, buffers: ArrayBuffer[]): ArrayBuffer;
|
|
25
25
|
/**
|
|
26
26
|
* Get accessor data.
|
|
27
27
|
*/
|
|
28
28
|
static processingSparseData(context: GLTFParserContext, accessor: IAccessor, bufferInfo: BufferInfo): AssetPromise<void>;
|
|
29
|
-
static getIndexFormat(type: AccessorComponentType): IndexFormat;
|
|
30
|
-
static getElementFormat(type: AccessorComponentType, size: number, normalized?: boolean): VertexElementFormat;
|
|
29
|
+
static getIndexFormat(type: AccessorComponentType): IndexFormat | undefined;
|
|
30
|
+
static getElementFormat(type: AccessorComponentType, size: number, normalized?: boolean): VertexElementFormat | undefined;
|
|
31
31
|
/**
|
|
32
32
|
* Load image buffer
|
|
33
33
|
*/
|
|
@@ -39,7 +39,7 @@ export declare class GLTFUtils {
|
|
|
39
39
|
glTF?: IGLTF;
|
|
40
40
|
buffers?: ArrayBuffer[];
|
|
41
41
|
originBuffer?: ArrayBuffer;
|
|
42
|
-
};
|
|
42
|
+
} | null;
|
|
43
43
|
static parseSampler(texture: Texture2D, samplerInfo: ISamplerInfo): void;
|
|
44
44
|
static getSamplerInfo(sampler: ISampler): ISamplerInfo;
|
|
45
45
|
}
|
|
@@ -19,7 +19,7 @@ export declare abstract class GLTFExtensionParser {
|
|
|
19
19
|
* @param extensionOwnerSchema - The extension owner schema
|
|
20
20
|
* @returns The resource or promise
|
|
21
21
|
*/
|
|
22
|
-
createAndParse(context: GLTFParserContext, extensionSchema: GLTFExtensionSchema, extensionOwnerSchema: GLTFExtensionOwnerSchema, ...extra: any[]): EngineObject | AssetPromise<EngineObject | Uint8Array>;
|
|
22
|
+
createAndParse(context: GLTFParserContext, extensionSchema: GLTFExtensionSchema, extensionOwnerSchema: GLTFExtensionOwnerSchema, ...extra: any[]): EngineObject | AssetPromise<EngineObject | Uint8Array | null>;
|
|
23
23
|
/**
|
|
24
24
|
* Additive parse to the resource.
|
|
25
25
|
* @param context - The parser context
|
|
@@ -3,7 +3,7 @@ export declare let ready: Promise<{
|
|
|
3
3
|
useWorkers: (count?: number) => void;
|
|
4
4
|
decodeGltfBuffer: (count: any, stride: any, source: any, mode: any, filter: any) => Promise<Uint8Array>;
|
|
5
5
|
release: () => void;
|
|
6
|
-
}
|
|
6
|
+
}> | undefined;
|
|
7
7
|
export declare function getMeshoptDecoder(): Promise<{
|
|
8
8
|
workerCount: number;
|
|
9
9
|
useWorkers: (count?: number) => void;
|
|
@@ -2,6 +2,6 @@ import { AnimatorController, AssetPromise } from "@galacean/engine-core";
|
|
|
2
2
|
import { GLTFParser } from "./GLTFParser";
|
|
3
3
|
import { GLTFParserContext } from "./GLTFParserContext";
|
|
4
4
|
export declare class GLTFAnimatorControllerParser extends GLTFParser {
|
|
5
|
-
parse(context: GLTFParserContext): AssetPromise<AnimatorController>;
|
|
5
|
+
parse(context: GLTFParserContext): AssetPromise<AnimatorController | null>;
|
|
6
6
|
private _createAnimatorController;
|
|
7
7
|
}
|
|
@@ -17,7 +17,7 @@ export declare abstract class GLTFParser {
|
|
|
17
17
|
*/
|
|
18
18
|
static executeExtensionsCreateAndParse(extensions: {
|
|
19
19
|
[key: string]: any;
|
|
20
|
-
}, context: GLTFParserContext, ownerSchema: GLTFExtensionOwnerSchema, ...extra: any[]): EngineObject | void | AssetPromise<EngineObject | Uint8Array | void>;
|
|
20
|
+
} | undefined, context: GLTFParserContext, ownerSchema: GLTFExtensionOwnerSchema, ...extra: any[]): EngineObject | void | AssetPromise<EngineObject | Uint8Array | void>;
|
|
21
21
|
/**
|
|
22
22
|
* Execute all parses of extension to parse resource.
|
|
23
23
|
* @param extensions - Related extensions field
|
|
@@ -28,7 +28,7 @@ export declare abstract class GLTFParser {
|
|
|
28
28
|
*/
|
|
29
29
|
static executeExtensionsAdditiveAndParse(extensions: {
|
|
30
30
|
[key: string]: any;
|
|
31
|
-
}, context: GLTFParserContext, parseResource: EngineObject, ownerSchema: GLTFExtensionOwnerSchema, ...extra: any[]): void;
|
|
31
|
+
} | undefined, context: GLTFParserContext, parseResource: EngineObject, ownerSchema: GLTFExtensionOwnerSchema, ...extra: any[]): void;
|
|
32
32
|
/**
|
|
33
33
|
* Whether the plugin is registered.
|
|
34
34
|
* @param extensionName - Extension name
|
|
@@ -31,10 +31,10 @@ export declare class GLTFParserContext {
|
|
|
31
31
|
get<T>(type: GLTFParserType.Entity, index: number): Entity;
|
|
32
32
|
get<T>(type: GLTFParserType.Entity): Entity[];
|
|
33
33
|
get<T>(type: GLTFParserType.Schema): AssetPromise<T>;
|
|
34
|
-
get<T>(type: GLTFParserType.Validator): AssetPromise<T>;
|
|
35
|
-
get<T>(type: GLTFParserType.AnimatorController): AssetPromise<T>;
|
|
34
|
+
get<T>(type: GLTFParserType.Validator): AssetPromise<T | null>;
|
|
35
|
+
get<T>(type: GLTFParserType.AnimatorController): AssetPromise<T | null>;
|
|
36
36
|
get<T>(type: GLTFParserType, index: number): AssetPromise<T>;
|
|
37
|
-
get<T>(type: GLTFParserType): AssetPromise<T[]>;
|
|
37
|
+
get<T>(type: GLTFParserType): AssetPromise<T[] | null>;
|
|
38
38
|
parse(): AssetPromise<GLTFResource>;
|
|
39
39
|
/**
|
|
40
40
|
* @internal
|
|
@@ -2,5 +2,5 @@ import { AssetPromise } from "@galacean/engine-core";
|
|
|
2
2
|
import { GLTFParser } from "./GLTFParser";
|
|
3
3
|
import { GLTFParserContext } from "./GLTFParserContext";
|
|
4
4
|
export declare class GLTFValidator extends GLTFParser {
|
|
5
|
-
parse(context: GLTFParserContext): AssetPromise<
|
|
5
|
+
parse(context: GLTFParserContext): AssetPromise<null>;
|
|
6
6
|
}
|
|
@@ -25,7 +25,7 @@ export declare class KTX2Loader extends Loader<Texture2D | TextureCube> {
|
|
|
25
25
|
private static _detectSupportedFormat;
|
|
26
26
|
private static _getBinomialLLCTranscoder;
|
|
27
27
|
private static _getEngineTextureFormat;
|
|
28
|
-
initialize(_: Engine, configuration: EngineConfiguration): Promise<void
|
|
28
|
+
initialize(_: Engine, configuration: EngineConfiguration): Promise<void> | void;
|
|
29
29
|
/**
|
|
30
30
|
* @internal
|
|
31
31
|
*/
|
|
@@ -13,7 +13,7 @@ export declare class WorkerPool<T = any, U = any> {
|
|
|
13
13
|
* @param limitedCount - worker limit count
|
|
14
14
|
* @param _workerCreator - creator of worker
|
|
15
15
|
*/
|
|
16
|
-
constructor(limitedCount: number, _workerCreator: () => Worker | Promise<Worker>);
|
|
16
|
+
constructor(limitedCount: number | undefined, _workerCreator: () => Worker | Promise<Worker>);
|
|
17
17
|
prepareWorker(): Promise<Worker[]>;
|
|
18
18
|
/**
|
|
19
19
|
* Post message to worker.
|
|
@@ -21,7 +21,7 @@ export declare class ParserContext {
|
|
|
21
21
|
readonly resourceManager: ResourceManager;
|
|
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;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type { FileHeader } from "./FileHeader";
|
|
2
2
|
export declare class BufferReader {
|
|
3
3
|
data: Uint8Array;
|
|
4
|
-
readonly header?: Readonly<FileHeader
|
|
4
|
+
readonly header?: Readonly<FileHeader> | undefined;
|
|
5
5
|
private _dataView;
|
|
6
6
|
private _littleEndian;
|
|
7
7
|
private _position;
|
|
8
8
|
private _baseOffset;
|
|
9
|
-
constructor(data: Uint8Array, byteOffset?: number, byteLength?: number, littleEndian?: boolean, header?: Readonly<FileHeader>);
|
|
9
|
+
constructor(data: Uint8Array, byteOffset?: number, byteLength?: number, littleEndian?: boolean, header?: Readonly<FileHeader> | undefined);
|
|
10
10
|
get position(): number;
|
|
11
11
|
get offset(): number;
|
|
12
12
|
nextUint8(): number;
|