浏览代码

VOXLoader: Convert to ES6 class.

Mr.doob 4 年之前
父节点
当前提交
a6186c3b23
共有 1 个文件被更改,包括 5 次插入13 次删除
  1. 5 13
      examples/jsm/loaders/VOXLoader.js

+ 5 - 13
examples/jsm/loaders/VOXLoader.js

@@ -3,17 +3,9 @@ import {
 	Loader
 	Loader
 } from '../../../build/three.module.js';
 } from '../../../build/three.module.js';
 
 
-function VOXLoader( manager ) {
+class VOXLoader extends Loader {
 
 
-	Loader.call( this, manager );
-
-}
-
-VOXLoader.prototype = Object.assign( Object.create( Loader.prototype ), {
-
-	constructor: VOXLoader,
-
-	load: function ( url, onLoad, onProgress, onError ) {
+	load( url, onLoad, onProgress, onError ) {
 
 
 		var scope = this;
 		var scope = this;
 
 
@@ -45,9 +37,9 @@ VOXLoader.prototype = Object.assign( Object.create( Loader.prototype ), {
 
 
 		}, onProgress, onError );
 		}, onProgress, onError );
 
 
-	},
+	}
 
 
-	parse: function ( buffer ) {
+	parse( buffer ) {
 
 
 		const data = new DataView( buffer );
 		const data = new DataView( buffer );
 
 
@@ -162,6 +154,6 @@ VOXLoader.prototype = Object.assign( Object.create( Loader.prototype ), {
 
 
 	}
 	}
 
 
-} );
+}
 
 
 export { VOXLoader };
 export { VOXLoader };