mirror of
https://github.com/tengge1/ShadowEditor.git
synced 2026-01-25 15:08:11 +00:00
29 lines
750 B
JavaScript
29 lines
750 B
JavaScript
import BaseLoader from './BaseLoader';
|
|
|
|
/**
|
|
* BinaryLoader
|
|
* @author tengge / https://github.com/tengge1
|
|
*/
|
|
function BinaryLoader() {
|
|
BaseLoader.call(this);
|
|
}
|
|
|
|
BinaryLoader.prototype = Object.create(BaseLoader.prototype);
|
|
BinaryLoader.prototype.constructor = BinaryLoader;
|
|
|
|
BinaryLoader.prototype.load = function (url) {
|
|
return new Promise(resolve => {
|
|
this.require('BinaryLoader').then(() => {
|
|
var loader = new THREE.BinaryLoader();
|
|
|
|
loader.load(url, (geometry, materials) => {
|
|
var mesh = new THREE.Mesh(geometry, materials);
|
|
resolve(mesh);
|
|
}, undefined, () => {
|
|
resolve(null);
|
|
});
|
|
});
|
|
});
|
|
};
|
|
|
|
export default BinaryLoader; |