|
@@ -2,24 +2,22 @@ import { AnimationClip } from '../animation/AnimationClip.js';
|
|
|
import { FileLoader } from './FileLoader.js';
|
|
|
import { Loader } from './Loader.js';
|
|
|
|
|
|
-function AnimationLoader( manager ) {
|
|
|
+class AnimationLoader extends Loader {
|
|
|
|
|
|
- Loader.call( this, manager );
|
|
|
+ constructor( manager ) {
|
|
|
|
|
|
-}
|
|
|
-
|
|
|
-AnimationLoader.prototype = Object.assign( Object.create( Loader.prototype ), {
|
|
|
+ super( manager );
|
|
|
|
|
|
- constructor: AnimationLoader,
|
|
|
+ }
|
|
|
|
|
|
- load: function ( url, onLoad, onProgress, onError ) {
|
|
|
+ load( url, onLoad, onProgress, onError ) {
|
|
|
|
|
|
const scope = this;
|
|
|
|
|
|
- const loader = new FileLoader( scope.manager );
|
|
|
- loader.setPath( scope.path );
|
|
|
- loader.setRequestHeader( scope.requestHeader );
|
|
|
- loader.setWithCredentials( scope.withCredentials );
|
|
|
+ const loader = new FileLoader( this.manager );
|
|
|
+ loader.setPath( this.path );
|
|
|
+ loader.setRequestHeader( this.requestHeader );
|
|
|
+ loader.setWithCredentials( this.withCredentials );
|
|
|
loader.load( url, function ( text ) {
|
|
|
|
|
|
try {
|
|
@@ -44,9 +42,9 @@ AnimationLoader.prototype = Object.assign( Object.create( Loader.prototype ), {
|
|
|
|
|
|
}, onProgress, onError );
|
|
|
|
|
|
- },
|
|
|
+ }
|
|
|
|
|
|
- parse: function ( json ) {
|
|
|
+ parse( json ) {
|
|
|
|
|
|
const animations = [];
|
|
|
|
|
@@ -62,7 +60,7 @@ AnimationLoader.prototype = Object.assign( Object.create( Loader.prototype ), {
|
|
|
|
|
|
}
|
|
|
|
|
|
-} );
|
|
|
+}
|
|
|
|
|
|
|
|
|
export { AnimationLoader };
|