@galacean/engine-loader 1.0.0-alpha.6 → 1.0.0-beta.0

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.
@@ -1,8 +0,0 @@
1
- import { EngineObject } from "@galacean/engine-core";
2
- import { ParserContext } from "../parser/ParserContext";
3
- import { ExtensionSchema } from "./Schema";
4
- export declare abstract class ExtensionParser {
5
- initialize(): void;
6
- parseEngineResource(schema: ExtensionSchema, parseResource: EngineObject, context: ParserContext, ...extra: any[]): void | Promise<void>;
7
- createEngineResource(schema: ExtensionSchema, context: ParserContext, ...extra: any[]): EngineObject | Promise<EngineObject>;
8
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,142 +0,0 @@
1
- import { IMaterialNormalTextureInfo, ITextureInfo } from "../Schema";
2
- /**
3
- * Interfaces from the KHR_lights_punctual extension
4
- */
5
- export interface IKHRLightsPunctual_LightNode {
6
- light: number;
7
- }
8
- export interface IKHRLightsPunctual_Light {
9
- type: "directional" | "point" | "spot";
10
- color?: number[];
11
- intensity?: number;
12
- range?: number;
13
- spot?: {
14
- innerConeAngle?: number;
15
- outerConeAngle?: number;
16
- };
17
- }
18
- export interface IKHRLightsPunctual {
19
- lights: IKHRLightsPunctual_Light[];
20
- }
21
- /**
22
- * Interfaces from the KHR_draco_mesh_compression extension
23
- */
24
- export interface IKHRDracoMeshCompression {
25
- bufferView: number;
26
- attributes: {
27
- [name: string]: number;
28
- };
29
- }
30
- /**
31
- * Interfaces from the KHR_materials_clearcoat extension
32
- */
33
- export interface IKHRMaterialsClearcoat {
34
- clearcoatFactor: number;
35
- clearcoatTexture: ITextureInfo;
36
- clearcoatRoughnessFactor: number;
37
- clearcoatRoughnessTexture: ITextureInfo;
38
- clearcoatNormalTexture: IMaterialNormalTextureInfo;
39
- }
40
- /**
41
- * Interfaces from the KHR_materials_ior extension
42
- */
43
- export interface IKHRMaterialsIor {
44
- ior: number;
45
- }
46
- /**
47
- * Interfaces from the KHR_materials_unlit extension
48
- */
49
- export interface IKHRMaterialsUnlit {
50
- }
51
- /**
52
- * Interfaces from the KHR_materials_pbrSpecularGlossiness extension
53
- */
54
- export interface IKHRMaterialsPbrSpecularGlossiness {
55
- diffuseFactor: number[];
56
- diffuseTexture: ITextureInfo;
57
- specularFactor: number[];
58
- glossinessFactor: number;
59
- specularGlossinessTexture: ITextureInfo;
60
- }
61
- /**
62
- * Interfaces from the KHR_materials_sheen extension
63
- */
64
- export interface IKHRMaterialsSheen {
65
- sheenColorFactor?: number[];
66
- sheenColorTexture?: ITextureInfo;
67
- sheenRoughnessFactor?: number;
68
- sheenRoughnessTexture?: ITextureInfo;
69
- }
70
- /**
71
- * Interfaces from the KHR_materials_specular extension
72
- */
73
- export interface IKHRMaterialsSpecular {
74
- specularFactor: number;
75
- specularColorFactor: number[];
76
- specularTexture: ITextureInfo;
77
- }
78
- /**
79
- * Interfaces from the KHR_materials_transmission extension
80
- */
81
- export interface IKHRMaterialsTransmission {
82
- transmissionFactor?: number;
83
- transmissionTexture?: ITextureInfo;
84
- }
85
- /**
86
- * Interfaces from the KHR_materials_translucency extension
87
- */
88
- export interface IKHRMaterialsTranslucency {
89
- translucencyFactor?: number;
90
- translucencyTexture?: ITextureInfo;
91
- }
92
- /**
93
- * Interfaces from the KHR_materials_variants extension
94
- */
95
- export interface IKHRMaterialVariants_Mapping {
96
- mappings: Array<{
97
- variants: number[];
98
- material: number;
99
- }>;
100
- extensions?: any;
101
- extras?: any;
102
- }
103
- export interface IKHRMaterialVariants_Variant {
104
- name: string;
105
- extensions?: any;
106
- extras?: any;
107
- }
108
- export interface IKHRMaterialVariants_Variants {
109
- variants: Array<IKHRMaterialVariants_Variant>;
110
- }
111
- /**
112
- * Interfaces from the KHR_texture_basisu extension
113
- */
114
- export interface IKHRTextureBasisU {
115
- source: number;
116
- }
117
- /**
118
- * Interfaces from the KHR_texture_transform extension
119
- */
120
- export interface IKHRTextureTransform {
121
- offset?: number[];
122
- rotation?: number;
123
- scale?: number[];
124
- texCoord?: number;
125
- }
126
- /**
127
- * Interfaces from the KHR_xmp extension
128
- */
129
- export interface IKHRXmp {
130
- packets: Array<{
131
- [key: string]: unknown;
132
- }>;
133
- }
134
- export interface IKHRXmp_Node {
135
- packet: number;
136
- }
137
- export interface IGalaceanMaterialRemap {
138
- refId: string;
139
- key?: string;
140
- isClone?: boolean;
141
- }
142
- export type ExtensionSchema = IKHRLightsPunctual_Light | IKHRDracoMeshCompression | IKHRMaterialsClearcoat | IKHRMaterialsIor | IKHRMaterialsUnlit | IKHRMaterialsPbrSpecularGlossiness | IKHRMaterialsSheen | IKHRMaterialsSpecular | IKHRMaterialsTransmission | IKHRMaterialsTranslucency | IKHRMaterialVariants_Mapping | IKHRMaterialVariants_Variants | IKHRTextureBasisU | IKHRTextureTransform | IKHRXmp | IKHRXmp_Node;
@@ -1,7 +0,0 @@
1
- import { AnimationClip, AssetPromise } from "@galacean/engine-core";
2
- import { Parser } from "./Parser";
3
- import { ParserContext } from "./ParserContext";
4
- export declare class AnimationParser extends Parser {
5
- parse(context: ParserContext): AssetPromise<AnimationClip[]>;
6
- private _addCurve;
7
- }
@@ -1,7 +0,0 @@
1
- import { AssetPromise } from "@galacean/engine-core";
2
- import { Parser } from "./Parser";
3
- import { ParserContext } from "./ParserContext";
4
- export declare class BufferParser extends Parser {
5
- parse(context: ParserContext): AssetPromise<void>;
6
- private _isGLB;
7
- }
@@ -1,9 +0,0 @@
1
- import { Parser } from "./Parser";
2
- import { ParserContext } from "./ParserContext";
3
- export declare class EntityParser extends Parser {
4
- /** @internal */
5
- static _defaultName: String;
6
- parse(context: ParserContext): void;
7
- private _buildEntityTree;
8
- private _createSceneRoots;
9
- }
@@ -1,8 +0,0 @@
1
- import { AssetPromise, Material } from "@galacean/engine-core";
2
- import { Parser } from "./Parser";
3
- import { ParserContext } from "./ParserContext";
4
- export declare class MaterialParser extends Parser {
5
- /** @internal */
6
- static _parseTextureTransform(material: Material, extensions: any, context: ParserContext): void;
7
- parse(context: ParserContext): AssetPromise<Material[]>;
8
- }
@@ -1,13 +0,0 @@
1
- import { AssetPromise, ModelMesh } from "@galacean/engine-core";
2
- import { Parser } from "./Parser";
3
- import { ParserContext } from "./ParserContext";
4
- export declare class MeshParser extends Parser {
5
- private static _tempVector3;
6
- parse(context: ParserContext): AssetPromise<ModelMesh[][]>;
7
- private _parseMeshFromGLTFPrimitive;
8
- private _createBlendShape;
9
- /**
10
- * @deprecated
11
- */
12
- private _parseMeshFromGLTFPrimitiveDraco;
13
- }
@@ -1,21 +0,0 @@
1
- import { AnimationClip, AssetPromise, EngineObject, Material, Mesh } from "@galacean/engine-core";
2
- import { ExtensionParser } from "../extensions/ExtensionParser";
3
- import { ExtensionSchema } from "../extensions/Schema";
4
- import { ParserContext } from "./ParserContext";
5
- export declare abstract class Parser {
6
- private static _extensionParsers;
7
- static parseEngineResource(extensionName: string, extensionSchema: ExtensionSchema, parseResource: EngineObject, context: ParserContext, ...extra: any[]): void;
8
- static createEngineResource<T extends EngineObject>(extensionName: string, extensionSchema: ExtensionSchema, context: ParserContext, ...extra: any[]): T | Promise<T>;
9
- static hasExtensionParser(extensionName: string): boolean;
10
- static initialize(extensionName: string): void;
11
- /**
12
- * @internal
13
- */
14
- static _addExtensionParser(extensionName: string, extensionParser: ExtensionParser): void;
15
- abstract parse(context: ParserContext): AssetPromise<any> | void | Material | AnimationClip | Mesh;
16
- }
17
- /**
18
- * Declare ExtensionParser's decorator.
19
- * @param extensionName - Extension name
20
- */
21
- export declare function registerExtension(extensionName: string): (parser: new () => ExtensionParser) => void;
@@ -1,46 +0,0 @@
1
- import { AnimationClip, AssetPromise, Buffer, Entity, Material, ModelMesh, Texture2D, TypedArray } from "@galacean/engine-core";
2
- import { GLTFResource } from "../GLTFResource";
3
- import { IGLTF } from "../Schema";
4
- /**
5
- * @internal
6
- */
7
- export declare class ParserContext {
8
- gltf: IGLTF;
9
- buffers: ArrayBuffer[];
10
- glTFResource: GLTFResource;
11
- keepMeshData: boolean;
12
- hasSkinned: boolean;
13
- /** chain asset promise */
14
- chainPromises: AssetPromise<any>[];
15
- accessorBufferCache: Record<string, BufferInfo>;
16
- texturesPromiseInfo: PromiseInfo<Texture2D[]>;
17
- materialsPromiseInfo: PromiseInfo<Material[]>;
18
- meshesPromiseInfo: PromiseInfo<ModelMesh[][]>;
19
- animationClipsPromiseInfo: PromiseInfo<AnimationClip[]>;
20
- defaultSceneRootPromiseInfo: PromiseInfo<Entity>;
21
- masterPromiseInfo: PromiseInfo<GLTFResource>;
22
- promiseMap: Record<string, AssetPromise<any>>;
23
- constructor(url: string);
24
- private _initPromiseInfo;
25
- }
26
- /**
27
- * @internal
28
- */
29
- export declare class BufferInfo {
30
- data: TypedArray;
31
- interleaved: boolean;
32
- stride: number;
33
- vertexBuffer: Buffer;
34
- vertexBindingInfos: Record<number, number>;
35
- constructor(data: TypedArray, interleaved: boolean, stride: number);
36
- }
37
- /**
38
- * @internal
39
- */
40
- export declare class PromiseInfo<T> {
41
- promise: AssetPromise<T>;
42
- resolve: (value?: T | PromiseLike<T>) => void;
43
- reject: (reason?: any) => void;
44
- setProgress: (progress: number) => void;
45
- onCancel: (callback: () => void) => void;
46
- }
@@ -1,11 +0,0 @@
1
- import { AssetPromise, Entity } from "@galacean/engine-core";
2
- import { Parser } from "./Parser";
3
- import { ParserContext } from "./ParserContext";
4
- export declare class SceneParser extends Parser {
5
- private static _defaultMaterial;
6
- private static _getDefaultMaterial;
7
- parse(context: ParserContext): AssetPromise<Entity>;
8
- private _createCamera;
9
- private _createRenderer;
10
- private _createAnimator;
11
- }
@@ -1,6 +0,0 @@
1
- import { Parser } from "./Parser";
2
- import { ParserContext } from "./ParserContext";
3
- export declare class SkinParser extends Parser {
4
- parse(context: ParserContext): void;
5
- private _findSkeletonRootBone;
6
- }
@@ -1,8 +0,0 @@
1
- import { AssetPromise, Texture2D } from "@galacean/engine-core";
2
- import { Parser } from "./Parser";
3
- import { ParserContext } from "./ParserContext";
4
- export declare class TextureParser extends Parser {
5
- private static _wrapMap;
6
- parse(context: ParserContext): AssetPromise<Texture2D[]>;
7
- private _parseSampler;
8
- }
@@ -1,5 +0,0 @@
1
- import { Parser } from "./Parser";
2
- import { ParserContext } from "./ParserContext";
3
- export declare class Validator extends Parser {
4
- parse(context: ParserContext): void;
5
- }