threepipe
Version:
A 3D viewer framework built on top of three.js in TypeScript with a focus on quality rendering, modularity and extensibility.
44 lines • 1.92 kB
TypeScript
import type { GLTFParser } from 'three/examples/jsm/loaders/GLTFLoader';
import type { GLTFWriter } from 'three/examples/jsm/exporters/GLTFExporter';
import { ISerializedViewerConfig, ThreeViewer } from '../../viewer';
import { Group } from 'three';
export declare class GLTFViewerConfigExtension {
static readonly ViewerConfigGLTFExtension = "WEBGI_viewer";
/**
* Import viewer config from glTF(exported from {@link GLTFViewerConfigExtension.ExportViewerConfig}) and sets in scene.importedViewerConfig
* Must be called from afterRoot in gltf loader. Used in {@link GLTFLoader2.setup}
* Only imports, does not apply.
* @param parser
* @param viewer
* @param resultScenes
* @param scene
*/
static ImportViewerConfig(parser: GLTFParser, viewer: ThreeViewer, resultScenes: Group[], scene?: any): Promise<Partial<ISerializedViewerConfig>>;
/**
* Find resources in parser from uuid
* @param currentResources
* @param parser
* @param viewer
* @private
*/
private static _parseExtraResources;
private static _parseArrayBuffers;
/**
* Export viewer config to glTF(can be imported by {@link GLTFViewerConfigExtension.ImportViewerConfig}).
* Used in {@link GLTFExporter2}
* @param viewer
* @param writer
* @constructor
*/
static ExportViewerConfig(viewer: ThreeViewer, writer: GLTFWriter): void;
private static _bundleArrayBuffers;
/**
* Find the resources that are in the viewer config AND in writer.json and use the ones in writer and remove from viewer Config.
* For now (for the lack of a better way) we can let the resources be exported twice and removed from resources. Overhead will be just for some images.
* @param json
* @param viewerData
* @private
*/
private static _bundleExtraResources;
}
//# sourceMappingURL=GLTFViewerConfigExtension.d.ts.map