@galacean/effects-plugin-model 2.0.0-alpha.21 → 2.0.0-alpha.23
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/alipay.js +818 -9
- package/dist/alipay.js.map +1 -1
- package/dist/alipay.mjs +818 -9
- package/dist/alipay.mjs.map +1 -1
- package/dist/gltf/loader-impl.d.ts +24 -6
- package/dist/gltf/protocol.d.ts +17 -3
- package/dist/index.js +819 -10
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +2 -2
- package/dist/index.min.js.map +1 -1
- package/dist/index.mjs +819 -10
- package/dist/index.mjs.map +1 -1
- package/dist/loader.mjs +819 -10
- package/dist/loader.mjs.map +1 -1
- package/package.json +5 -5
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import { spec } from '@galacean/effects';
|
|
2
|
-
import type { TextureSourceOptions, math } from '@galacean/effects';
|
|
1
|
+
import { spec, Geometry } from '@galacean/effects';
|
|
2
|
+
import type { TextureSourceOptions, math, Engine, Texture } from '@galacean/effects';
|
|
3
3
|
import type { SkyboxType, LoadSceneOptions, LoadSceneResult, Loader, ModelCamera, ModelLight, ModelSkybox, ModelImageLike } from './protocol';
|
|
4
|
-
import type { ModelMeshComponentData, ModelSkyboxComponentData,
|
|
4
|
+
import type { ModelMeshComponentData, ModelSkyboxComponentData, ModelLightComponentData, ModelCameraComponentData, ModelAnimationOptions, ModelMaterialOptions, ModelSkyboxOptions, ModelTreeOptions } from '../index';
|
|
5
5
|
import { PSkyboxType } from '../runtime';
|
|
6
|
-
import type { GLTFResources } from '@vvfx/resource-detection';
|
|
6
|
+
import type { GLTFImage, GLTFMaterial, GLTFTexture, GLTFScene, GLTFLight, GLTFCamera, GLTFAnimation, GLTFResources, GLTFImageBasedLight, GLTFPrimitive } from '@vvfx/resource-detection';
|
|
7
|
+
import type { CubeImage } from '@vvfx/resource-detection/dist/src/gltf-tools/gltf-image-based-light';
|
|
7
8
|
export interface LoaderOptions {
|
|
8
9
|
compatibleMode?: 'gltf' | 'tiny3d';
|
|
9
10
|
}
|
|
10
|
-
export declare function getDefaultEffectsGLTFLoader(options?: LoaderOptions): Loader;
|
|
11
|
+
export declare function getDefaultEffectsGLTFLoader(engine: Engine, options?: LoaderOptions): Loader;
|
|
11
12
|
export declare function setDefaultEffectsGLTFLoader(loader: Loader): void;
|
|
12
13
|
export declare class LoaderImpl implements Loader {
|
|
13
14
|
private sceneOptions;
|
|
@@ -34,6 +35,7 @@ export declare class LoaderImpl implements Loader {
|
|
|
34
35
|
geometries: spec.GeometryData[];
|
|
35
36
|
animations: spec.AnimationClipData[];
|
|
36
37
|
sceneAABB: math.Box3;
|
|
38
|
+
engine: Engine;
|
|
37
39
|
constructor(composition?: spec.CompositionData);
|
|
38
40
|
loadScene(options: LoadSceneOptions): Promise<LoadSceneResult>;
|
|
39
41
|
processGLTFResource(resource: GLTFResources, imageElements: ModelImageLike[]): void;
|
|
@@ -43,7 +45,7 @@ export declare class LoaderImpl implements Loader {
|
|
|
43
45
|
processSkyboxComponentData(skybox: ModelSkyboxComponentData): void;
|
|
44
46
|
processMaterialData(material: spec.MaterialData): void;
|
|
45
47
|
processTextureOptions(options: TextureSourceOptions, isBaseColor: boolean, image?: ModelImageLike): void;
|
|
46
|
-
initial(options?: LoaderOptions): void;
|
|
48
|
+
initial(engine: Engine, options?: LoaderOptions): void;
|
|
47
49
|
checkMeshComponentData(mesh: ModelMeshComponentData, resource: GLTFResources): void;
|
|
48
50
|
processMaterialTexture(material: spec.MaterialData, textureName: string, isBaseColor: boolean, textureDataMap: Record<string, TextureSourceOptions>, imageElements: ModelImageLike[]): void;
|
|
49
51
|
getLoadResult(): LoadSceneResult;
|
|
@@ -75,6 +77,22 @@ export declare class LoaderImpl implements Loader {
|
|
|
75
77
|
isSkyboxVis(): boolean;
|
|
76
78
|
ignoreSkybox(): boolean;
|
|
77
79
|
isEnvironmentTest(): boolean;
|
|
80
|
+
/**
|
|
81
|
+
* for old scene compatibility
|
|
82
|
+
*/
|
|
83
|
+
processLight(lights: GLTFLight[], fromGLTF: boolean): void;
|
|
84
|
+
processCamera(cameras: GLTFCamera[], fromGLTF: boolean): void;
|
|
85
|
+
processMaterial(materials: GLTFMaterial[], fromGLTF: boolean): void;
|
|
86
|
+
createTreeOptions(scene: GLTFScene): ModelTreeOptions;
|
|
87
|
+
createAnimations(animations: GLTFAnimation[]): ModelAnimationOptions[];
|
|
88
|
+
createGeometry(primitive: GLTFPrimitive, hasSkinAnim: boolean): Geometry;
|
|
89
|
+
createMaterial(material: GLTFMaterial): ModelMaterialOptions;
|
|
90
|
+
createTexture2D(image: GLTFImage, texture: GLTFTexture, isBaseColor: boolean): Promise<Texture>;
|
|
91
|
+
createTextureCube(cubeImages: CubeImage[], level0Size?: number): Promise<Texture>;
|
|
92
|
+
createSkybox(ibl: GLTFImageBasedLight): Promise<ModelSkyboxOptions>;
|
|
93
|
+
createDefaultSkybox(typeName: SkyboxType): Promise<ModelSkyboxOptions>;
|
|
94
|
+
scaleColorVal(val: number, fromGLTF: boolean): number;
|
|
95
|
+
scaleColorVec(vec: number[], fromGLTF: boolean): number[];
|
|
78
96
|
}
|
|
79
97
|
export declare function getPBRShaderProperties(): string;
|
|
80
98
|
export declare function getUnlitShaderProperties(): string;
|
package/dist/gltf/protocol.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import type { GLTFResources } from '@vvfx/resource-detection';
|
|
2
|
-
import type {
|
|
3
|
-
import type {
|
|
1
|
+
import type { GLTFResources, GLTFMaterial, GLTFPrimitive, GLTFLight, GLTFScene, GLTFImage, GLTFTexture, GLTFCamera, GLTFAnimation, GLTFImageBasedLight } from '@vvfx/resource-detection';
|
|
2
|
+
import type { CubeImage } from '@vvfx/resource-detection/dist/src/gltf-tools/gltf-image-based-light';
|
|
3
|
+
import type { spec, TextureSourceOptions, EffectComponentData, Texture, Geometry } from '@galacean/effects';
|
|
4
|
+
import type { ModelAnimationOptions, ModelMaterialOptions, ModelSkyboxOptions, ModelTreeOptions, ModelLightComponentData, ModelCameraComponentData, ModelSkyboxComponentData } from '../index';
|
|
4
5
|
/**
|
|
5
6
|
* glTF 场景文件加载选项,主要用于 Demo 测试或外部测试调用
|
|
6
7
|
*/
|
|
@@ -109,4 +110,17 @@ export interface Loader {
|
|
|
109
110
|
processSkyboxComponentData(skybox: ModelSkyboxComponentData): void;
|
|
110
111
|
processMaterialData(material: spec.MaterialData): void;
|
|
111
112
|
processTextureOptions(options: TextureSourceOptions, isBaseColor: boolean, image?: ModelImageLike): void;
|
|
113
|
+
processLight(lights: GLTFLight[], fromGLTF: boolean): void;
|
|
114
|
+
processCamera(cameras: GLTFCamera[], fromGLTF: boolean): void;
|
|
115
|
+
processMaterial(materials: GLTFMaterial[], fromGLTF: boolean): void;
|
|
116
|
+
createTreeOptions(scene: GLTFScene): ModelTreeOptions;
|
|
117
|
+
createAnimations(animations: GLTFAnimation[]): ModelAnimationOptions[];
|
|
118
|
+
createGeometry(primitive: GLTFPrimitive, hasSkinAnim: boolean): Geometry;
|
|
119
|
+
createMaterial(material: GLTFMaterial): ModelMaterialOptions;
|
|
120
|
+
createTexture2D(images: GLTFImage, textures: GLTFTexture, isBaseColor: boolean): Promise<Texture>;
|
|
121
|
+
createTextureCube(cubeImages: CubeImage[], level0Size?: number): Promise<Texture>;
|
|
122
|
+
createSkybox(ibl: GLTFImageBasedLight): Promise<ModelSkyboxOptions>;
|
|
123
|
+
createDefaultSkybox(typeName: SkyboxType): Promise<ModelSkyboxOptions>;
|
|
124
|
+
scaleColorVal(val: number, fromGLTF: boolean): number;
|
|
125
|
+
scaleColorVec(vec: number[], fromGLTF: boolean): number[];
|
|
112
126
|
}
|