@galacean/engine-loader 1.3.2 → 1.3.4

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 (142) hide show
  1. package/dist/main.js +87 -49
  2. package/dist/main.js.map +1 -1
  3. package/dist/miniprogram.js +87 -49
  4. package/dist/module.js +87 -49
  5. package/dist/module.js.map +1 -1
  6. package/package.json +4 -4
  7. package/types/gltf/GLTFSchema.d.ts +1 -1
  8. package/types/gltf/extensions/index.d.ts +1 -0
  9. package/types/gltf/parser/GLTFTextureParser.d.ts +4 -2
  10. package/types/draco/src/DRACOWorker.d.ts +0 -23
  11. package/types/draco/src/KHR_draco_mesh_compression.d.ts +0 -9
  12. package/types/draco/src/decoder.d.ts +0 -18
  13. package/types/gltf/GLTFParser.d.ts +0 -9
  14. package/types/gltf/GLTFPipeline.d.ts +0 -23
  15. package/types/gltf/GLTFUtil.d.ts +0 -53
  16. package/types/gltf/Schema.d.ts +0 -814
  17. package/types/gltf/extensions/ExtensionParser.d.ts +0 -8
  18. package/types/gltf/extensions/Schema.d.ts +0 -142
  19. package/types/gltf/extensions/test.d.ts +0 -0
  20. package/types/gltf/parser/AnimationParser.d.ts +0 -7
  21. package/types/gltf/parser/BufferParser.d.ts +0 -7
  22. package/types/gltf/parser/EntityParser.d.ts +0 -9
  23. package/types/gltf/parser/MaterialParser.d.ts +0 -8
  24. package/types/gltf/parser/MeshParser.d.ts +0 -13
  25. package/types/gltf/parser/Parser.d.ts +0 -21
  26. package/types/gltf/parser/ParserContext.d.ts +0 -46
  27. package/types/gltf/parser/SceneParser.d.ts +0 -11
  28. package/types/gltf/parser/SkinParser.d.ts +0 -6
  29. package/types/gltf/parser/TextureParser.d.ts +0 -8
  30. package/types/gltf/parser/Validator.d.ts +0 -5
  31. package/types/ktx2/BinomialLLCTranscoder/BinomialLLCTranscoder.d.ts +0 -13
  32. package/types/ktx2/BinomialLLCTranscoder/TranscodeWorkerCode.d.ts +0 -33
  33. package/types/ktx2/KTX2Parser.d.ts +0 -4
  34. package/types/ktx2/KhronosTranscoder/KhronosTranscoder.d.ts +0 -17
  35. package/types/ktx2/KhronosTranscoder/TranscoderWorkerCode.d.ts +0 -34
  36. package/types/ktx2/TargetFormat.d.ts +0 -8
  37. package/types/ktx2/TranscodeResult.d.ts +0 -10
  38. package/types/ktx2/constants.d.ts +0 -7
  39. package/types/ktx2/zstddec.d.ts +0 -62
  40. package/types/loader/src/AnimationClipLoader.d.ts +0 -1
  41. package/types/loader/src/AnimatorControllerLoader.d.ts +0 -1
  42. package/types/loader/src/BufferLoader.d.ts +0 -1
  43. package/types/loader/src/EnvLoader.d.ts +0 -1
  44. package/types/loader/src/FontLoader.d.ts +0 -1
  45. package/types/loader/src/GLTFContentRestorer.d.ts +0 -92
  46. package/types/loader/src/GLTFLoader.d.ts +0 -22
  47. package/types/loader/src/HDRLoader.d.ts +0 -1
  48. package/types/loader/src/JSONLoader.d.ts +0 -1
  49. package/types/loader/src/KTXCubeLoader.d.ts +0 -1
  50. package/types/loader/src/KTXLoader.d.ts +0 -4
  51. package/types/loader/src/MaterialLoader.d.ts +0 -1
  52. package/types/loader/src/MeshLoader.d.ts +0 -1
  53. package/types/loader/src/ProjectLoader.d.ts +0 -1
  54. package/types/loader/src/SceneLoader.d.ts +0 -1
  55. package/types/loader/src/SourceFontLoader.d.ts +0 -1
  56. package/types/loader/src/SpriteAtlasLoader.d.ts +0 -1
  57. package/types/loader/src/SpriteLoader.d.ts +0 -1
  58. package/types/loader/src/TextLoader.d.ts +0 -1
  59. package/types/loader/src/Texture2DContentRestorer.d.ts +0 -11
  60. package/types/loader/src/Texture2DLoader.d.ts +0 -18
  61. package/types/loader/src/TextureCubeContentRestorer.d.ts +0 -11
  62. package/types/loader/src/TextureCubeLoader.d.ts +0 -1
  63. package/types/loader/src/compressed-texture/KhronosTextureContainer.d.ts +0 -20
  64. package/types/loader/src/compressed-texture/index.d.ts +0 -3
  65. package/types/loader/src/compressed-texture/type.d.ts +0 -87
  66. package/types/loader/src/gltf/GLTFResource.d.ts +0 -65
  67. package/types/loader/src/gltf/GLTFSchema.d.ts +0 -822
  68. package/types/loader/src/gltf/GLTFUtils.d.ts +0 -49
  69. package/types/loader/src/gltf/extensions/EXT_meshopt_compression.d.ts +0 -13
  70. package/types/loader/src/gltf/extensions/GALACEAN_animation_event.d.ts +0 -1
  71. package/types/loader/src/gltf/extensions/GALACEAN_materials_remap.d.ts +0 -1
  72. package/types/loader/src/gltf/extensions/GLTFExtensionParser.d.ts +0 -46
  73. package/types/loader/src/gltf/extensions/GLTFExtensionSchema.d.ts +0 -157
  74. package/types/loader/src/gltf/extensions/KHR_lights_punctual.d.ts +0 -1
  75. package/types/loader/src/gltf/extensions/KHR_materials_anisotropy.d.ts +0 -1
  76. package/types/loader/src/gltf/extensions/KHR_materials_clearcoat.d.ts +0 -1
  77. package/types/loader/src/gltf/extensions/KHR_materials_ior.d.ts +0 -1
  78. package/types/loader/src/gltf/extensions/KHR_materials_pbrSpecularGlossiness.d.ts +0 -1
  79. package/types/loader/src/gltf/extensions/KHR_materials_sheen.d.ts +0 -0
  80. package/types/loader/src/gltf/extensions/KHR_materials_transmission.d.ts +0 -0
  81. package/types/loader/src/gltf/extensions/KHR_materials_unlit.d.ts +0 -1
  82. package/types/loader/src/gltf/extensions/KHR_materials_variants.d.ts +0 -6
  83. package/types/loader/src/gltf/extensions/KHR_materials_volume.d.ts +0 -0
  84. package/types/loader/src/gltf/extensions/KHR_mesh_quantization.d.ts +0 -1
  85. package/types/loader/src/gltf/extensions/KHR_texture_basisu.d.ts +0 -1
  86. package/types/loader/src/gltf/extensions/KHR_texture_transform.d.ts +0 -1
  87. package/types/loader/src/gltf/extensions/MeshoptDecoder.d.ts +0 -8
  88. package/types/loader/src/gltf/extensions/index.d.ts +0 -19
  89. package/types/loader/src/gltf/index.d.ts +0 -5
  90. package/types/loader/src/gltf/parser/GLTFAnimationParser.d.ts +0 -12
  91. package/types/loader/src/gltf/parser/GLTFBufferParser.d.ts +0 -6
  92. package/types/loader/src/gltf/parser/GLTFBufferViewParser.d.ts +0 -5
  93. package/types/loader/src/gltf/parser/GLTFEntityParser.d.ts +0 -6
  94. package/types/loader/src/gltf/parser/GLTFMaterialParser.d.ts +0 -18
  95. package/types/loader/src/gltf/parser/GLTFMeshParser.d.ts +0 -19
  96. package/types/loader/src/gltf/parser/GLTFParser.d.ts +0 -57
  97. package/types/loader/src/gltf/parser/GLTFParserContext.d.ts +0 -70
  98. package/types/loader/src/gltf/parser/GLTFSceneParser.d.ts +0 -11
  99. package/types/loader/src/gltf/parser/GLTFSchemaParser.d.ts +0 -7
  100. package/types/loader/src/gltf/parser/GLTFSkinParser.d.ts +0 -7
  101. package/types/loader/src/gltf/parser/GLTFTextureParser.d.ts +0 -12
  102. package/types/loader/src/gltf/parser/GLTFValidator.d.ts +0 -5
  103. package/types/loader/src/gltf/parser/index.d.ts +0 -13
  104. package/types/loader/src/index.d.ts +0 -28
  105. package/types/loader/src/ktx2/KTX2Container.d.ts +0 -72
  106. package/types/loader/src/ktx2/KTX2Loader.d.ts +0 -65
  107. package/types/loader/src/ktx2/KTX2TargetFormat.d.ts +0 -21
  108. package/types/loader/src/ktx2/WorkerPool.d.ts +0 -32
  109. package/types/loader/src/ktx2/transcoder/AbstractTranscoder.d.ts +0 -55
  110. package/types/loader/src/ktx2/transcoder/BinomialLLCTranscoder.d.ts +0 -8
  111. package/types/loader/src/ktx2/transcoder/BinomialLLCWorkerCode.d.ts +0 -6
  112. package/types/loader/src/ktx2/transcoder/KhronosTranscoder.d.ts +0 -13
  113. package/types/loader/src/ktx2/transcoder/KhronosWorkerCode.d.ts +0 -1
  114. package/types/loader/src/resource-deserialize/index.d.ts +0 -18
  115. package/types/loader/src/resource-deserialize/resources/animationClip/AnimationClipDecoder.d.ts +0 -19
  116. package/types/loader/src/resource-deserialize/resources/animationClip/ComponentMap.d.ts +0 -2
  117. package/types/loader/src/resource-deserialize/resources/mesh/MeshDecoder.d.ts +0 -9
  118. package/types/loader/src/resource-deserialize/resources/mesh/type.d.ts +0 -31
  119. package/types/loader/src/resource-deserialize/resources/parser/PrefabParser.d.ts +0 -5
  120. package/types/loader/src/resource-deserialize/resources/parser/ReflectionParser.d.ts +0 -18
  121. package/types/loader/src/resource-deserialize/resources/scene/EditorTextureLoader.d.ts +0 -4
  122. package/types/loader/src/resource-deserialize/resources/scene/MeshLoader.d.ts +0 -4
  123. package/types/loader/src/resource-deserialize/resources/scene/SceneParser.d.ts +0 -29
  124. package/types/loader/src/resource-deserialize/resources/scene/SceneParserContext.d.ts +0 -15
  125. package/types/loader/src/resource-deserialize/resources/schema/BasicSchema.d.ts +0 -66
  126. package/types/loader/src/resource-deserialize/resources/schema/MaterialSchema.d.ts +0 -91
  127. package/types/loader/src/resource-deserialize/resources/schema/ProjectSchema.d.ts +0 -9
  128. package/types/loader/src/resource-deserialize/resources/schema/SceneSchema.d.ts +0 -43
  129. package/types/loader/src/resource-deserialize/resources/schema/index.d.ts +0 -4
  130. package/types/loader/src/resource-deserialize/resources/texture2D/TextureDecoder.d.ts +0 -5
  131. package/types/loader/src/resource-deserialize/utils/BufferReader.d.ts +0 -28
  132. package/types/loader/src/resource-deserialize/utils/Decorator.d.ts +0 -11
  133. package/types/loader/src/resource-deserialize/utils/FileHeader.d.ts +0 -9
  134. package/types/loader/src/resource-deserialize/utils/Utils.d.ts +0 -5
  135. package/types/prefab/PrefabParserContext.d.ts +0 -6
  136. package/types/prefab/index.d.ts +0 -3
  137. package/types/resource-deserialize/resources/animationClip/ComponentMap.d.ts +0 -2
  138. package/types/resource-deserialize/resources/parser/PrefabParser.d.ts +0 -5
  139. package/types/resource-deserialize/resources/parser/PrefabParserContext.d.ts +0 -5
  140. package/types/resource-deserialize/resources/prefab/PrefabDesign.d.ts +0 -70
  141. package/types/resource-deserialize/resources/prefab/ReflectionParser.d.ts +0 -14
  142. /package/types/gltf/extensions/{KHR_draco_mesh_compression.d.ts → EXT_texture_webp.d.ts} +0 -0
@@ -1,72 +0,0 @@
1
- export declare enum SupercompressionScheme {
2
- None = 0,
3
- BasisLZ = 1,
4
- Zstd = 2,
5
- ZLib = 3
6
- }
7
- /** @internal */
8
- export declare class KTX2Container {
9
- vkFormat: number;
10
- typeSize: number;
11
- pixelWidth: number;
12
- pixelHeight: number;
13
- pixelDepth: number;
14
- layerCount: number;
15
- faceCount: number;
16
- supercompressionScheme: SupercompressionScheme;
17
- levels: KTX2Level[];
18
- dataFormatDescriptor: KTX2DataFormatDescriptorBasicFormat;
19
- keyValue: {
20
- [key: string]: string | Uint8Array;
21
- };
22
- globalData: KTX2GlobalDataBasisLZ | null;
23
- constructor(buffer: Uint8Array);
24
- get isSRGB(): boolean;
25
- get isUASTC(): boolean;
26
- private parse;
27
- }
28
- interface KTX2Level {
29
- levelData: Uint8Array;
30
- uncompressedByteLength: number;
31
- }
32
- interface KTX2DataFormatDescriptorBasicFormat {
33
- vendorId: number;
34
- descriptorType: number;
35
- versionNumber: number;
36
- /** @deprecated Inferred. */
37
- descriptorBlockSize: number;
38
- colorModel: number;
39
- colorPrimaries: number;
40
- transferFunction: number;
41
- flags: number;
42
- texelBlockDimension: [number, number, number, number];
43
- bytesPlane: [number, number, number, number, number, number, number, number];
44
- samples: KTX2BasicFormatSample[];
45
- }
46
- interface KTX2BasicFormatSample {
47
- bitOffset: number;
48
- bitLength: number;
49
- /** @deprecated Renamed to 'channelType'. */
50
- channelID?: number;
51
- channelType: number;
52
- samplePosition: number[];
53
- sampleLower: number;
54
- sampleUpper: number;
55
- }
56
- interface KTX2GlobalDataBasisLZ {
57
- endpointCount: number;
58
- selectorCount: number;
59
- imageDescs: KTX2GlobalDataBasisLZImageDesc[];
60
- endpointsData: Uint8Array;
61
- selectorsData: Uint8Array;
62
- tablesData: Uint8Array;
63
- extendedData: Uint8Array;
64
- }
65
- interface KTX2GlobalDataBasisLZImageDesc {
66
- imageFlags: number;
67
- rgbSliceByteOffset: number;
68
- rgbSliceByteLength: number;
69
- alphaSliceByteOffset: number;
70
- alphaSliceByteLength: number;
71
- }
72
- export {};
@@ -1,65 +0,0 @@
1
- import { AssetPromise, Engine, EngineConfiguration, LoadItem, Loader, ResourceManager, Texture2D, TextureCube } from "@galacean/engine-core";
2
- import { KTX2TargetFormat } from "./KTX2TargetFormat";
3
- import { TranscodeResult } from "./transcoder/AbstractTranscoder";
4
- export declare class KTX2Loader extends Loader<Texture2D | TextureCube> {
5
- private static _isBinomialInit;
6
- private static _binomialLLCTranscoder;
7
- private static _khronosTranscoder;
8
- private static _priorityFormats;
9
- private static _supportedMap;
10
- /**
11
- * Release ktx2 transcoder worker.
12
- * @remarks If use loader after releasing, we should release again.
13
- */
14
- static release(): void;
15
- /** @internal */
16
- static _parseBuffer(buffer: Uint8Array, engine: Engine, params?: KTX2Params): Promise<{
17
- engine: Engine;
18
- result: TranscodeResult;
19
- targetFormat: KTX2TargetFormat;
20
- params: Uint8Array;
21
- }>;
22
- /** @internal */
23
- static _createTextureByBuffer(engine: Engine, transcodeResult: TranscodeResult, targetFormat: KTX2TargetFormat, params?: Uint8Array): Texture2D | TextureCube;
24
- private static _decideTargetFormat;
25
- private static _detectSupportedFormat;
26
- private static _getBinomialLLCTranscoder;
27
- private static _getKhronosTranscoder;
28
- private static _getEngineTextureFormat;
29
- initialize(_: Engine, configuration: EngineConfiguration): Promise<void>;
30
- /**
31
- * @internal
32
- */
33
- load(item: LoadItem & {
34
- params?: KTX2Params;
35
- }, resourceManager: ResourceManager): AssetPromise<Texture2D | TextureCube>;
36
- }
37
- /**
38
- * KTX2 loader params interface.
39
- */
40
- export interface KTX2Params {
41
- /** Priority transcoding format queue which is preferred options, default is BC7/ASTC/BC3_BC1/ETC/PVRTC/R8G8B8A8. */
42
- /** @deprecated */
43
- priorityFormats: KTX2TargetFormat[];
44
- }
45
- /** Used for initialize KTX2 transcoder. */
46
- export declare enum KTX2Transcoder {
47
- /** BinomialLLC transcoder. */
48
- BinomialLLC = 0,
49
- /** Khronos transcoder. */
50
- Khronos = 1
51
- }
52
- declare module "@galacean/engine-core" {
53
- interface EngineConfiguration {
54
- /** KTX2 loader options. If set this option and workCount is great than 0, workers will be created. */
55
- ktx2Loader?: {
56
- /** Worker count for transcoder, default is 4. */
57
- workerCount?: number;
58
- /** Global transcoding format queue which will be used if not specified in per-instance param, default is BC7/ASTC/BC3_BC1/ETC/PVRTC/R8G8B8A8. */
59
- /** @deprecated */
60
- priorityFormats?: KTX2TargetFormat[];
61
- /** Used for initialize KTX2 transcoder, default is BinomialLLC. */
62
- transcoder?: KTX2Transcoder;
63
- };
64
- }
65
- }
@@ -1,21 +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
- }
@@ -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,13 +0,0 @@
1
- import { KTX2Container } from "../KTX2Container";
2
- import { KTX2TargetFormat } from "../KTX2TargetFormat";
3
- import { AbstractTranscoder, TranscodeResult } from "./AbstractTranscoder";
4
- /** @internal */
5
- export declare class KhronosTranscoder extends AbstractTranscoder {
6
- readonly type: KTX2TargetFormat;
7
- static transcoderMap: {
8
- 0: string;
9
- };
10
- constructor(workerLimitCount: number, type: KTX2TargetFormat);
11
- _initTranscodeWorkerPool(): Promise<Worker[]>;
12
- transcode(ktx2Container: KTX2Container): Promise<TranscodeResult>;
13
- }
@@ -1 +0,0 @@
1
- export declare function TranscodeWorkerCode(): void;
@@ -1,18 +0,0 @@
1
- import { Engine } from "@galacean/engine-core";
2
- export { MeshDecoder } from "./resources/mesh/MeshDecoder";
3
- export { Texture2DDecoder } from "./resources/texture2D/TextureDecoder";
4
- export { ReflectionParser } from "./resources/parser/ReflectionParser";
5
- export { PrefabParser } from "./resources/parser/PrefabParser";
6
- export * from "./resources/animationClip/AnimationClipDecoder";
7
- export type { IModelMesh } from "./resources/mesh/IModelMesh";
8
- /**
9
- * Decode engine binary resource.
10
- * @param arrayBuffer - array buffer of decode binary file
11
- * @param engine - engine
12
- * @returns
13
- */
14
- export declare function decode<T>(arrayBuffer: ArrayBuffer, engine: Engine): Promise<T>;
15
- export * from "./resources/schema";
16
- export * from "./resources/scene/SceneParser";
17
- export * from "./resources/scene/MeshLoader";
18
- export * from "./resources/scene/EditorTextureLoader";
@@ -1,19 +0,0 @@
1
- import { AnimationClip, Engine } from "@galacean/engine-core";
2
- import type { BufferReader } from "../../utils/BufferReader";
3
- export { ComponentMap } from "./ComponentMap";
4
- export declare enum InterpolableValueType {
5
- Float = 0,
6
- FloatArray = 1,
7
- Vector2 = 2,
8
- Vector3 = 3,
9
- Vector4 = 4,
10
- Quaternion = 5,
11
- Color = 6,
12
- Array = 7,
13
- Boolean = 8,
14
- Rect = 9,
15
- ReferResource = 10
16
- }
17
- export declare class AnimationClipDecoder {
18
- static decode(engine: Engine, bufferReader: BufferReader): Promise<AnimationClip>;
19
- }
@@ -1,2 +0,0 @@
1
- import { Component, Entity } from "@galacean/engine-core";
2
- export declare const ComponentMap: Record<string, new (entity: Entity) => Component>;
@@ -1,9 +0,0 @@
1
- import type { Engine } from "@galacean/engine-core";
2
- import { ModelMesh } from "@galacean/engine-core";
3
- import type { BufferReader } from "../../utils/BufferReader";
4
- /**
5
- * @todo refactor
6
- */
7
- export declare class MeshDecoder {
8
- static decode(engine: Engine, bufferReader: BufferReader): Promise<ModelMesh>;
9
- }
@@ -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,5 +0,0 @@
1
- import { Entity } from "@galacean/engine-core";
2
- import type { IEntity } from "../schema";
3
- export declare class PrefabParser {
4
- static parseChildren(entitiesConfig: Map<string, IEntity>, entities: Map<string, Entity>, parentId: string): void;
5
- }
@@ -1,18 +0,0 @@
1
- import { Entity } from "@galacean/engine-core";
2
- import type { IBasicType, IClassObject, IEntity } from "../schema";
3
- import { SceneParserContext } from "../scene/SceneParserContext";
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: SceneParserContext);
9
- parseEntity(entityConfig: IEntity): Promise<Entity>;
10
- parseClassObject(item: IClassObject): Promise<any>;
11
- parsePropsAndMethods(instance: any, item: Omit<IClassObject, "class">): Promise<any>;
12
- parseMethod(instance: any, methodName: string, methodParams: Array<IBasicType>): Promise<any>;
13
- parseBasicType(value: IBasicType, originValue?: any): Promise<any>;
14
- private _getEntityByConfig;
15
- private static _isClass;
16
- private static _isAssetRef;
17
- private static _isEntityRef;
18
- }
@@ -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,4 +0,0 @@
1
- import { AssetPromise, Loader, LoadItem, ModelMesh, ResourceManager } from "@galacean/engine-core";
2
- export declare class MeshLoader extends Loader<ModelMesh> {
3
- load(item: LoadItem, resourceManager: ResourceManager): AssetPromise<ModelMesh>;
4
- }
@@ -1,29 +0,0 @@
1
- import { Engine, Scene } from "@galacean/engine-core";
2
- import type { IScene } from "../schema";
3
- import { SceneParserContext } from "./SceneParserContext";
4
- /** @Internal */
5
- export declare class SceneParser {
6
- readonly context: SceneParserContext;
7
- /**
8
- * Parse scene data.
9
- * @param engine - the engine of the parser context
10
- * @param sceneData - scene data which is exported by editor
11
- * @returns a promise of scene
12
- */
13
- static parse(engine: Engine, sceneData: IScene): Promise<Scene>;
14
- /**
15
- * The promise of parsed scene.
16
- */
17
- readonly promise: Promise<Scene>;
18
- private _resolve;
19
- private _reject;
20
- private _engine;
21
- private _reflectionParser;
22
- constructor(context: SceneParserContext);
23
- /** start parse the scene */
24
- start(): void;
25
- private _parseEntities;
26
- private _organizeEntities;
27
- private _parseComponents;
28
- private _clearAndResolveScene;
29
- }
@@ -1,15 +0,0 @@
1
- import { Component, Engine, Entity, ResourceManager, Scene } from "@galacean/engine-core";
2
- import type { IEntity, IScene } from "../schema";
3
- export declare class SceneParserContext {
4
- readonly originalData: IScene;
5
- readonly scene: Scene;
6
- entityMap: Map<string, Entity>;
7
- components: Map<string, Component>;
8
- assets: Map<string, any>;
9
- entityConfigMap: Map<string, IEntity>;
10
- rootIds: string[];
11
- readonly engine: Engine;
12
- readonly resourceManager: ResourceManager;
13
- constructor(originalData: IScene, scene: Scene);
14
- destroy(): void;
15
- }
@@ -1,66 +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 IPrefabFile {
24
- entities: Array<IEntity>;
25
- }
26
- export type IMethodParams = Array<IBasicType>;
27
- export interface IBasicEntity {
28
- name?: string;
29
- id?: string;
30
- components?: Array<IComponent>;
31
- isActive?: boolean;
32
- position?: IVector3;
33
- rotation?: IVector3;
34
- scale?: IVector3;
35
- children?: Array<string>;
36
- parent?: string;
37
- layer?: Layer;
38
- }
39
- export type IEntity = IBasicEntity | IRefEntity;
40
- export interface IRefEntity extends IBasicEntity {
41
- assetRefId: string;
42
- key?: string;
43
- isClone?: boolean;
44
- }
45
- export type IComponent = {
46
- id: string;
47
- refId?: string;
48
- } & IClassObject;
49
- export type IClassObject = {
50
- class: string;
51
- constructParams?: IMethodParams;
52
- methods?: {
53
- [methodName: string]: Array<IMethodParams>;
54
- };
55
- props?: {
56
- [key: string]: IBasicType | IMethodParams;
57
- };
58
- };
59
- export type IBasicType = string | number | boolean | null | undefined | IAssetRef | IClassObject | IMethodParams | IEntityRef;
60
- export type IAssetRef = {
61
- key?: string;
62
- refId: string;
63
- };
64
- export type IEntityRef = {
65
- entityId: string;
66
- };
@@ -1,91 +0,0 @@
1
- import { BlendFactor, BlendOperation, ColorWriteMask, CompareFunction, CullMode, RenderQueueType, StencilOperation } from "@galacean/engine-core";
2
- import type { IAssetRef, IColor, IVector2, IVector3 } from "./BasicSchema";
3
- export interface IRenderState {
4
- /** Blend state. */
5
- blendState: {
6
- /** The blend state of the render target. */
7
- targetBlendState: {
8
- /** Whether to enable blend. */
9
- enabled: boolean;
10
- /** color (RGB) blend operation. */
11
- colorBlendOperation: BlendOperation;
12
- /** alpha (A) blend operation. */
13
- alphaBlendOperation: BlendOperation;
14
- /** color blend factor (RGB) for source. */
15
- sourceColorBlendFactor: BlendFactor;
16
- /** alpha blend factor (A) for source. */
17
- sourceAlphaBlendFactor: BlendFactor;
18
- /** color blend factor (RGB) for destination. */
19
- destinationColorBlendFactor: BlendFactor;
20
- /** alpha blend factor (A) for destination. */
21
- destinationAlphaBlendFactor: BlendFactor;
22
- /** color mask. */
23
- colorWriteMask: ColorWriteMask;
24
- };
25
- blendColor: IColor;
26
- /** Whether to use (Alpha-to-Coverage) technology. */
27
- alphaToCoverage: boolean;
28
- };
29
- /** Depth state. */
30
- depthState: {
31
- /** Whether to enable the depth test. */
32
- enabled: boolean;
33
- /** Whether the depth value can be written.*/
34
- writeEnabled: boolean;
35
- /** Depth comparison function. */
36
- compareFunction: CompareFunction;
37
- };
38
- /** Stencil state. */
39
- stencilState: {
40
- /** Whether to enable stencil test. */
41
- enabled: boolean;
42
- /** Write the reference value of the stencil buffer. */
43
- referenceValue: number;
44
- /** Specifying a bit-wise mask that is used to AND the reference value and the stored stencil value when the test is done. */
45
- mask: number;
46
- /** Specifying a bit mask to enable or disable writing of individual bits in the stencil planes. */
47
- writeMask: number;
48
- /** The comparison function of the reference value of the front face of the geometry and the current buffer storage value. */
49
- compareFunctionFront: CompareFunction;
50
- /** The comparison function of the reference value of the back of the geometry and the current buffer storage value. */
51
- compareFunctionBack: CompareFunction;
52
- /** specifying the function to use for front face when both the stencil test and the depth test pass. */
53
- passOperationFront: StencilOperation;
54
- /** specifying the function to use for back face when both the stencil test and the depth test pass. */
55
- passOperationBack: StencilOperation;
56
- /** specifying the function to use for front face when the stencil test fails. */
57
- failOperationFront: StencilOperation;
58
- /** specifying the function to use for back face when the stencil test fails. */
59
- failOperationBack: StencilOperation;
60
- /** specifying the function to use for front face when the stencil test passes, but the depth test fails. */
61
- zFailOperationFront: StencilOperation;
62
- /** specifying the function to use for back face when the stencil test passes, but the depth test fails. */
63
- zFailOperationBack: StencilOperation;
64
- };
65
- /** Raster state. */
66
- rasterState: {
67
- /** Specifies whether or not front- and/or back-facing polygons can be culled. */
68
- cullMode: CullMode;
69
- /** The multiplier by which an implementation-specific value is multiplied with to create a constant depth offset. */
70
- depthBias: number;
71
- /** The scale factor for the variable depth offset for each polygon. */
72
- slopeScaledDepthBias: number;
73
- };
74
- /** Render queue type. */
75
- renderQueueType: RenderQueueType;
76
- }
77
- export interface IMaterialSchema {
78
- name: string;
79
- shader: string;
80
- shaderData: {
81
- [key: string]: {
82
- type: "Vector2" | "Vector3" | "Vector4" | "Color" | "Float" | "Texture" | "Boolean" | "Integer";
83
- value: IVector3 | IVector2 | IColor | number | IAssetRef;
84
- };
85
- };
86
- macros: Array<{
87
- name: string;
88
- value?: string;
89
- }>;
90
- renderState: IRenderState;
91
- }
@@ -1,9 +0,0 @@
1
- export interface IProject {
2
- scene: string;
3
- files: {
4
- virtualPath: string;
5
- path: string;
6
- type: string;
7
- id: string;
8
- }[];
9
- }
@@ -1,43 +0,0 @@
1
- import { BackgroundMode, DiffuseMode, ShadowCascadesMode, ShadowResolution } from "@galacean/engine-core";
2
- import type { IReferable } from "@galacean/engine-core/types/asset/IReferable";
3
- import type { IColor, IPrefabFile, IVector3 } from "./BasicSchema";
4
- export declare enum SpecularMode {
5
- Sky = "Sky",
6
- Custom = "Custom"
7
- }
8
- export interface IScene extends IPrefabFile {
9
- scene: {
10
- background: {
11
- mode: BackgroundMode;
12
- color: IColor;
13
- texture?: IReferable;
14
- skyMesh?: IReferable;
15
- skyMaterial?: IReferable;
16
- };
17
- ambient: {
18
- diffuseMode: DiffuseMode;
19
- ambientLight: IReferable;
20
- customAmbientLight: IReferable;
21
- customSpecularTexture: IReferable;
22
- diffuseSolidColor: IColor;
23
- diffuseIntensity: number;
24
- specularIntensity: number;
25
- specularMode: SpecularMode;
26
- bakerResolution: number;
27
- };
28
- shadow?: {
29
- castShadows: boolean;
30
- shadowResolution: ShadowResolution;
31
- shadowDistance: number;
32
- shadowCascades: ShadowCascadesMode;
33
- shadowTwoCascadeSplits: number;
34
- shadowFourCascadeSplits: IVector3;
35
- };
36
- };
37
- files: Array<{
38
- id: string;
39
- type: string;
40
- virtualPath: string;
41
- path: string;
42
- }>;
43
- }