@galacean/engine-loader 1.2.0-beta.6 → 1.2.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.
- package/dist/main.js +64 -49
- package/dist/main.js.map +1 -1
- package/dist/miniprogram.js +64 -49
- package/dist/module.js +64 -49
- package/dist/module.js.map +1 -1
- package/package.json +4 -4
- package/types/PrefabLoader.d.ts +5 -0
- package/types/gltf/GLTFSchema.d.ts +1 -1
- package/types/gltf/extensions/EXT_meshopt_compression.d.ts +16 -3
- package/types/gltf/extensions/MeshoptDecoder.d.ts +10 -6
- package/types/prefab/PrefabParser.d.ts +11 -0
- package/types/prefab/PrefabResource.d.ts +25 -0
- package/types/resource-deserialize/resources/schema/SceneSchema.d.ts +2 -1
- package/types/gltf/extensions/KHR_draco_mesh_compression.d.ts +0 -1
- package/types/resource-deserialize/resources/animationClip/ComponentMap.d.ts +0 -2
- package/types/resource-deserialize/resources/parser/PrefabParser.d.ts +0 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@galacean/engine-loader",
|
|
3
|
-
"version": "1.2.0
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"registry": "https://registry.npmjs.org"
|
|
@@ -15,9 +15,9 @@
|
|
|
15
15
|
"types/**/*"
|
|
16
16
|
],
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@galacean/engine-core": "1.2.0
|
|
19
|
-
"@galacean/engine-rhi-webgl": "1.2.0
|
|
20
|
-
"@galacean/engine-math": "1.2.0
|
|
18
|
+
"@galacean/engine-core": "1.2.0",
|
|
19
|
+
"@galacean/engine-rhi-webgl": "1.2.0",
|
|
20
|
+
"@galacean/engine-math": "1.2.0"
|
|
21
21
|
},
|
|
22
22
|
"scripts": {
|
|
23
23
|
"b:types": "tsc"
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { AssetPromise, Loader, LoadItem, ResourceManager } from "@galacean/engine-core";
|
|
2
|
+
import { PrefabResource } from "./prefab/PrefabResource";
|
|
3
|
+
export declare class PrefabLoader extends Loader<PrefabResource> {
|
|
4
|
+
load(item: LoadItem, resourceManager: ResourceManager): AssetPromise<PrefabResource>;
|
|
5
|
+
}
|
|
@@ -1,11 +1,24 @@
|
|
|
1
1
|
declare module "@galacean/engine-core" {
|
|
2
2
|
interface EngineConfiguration {
|
|
3
|
-
|
|
3
|
+
glTFLoader?: {
|
|
4
|
+
/** Meshopt options. If set this option and workCount is great than 0, workers will be created. */
|
|
5
|
+
meshOpt?: {
|
|
6
|
+
/**
|
|
7
|
+
* Worker count for transcoder.
|
|
8
|
+
* @defaultValue 4
|
|
9
|
+
*/
|
|
10
|
+
workerCount?: number;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
/** @deprecated glTF loader options. */
|
|
4
14
|
glTF?: {
|
|
5
15
|
/** Meshopt options. If set this option and workCount is great than 0, workers will be created. */
|
|
6
16
|
meshOpt?: {
|
|
7
|
-
/**
|
|
8
|
-
|
|
17
|
+
/**
|
|
18
|
+
* Worker count for transcoder.
|
|
19
|
+
* @defaultValue 4
|
|
20
|
+
*/
|
|
21
|
+
workerCount?: number;
|
|
9
22
|
};
|
|
10
23
|
};
|
|
11
24
|
}
|
|
@@ -1,8 +1,12 @@
|
|
|
1
|
-
declare
|
|
1
|
+
export declare let ready: Promise<{
|
|
2
2
|
workerCount: number;
|
|
3
|
-
|
|
4
|
-
useWorkers: () => void;
|
|
3
|
+
useWorkers: (count?: number) => void;
|
|
5
4
|
decodeGltfBuffer: (count: any, stride: any, source: any, mode: any, filter: any) => Promise<Uint8Array>;
|
|
6
|
-
release()
|
|
7
|
-
}
|
|
8
|
-
export
|
|
5
|
+
release: () => void;
|
|
6
|
+
}>;
|
|
7
|
+
export declare function getMeshoptDecoder(): Promise<{
|
|
8
|
+
workerCount: number;
|
|
9
|
+
useWorkers: (count?: number) => void;
|
|
10
|
+
decodeGltfBuffer: (count: any, stride: any, source: any, mode: any, filter: any) => Promise<Uint8Array>;
|
|
11
|
+
release: () => void;
|
|
12
|
+
}>;
|
|
@@ -0,0 +1,11 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
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,4 +1,4 @@
|
|
|
1
|
-
import { BackgroundMode, DiffuseMode, FogMode, ShadowCascadesMode, ShadowResolution } from "@galacean/engine-core";
|
|
1
|
+
import { BackgroundMode, BackgroundTextureFillMode, DiffuseMode, FogMode, ShadowCascadesMode, ShadowResolution } from "@galacean/engine-core";
|
|
2
2
|
import type { IReferable } from "@galacean/engine-core/types/asset/IReferable";
|
|
3
3
|
import type { IColor, IPrefabFile, IVector3 } from "./BasicSchema";
|
|
4
4
|
export declare enum SpecularMode {
|
|
@@ -11,6 +11,7 @@ export interface IScene extends IPrefabFile {
|
|
|
11
11
|
mode: BackgroundMode;
|
|
12
12
|
color: IColor;
|
|
13
13
|
texture?: IReferable;
|
|
14
|
+
textureFillMode?: BackgroundTextureFillMode;
|
|
14
15
|
skyMesh?: IReferable;
|
|
15
16
|
skyMaterial?: IReferable;
|
|
16
17
|
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|