@galacean/engine-loader 1.0.0-beta.0 → 1.0.0-beta.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 +16 -48
- package/dist/main.js.map +1 -1
- package/dist/miniprogram.js +16 -48
- package/dist/module.js +16 -48
- package/dist/module.js.map +1 -1
- package/package.json +5 -5
- package/types/GLTFContentRestorer.d.ts +0 -3
- package/types/GLTFLoader.d.ts +0 -3
- package/types/Texture2DContentRestorer.d.ts +0 -3
- package/types/TextureCubeContentRestorer.d.ts +0 -3
- package/types/gltf/GLTFParser.d.ts +9 -0
- package/types/gltf/GLTFResource.d.ts +0 -3
- 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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@galacean/engine-loader",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.1",
|
|
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-
|
|
19
|
-
"@galacean/engine-
|
|
20
|
-
"@galacean/engine-
|
|
21
|
-
"@galacean/engine-
|
|
18
|
+
"@galacean/engine-draco": "1.0.0-beta.1",
|
|
19
|
+
"@galacean/engine-math": "1.0.0-beta.1",
|
|
20
|
+
"@galacean/engine-rhi-webgl": "1.0.0-beta.1",
|
|
21
|
+
"@galacean/engine-core": "1.0.0-beta.1"
|
|
22
22
|
},
|
|
23
23
|
"scripts": {
|
|
24
24
|
"b:types": "tsc"
|
|
@@ -12,9 +12,6 @@ export declare class GLTFContentRestorer extends ContentRestorer<GLTFResource> {
|
|
|
12
12
|
glbBufferSlices: Vector2[];
|
|
13
13
|
bufferTextures: BufferTextureRestoreInfo[];
|
|
14
14
|
meshes: ModelMeshRestoreInfo[];
|
|
15
|
-
/**
|
|
16
|
-
* @override
|
|
17
|
-
*/
|
|
18
15
|
restoreContent(): AssetPromise<GLTFResource>;
|
|
19
16
|
private _getBufferData;
|
|
20
17
|
}
|
package/types/GLTFLoader.d.ts
CHANGED
|
@@ -2,9 +2,6 @@ import { AssetPromise, Loader, LoadItem, ResourceManager } from "@galacean/engin
|
|
|
2
2
|
import { GLTFPipeline } from "./gltf/GLTFPipeline";
|
|
3
3
|
import { GLTFResource } from "./gltf/GLTFResource";
|
|
4
4
|
export declare class GLTFLoader extends Loader<GLTFResource> {
|
|
5
|
-
/**
|
|
6
|
-
* @override
|
|
7
|
-
*/
|
|
8
5
|
load(item: LoadItem, resourceManager: ResourceManager): Record<string, AssetPromise<any>>;
|
|
9
6
|
}
|
|
10
7
|
/**
|
|
@@ -7,8 +7,5 @@ export declare class Texture2DContentRestorer extends ContentRestorer<Texture2D>
|
|
|
7
7
|
url: string;
|
|
8
8
|
requestConfig: RequestConfig;
|
|
9
9
|
constructor(resource: Texture2D, url: string, requestConfig: RequestConfig);
|
|
10
|
-
/**
|
|
11
|
-
* @override
|
|
12
|
-
*/
|
|
13
10
|
restoreContent(): AssetPromise<Texture2D>;
|
|
14
11
|
}
|
|
@@ -7,8 +7,5 @@ export declare class TextureCubeContentRestorer extends ContentRestorer<TextureC
|
|
|
7
7
|
urls: string[];
|
|
8
8
|
requestConfig: RequestConfig;
|
|
9
9
|
constructor(resource: TextureCube, urls: string[], requestConfig: RequestConfig);
|
|
10
|
-
/**
|
|
11
|
-
* @override
|
|
12
|
-
*/
|
|
13
10
|
restoreContent(): AssetPromise<TextureCube>;
|
|
14
11
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { AssetPromise } from "@galacean/engine-core";
|
|
2
|
+
import { GLTFResource } from "./GLTFResource";
|
|
3
|
+
import { ParserContext } from "./parser/ParserContext";
|
|
4
|
+
export declare class GLTFParser {
|
|
5
|
+
static defaultPipeline: GLTFParser;
|
|
6
|
+
private _pipes;
|
|
7
|
+
private constructor();
|
|
8
|
+
parse(context: ParserContext): AssetPromise<GLTFResource>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { IndexFormat, TypedArray, VertexElementFormat } from "@galacean/engine-core";
|
|
2
|
+
import { Color, Vector2, Vector3, Vector4 } from "@galacean/engine-math";
|
|
3
|
+
import { BufferInfo, ParserContext } from "./parser/ParserContext";
|
|
4
|
+
import { AccessorComponentType, AccessorType, IAccessor, IBufferView, IGLTF } from "./Schema";
|
|
5
|
+
/**
|
|
6
|
+
* @internal
|
|
7
|
+
*/
|
|
8
|
+
export declare class GLTFUtil {
|
|
9
|
+
static floatBufferToVector2Array(buffer: Float32Array): Vector2[];
|
|
10
|
+
static floatBufferToVector3Array(buffer: Float32Array): Vector3[];
|
|
11
|
+
static floatBufferToVector4Array(buffer: Float32Array): Vector4[];
|
|
12
|
+
static floatBufferToColorArray(buffer: Float32Array, isColor3: boolean): Color[];
|
|
13
|
+
/**
|
|
14
|
+
* Parse binary text for glb loader.
|
|
15
|
+
*/
|
|
16
|
+
static decodeText(array: Uint8Array): string;
|
|
17
|
+
/**
|
|
18
|
+
* Get the number of bytes occupied by accessor type.
|
|
19
|
+
*/
|
|
20
|
+
static getAccessorTypeSize(accessorType: AccessorType): number;
|
|
21
|
+
/**
|
|
22
|
+
* Get the TypedArray corresponding to the component type.
|
|
23
|
+
*/
|
|
24
|
+
static getComponentType(componentType: AccessorComponentType): Uint8ArrayConstructor | Float32ArrayConstructor | Uint16ArrayConstructor | Int8ArrayConstructor | Int16ArrayConstructor | Uint32ArrayConstructor;
|
|
25
|
+
static getNormalizedComponentScale(componentType: AccessorComponentType): number;
|
|
26
|
+
static getAccessorBuffer(context: ParserContext, gltf: IGLTF, accessor: IAccessor): BufferInfo;
|
|
27
|
+
/**
|
|
28
|
+
* @deprecated
|
|
29
|
+
* Get accessor data.
|
|
30
|
+
*/
|
|
31
|
+
static getAccessorData(gltf: IGLTF, accessor: IAccessor, buffers: ArrayBuffer[]): TypedArray;
|
|
32
|
+
static getBufferViewData(bufferView: IBufferView, buffers: ArrayBuffer[]): ArrayBuffer;
|
|
33
|
+
/**
|
|
34
|
+
* Get accessor data.
|
|
35
|
+
*/
|
|
36
|
+
static processingSparseData(gltf: IGLTF, accessor: IAccessor, buffers: ArrayBuffer[], originData: TypedArray): TypedArray;
|
|
37
|
+
static getIndexFormat(type: AccessorComponentType): IndexFormat;
|
|
38
|
+
static getElementFormat(type: AccessorComponentType, size: number, normalized?: boolean): VertexElementFormat;
|
|
39
|
+
/**
|
|
40
|
+
* Load image buffer
|
|
41
|
+
*/
|
|
42
|
+
static loadImageBuffer(imageBuffer: ArrayBuffer, type: string): Promise<HTMLImageElement>;
|
|
43
|
+
static isAbsoluteUrl(url: string): boolean;
|
|
44
|
+
static parseRelativeUrl(baseUrl: string, relativeUrl: string): string;
|
|
45
|
+
/**
|
|
46
|
+
* Parse the glb format.
|
|
47
|
+
*/
|
|
48
|
+
static parseGLB(glb: ArrayBuffer): {
|
|
49
|
+
gltf: IGLTF;
|
|
50
|
+
buffers: ArrayBuffer[];
|
|
51
|
+
};
|
|
52
|
+
private static _formatRelativePath;
|
|
53
|
+
}
|