Initial project import
This commit is contained in:
39
node_modules/three-stdlib/loaders/VRMLoader.cjs
generated
vendored
Normal file
39
node_modules/three-stdlib/loaders/VRMLoader.cjs
generated
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
||||
const THREE = require("three");
|
||||
const GLTFLoader = require("./GLTFLoader.cjs");
|
||||
class VRMLoader extends THREE.Loader {
|
||||
constructor(manager) {
|
||||
super(manager);
|
||||
this.gltfLoader = new GLTFLoader.GLTFLoader(manager);
|
||||
}
|
||||
load(url, onLoad, onProgress, onError) {
|
||||
const scope = this;
|
||||
this.gltfLoader.load(
|
||||
url,
|
||||
function(gltf) {
|
||||
try {
|
||||
scope.parse(gltf, onLoad);
|
||||
} catch (e) {
|
||||
if (onError) {
|
||||
onError(e);
|
||||
} else {
|
||||
console.error(e);
|
||||
}
|
||||
scope.manager.itemError(url);
|
||||
}
|
||||
},
|
||||
onProgress,
|
||||
onError
|
||||
);
|
||||
}
|
||||
setDRACOLoader(dracoLoader) {
|
||||
this.gltfLoader.setDRACOLoader(dracoLoader);
|
||||
return this;
|
||||
}
|
||||
parse(gltf, onLoad) {
|
||||
onLoad(gltf);
|
||||
}
|
||||
}
|
||||
exports.VRMLoader = VRMLoader;
|
||||
//# sourceMappingURL=VRMLoader.cjs.map
|
||||
Reference in New Issue
Block a user