@galacean/engine-loader 1.0.0-beta.0 → 1.0.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.
Files changed (47) hide show
  1. package/dist/main.js +1050 -1449
  2. package/dist/main.js.map +1 -1
  3. package/dist/miniprogram.js +1069 -1468
  4. package/dist/module.js +1052 -1436
  5. package/dist/module.js.map +1 -1
  6. package/package.json +5 -5
  7. package/types/AnimationClipLoader.d.ts +0 -1
  8. package/types/GLTFLoader.d.ts +0 -6
  9. package/types/gltf/GLTFParser.d.ts +9 -0
  10. package/types/gltf/GLTFResource.d.ts +11 -7
  11. package/types/gltf/{GLTFUtils.d.ts → GLTFUtil.d.ts} +15 -9
  12. package/types/gltf/{GLTFSchema.d.ts → Schema.d.ts} +0 -2
  13. package/types/gltf/extensions/ExtensionParser.d.ts +8 -0
  14. package/types/gltf/extensions/KHR_materials_variants.d.ts +1 -6
  15. package/types/gltf/extensions/{GLTFExtensionSchema.d.ts → Schema.d.ts} +2 -9
  16. package/types/gltf/extensions/index.d.ts +1 -4
  17. package/types/gltf/parser/AnimationParser.d.ts +7 -0
  18. package/types/gltf/parser/BufferParser.d.ts +7 -0
  19. package/types/gltf/parser/EntityParser.d.ts +9 -0
  20. package/types/gltf/parser/MaterialParser.d.ts +8 -0
  21. package/types/gltf/parser/MeshParser.d.ts +13 -0
  22. package/types/gltf/parser/Parser.d.ts +21 -0
  23. package/types/gltf/parser/{GLTFParserContext.d.ts → ParserContext.d.ts} +4 -6
  24. package/types/gltf/parser/SceneParser.d.ts +11 -0
  25. package/types/gltf/parser/SkinParser.d.ts +6 -0
  26. package/types/gltf/parser/TextureParser.d.ts +8 -0
  27. package/types/gltf/parser/Validator.d.ts +5 -0
  28. package/types/index.d.ts +2 -2
  29. package/types/resource-deserialize/resources/prefab/PrefabDesign.d.ts +4 -4
  30. package/types/GLTFContentRestorer.d.ts +0 -85
  31. package/types/Texture2DContentRestorer.d.ts +0 -14
  32. package/types/TextureCubeContentRestorer.d.ts +0 -14
  33. package/types/gltf/GLTFPipeline.d.ts +0 -23
  34. package/types/gltf/extensions/GALACEAN_animation_event.d.ts +0 -1
  35. package/types/gltf/extensions/GLTFExtensionParser.d.ts +0 -52
  36. package/types/gltf/index.d.ts +0 -6
  37. package/types/gltf/parser/GLTFAnimationParser.d.ts +0 -12
  38. package/types/gltf/parser/GLTFBufferParser.d.ts +0 -7
  39. package/types/gltf/parser/GLTFEntityParser.d.ts +0 -9
  40. package/types/gltf/parser/GLTFMaterialParser.d.ts +0 -15
  41. package/types/gltf/parser/GLTFMeshParser.d.ts +0 -19
  42. package/types/gltf/parser/GLTFParser.d.ts +0 -63
  43. package/types/gltf/parser/GLTFSceneParser.d.ts +0 -11
  44. package/types/gltf/parser/GLTFSkinParser.d.ts +0 -6
  45. package/types/gltf/parser/GLTFTextureParser.d.ts +0 -8
  46. package/types/gltf/parser/GLTFValidator.d.ts +0 -6
  47. package/types/gltf/parser/index.d.ts +0 -11
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@galacean/engine-loader",
3
- "version": "1.0.0-beta.0",
3
+ "version": "1.0.0",
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": "1.0.0-beta.0",
19
- "@galacean/engine-draco": "1.0.0-beta.0",
20
- "@galacean/engine-math": "1.0.0-beta.0",
21
- "@galacean/engine-rhi-webgl": "1.0.0-beta.0"
18
+ "@galacean/engine-core": "1.0.0",
19
+ "@galacean/engine-draco": "1.0.0",
20
+ "@galacean/engine-math": "1.0.0",
21
+ "@galacean/engine-rhi-webgl": "1.0.0"
22
22
  },
23
23
  "scripts": {
24
24
  "b:types": "tsc"
@@ -1 +0,0 @@
1
- export {};
@@ -1,10 +1,6 @@
1
1
  import { AssetPromise, Loader, LoadItem, ResourceManager } from "@galacean/engine-core";
2
- import { GLTFPipeline } from "./gltf/GLTFPipeline";
3
2
  import { GLTFResource } from "./gltf/GLTFResource";
4
3
  export declare class GLTFLoader extends Loader<GLTFResource> {
5
- /**
6
- * @override
7
- */
8
4
  load(item: LoadItem, resourceManager: ResourceManager): Record<string, AssetPromise<any>>;
9
5
  }
10
6
  /**
@@ -16,6 +12,4 @@ export interface GLTFParams {
16
12
  * Keep raw mesh data for glTF parser, default is false.
17
13
  */
18
14
  keepMeshData: boolean;
19
- /** Custom glTF pipeline. */
20
- pipeline: GLTFPipeline;
21
15
  }
@@ -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
+ }
@@ -1,9 +1,9 @@
1
- import { AnimationClip, Camera, Engine, EngineObject, Entity, Light, Material, ModelMesh, Skin, Texture2D } from "@galacean/engine-core";
1
+ import { AnimationClip, Camera, Engine, EngineObject, Entity, Light, Material, ModelMesh, Renderer, Skin, Texture2D } from "@galacean/engine-core";
2
2
  /**
3
- * Product after glTF parser, usually, `defaultSceneRoot` is only needed to use.
3
+ * Product after GLTF parser, usually, `defaultSceneRoot` is only needed to use.
4
4
  */
5
5
  export declare class GLTFResource extends EngineObject {
6
- /** glTF file url. */
6
+ /** GLTF file url. */
7
7
  url: string;
8
8
  /** Texture2D after TextureParser. */
9
9
  textures?: Texture2D[];
@@ -19,17 +19,21 @@ 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
- /** Extensions data. */
29
- extensionsData: Record<string, any>;
28
+ /** Renderer can replace material by `renderer.setMaterial` if gltf use plugin-in KHR_materials_variants. */
29
+ variants?: {
30
+ renderer: Renderer;
31
+ material: Material;
32
+ variants: string[];
33
+ }[];
30
34
  constructor(engine: Engine, url: string);
31
35
  /**
32
36
  * @override
33
37
  */
34
- protected _onDestroy(): void;
38
+ destroy(): void;
35
39
  }
@@ -1,15 +1,19 @@
1
1
  import { IndexFormat, TypedArray, VertexElementFormat } from "@galacean/engine-core";
2
2
  import { Color, Vector2, Vector3, Vector4 } from "@galacean/engine-math";
3
- import { AccessorComponentType, AccessorType, IAccessor, IBufferView, IGLTF } from "./GLTFSchema";
4
- import { BufferInfo, GLTFParserContext } from "./parser/GLTFParserContext";
3
+ import { BufferInfo, ParserContext } from "./parser/ParserContext";
4
+ import { AccessorComponentType, AccessorType, IAccessor, IBufferView, IGLTF } from "./Schema";
5
5
  /**
6
6
  * @internal
7
7
  */
8
- export declare class GLTFUtils {
8
+ export declare class GLTFUtil {
9
9
  static floatBufferToVector2Array(buffer: Float32Array): Vector2[];
10
10
  static floatBufferToVector3Array(buffer: Float32Array): Vector3[];
11
11
  static floatBufferToVector4Array(buffer: Float32Array): Vector4[];
12
12
  static floatBufferToColorArray(buffer: Float32Array, isColor3: boolean): Color[];
13
+ /**
14
+ * Parse binary text for glb loader.
15
+ */
16
+ static decodeText(array: Uint8Array): string;
13
17
  /**
14
18
  * Get the number of bytes occupied by accessor type.
15
19
  */
@@ -17,30 +21,32 @@ export declare class GLTFUtils {
17
21
  /**
18
22
  * Get the TypedArray corresponding to the component type.
19
23
  */
20
- static getComponentType(componentType: AccessorComponentType): Uint8ArrayConstructor | Int8ArrayConstructor | Int16ArrayConstructor | Uint16ArrayConstructor | Uint32ArrayConstructor | Float32ArrayConstructor;
24
+ static getComponentType(componentType: AccessorComponentType): Uint8ArrayConstructor | Float32ArrayConstructor | Uint16ArrayConstructor | Int8ArrayConstructor | Int16ArrayConstructor | Uint32ArrayConstructor;
21
25
  static getNormalizedComponentScale(componentType: AccessorComponentType): number;
22
- static getAccessorBuffer(context: GLTFParserContext, bufferViews: IBufferView[], accessor: IAccessor): BufferInfo;
26
+ static getAccessorBuffer(context: ParserContext, gltf: IGLTF, accessor: IAccessor): BufferInfo;
23
27
  /**
24
28
  * @deprecated
25
29
  * Get accessor data.
26
30
  */
27
- static getAccessorData(glTF: IGLTF, accessor: IAccessor, buffers: ArrayBuffer[]): TypedArray;
31
+ static getAccessorData(gltf: IGLTF, accessor: IAccessor, buffers: ArrayBuffer[]): TypedArray;
28
32
  static getBufferViewData(bufferView: IBufferView, buffers: ArrayBuffer[]): ArrayBuffer;
29
33
  /**
30
34
  * Get accessor data.
31
35
  */
32
- static processingSparseData(bufferViews: IBufferView[], accessor: IAccessor, buffers: ArrayBuffer[], bufferInfo: BufferInfo): void;
36
+ static processingSparseData(gltf: IGLTF, accessor: IAccessor, buffers: ArrayBuffer[], originData: TypedArray): TypedArray;
33
37
  static getIndexFormat(type: AccessorComponentType): IndexFormat;
34
38
  static getElementFormat(type: AccessorComponentType, size: number, normalized?: boolean): VertexElementFormat;
35
39
  /**
36
40
  * Load image buffer
37
41
  */
38
42
  static loadImageBuffer(imageBuffer: ArrayBuffer, type: string): Promise<HTMLImageElement>;
43
+ static isAbsoluteUrl(url: string): boolean;
44
+ static parseRelativeUrl(baseUrl: string, relativeUrl: string): string;
39
45
  /**
40
46
  * Parse the glb format.
41
47
  */
42
- static parseGLB(context: GLTFParserContext, glb: ArrayBuffer): {
43
- glTF: IGLTF;
48
+ static parseGLB(glb: ArrayBuffer): {
49
+ gltf: IGLTF;
44
50
  buffers: ArrayBuffer[];
45
51
  };
46
52
  private static _formatRelativePath;
@@ -812,5 +812,3 @@ export interface IGLTF extends IProperty {
812
812
  */
813
813
  textures?: ITexture[];
814
814
  }
815
- /** glTF extensible owner schema. */
816
- export type GLTFExtensionOwnerSchema = IMeshPrimitive | IMaterial | ITextureInfo | INode;
@@ -0,0 +1,8 @@
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,6 +1 @@
1
- import { Material, Renderer } from "@galacean/engine-core";
2
- export type IGLTFExtensionVariants = Array<{
3
- renderer: Renderer;
4
- material: Material;
5
- variants: string[];
6
- }>;
1
+ export {};
@@ -1,4 +1,4 @@
1
- import { IMaterialNormalTextureInfo, ITextureInfo } from "../GLTFSchema";
1
+ import { IMaterialNormalTextureInfo, ITextureInfo } from "../Schema";
2
2
  /**
3
3
  * Interfaces from the KHR_lights_punctual extension
4
4
  */
@@ -139,11 +139,4 @@ export interface IGalaceanMaterialRemap {
139
139
  key?: string;
140
140
  isClone?: boolean;
141
141
  }
142
- export interface IGalaceanAnimation {
143
- events: {
144
- time: number;
145
- functionName: string;
146
- parameter: any;
147
- }[];
148
- }
149
- export type GLTFExtensionSchema = IKHRLightsPunctual_Light | IKHRDracoMeshCompression | IKHRMaterialsClearcoat | IKHRMaterialsIor | IKHRMaterialsUnlit | IKHRMaterialsPbrSpecularGlossiness | IKHRMaterialsSheen | IKHRMaterialsSpecular | IKHRMaterialsTransmission | IKHRMaterialsTranslucency | IKHRMaterialVariants_Mapping | IKHRMaterialVariants_Variants | IKHRTextureBasisU | IKHRTextureTransform | IKHRXmp | IKHRXmp_Node | IGalaceanAnimation | Object;
142
+ export type ExtensionSchema = IKHRLightsPunctual_Light | IKHRDracoMeshCompression | IKHRMaterialsClearcoat | IKHRMaterialsIor | IKHRMaterialsUnlit | IKHRMaterialsPbrSpecularGlossiness | IKHRMaterialsSheen | IKHRMaterialsSpecular | IKHRMaterialsTransmission | IKHRMaterialsTranslucency | IKHRMaterialVariants_Mapping | IKHRMaterialVariants_Variants | IKHRTextureBasisU | IKHRTextureTransform | IKHRXmp | IKHRXmp_Node;
@@ -6,12 +6,9 @@ import "./KHR_materials_pbrSpecularGlossiness";
6
6
  import "./KHR_materials_sheen";
7
7
  import "./KHR_materials_transmission";
8
8
  import "./KHR_materials_unlit";
9
- export type { IGLTFExtensionVariants } from "./KHR_materials_variants";
9
+ import "./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
14
  import "./GALACEAN_materials_remap";
15
- import "./GALACEAN_animation_event";
16
- export { GLTFExtensionParser, GLTFExtensionMode } from "./GLTFExtensionParser";
17
- export * from "./GLTFExtensionSchema";
@@ -0,0 +1,7 @@
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
+ }
@@ -0,0 +1,7 @@
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
+ }
@@ -0,0 +1,9 @@
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
+ }
@@ -0,0 +1,8 @@
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
+ }
@@ -0,0 +1,13 @@
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
+ }
@@ -0,0 +1,21 @@
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,16 +1,16 @@
1
1
  import { AnimationClip, AssetPromise, Buffer, Entity, Material, ModelMesh, Texture2D, TypedArray } from "@galacean/engine-core";
2
- import { BufferDataRestoreInfo, GLTFContentRestorer } from "../../GLTFContentRestorer";
3
2
  import { GLTFResource } from "../GLTFResource";
4
- import { IGLTF } from "../GLTFSchema";
3
+ import { IGLTF } from "../Schema";
5
4
  /**
6
5
  * @internal
7
6
  */
8
- export declare class GLTFParserContext {
9
- glTF: IGLTF;
7
+ export declare class ParserContext {
8
+ gltf: IGLTF;
10
9
  buffers: ArrayBuffer[];
11
10
  glTFResource: GLTFResource;
12
11
  keepMeshData: boolean;
13
12
  hasSkinned: boolean;
13
+ /** chain asset promise */
14
14
  chainPromises: AssetPromise<any>[];
15
15
  accessorBufferCache: Record<string, BufferInfo>;
16
16
  texturesPromiseInfo: PromiseInfo<Texture2D[]>;
@@ -20,7 +20,6 @@ export declare class GLTFParserContext {
20
20
  defaultSceneRootPromiseInfo: PromiseInfo<Entity>;
21
21
  masterPromiseInfo: PromiseInfo<GLTFResource>;
22
22
  promiseMap: Record<string, AssetPromise<any>>;
23
- contentRestorer: GLTFContentRestorer;
24
23
  constructor(url: string);
25
24
  private _initPromiseInfo;
26
25
  }
@@ -33,7 +32,6 @@ export declare class BufferInfo {
33
32
  stride: number;
34
33
  vertexBuffer: Buffer;
35
34
  vertexBindingInfos: Record<number, number>;
36
- restoreInfo: BufferDataRestoreInfo;
37
35
  constructor(data: TypedArray, interleaved: boolean, stride: number);
38
36
  }
39
37
  /**
@@ -0,0 +1,11 @@
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
+ }
@@ -0,0 +1,6 @@
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
+ }
@@ -0,0 +1,8 @@
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
+ }
@@ -0,0 +1,5 @@
1
+ import { Parser } from "./Parser";
2
+ import { ParserContext } from "./ParserContext";
3
+ export declare class Validator extends Parser {
4
+ parse(context: ParserContext): void;
5
+ }
package/types/index.d.ts CHANGED
@@ -2,6 +2,7 @@ import "./AnimatorControllerLoader";
2
2
  import "./BufferLoader";
3
3
  import "./EnvLoader";
4
4
  import "./FontLoader";
5
+ import "./gltf/extensions/index";
5
6
  import "./GLTFLoader";
6
7
  import "./HDRLoader";
7
8
  import "./JSONLoader";
@@ -14,10 +15,9 @@ import "./SpriteAtlasLoader";
14
15
  import "./SpriteLoader";
15
16
  import "./Texture2DLoader";
16
17
  import "./TextureCubeLoader";
17
- import "./AnimationClipLoader";
18
18
  export { parseSingleKTX } from "./compressed-texture";
19
+ export { GLTFResource } from "./gltf/GLTFResource";
19
20
  export type { GLTFParams } from "./GLTFLoader";
20
21
  export * from "./resource-deserialize";
21
22
  export * from "./SceneLoader";
22
23
  export type { Texture2DParams } from "./Texture2DLoader";
23
- export * from "./gltf";
@@ -1,5 +1,5 @@
1
1
  import type { BackgroundMode } from "@galacean/engine-core";
2
- import { IReferable } from "@galacean/engine-core/types/asset/IReferable";
2
+ import { IRefObject } from "@galacean/engine-core/types/asset/IRefObject";
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?: IReferable;
13
- sky?: IReferable;
12
+ texture?: IRefObject;
13
+ sky?: IRefObject;
14
14
  };
15
15
  ambient: {
16
- ambientLight: IReferable;
16
+ ambientLight: IRefObject;
17
17
  diffuseSolidColor: IColor;
18
18
  diffuseIntensity: number;
19
19
  specularIntensity: number;
@@ -1,85 +0,0 @@
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
- import { GLTFResource } from "./gltf/GLTFResource";
5
- import { IBufferView } from "./gltf/GLTFSchema";
6
- /**
7
- * @internal
8
- */
9
- export declare class GLTFContentRestorer extends ContentRestorer<GLTFResource> {
10
- isGLB: boolean;
11
- bufferRequests: BufferRequestInfo[];
12
- glbBufferSlices: Vector2[];
13
- bufferTextures: BufferTextureRestoreInfo[];
14
- meshes: ModelMeshRestoreInfo[];
15
- /**
16
- * @override
17
- */
18
- restoreContent(): AssetPromise<GLTFResource>;
19
- private _getBufferData;
20
- }
21
- /**
22
- * @internal
23
- */
24
- export declare class BufferRequestInfo {
25
- url: string;
26
- config: RequestConfig;
27
- constructor(url: string, config: RequestConfig);
28
- }
29
- /**
30
- * @internal
31
- */
32
- export declare class BufferTextureRestoreInfo {
33
- texture: Texture2D;
34
- bufferView: IBufferView;
35
- mimeType: string;
36
- constructor(texture: Texture2D, bufferView: IBufferView, mimeType: string);
37
- }
38
- /**
39
- * @internal
40
- */
41
- export declare class ModelMeshRestoreInfo {
42
- mesh: ModelMesh;
43
- vertexBuffers: BufferRestoreInfo[];
44
- indexBuffer: BufferDataRestoreInfo;
45
- blendShapes: BlendShapeRestoreInfo[];
46
- }
47
- /**
48
- * @internal
49
- */
50
- export declare class BufferRestoreInfo {
51
- buffer: Buffer;
52
- data: BufferDataRestoreInfo;
53
- constructor(buffer: Buffer, data: BufferDataRestoreInfo);
54
- }
55
- /**
56
- * @internal
57
- */
58
- export declare class BufferDataRestoreInfo {
59
- main: RestoreDataAccessor;
60
- typeSize?: number;
61
- sparseCount?: number;
62
- sparseIndices?: RestoreDataAccessor;
63
- sparseValues?: RestoreDataAccessor;
64
- constructor(main: RestoreDataAccessor, typeSize?: number, sparseCount?: number, sparseIndices?: RestoreDataAccessor, sparseValues?: RestoreDataAccessor);
65
- }
66
- /**
67
- * @internal
68
- */
69
- export declare class RestoreDataAccessor {
70
- bufferIndex: number;
71
- TypedArray: new (buffer: ArrayBuffer, byteOffset: number, length?: number) => ArrayBufferView;
72
- byteOffset: number;
73
- length: number;
74
- constructor(bufferIndex: number, TypedArray: new (buffer: ArrayBuffer, byteOffset: number, length?: number) => ArrayBufferView, byteOffset: number, length: number);
75
- }
76
- /**
77
- * @internal
78
- */
79
- export declare class BlendShapeRestoreInfo {
80
- blendShape: BlendShape;
81
- position: BufferDataRestoreInfo;
82
- normal?: BufferDataRestoreInfo;
83
- tangent?: BufferDataRestoreInfo;
84
- constructor(blendShape: BlendShape, position: BufferDataRestoreInfo, normal?: BufferDataRestoreInfo, tangent?: BufferDataRestoreInfo);
85
- }
@@ -1,14 +0,0 @@
1
- import { AssetPromise, ContentRestorer, Texture2D } from "@galacean/engine-core";
2
- import { RequestConfig } from "@galacean/engine-core/types/asset/request";
3
- /**
4
- * @internal
5
- */
6
- export declare class Texture2DContentRestorer extends ContentRestorer<Texture2D> {
7
- url: string;
8
- requestConfig: RequestConfig;
9
- constructor(resource: Texture2D, url: string, requestConfig: RequestConfig);
10
- /**
11
- * @override
12
- */
13
- restoreContent(): AssetPromise<Texture2D>;
14
- }
@@ -1,14 +0,0 @@
1
- import { AssetPromise, ContentRestorer, TextureCube } from "@galacean/engine-core";
2
- import { RequestConfig } from "@galacean/engine-core/types/asset/request";
3
- /**
4
- * @internal
5
- */
6
- export declare class TextureCubeContentRestorer extends ContentRestorer<TextureCube> {
7
- urls: string[];
8
- requestConfig: RequestConfig;
9
- constructor(resource: TextureCube, urls: string[], requestConfig: RequestConfig);
10
- /**
11
- * @override
12
- */
13
- restoreContent(): AssetPromise<TextureCube>;
14
- }
@@ -1,23 +0,0 @@
1
- import { AssetPromise } from "@galacean/engine-core";
2
- import { GLTFResource } from "./GLTFResource";
3
- import { GLTFParser } from "./parser/GLTFParser";
4
- import { GLTFParserContext } from "./parser/GLTFParserContext";
5
- /**
6
- * GLTF pipeline.
7
- */
8
- export declare class GLTFPipeline {
9
- /**
10
- * Default pipeline.
11
- */
12
- static defaultPipeline: GLTFPipeline;
13
- private _parsers;
14
- /**
15
- * Constructor of GLTFPipeline.
16
- * @param parsers - Parsers to be executed in order
17
- */
18
- constructor(...parsers: (new () => GLTFParser)[]);
19
- /**
20
- * @internal
21
- */
22
- _parse(context: GLTFParserContext): AssetPromise<GLTFResource>;
23
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,52 +0,0 @@
1
- import { EngineObject } from "@galacean/engine-core";
2
- import { GLTFExtensionOwnerSchema } from "../GLTFSchema";
3
- import { GLTFParserContext } from "../parser/GLTFParserContext";
4
- import { GLTFExtensionSchema } from "./GLTFExtensionSchema";
5
- /**
6
- * Base class of glTF extension parser.
7
- */
8
- export declare abstract class GLTFExtensionParser {
9
- /**
10
- * @internal
11
- * The extension mode.
12
- */
13
- _mode: GLTFExtensionMode;
14
- /**
15
- * Initialize the parser.
16
- * @remarks Some plugins require initialization.
17
- * @returns The void or promise
18
- */
19
- initialize(): void | Promise<void>;
20
- /**
21
- * Create and parse the resource.
22
- * @remarks This method overrides the default resource creation.
23
- * @param context - The parser context
24
- * @param extensionSchema - The extension schema
25
- * @param extensionOwnerSchema - The extension owner schema
26
- * @returns The resource or promise
27
- */
28
- createAndParse(context: GLTFParserContext, extensionSchema: GLTFExtensionSchema, extensionOwnerSchema: GLTFExtensionOwnerSchema, ...extra: any[]): EngineObject | Promise<EngineObject>;
29
- /**
30
- * Additive parse to the resource.
31
- * @param context - The parser context
32
- * @param parseResource - The parsed resource
33
- * @param extensionSchema - The extension schema
34
- * @param extensionOwnerSchema - The extension owner schema
35
- * @returns The void or promise
36
- */
37
- additiveParse(context: GLTFParserContext, parseResource: EngineObject, extensionSchema: GLTFExtensionSchema, extensionOwnerSchema: GLTFExtensionOwnerSchema, ...extra: any[]): void | Promise<void>;
38
- }
39
- /**
40
- * glTF Extension mode.
41
- */
42
- export declare enum GLTFExtensionMode {
43
- /**
44
- * Cerate instance and parse mode.
45
- * @remarks
46
- * If the glTF property has multiple extensions of `CreateAndParse` mode, only execute the last one.
47
- * If this method is registered, the default pipeline processing will be ignored.
48
- */
49
- CreateAndParse = 0,
50
- /** Additive parse mode. */
51
- AdditiveParse = 1
52
- }
@@ -1,6 +0,0 @@
1
- export { GLTFPipeline } from "./GLTFPipeline";
2
- export { GLTFResource } from "./GLTFResource";
3
- export { GLTFUtils } from "./GLTFUtils";
4
- export * from "./parser";
5
- export * from "./extensions/index";
6
- export type { IMaterial, IMeshPrimitive, ITextureInfo, INode, GLTFExtensionOwnerSchema } from "./GLTFSchema";
@@ -1,12 +0,0 @@
1
- import { AnimationClip, AssetPromise } from "@galacean/engine-core";
2
- import { IAnimation } from "../GLTFSchema";
3
- import { GLTFParser } from "./GLTFParser";
4
- import { GLTFParserContext } from "./GLTFParserContext";
5
- export declare class GLTFAnimationParser extends GLTFParser {
6
- /**
7
- * @internal
8
- */
9
- static _parseStandardProperty(context: GLTFParserContext, animationClip: AnimationClip, animationInfo: IAnimation): void;
10
- private static _addCurve;
11
- parse(context: GLTFParserContext): AssetPromise<AnimationClip[]>;
12
- }
@@ -1,7 +0,0 @@
1
- import { AssetPromise } from "@galacean/engine-core";
2
- import { GLTFParser } from "./GLTFParser";
3
- import { GLTFParserContext } from "./GLTFParserContext";
4
- export declare class GLTFBufferParser extends GLTFParser {
5
- parse(context: GLTFParserContext): AssetPromise<void>;
6
- private _isGLB;
7
- }
@@ -1,9 +0,0 @@
1
- import { GLTFParser } from "./GLTFParser";
2
- import { GLTFParserContext } from "./GLTFParserContext";
3
- export declare class GLTFEntityParser extends GLTFParser {
4
- /** @internal */
5
- static _defaultName: String;
6
- parse(context: GLTFParserContext): void;
7
- private _buildEntityTree;
8
- private _createSceneRoots;
9
- }