@galacean/engine-loader 1.6.7 → 1.6.8

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 (107) hide show
  1. package/package.json +4 -4
  2. package/dist/main.js +0 -7355
  3. package/dist/main.js.map +0 -1
  4. package/dist/module.js +0 -7325
  5. package/dist/module.js.map +0 -1
  6. package/types/AnimationClipLoader.d.ts +0 -1
  7. package/types/AnimatorControllerLoader.d.ts +0 -1
  8. package/types/AudioLoader.d.ts +0 -1
  9. package/types/BufferLoader.d.ts +0 -1
  10. package/types/EnvLoader.d.ts +0 -1
  11. package/types/FontLoader.d.ts +0 -1
  12. package/types/GLTFContentRestorer.d.ts +0 -92
  13. package/types/GLTFLoader.d.ts +0 -22
  14. package/types/HDRLoader.d.ts +0 -1
  15. package/types/JSONLoader.d.ts +0 -1
  16. package/types/KTXCubeLoader.d.ts +0 -1
  17. package/types/KTXLoader.d.ts +0 -4
  18. package/types/MaterialLoader.d.ts +0 -1
  19. package/types/MeshLoader.d.ts +0 -1
  20. package/types/PhysicsMaterialLoader.d.ts +0 -1
  21. package/types/PrefabLoader.d.ts +0 -5
  22. package/types/PrimitiveMeshLoader.d.ts +0 -1
  23. package/types/ProjectLoader.d.ts +0 -1
  24. package/types/SceneLoader.d.ts +0 -1
  25. package/types/ShaderChunkLoader.d.ts +0 -9
  26. package/types/ShaderLoader.d.ts +0 -1
  27. package/types/SourceFontLoader.d.ts +0 -1
  28. package/types/SpriteAtlasLoader.d.ts +0 -1
  29. package/types/SpriteLoader.d.ts +0 -1
  30. package/types/TextLoader.d.ts +0 -1
  31. package/types/Texture2DContentRestorer.d.ts +0 -10
  32. package/types/Texture2DLoader.d.ts +0 -20
  33. package/types/TextureCubeContentRestorer.d.ts +0 -10
  34. package/types/TextureCubeLoader.d.ts +0 -1
  35. package/types/compressed-texture/KhronosTextureContainer.d.ts +0 -20
  36. package/types/compressed-texture/index.d.ts +0 -3
  37. package/types/compressed-texture/type.d.ts +0 -87
  38. package/types/gltf/GLTFResource.d.ts +0 -67
  39. package/types/gltf/GLTFSchema.d.ts +0 -822
  40. package/types/gltf/GLTFUtils.d.ts +0 -45
  41. package/types/gltf/extensions/EXT_meshopt_compression.d.ts +0 -26
  42. package/types/gltf/extensions/EXT_texture_webp.d.ts +0 -1
  43. package/types/gltf/extensions/GALACEAN_animation_event.d.ts +0 -1
  44. package/types/gltf/extensions/GALACEAN_materials_remap.d.ts +0 -1
  45. package/types/gltf/extensions/GLTFExtensionParser.d.ts +0 -46
  46. package/types/gltf/extensions/GLTFExtensionSchema.d.ts +0 -168
  47. package/types/gltf/extensions/KHR_lights_punctual.d.ts +0 -1
  48. package/types/gltf/extensions/KHR_materials_anisotropy.d.ts +0 -1
  49. package/types/gltf/extensions/KHR_materials_clearcoat.d.ts +0 -1
  50. package/types/gltf/extensions/KHR_materials_ior.d.ts +0 -1
  51. package/types/gltf/extensions/KHR_materials_iridescence.d.ts +0 -1
  52. package/types/gltf/extensions/KHR_materials_sheen.d.ts +0 -1
  53. package/types/gltf/extensions/KHR_materials_specular.d.ts +0 -1
  54. package/types/gltf/extensions/KHR_materials_transmission.d.ts +0 -1
  55. package/types/gltf/extensions/KHR_materials_unlit.d.ts +0 -1
  56. package/types/gltf/extensions/KHR_materials_variants.d.ts +0 -6
  57. package/types/gltf/extensions/KHR_materials_volume.d.ts +0 -1
  58. package/types/gltf/extensions/KHR_mesh_quantization.d.ts +0 -1
  59. package/types/gltf/extensions/KHR_texture_basisu.d.ts +0 -1
  60. package/types/gltf/extensions/KHR_texture_transform.d.ts +0 -1
  61. package/types/gltf/extensions/MeshoptDecoder.d.ts +0 -12
  62. package/types/gltf/extensions/index.d.ts +0 -21
  63. package/types/gltf/index.d.ts +0 -6
  64. package/types/gltf/parser/GLTFAnimationParser.d.ts +0 -12
  65. package/types/gltf/parser/GLTFAnimatorControllerParser.d.ts +0 -7
  66. package/types/gltf/parser/GLTFBufferParser.d.ts +0 -7
  67. package/types/gltf/parser/GLTFBufferViewParser.d.ts +0 -6
  68. package/types/gltf/parser/GLTFEntityParser.d.ts +0 -6
  69. package/types/gltf/parser/GLTFMaterialParser.d.ts +0 -15
  70. package/types/gltf/parser/GLTFMeshParser.d.ts +0 -20
  71. package/types/gltf/parser/GLTFParser.d.ts +0 -57
  72. package/types/gltf/parser/GLTFParserContext.d.ts +0 -74
  73. package/types/gltf/parser/GLTFSceneParser.d.ts +0 -11
  74. package/types/gltf/parser/GLTFSchemaParser.d.ts +0 -6
  75. package/types/gltf/parser/GLTFSkinParser.d.ts +0 -7
  76. package/types/gltf/parser/GLTFTextureParser.d.ts +0 -15
  77. package/types/gltf/parser/GLTFValidator.d.ts +0 -6
  78. package/types/gltf/parser/index.d.ts +0 -14
  79. package/types/index.d.ts +0 -35
  80. package/types/ktx2/KTX2Container.d.ts +0 -81
  81. package/types/ktx2/KTX2Loader.d.ts +0 -55
  82. package/types/ktx2/KTX2TargetFormat.d.ts +0 -27
  83. package/types/ktx2/WorkerPool.d.ts +0 -32
  84. package/types/ktx2/transcoder/AbstractTranscoder.d.ts +0 -55
  85. package/types/ktx2/transcoder/BinomialLLCTranscoder.d.ts +0 -8
  86. package/types/ktx2/transcoder/BinomialLLCWorkerCode.d.ts +0 -6
  87. package/types/prefab/PrefabParser.d.ts +0 -11
  88. package/types/prefab/PrefabResource.d.ts +0 -25
  89. package/types/resource-deserialize/index.d.ts +0 -21
  90. package/types/resource-deserialize/resources/animationClip/AnimationClipDecoder.d.ts +0 -18
  91. package/types/resource-deserialize/resources/mesh/MeshDecoder.d.ts +0 -8
  92. package/types/resource-deserialize/resources/mesh/type.d.ts +0 -31
  93. package/types/resource-deserialize/resources/parser/HierarchyParser.d.ts +0 -43
  94. package/types/resource-deserialize/resources/parser/ParserContext.d.ts +0 -30
  95. package/types/resource-deserialize/resources/parser/ReflectionParser.d.ts +0 -21
  96. package/types/resource-deserialize/resources/scene/EditorTextureLoader.d.ts +0 -4
  97. package/types/resource-deserialize/resources/scene/SceneParser.d.ts +0 -17
  98. package/types/resource-deserialize/resources/schema/BasicSchema.d.ts +0 -97
  99. package/types/resource-deserialize/resources/schema/MaterialSchema.d.ts +0 -102
  100. package/types/resource-deserialize/resources/schema/ProjectSchema.d.ts +0 -9
  101. package/types/resource-deserialize/resources/schema/SceneSchema.d.ts +0 -80
  102. package/types/resource-deserialize/resources/schema/index.d.ts +0 -4
  103. package/types/resource-deserialize/resources/texture2D/TextureDecoder.d.ts +0 -5
  104. package/types/resource-deserialize/utils/BufferReader.d.ts +0 -28
  105. package/types/resource-deserialize/utils/Decorator.d.ts +0 -11
  106. package/types/resource-deserialize/utils/FileHeader.d.ts +0 -9
  107. package/types/resource-deserialize/utils/Utils.d.ts +0 -5
@@ -1,6 +0,0 @@
1
- import { AssetPromise } from "@galacean/engine-core";
2
- import { GLTFParser } from "./GLTFParser";
3
- import { GLTFParserContext } from "./GLTFParserContext";
4
- export declare class GLTFValidator extends GLTFParser {
5
- parse(context: GLTFParserContext): AssetPromise<void>;
6
- }
@@ -1,14 +0,0 @@
1
- export { GLTFSchemaParser } from "./GLTFSchemaParser";
2
- export { GLTFAnimationParser } from "./GLTFAnimationParser";
3
- export { GLTFBufferParser } from "./GLTFBufferParser";
4
- export { GLTFEntityParser } from "./GLTFEntityParser";
5
- export { GLTFMaterialParser } from "./GLTFMaterialParser";
6
- export { GLTFMeshParser } from "./GLTFMeshParser";
7
- export { GLTFParser, registerGLTFExtension } from "./GLTFParser";
8
- export { GLTFSceneParser } from "./GLTFSceneParser";
9
- export { GLTFSkinParser } from "./GLTFSkinParser";
10
- export { GLTFTextureParser } from "./GLTFTextureParser";
11
- export { GLTFValidator } from "./GLTFValidator";
12
- export { GLTFParserContext, GLTFParserType, registerGLTFParser, BufferInfo } from "./GLTFParserContext";
13
- export { GLTFBufferViewParser } from "./GLTFBufferViewParser";
14
- export { GLTFAnimatorControllerParser } from "./GLTFAnimatorControllerParser";
package/types/index.d.ts DELETED
@@ -1,35 +0,0 @@
1
- import "./AnimationClipLoader";
2
- import "./AnimatorControllerLoader";
3
- import "./BufferLoader";
4
- import "./EnvLoader";
5
- import "./FontLoader";
6
- import "./GLTFLoader";
7
- import "./PrefabLoader";
8
- import "./HDRLoader";
9
- import "./JSONLoader";
10
- import "./KTXCubeLoader";
11
- import "./KTXLoader";
12
- import "./MaterialLoader";
13
- import "./MeshLoader";
14
- import "./PrimitiveMeshLoader";
15
- import "./ProjectLoader";
16
- import "./SourceFontLoader";
17
- import "./SpriteAtlasLoader";
18
- import "./SpriteLoader";
19
- import "./Texture2DLoader";
20
- import "./TextureCubeLoader";
21
- import "./AudioLoader";
22
- import "./ktx2/KTX2Loader";
23
- import "./ShaderLoader";
24
- import "./ShaderChunkLoader";
25
- import "./PhysicsMaterialLoader";
26
- export { GLTFLoader } from "./GLTFLoader";
27
- export type { GLTFParams } from "./GLTFLoader";
28
- export * from "./SceneLoader";
29
- export type { Texture2DParams } from "./Texture2DLoader";
30
- export { parseSingleKTX } from "./compressed-texture";
31
- export * from "./gltf";
32
- export { KTX2Loader } from "./ktx2/KTX2Loader";
33
- export { KTX2TargetFormat } from "./ktx2/KTX2TargetFormat";
34
- export * from "./resource-deserialize";
35
- export * from "./prefab/PrefabResource";
@@ -1,81 +0,0 @@
1
- export declare enum DFDTransferFunction {
2
- linear = 1,
3
- sRGB = 2
4
- }
5
- export declare enum ColorModel {
6
- ETC1S = 163,
7
- UASTC_LDR_4X4 = 166,
8
- UASTC_HDR_4X4 = 167
9
- }
10
- export declare enum SupercompressionScheme {
11
- None = 0,
12
- BasisLZ = 1,
13
- Zstd = 2,
14
- ZLib = 3
15
- }
16
- /** @internal */
17
- export declare class KTX2Container {
18
- vkFormat: number;
19
- typeSize: number;
20
- pixelWidth: number;
21
- pixelHeight: number;
22
- pixelDepth: number;
23
- layerCount: number;
24
- faceCount: number;
25
- supercompressionScheme: SupercompressionScheme;
26
- levels: KTX2Level[];
27
- dataFormatDescriptor: KTX2DataFormatDescriptorBasicFormat;
28
- keyValue: {
29
- [key: string]: string | Uint8Array;
30
- };
31
- globalData: KTX2GlobalDataBasisLZ | null;
32
- constructor(buffer: Uint8Array);
33
- get isSRGB(): boolean;
34
- get colorModel(): ColorModel;
35
- private parse;
36
- }
37
- interface KTX2Level {
38
- levelData: Uint8Array;
39
- uncompressedByteLength: number;
40
- }
41
- interface KTX2DataFormatDescriptorBasicFormat {
42
- vendorId: number;
43
- descriptorType: number;
44
- versionNumber: number;
45
- /** @deprecated Inferred. */
46
- descriptorBlockSize: number;
47
- colorModel: number;
48
- colorPrimaries: number;
49
- transferFunction: number;
50
- flags: number;
51
- texelBlockDimension: [number, number, number, number];
52
- bytesPlane: [number, number, number, number, number, number, number, number];
53
- samples: KTX2BasicFormatSample[];
54
- }
55
- interface KTX2BasicFormatSample {
56
- bitOffset: number;
57
- bitLength: number;
58
- /** @deprecated Renamed to 'channelType'. */
59
- channelID?: number;
60
- channelType: number;
61
- samplePosition: number[];
62
- sampleLower: number;
63
- sampleUpper: number;
64
- }
65
- interface KTX2GlobalDataBasisLZ {
66
- endpointCount: number;
67
- selectorCount: number;
68
- imageDescs: KTX2GlobalDataBasisLZImageDesc[];
69
- endpointsData: Uint8Array;
70
- selectorsData: Uint8Array;
71
- tablesData: Uint8Array;
72
- extendedData: Uint8Array;
73
- }
74
- interface KTX2GlobalDataBasisLZImageDesc {
75
- imageFlags: number;
76
- rgbSliceByteOffset: number;
77
- rgbSliceByteLength: number;
78
- alphaSliceByteOffset: number;
79
- alphaSliceByteLength: number;
80
- }
81
- export {};
@@ -1,55 +0,0 @@
1
- import { AssetPromise, Engine, EngineConfiguration, LoadItem, Loader, ResourceManager, Texture2D, TextureCube } from "@galacean/engine-core";
2
- import { KTX2Container } from "./KTX2Container";
3
- import { KTX2TargetFormat } from "./KTX2TargetFormat";
4
- import { TranscodeResult } from "./transcoder/AbstractTranscoder";
5
- export declare class KTX2Loader extends Loader<Texture2D | TextureCube> {
6
- private static _binomialLLCTranscoder;
7
- private static _priorityFormats;
8
- private static _capabilityMap;
9
- /**
10
- * Release ktx2 transcoder worker.
11
- * @remarks If use loader after releasing, we should release again.
12
- */
13
- static release(): void;
14
- /** @internal */
15
- static _parseBuffer(buffer: Uint8Array, engine: Engine, params?: KTX2Params): Promise<{
16
- ktx2Container: KTX2Container;
17
- engine: Engine;
18
- result: TranscodeResult;
19
- targetFormat: KTX2TargetFormat;
20
- params: Uint8Array;
21
- }>;
22
- /** @internal */
23
- static _createTextureByBuffer(engine: Engine, isSRGB: boolean, transcodeResult: TranscodeResult, targetFormat: KTX2TargetFormat, params?: Uint8Array, restoredTexture?: Texture2D | TextureCube): Texture2D | TextureCube;
24
- private static _decideTargetFormat;
25
- private static _detectSupportedFormat;
26
- private static _getBinomialLLCTranscoder;
27
- private static _getEngineTextureFormat;
28
- initialize(_: Engine, configuration: EngineConfiguration): Promise<void>;
29
- /**
30
- * @internal
31
- */
32
- load(item: LoadItem & {
33
- params?: KTX2Params;
34
- }, resourceManager: ResourceManager): AssetPromise<Texture2D | TextureCube>;
35
- }
36
- /**
37
- * KTX2 loader params interface.
38
- */
39
- export interface KTX2Params {
40
- /** Priority transcoding format queue which is preferred options, default is BC7/ASTC/BC3_BC1/ETC/PVRTC/R8G8B8A8. */
41
- /** @deprecated */
42
- priorityFormats: KTX2TargetFormat[];
43
- }
44
- declare module "@galacean/engine-core" {
45
- interface EngineConfiguration {
46
- /** KTX2 loader options. If set this option and workCount is great than 0, workers will be created. */
47
- ktx2Loader?: {
48
- /** Worker count for transcoder, default is 4. */
49
- workerCount?: number;
50
- /** Global transcoding format queue which will be used if not specified in per-instance param, default is BC7/ASTC/BC3_BC1/ETC/PVRTC/R8G8B8A8. */
51
- /** @deprecated */
52
- priorityFormats?: KTX2TargetFormat[];
53
- };
54
- }
55
- }
@@ -1,27 +0,0 @@
1
- /**
2
- * KTX2 transcode target format.
3
- */
4
- export declare enum KTX2TargetFormat {
5
- /** RGB(A) compressed format, 128 bits per 4x4 pixel block. */
6
- ASTC = 0,
7
- /** RGB(A) compressed format, 128 bits per 4x4 pixel block. */
8
- BC7 = 1,
9
- /** RGB(A) compressed format, 4 bits per pixel if no alpha channel, 8 bits per pixel if has alpha channel. */
10
- BC1_BC3 = 2,
11
- /** RGB(A) compressed format, 4 bits per pixel. */
12
- PVRTC = 3,
13
- /** RGB(A) compressed format, 4 bits per pixel if no alpha channel, 8 bits per pixel if has alpha channel. */
14
- ETC = 4,
15
- /** R format, 8 bits per pixel. */
16
- R8 = 5,
17
- /** RG format, 16 bits per pixel. */
18
- R8G8 = 6,
19
- /** RGBA format, 32 bits per pixel. */
20
- R8G8B8A8 = 7,
21
- /** RGB HDR compressed format, 8 bits per pixel. */
22
- BC6H = 8,
23
- /** HDR RGB(A) compressed format, 128 bits per 4x4 pixel block (currently UASTC HDR 4x4 encoders are only RGB). */
24
- ASTC_HDR_4x4 = 9,
25
- /** RGBA format, 16 bits per channel. */
26
- R16G16B16A16 = 10
27
- }
@@ -1,32 +0,0 @@
1
- /**
2
- * @internal
3
- * WorkerPool, T is is post message type, U is return type.
4
- */
5
- export declare class WorkerPool<T = any, U = any> {
6
- readonly limitedCount: number;
7
- private readonly _workerCreator;
8
- private _taskQueue;
9
- private _workerStatus;
10
- private _workerItems;
11
- /**
12
- * Constructor of WorkerPool.
13
- * @param limitedCount - worker limit count
14
- * @param _workerCreator - creator of worker
15
- */
16
- constructor(limitedCount: number, _workerCreator: () => Worker | Promise<Worker>);
17
- prepareWorker(): Promise<Worker[]>;
18
- /**
19
- * Post message to worker.
20
- * @param message - Message which posted to worker
21
- * @returns Return a promise of message
22
- */
23
- postMessage(message: T): Promise<U>;
24
- /**
25
- * Destroy the worker pool.
26
- */
27
- destroy(): void;
28
- private _initWorker;
29
- private _getIdleWorkerId;
30
- private _onMessage;
31
- private _nextTask;
32
- }
@@ -1,55 +0,0 @@
1
- import { WorkerPool } from "../WorkerPool";
2
- export declare abstract class AbstractTranscoder {
3
- readonly workerLimitCount: number;
4
- protected _transcodeWorkerPool: WorkerPool;
5
- protected _initPromise: Promise<any>;
6
- constructor(workerLimitCount: number);
7
- init(): Promise<any>;
8
- destroy(): void;
9
- protected abstract _initTranscodeWorkerPool(): Promise<any>;
10
- protected _createTranscodePool(workerURL: string, wasmBuffer: ArrayBuffer): Promise<Worker[]>;
11
- }
12
- type MessageType = "init" | "transcode";
13
- export interface BaseMessage {
14
- type: MessageType;
15
- }
16
- export interface InitMessage extends BaseMessage {
17
- type: "init";
18
- transcoderWasm: ArrayBuffer;
19
- }
20
- export interface BinomialTranscodeMessage extends BaseMessage {
21
- type: "transcode";
22
- format: number;
23
- buffer: Uint8Array;
24
- }
25
- export type IBinomialMessage = InitMessage | BinomialTranscodeMessage;
26
- export type TranscodeResult = {
27
- width: number;
28
- height: number;
29
- hasAlpha: boolean;
30
- format: number;
31
- faces: Array<{
32
- data: Uint8Array;
33
- width: number;
34
- height: number;
35
- }>[];
36
- faceCount: number;
37
- };
38
- export type TranscodeResponse = {
39
- id: number;
40
- type: "transcoded";
41
- } & TranscodeResult;
42
- export interface EncodedData {
43
- buffer: Uint8Array;
44
- levelWidth: number;
45
- levelHeight: number;
46
- uncompressedByteLength: number;
47
- }
48
- export interface KhronosTranscoderMessage extends BaseMessage {
49
- type: "transcode";
50
- format: number;
51
- needZstd: boolean;
52
- data: EncodedData[][];
53
- }
54
- export type IKhronosMessageMessage = InitMessage | KhronosTranscoderMessage;
55
- export {};
@@ -1,8 +0,0 @@
1
- import { KTX2TargetFormat } from "../KTX2TargetFormat";
2
- import { AbstractTranscoder, TranscodeResult } from "./AbstractTranscoder";
3
- /** @internal */
4
- export declare class BinomialLLCTranscoder extends AbstractTranscoder {
5
- constructor(workerLimitCount: number);
6
- _initTranscodeWorkerPool(): Promise<any>;
7
- transcode(buffer: Uint8Array, format: KTX2TargetFormat): Promise<TranscodeResult>;
8
- }
@@ -1,6 +0,0 @@
1
- import { TranscodeResult } from "./AbstractTranscoder";
2
- /** @internal */
3
- export declare function TranscodeWorkerCode(): void;
4
- export declare const _init: () => (wasmBinary?: ArrayBuffer) => any;
5
- export declare const init: (wasmBinary?: ArrayBuffer) => any;
6
- export declare function transcode(buffer: Uint8Array, targetFormat: any, KTX2File: any): TranscodeResult;
@@ -1,11 +0,0 @@
1
- import { Engine, Entity } from "@galacean/engine-core";
2
- import { HierarchyParser } from "../resource-deserialize/resources/parser/HierarchyParser";
3
- import { PrefabResource } from "./PrefabResource";
4
- import { IHierarchyFile, ParserContext } from "../resource-deserialize";
5
- export declare class PrefabParser extends HierarchyParser<PrefabResource, ParserContext<IHierarchyFile, Entity>> {
6
- readonly prefabResource: PrefabResource;
7
- static parse(engine: Engine, url: string, data: IHierarchyFile): Promise<PrefabResource>;
8
- constructor(data: IHierarchyFile, context: ParserContext<IHierarchyFile, Entity>, prefabResource: PrefabResource);
9
- protected _handleRootEntity(id: string): void;
10
- protected _clearAndResolve(): PrefabResource;
11
- }
@@ -1,25 +0,0 @@
1
- import { Engine, Entity, ReferResource } from "@galacean/engine-core";
2
- /**
3
- * The Prefab resource.
4
- */
5
- export declare class PrefabResource extends ReferResource {
6
- readonly url: string;
7
- /** @internal */
8
- _root: Entity;
9
- private _dependenceAssets;
10
- /**
11
- * @internal
12
- * @param url - The url of the prefab
13
- */
14
- constructor(engine: Engine, url: string);
15
- /**
16
- * Instantiate prefab.
17
- * @returns prefab's root entity
18
- */
19
- instantiate(): Entity;
20
- /**
21
- * @internal
22
- */
23
- _addDependenceAsset(resource: ReferResource): void;
24
- protected _onDestroy(): void;
25
- }
@@ -1,21 +0,0 @@
1
- import { AssetPromise, Engine } from "@galacean/engine-core";
2
- export * from "./resources/animationClip/AnimationClipDecoder";
3
- export type { IModelMesh } from "./resources/mesh/IModelMesh";
4
- export { MeshDecoder } from "./resources/mesh/MeshDecoder";
5
- export { ReflectionParser } from "./resources/parser/ReflectionParser";
6
- export { Texture2DDecoder } from "./resources/texture2D/TextureDecoder";
7
- /**
8
- * Decode engine binary resource.
9
- * @param arrayBuffer - array buffer of decode binary file
10
- * @param engine - engine
11
- * @returns
12
- */
13
- export declare function decode<T>(arrayBuffer: ArrayBuffer, engine: Engine, ...args: any[]): AssetPromise<T>;
14
- export * from "./resources/parser/HierarchyParser";
15
- export * from "./resources/parser/ParserContext";
16
- export * from "./resources/scene/EditorTextureLoader";
17
- export * from "./resources/scene/SceneParser";
18
- export * from "./resources/schema";
19
- export * from "./utils/BufferReader";
20
- export * from "./utils/Decorator";
21
- export * from "./utils/FileHeader";
@@ -1,18 +0,0 @@
1
- import { AnimationClip, AssetPromise, Engine } from "@galacean/engine-core";
2
- import type { BufferReader } from "../../utils/BufferReader";
3
- export declare enum InterpolableValueType {
4
- Float = 0,
5
- FloatArray = 1,
6
- Vector2 = 2,
7
- Vector3 = 3,
8
- Vector4 = 4,
9
- Quaternion = 5,
10
- Color = 6,
11
- Array = 7,
12
- Boolean = 8,
13
- Rect = 9,
14
- ReferResource = 10
15
- }
16
- export declare class AnimationClipDecoder {
17
- static decode(engine: Engine, bufferReader: BufferReader): AssetPromise<AnimationClip>;
18
- }
@@ -1,8 +0,0 @@
1
- import { AssetPromise, Engine, ModelMesh } from "@galacean/engine-core";
2
- import type { BufferReader } from "../../utils/BufferReader";
3
- /**
4
- * @todo refactor
5
- */
6
- export declare class MeshDecoder {
7
- static decode(engine: Engine, bufferReader: BufferReader, restoredMesh?: ModelMesh): AssetPromise<ModelMesh>;
8
- }
@@ -1,31 +0,0 @@
1
- type uint8 = number;
2
- type uint16 = number;
3
- type uint32 = number;
4
- export interface IMeshData {
5
- objectId: string;
6
- name: string;
7
- vertexElements: Array<{
8
- semantic: string;
9
- offset: uint32;
10
- format: uint8;
11
- bindingIndex: uint8;
12
- instanceStepRate: uint8;
13
- }>;
14
- subMeshes: Array<{
15
- start: uint32;
16
- count: uint32;
17
- topology: uint8;
18
- }>;
19
- vertexBuffer: {
20
- bufferUsage: uint8;
21
- buffer: ArrayBuffer;
22
- stride: uint16;
23
- };
24
- hasIndexBuffer: boolean;
25
- indexBuffer?: {
26
- bufferUsage: uint8;
27
- buffer: ArrayBuffer;
28
- format: uint8;
29
- };
30
- }
31
- export {};
@@ -1,43 +0,0 @@
1
- import { Engine, Scene } from "@galacean/engine-core";
2
- import { PrefabResource } from "../../../prefab/PrefabResource";
3
- import type { IHierarchyFile } from "../schema";
4
- import { ParserContext } from "./ParserContext";
5
- import { ReflectionParser } from "./ReflectionParser";
6
- /** @Internal */
7
- export declare abstract class HierarchyParser<T extends Scene | PrefabResource, V extends ParserContext<IHierarchyFile, T>> {
8
- readonly data: IHierarchyFile;
9
- readonly context: V;
10
- /**
11
- * The promise of parsed object.
12
- */
13
- readonly promise: Promise<T>;
14
- protected _resolve: (item: T) => void;
15
- protected _reject: (reason: any) => void;
16
- protected _engine: Engine;
17
- protected _reflectionParser: ReflectionParser;
18
- private _prefabContextMap;
19
- private _prefabPromiseMap;
20
- constructor(data: IHierarchyFile, context: V);
21
- /** start parse the scene or prefab or others */
22
- start(): void;
23
- protected abstract _handleRootEntity(id: string): void;
24
- protected abstract _clearAndResolve(): Scene | PrefabResource;
25
- private _parseEntities;
26
- private _parseComponents;
27
- private _parsePrefabModification;
28
- private _parseAddedComponents;
29
- private _parsePrefabRemovedEntities;
30
- private _parsePrefabRemovedComponents;
31
- private _organizeEntities;
32
- private _getEntityByConfig;
33
- private _parseEntity;
34
- private _parsePrefab;
35
- private _parseStrippedEntity;
36
- private _parseChildren;
37
- private _addComponents;
38
- private _applyEntityData;
39
- private _generateInstanceContext;
40
- private _parseComponentsPropsAndMethods;
41
- private _addComponentPlugin;
42
- private _addEntityPlugin;
43
- }
@@ -1,30 +0,0 @@
1
- import { AssetPromise, Component, Engine, EngineObject, Entity, ReferResource, ResourceManager, Scene } from "@galacean/engine-core";
2
- import type { IEntity, IHierarchyFile } from "../schema";
3
- export declare enum ParserType {
4
- Prefab = 0,
5
- Scene = 1
6
- }
7
- /**
8
- * @internal
9
- */
10
- export declare class ParserContext<T extends IHierarchyFile, I extends EngineObject> {
11
- readonly engine: Engine;
12
- readonly type: ParserType;
13
- readonly resource: ReferResource | Scene;
14
- entityMap: Map<string, Entity>;
15
- entityConfigMap: Map<string, IEntity>;
16
- components: Map<string, Component>;
17
- componentConfigMap: Map<string, any>;
18
- rootIds: string[];
19
- strippedIds: string[];
20
- readonly resourceManager: ResourceManager;
21
- private _tasks;
22
- private _loaded;
23
- private _total;
24
- constructor(engine: Engine, type: ParserType, resource: ReferResource | Scene);
25
- clear(): void;
26
- /** @internal */
27
- _setTaskCompleteProgress: (loaded: number, total: number) => void;
28
- /** @internal */
29
- _addDependentAsset(refID: string, promise: AssetPromise<any>): void;
30
- }
@@ -1,21 +0,0 @@
1
- import { EngineObject, Entity } from "@galacean/engine-core";
2
- import type { IBasicType, IClass, IEntity, IHierarchyFile, IMethodParams } from "../schema";
3
- import { ParserContext } from "./ParserContext";
4
- export declare class ReflectionParser {
5
- private readonly _context;
6
- static customParseComponentHandles: Map<string, Function>;
7
- static registerCustomParseComponent(componentType: string, handle: Function): void;
8
- constructor(_context: ParserContext<IHierarchyFile, EngineObject>);
9
- parseEntity(entityConfig: IEntity): Promise<Entity>;
10
- parseClassObject(item: IClass): Promise<any>;
11
- parsePropsAndMethods(instance: any, item: Omit<IClass, "class">): Promise<any>;
12
- parseMethod(instance: any, methodName: string, methodParams: IMethodParams): Promise<any>;
13
- parseBasicType(value: IBasicType, originValue?: any): Promise<any>;
14
- private _getEntityByConfig;
15
- private static _isClass;
16
- private static _isClassType;
17
- private static _isAssetRef;
18
- private static _isEntityRef;
19
- private static _isComponentRef;
20
- private static _isMethodObject;
21
- }
@@ -1,4 +0,0 @@
1
- import { AssetPromise, Loader, LoadItem, ResourceManager, Texture2D } from "@galacean/engine-core";
2
- export declare class EditorTextureLoader extends Loader<Texture2D> {
3
- load(item: LoadItem, resourceManager: ResourceManager): AssetPromise<Texture2D>;
4
- }
@@ -1,17 +0,0 @@
1
- import { Scene } from "@galacean/engine-core";
2
- import { HierarchyParser } from "../parser/HierarchyParser";
3
- import { ParserContext } from "../parser/ParserContext";
4
- import { type IScene } from "../schema";
5
- /** @Internal */
6
- export declare class SceneParser extends HierarchyParser<Scene, ParserContext<IScene, Scene>> {
7
- readonly scene: Scene;
8
- constructor(data: IScene, context: ParserContext<IScene, Scene>, scene: Scene);
9
- /**
10
- * @internal
11
- */
12
- _collectDependentAssets(data: IScene): void;
13
- protected _handleRootEntity(id: string): void;
14
- protected _clearAndResolve(): Scene;
15
- private _parseDependentAssets;
16
- private _searchDependentAssets;
17
- }
@@ -1,97 +0,0 @@
1
- import { Layer } from "@galacean/engine-core";
2
- export interface IVector3 {
3
- x: number;
4
- y: number;
5
- z: number;
6
- }
7
- export interface IVector2 {
8
- x: number;
9
- y: number;
10
- }
11
- export interface IVector4 {
12
- x: number;
13
- y: number;
14
- z: number;
15
- w: number;
16
- }
17
- export interface IColor {
18
- r: number;
19
- g: number;
20
- b: number;
21
- a: number;
22
- }
23
- export interface IHierarchyFile {
24
- entities: Array<IEntity>;
25
- }
26
- export type IMethod = {
27
- params: Array<IBasicType>;
28
- result?: IInstance;
29
- };
30
- export type IMethodParams = Array<IBasicType> | IMethod;
31
- export interface IBasicEntity {
32
- name?: string;
33
- id?: string;
34
- transform?: IComponent;
35
- components?: Array<IComponent>;
36
- isActive?: boolean;
37
- position?: IVector3;
38
- rotation?: IVector3;
39
- scale?: IVector3;
40
- children?: Array<string>;
41
- parent?: string;
42
- layer?: Layer;
43
- }
44
- export type IEntity = IBasicEntity | IRefEntity | IStrippedEntity;
45
- export interface IRefEntity extends IBasicEntity {
46
- assetRefId: string;
47
- key?: string;
48
- isClone?: boolean;
49
- modifications: (IInstance & {
50
- target: IPrefabModifyTarget;
51
- })[];
52
- removedEntities: IPrefabModifyTarget[];
53
- removedComponents: IPrefabModifyTarget[];
54
- }
55
- export interface IPrefabModifyTarget {
56
- entityId?: string;
57
- componentId?: string;
58
- }
59
- export interface IStrippedEntity extends IBasicEntity {
60
- strippedId: string;
61
- prefabInstanceId: string;
62
- prefabSource: {
63
- assetId: string;
64
- entityId: string;
65
- };
66
- }
67
- export type IComponent = {
68
- id: string;
69
- refId?: string;
70
- } & IClass;
71
- export type IClass = {
72
- class: string;
73
- constructParams?: Array<IBasicType>;
74
- } & IInstance;
75
- export interface IInstance {
76
- methods?: {
77
- [methodName: string]: Array<IMethodParams>;
78
- };
79
- props?: {
80
- [key: string]: IBasicType | IMethodParams;
81
- };
82
- }
83
- export type IClassType = {
84
- classType: string;
85
- };
86
- export type IBasicType = string | number | boolean | null | undefined | IAssetRef | IClass | IClassType | IMethodParams | IEntityRef;
87
- export type IAssetRef = {
88
- key?: string;
89
- refId: string;
90
- };
91
- export type IEntityRef = {
92
- entityId: string;
93
- };
94
- export type IComponentRef = {
95
- ownerId: string;
96
- componentId: string;
97
- };