threepipe
Version:
A 3D viewer framework built on top of three.js in TypeScript with a focus on quality rendering, modularity and extensibility.
18 lines • 682 B
JavaScript
/**
* Importer for loading files through AssetImporter. By default, it's a wrapper for threejs loaders.
*/
export class Importer {
ctor(assetImporter) {
const loader = this.cls && new this.cls(assetImporter.loadingManager);
return typeof this.onCtor === 'function' ? this.onCtor(loader, assetImporter, this) : loader;
}
constructor(cls, ext, mime, root, onCtor) {
this.extensions = [];
this.cls = cls;
this.ext = ext.filter(Boolean).map(e => e.toLowerCase());
this.mime = mime.filter(Boolean).map(e => e.toLowerCase());
this.root = root;
this.onCtor = onCtor;
}
}
//# sourceMappingURL=Importer.js.map