123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- ( function () {
-
-
-
- class VRMLoader extends THREE.Loader {
- constructor( manager ) {
- if ( THREE.GLTFLoader === undefined ) {
- throw new Error( 'THREE.VRMLoader: Import THREE.GLTFLoader.' );
- }
- super( manager );
- this.gltfLoader = new THREE.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 );
- }
- }
- THREE.VRMLoader = VRMLoader;
- } )();
|