@galacean/engine-loader 0.9.19 → 0.9.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 +11 -5
- package/dist/main.js.map +1 -1
- package/dist/miniprogram.js +11 -5
- package/dist/module.js +11 -5
- package/dist/module.js.map +1 -1
- package/package.json +5 -5
- package/types/GLTFContentRestorer.d.ts +17 -7
- package/types/gltf/GLTFUtils.d.ts +2 -1
- package/types/gltf/parser/GLTFAnimationParser.d.ts +2 -2
- package/types/gltf/parser/GLTFMeshParser.d.ts +5 -5
- package/types/gltf/parser/GLTFParserContext.d.ts +6 -1
- package/types/gltf/parser/GLTFSceneParser.d.ts +2 -2
- package/types/gltf/parser/GLTFSkinParser.d.ts +2 -1
- package/types/gltf/parser/GLTFTextureParser.d.ts +3 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@galacean/engine-loader",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.20",
|
|
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.9.
|
|
19
|
-
"@galacean/engine-draco": "0.9.
|
|
20
|
-
"@galacean/engine-
|
|
21
|
-
"@galacean/engine-
|
|
18
|
+
"@galacean/engine-core": "0.9.20",
|
|
19
|
+
"@galacean/engine-draco": "0.9.20",
|
|
20
|
+
"@galacean/engine-rhi-webgl": "0.9.20",
|
|
21
|
+
"@galacean/engine-math": "0.9.20"
|
|
22
22
|
},
|
|
23
23
|
"scripts": {
|
|
24
24
|
"b:types": "tsc"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AssetPromise, BlendShape, Buffer, ContentRestorer, ModelMesh, Texture2D } from "@galacean/engine-core";
|
|
1
|
+
import { AssetPromise, BlendShape, Buffer, ContentRestorer, ModelMesh, Texture2D, TypedArray } from "@galacean/engine-core";
|
|
2
2
|
import { RequestConfig } from "@galacean/engine-core/types/asset/request";
|
|
3
3
|
import { Vector2 } from "@galacean/engine-math";
|
|
4
4
|
import { GLTFResource } from "./gltf/GLTFResource";
|
|
@@ -65,18 +65,28 @@ export declare class BufferDataRestoreInfo {
|
|
|
65
65
|
*/
|
|
66
66
|
export declare class RestoreDataAccessor {
|
|
67
67
|
bufferIndex: number;
|
|
68
|
-
TypedArray: new (buffer: ArrayBuffer, byteOffset: number, length?: number) =>
|
|
68
|
+
TypedArray: new (buffer: ArrayBuffer, byteOffset: number, length?: number) => TypedArray;
|
|
69
69
|
byteOffset: number;
|
|
70
70
|
length: number;
|
|
71
|
-
constructor(bufferIndex: number, TypedArray: new (buffer: ArrayBuffer, byteOffset: number, length?: number) =>
|
|
71
|
+
constructor(bufferIndex: number, TypedArray: new (buffer: ArrayBuffer, byteOffset: number, length?: number) => TypedArray, byteOffset: number, length: number);
|
|
72
72
|
}
|
|
73
73
|
/**
|
|
74
74
|
* @internal
|
|
75
75
|
*/
|
|
76
76
|
export declare class BlendShapeRestoreInfo {
|
|
77
77
|
blendShape: BlendShape;
|
|
78
|
-
position:
|
|
79
|
-
normal?:
|
|
80
|
-
tangent?:
|
|
81
|
-
constructor(blendShape: BlendShape, position:
|
|
78
|
+
position: BlendShapeDataRestoreInfo;
|
|
79
|
+
normal?: BlendShapeDataRestoreInfo;
|
|
80
|
+
tangent?: BlendShapeDataRestoreInfo;
|
|
81
|
+
constructor(blendShape: BlendShape, position: BlendShapeDataRestoreInfo, normal?: BlendShapeDataRestoreInfo, tangent?: BlendShapeDataRestoreInfo);
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* @internal
|
|
85
|
+
*/
|
|
86
|
+
export declare class BlendShapeDataRestoreInfo {
|
|
87
|
+
buffer: BufferDataRestoreInfo;
|
|
88
|
+
stride: number;
|
|
89
|
+
byteOffset: number;
|
|
90
|
+
count: number;
|
|
91
|
+
constructor(buffer: BufferDataRestoreInfo, stride: number, byteOffset: number, count: number);
|
|
82
92
|
}
|
|
@@ -19,7 +19,8 @@ export declare class GLTFUtils {
|
|
|
19
19
|
*/
|
|
20
20
|
static getComponentType(componentType: AccessorComponentType): Float32ArrayConstructor | Uint32ArrayConstructor | Uint8ArrayConstructor | Uint16ArrayConstructor | Int8ArrayConstructor | Int16ArrayConstructor;
|
|
21
21
|
static getNormalizedComponentScale(componentType: AccessorComponentType): number;
|
|
22
|
-
static getAccessorBuffer(context: GLTFParserContext, bufferViews: IBufferView[], accessor: IAccessor): BufferInfo
|
|
22
|
+
static getAccessorBuffer(context: GLTFParserContext, bufferViews: IBufferView[], accessor: IAccessor): Promise<BufferInfo>;
|
|
23
|
+
static bufferToVector3Array(data: TypedArray, byteStride: number, accessorByteOffset: number, count: number): Vector3[];
|
|
23
24
|
/**
|
|
24
25
|
* @deprecated
|
|
25
26
|
* Get accessor data.
|
|
@@ -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): void
|
|
9
|
+
static _parseStandardProperty(context: GLTFParserContext, animationClip: AnimationClip, animationInfo: IAnimation): Promise<void>;
|
|
10
10
|
private static _addCurve;
|
|
11
|
-
parse(context: GLTFParserContext): AssetPromise<AnimationClip[]
|
|
11
|
+
parse(context: GLTFParserContext): AssetPromise<AnimationClip[]> | void;
|
|
12
12
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AssetPromise, ModelMesh, TypedArray } from "@galacean/engine-core";
|
|
2
2
|
import { ModelMeshRestoreInfo } from "../../GLTFContentRestorer";
|
|
3
|
-
import type { IGLTF, IMesh, IMeshPrimitive } from "../GLTFSchema";
|
|
3
|
+
import type { IAccessor, IGLTF, IMesh, IMeshPrimitive } from "../GLTFSchema";
|
|
4
4
|
import { GLTFParser } from "./GLTFParser";
|
|
5
5
|
import { BufferInfo, GLTFParserContext } from "./GLTFParserContext";
|
|
6
6
|
export declare class GLTFMeshParser extends GLTFParser {
|
|
@@ -8,12 +8,12 @@ export declare class GLTFMeshParser extends GLTFParser {
|
|
|
8
8
|
/**
|
|
9
9
|
* @internal
|
|
10
10
|
*/
|
|
11
|
-
static _parseMeshFromGLTFPrimitive(context: GLTFParserContext, mesh: ModelMesh, meshRestoreInfo: ModelMeshRestoreInfo, gltfMesh: IMesh, gltfPrimitive: IMeshPrimitive, gltf: IGLTF, getVertexBufferData: (semantic: string) => TypedArray, getBlendShapeData: (semantic: string, shapeIndex: number) => BufferInfo
|
|
11
|
+
static _parseMeshFromGLTFPrimitive(context: GLTFParserContext, mesh: ModelMesh, meshRestoreInfo: ModelMeshRestoreInfo, gltfMesh: IMesh, gltfPrimitive: IMeshPrimitive, gltf: IGLTF, getVertexBufferData: (semantic: string) => TypedArray, getBlendShapeData: (semantic: string, shapeIndex: number) => Promise<BufferInfo>, getIndexBufferData: () => Promise<TypedArray>, keepMeshData: boolean): Promise<ModelMesh>;
|
|
12
12
|
/**
|
|
13
13
|
* @internal
|
|
14
14
|
*/
|
|
15
|
-
static _createBlendShape(mesh: ModelMesh, meshRestoreInfo: ModelMeshRestoreInfo, glTFMesh: IMesh, glTFTargets: {
|
|
15
|
+
static _createBlendShape(mesh: ModelMesh, meshRestoreInfo: ModelMeshRestoreInfo, glTFMesh: IMesh, accessors: IAccessor[], glTFTargets: {
|
|
16
16
|
[name: string]: number;
|
|
17
|
-
}[], getBlendShapeData: (semantic: string, shapeIndex: number) => BufferInfo): void
|
|
18
|
-
parse(context: GLTFParserContext): AssetPromise<ModelMesh[][]
|
|
17
|
+
}[], getBlendShapeData: (semantic: string, shapeIndex: number) => Promise<BufferInfo>): Promise<void[]>;
|
|
18
|
+
parse(context: GLTFParserContext): AssetPromise<ModelMesh[][]> | void;
|
|
19
19
|
}
|
|
@@ -7,7 +7,6 @@ import type { IGLTF } from "../GLTFSchema";
|
|
|
7
7
|
*/
|
|
8
8
|
export declare class GLTFParserContext {
|
|
9
9
|
glTF: IGLTF;
|
|
10
|
-
buffers: ArrayBuffer[];
|
|
11
10
|
glTFResource: GLTFResource;
|
|
12
11
|
keepMeshData: boolean;
|
|
13
12
|
hasSkinned: boolean;
|
|
@@ -21,7 +20,13 @@ export declare class GLTFParserContext {
|
|
|
21
20
|
masterPromiseInfo: PromiseInfo<GLTFResource>;
|
|
22
21
|
promiseMap: Record<string, AssetPromise<any>>;
|
|
23
22
|
contentRestorer: GLTFContentRestorer;
|
|
23
|
+
/** @internal */
|
|
24
|
+
_buffers: ArrayBuffer[] | Promise<ArrayBuffer[]>;
|
|
24
25
|
constructor(url: string);
|
|
26
|
+
/**
|
|
27
|
+
* Get all the buffer data.
|
|
28
|
+
*/
|
|
29
|
+
getBuffers(): Promise<ArrayBuffer[]>;
|
|
25
30
|
private _initPromiseInfo;
|
|
26
31
|
}
|
|
27
32
|
/**
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { Entity } from "@galacean/engine-core";
|
|
1
|
+
import { AssetPromise, 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
5
|
private static _defaultMaterial;
|
|
6
6
|
private static _getDefaultMaterial;
|
|
7
|
-
parse(context: GLTFParserContext):
|
|
7
|
+
parse(context: GLTFParserContext): AssetPromise<Entity> | void;
|
|
8
8
|
private _createCamera;
|
|
9
9
|
private _createRenderer;
|
|
10
10
|
private _createAnimator;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { AssetPromise } from "@galacean/engine-core";
|
|
1
2
|
import { GLTFParserContext } from ".";
|
|
2
3
|
import { GLTFParser } from "./GLTFParser";
|
|
3
4
|
export declare class GLTFSkinParser extends GLTFParser {
|
|
4
|
-
parse(context: GLTFParserContext): void
|
|
5
|
+
parse(context: GLTFParserContext): AssetPromise<void>;
|
|
5
6
|
private _findSkeletonRootBone;
|
|
6
7
|
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { AssetPromise, Texture2D } from "@galacean/engine-core";
|
|
2
|
-
import { GLTFParser } from "./GLTFParser";
|
|
3
2
|
import { GLTFParserContext } from ".";
|
|
3
|
+
import { GLTFParser } from "./GLTFParser";
|
|
4
4
|
export declare class GLTFTextureParser extends GLTFParser {
|
|
5
5
|
private static _wrapMap;
|
|
6
|
-
parse(context: GLTFParserContext): AssetPromise<Texture2D[]
|
|
6
|
+
parse(context: GLTFParserContext): AssetPromise<Texture2D[]> | void;
|
|
7
|
+
private _getSamplerInfo;
|
|
7
8
|
private _parseSampler;
|
|
8
9
|
}
|