@galacean/engine-loader 0.9.0-beta.80 → 1.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 +1423 -1003
- package/dist/main.js.map +1 -1
- package/dist/miniprogram.js +1457 -1037
- package/dist/module.js +1410 -1005
- package/dist/module.js.map +1 -1
- package/package.json +5 -5
- package/types/AnimationClipLoader.d.ts +1 -0
- package/types/GLTFContentRestorer.d.ts +3 -3
- package/types/GLTFLoader.d.ts +6 -0
- package/types/Texture2DContentRestorer.d.ts +2 -2
- package/types/TextureCubeContentRestorer.d.ts +2 -2
- package/types/gltf/GLTFPipeline.d.ts +1 -1
- package/types/gltf/GLTFResource.d.ts +7 -11
- package/types/gltf/GLTFSchema.d.ts +1 -1
- package/types/gltf/GLTFUtil.d.ts +8 -8
- package/types/gltf/extensions/GLTFExtensionParser.d.ts +1 -1
- package/types/gltf/extensions/GLTFExtensionSchema.d.ts +1 -1
- package/types/gltf/extensions/KHR_materials_variants.d.ts +6 -1
- package/types/gltf/extensions/index.d.ts +5 -2
- package/types/gltf/parser/GLTFAnimationParser.d.ts +1 -1
- package/types/gltf/parser/GLTFBufferParser.d.ts +1 -1
- package/types/gltf/parser/GLTFMaterialParser.d.ts +1 -1
- package/types/gltf/parser/GLTFMeshParser.d.ts +1 -1
- package/types/gltf/parser/GLTFParser.d.ts +1 -1
- package/types/gltf/parser/GLTFParserContext.d.ts +1 -1
- package/types/gltf/parser/GLTFSceneParser.d.ts +2 -2
- package/types/gltf/parser/GLTFTextureParser.d.ts +1 -1
- package/types/gltf/parser/GLTFValidator.d.ts +1 -1
- package/types/index.d.ts +2 -2
- package/types/resource-deserialize/resources/prefab/PrefabDesign.d.ts +4 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@galacean/engine-loader",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0-alpha.6",
|
|
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-math": "0.
|
|
20
|
-
"@galacean/engine-rhi-webgl": "0.
|
|
21
|
-
"@galacean/engine-
|
|
18
|
+
"@galacean/engine-core": "1.0.0-alpha.6",
|
|
19
|
+
"@galacean/engine-math": "1.0.0-alpha.6",
|
|
20
|
+
"@galacean/engine-rhi-webgl": "1.0.0-alpha.6",
|
|
21
|
+
"@galacean/engine-draco": "1.0.0-alpha.6"
|
|
22
22
|
},
|
|
23
23
|
"scripts": {
|
|
24
24
|
"b:types": "tsc"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { AssetPromise, BlendShape, Buffer, ContentRestorer, ModelMesh, Texture2D } from "@
|
|
2
|
-
import { RequestConfig } from "@
|
|
3
|
-
import { Vector2 } from "@
|
|
1
|
+
import { AssetPromise, BlendShape, Buffer, ContentRestorer, ModelMesh, Texture2D } from "@galacean/engine-core";
|
|
2
|
+
import { RequestConfig } from "@galacean/engine-core/types/asset/request";
|
|
3
|
+
import { Vector2 } from "@galacean/engine-math";
|
|
4
4
|
import { GLTFResource } from "./gltf/GLTFResource";
|
|
5
5
|
import { IBufferView } from "./gltf/GLTFSchema";
|
|
6
6
|
/**
|
package/types/GLTFLoader.d.ts
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { AssetPromise, Loader, LoadItem, ResourceManager } from "@galacean/engine-core";
|
|
2
|
+
import { GLTFPipeline } from "./gltf/GLTFPipeline";
|
|
2
3
|
import { GLTFResource } from "./gltf/GLTFResource";
|
|
3
4
|
export declare class GLTFLoader extends Loader<GLTFResource> {
|
|
5
|
+
/**
|
|
6
|
+
* @override
|
|
7
|
+
*/
|
|
4
8
|
load(item: LoadItem, resourceManager: ResourceManager): Record<string, AssetPromise<any>>;
|
|
5
9
|
}
|
|
6
10
|
/**
|
|
@@ -9,4 +13,6 @@ export declare class GLTFLoader extends Loader<GLTFResource> {
|
|
|
9
13
|
export interface GLTFParams {
|
|
10
14
|
/** Keep raw mesh data for glTF parser, default is false. */
|
|
11
15
|
keepMeshData: boolean;
|
|
16
|
+
/** Custom glTF pipeline. */
|
|
17
|
+
pipeline: GLTFPipeline;
|
|
12
18
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AssetPromise, ContentRestorer, Texture2D } from "@
|
|
2
|
-
import { RequestConfig } from "@
|
|
1
|
+
import { AssetPromise, ContentRestorer, Texture2D } from "@galacean/engine-core";
|
|
2
|
+
import { RequestConfig } from "@galacean/engine-core/types/asset/request";
|
|
3
3
|
/**
|
|
4
4
|
* @internal
|
|
5
5
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AssetPromise, ContentRestorer, TextureCube } from "@
|
|
2
|
-
import { RequestConfig } from "@
|
|
1
|
+
import { AssetPromise, ContentRestorer, TextureCube } from "@galacean/engine-core";
|
|
2
|
+
import { RequestConfig } from "@galacean/engine-core/types/asset/request";
|
|
3
3
|
/**
|
|
4
4
|
* @internal
|
|
5
5
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AssetPromise } from "@
|
|
1
|
+
import { AssetPromise } from "@galacean/engine-core";
|
|
2
2
|
import { GLTFResource } from "./GLTFResource";
|
|
3
3
|
import { GLTFParser } from "./parser/GLTFParser";
|
|
4
4
|
import { GLTFParserContext } from "./parser/GLTFParserContext";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { AnimationClip, Camera, Engine, EngineObject, Entity, Light, Material, ModelMesh,
|
|
1
|
+
import { AnimationClip, Camera, Engine, EngineObject, Entity, Light, Material, ModelMesh, Skin, Texture2D } from "@galacean/engine-core";
|
|
2
2
|
/**
|
|
3
|
-
* Product after
|
|
3
|
+
* Product after glTF parser, usually, `defaultSceneRoot` is only needed to use.
|
|
4
4
|
*/
|
|
5
5
|
export declare class GLTFResource extends EngineObject {
|
|
6
|
-
/**
|
|
6
|
+
/** glTF file url. */
|
|
7
7
|
url: string;
|
|
8
8
|
/** Texture2D after TextureParser. */
|
|
9
9
|
textures?: Texture2D[];
|
|
@@ -19,21 +19,17 @@ export declare class GLTFResource extends EngineObject {
|
|
|
19
19
|
entities: Entity[];
|
|
20
20
|
/** Camera after SceneParser. */
|
|
21
21
|
cameras?: Camera[];
|
|
22
|
-
/** Export lights in extension KHR_lights_punctual */
|
|
22
|
+
/** Export lights in extension KHR_lights_punctual. */
|
|
23
23
|
lights?: Light[];
|
|
24
24
|
/** RootEntities after SceneParser. */
|
|
25
25
|
sceneRoots: Entity[];
|
|
26
26
|
/** RootEntity after SceneParser. */
|
|
27
27
|
defaultSceneRoot: Entity;
|
|
28
|
-
/**
|
|
29
|
-
|
|
30
|
-
renderer: Renderer;
|
|
31
|
-
material: Material;
|
|
32
|
-
variants: string[];
|
|
33
|
-
}[];
|
|
28
|
+
/** Extensions data. */
|
|
29
|
+
extensionsData: Record<string, any>;
|
|
34
30
|
constructor(engine: Engine, url: string);
|
|
35
31
|
/**
|
|
36
32
|
* @override
|
|
37
33
|
*/
|
|
38
|
-
|
|
34
|
+
protected _onDestroy(): void;
|
|
39
35
|
}
|
package/types/gltf/GLTFUtil.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { IndexFormat, TypedArray, VertexElementFormat } from "@galacean/engine-core";
|
|
2
2
|
import { Color, Vector2, Vector3, Vector4 } from "@galacean/engine-math";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { AccessorComponentType, AccessorType, IAccessor, IBufferView, IGLTF } from "./GLTFSchema";
|
|
4
|
+
import { BufferInfo, GLTFParserContext } from "./parser/GLTFParserContext";
|
|
5
5
|
/**
|
|
6
6
|
* @internal
|
|
7
7
|
*/
|
|
@@ -21,19 +21,19 @@ export declare class GLTFUtil {
|
|
|
21
21
|
/**
|
|
22
22
|
* Get the TypedArray corresponding to the component type.
|
|
23
23
|
*/
|
|
24
|
-
static getComponentType(componentType: AccessorComponentType): Uint8ArrayConstructor |
|
|
24
|
+
static getComponentType(componentType: AccessorComponentType): Uint8ArrayConstructor | Int8ArrayConstructor | Int16ArrayConstructor | Uint16ArrayConstructor | Uint32ArrayConstructor | Float32ArrayConstructor;
|
|
25
25
|
static getNormalizedComponentScale(componentType: AccessorComponentType): number;
|
|
26
|
-
static getAccessorBuffer(context:
|
|
26
|
+
static getAccessorBuffer(context: GLTFParserContext, bufferViews: IBufferView[], accessor: IAccessor): BufferInfo;
|
|
27
27
|
/**
|
|
28
28
|
* @deprecated
|
|
29
29
|
* Get accessor data.
|
|
30
30
|
*/
|
|
31
|
-
static getAccessorData(
|
|
31
|
+
static getAccessorData(glTF: IGLTF, accessor: IAccessor, buffers: ArrayBuffer[]): TypedArray;
|
|
32
32
|
static getBufferViewData(bufferView: IBufferView, buffers: ArrayBuffer[]): ArrayBuffer;
|
|
33
33
|
/**
|
|
34
34
|
* Get accessor data.
|
|
35
35
|
*/
|
|
36
|
-
static processingSparseData(
|
|
36
|
+
static processingSparseData(bufferViews: IBufferView[], accessor: IAccessor, buffers: ArrayBuffer[], bufferInfo: BufferInfo): void;
|
|
37
37
|
static getIndexFormat(type: AccessorComponentType): IndexFormat;
|
|
38
38
|
static getElementFormat(type: AccessorComponentType, size: number, normalized?: boolean): VertexElementFormat;
|
|
39
39
|
/**
|
|
@@ -45,8 +45,8 @@ export declare class GLTFUtil {
|
|
|
45
45
|
/**
|
|
46
46
|
* Parse the glb format.
|
|
47
47
|
*/
|
|
48
|
-
static parseGLB(glb: ArrayBuffer): {
|
|
49
|
-
|
|
48
|
+
static parseGLB(context: GLTFParserContext, glb: ArrayBuffer): {
|
|
49
|
+
glTF: IGLTF;
|
|
50
50
|
buffers: ArrayBuffer[];
|
|
51
51
|
};
|
|
52
52
|
private static _formatRelativePath;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EngineObject } from "@
|
|
1
|
+
import { EngineObject } from "@galacean/engine-core";
|
|
2
2
|
import { GLTFExtensionOwnerSchema } from "../GLTFSchema";
|
|
3
3
|
import { GLTFParserContext } from "../parser/GLTFParserContext";
|
|
4
4
|
import { GLTFExtensionSchema } from "./GLTFExtensionSchema";
|
|
@@ -6,9 +6,12 @@ import "./KHR_materials_pbrSpecularGlossiness";
|
|
|
6
6
|
import "./KHR_materials_sheen";
|
|
7
7
|
import "./KHR_materials_transmission";
|
|
8
8
|
import "./KHR_materials_unlit";
|
|
9
|
-
|
|
9
|
+
export type { IGLTFExtensionVariants } from "./KHR_materials_variants";
|
|
10
10
|
import "./KHR_materials_volume";
|
|
11
11
|
import "./KHR_mesh_quantization";
|
|
12
12
|
import "./KHR_texture_basisu";
|
|
13
13
|
import "./KHR_texture_transform";
|
|
14
|
-
import "./
|
|
14
|
+
import "./Galacean_materials_remap";
|
|
15
|
+
import "./OASIS_animation_event";
|
|
16
|
+
export { GLTFExtensionParser, GLTFExtensionMode } from "./GLTFExtensionParser";
|
|
17
|
+
export * from "./GLTFExtensionSchema";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AnimationClip, AssetPromise } from "@
|
|
1
|
+
import { AnimationClip, AssetPromise } from "@galacean/engine-core";
|
|
2
2
|
import { IAnimation } from "../GLTFSchema";
|
|
3
3
|
import { GLTFParser } from "./GLTFParser";
|
|
4
4
|
import { GLTFParserContext } from "./GLTFParserContext";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AssetPromise, Material, PBRMaterial, PBRSpecularMaterial, UnlitMaterial } from "@
|
|
1
|
+
import { AssetPromise, Material, PBRMaterial, PBRSpecularMaterial, UnlitMaterial } from "@galacean/engine-core";
|
|
2
2
|
import { IMaterial, ITextureInfo } from "../GLTFSchema";
|
|
3
3
|
import { GLTFParser } from "./GLTFParser";
|
|
4
4
|
import { GLTFParserContext } from "./GLTFParserContext";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AssetPromise, ModelMesh, TypedArray } from "@
|
|
1
|
+
import { AssetPromise, ModelMesh, TypedArray } from "@galacean/engine-core";
|
|
2
2
|
import { ModelMeshRestoreInfo } from "../../GLTFContentRestorer";
|
|
3
3
|
import { IGLTF, IMesh, IMeshPrimitive } from "../GLTFSchema";
|
|
4
4
|
import { GLTFParser } from "./GLTFParser";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AnimationClip, AssetPromise, EngineObject, Material, Mesh } from "@
|
|
1
|
+
import { AnimationClip, AssetPromise, EngineObject, Material, Mesh } from "@galacean/engine-core";
|
|
2
2
|
import { GLTFExtensionMode, GLTFExtensionParser } from "../extensions/GLTFExtensionParser";
|
|
3
3
|
import { GLTFExtensionOwnerSchema } from "../GLTFSchema";
|
|
4
4
|
import { GLTFParserContext } from "./GLTFParserContext";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AnimationClip, AssetPromise, Buffer, Entity, Material, ModelMesh, Texture2D, TypedArray } from "@
|
|
1
|
+
import { AnimationClip, AssetPromise, Buffer, Entity, Material, ModelMesh, Texture2D, TypedArray } from "@galacean/engine-core";
|
|
2
2
|
import { BufferDataRestoreInfo, GLTFContentRestorer } from "../../GLTFContentRestorer";
|
|
3
3
|
import { GLTFResource } from "../GLTFResource";
|
|
4
4
|
import { IGLTF } from "../GLTFSchema";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { Entity } from "@
|
|
1
|
+
import { 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): import("@
|
|
7
|
+
parse(context: GLTFParserContext): import("@galacean/engine-core").AssetPromise<Entity>;
|
|
8
8
|
private _createCamera;
|
|
9
9
|
private _createRenderer;
|
|
10
10
|
private _createAnimator;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AssetPromise, Texture2D } from "@
|
|
1
|
+
import { AssetPromise, Texture2D } from "@galacean/engine-core";
|
|
2
2
|
import { GLTFParser } from "./GLTFParser";
|
|
3
3
|
import { GLTFParserContext } from ".";
|
|
4
4
|
export declare class GLTFTextureParser extends GLTFParser {
|
package/types/index.d.ts
CHANGED
|
@@ -2,7 +2,6 @@ import "./AnimatorControllerLoader";
|
|
|
2
2
|
import "./BufferLoader";
|
|
3
3
|
import "./EnvLoader";
|
|
4
4
|
import "./FontLoader";
|
|
5
|
-
import "./gltf/extensions/index";
|
|
6
5
|
import "./GLTFLoader";
|
|
7
6
|
import "./HDRLoader";
|
|
8
7
|
import "./JSONLoader";
|
|
@@ -15,9 +14,10 @@ import "./SpriteAtlasLoader";
|
|
|
15
14
|
import "./SpriteLoader";
|
|
16
15
|
import "./Texture2DLoader";
|
|
17
16
|
import "./TextureCubeLoader";
|
|
17
|
+
import "./AnimationClipLoader";
|
|
18
18
|
export { parseSingleKTX } from "./compressed-texture";
|
|
19
|
-
export { GLTFResource } from "./gltf/GLTFResource";
|
|
20
19
|
export type { GLTFParams } from "./GLTFLoader";
|
|
21
20
|
export * from "./resource-deserialize";
|
|
22
21
|
export * from "./SceneLoader";
|
|
23
22
|
export type { Texture2DParams } from "./Texture2DLoader";
|
|
23
|
+
export * from "./gltf";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { BackgroundMode } from "@galacean/engine-core";
|
|
2
|
-
import {
|
|
2
|
+
import { IReferable } from "@galacean/engine-core/types/asset/IReferable";
|
|
3
3
|
import { IColor } from "../mesh/IModelMesh";
|
|
4
4
|
export interface IPrefabFile {
|
|
5
5
|
entities: Array<IEntity>;
|
|
@@ -9,11 +9,11 @@ export interface IScene extends IPrefabFile {
|
|
|
9
9
|
background: {
|
|
10
10
|
mode: BackgroundMode;
|
|
11
11
|
color: IColor;
|
|
12
|
-
texture?:
|
|
13
|
-
sky?:
|
|
12
|
+
texture?: IReferable;
|
|
13
|
+
sky?: IReferable;
|
|
14
14
|
};
|
|
15
15
|
ambient: {
|
|
16
|
-
ambientLight:
|
|
16
|
+
ambientLight: IReferable;
|
|
17
17
|
diffuseSolidColor: IColor;
|
|
18
18
|
diffuseIntensity: number;
|
|
19
19
|
specularIntensity: number;
|