Buckets:
| import { AnimationClip } from '../animation/AnimationClip.js'; | |
| import { FileLoader } from './FileLoader.js'; | |
| import { Loader } from './Loader.js'; | |
| class AnimationLoader extends Loader { | |
| constructor( manager ) { | |
| super( manager ); | |
| } | |
| load( url, onLoad, onProgress, onError ) { | |
| const scope = this; | |
| const loader = new FileLoader( this.manager ); | |
| loader.setPath( this.path ); | |
| loader.setRequestHeader( this.requestHeader ); | |
| loader.setWithCredentials( this.withCredentials ); | |
| loader.load( url, function ( text ) { | |
| try { | |
| onLoad( scope.parse( JSON.parse( text ) ) ); | |
| } catch ( e ) { | |
| if ( onError ) { | |
| onError( e ); | |
| } else { | |
| console.error( e ); | |
| } | |
| scope.manager.itemError( url ); | |
| } | |
| }, onProgress, onError ); | |
| } | |
| parse( json ) { | |
| const animations = []; | |
| for ( let i = 0; i < json.length; i ++ ) { | |
| const clip = AnimationClip.parse( json[ i ] ); | |
| animations.push( clip ); | |
| } | |
| return animations; | |
| } | |
| } | |
| export { AnimationLoader }; | |
Xet Storage Details
- Size:
- 1.01 kB
- Xet hash:
- 33a4f13833f376d7b4dc17d979fc531a9d24e68fca8ba5e28fecb3209ac370e7
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.