|
@@ -24,7 +24,6 @@ import {
|
|
BufferGeometry,
|
|
BufferGeometry,
|
|
ClampToEdgeWrapping,
|
|
ClampToEdgeWrapping,
|
|
Color,
|
|
Color,
|
|
- DefaultLoadingManager,
|
|
|
|
DoubleSide,
|
|
DoubleSide,
|
|
EquirectangularReflectionMapping,
|
|
EquirectangularReflectionMapping,
|
|
EquirectangularRefractionMapping,
|
|
EquirectangularRefractionMapping,
|
|
@@ -33,6 +32,7 @@ import {
|
|
FrontSide,
|
|
FrontSide,
|
|
LineBasicMaterial,
|
|
LineBasicMaterial,
|
|
LineSegments,
|
|
LineSegments,
|
|
|
|
+ Loader,
|
|
LoaderUtils,
|
|
LoaderUtils,
|
|
Mesh,
|
|
Mesh,
|
|
MeshPhongMaterial,
|
|
MeshPhongMaterial,
|
|
@@ -2050,25 +2050,23 @@ var lwoTree;
|
|
|
|
|
|
var LWOLoader = function ( manager, parameters ) {
|
|
var LWOLoader = function ( manager, parameters ) {
|
|
|
|
|
|
- this.manager = ( manager !== undefined ) ? manager : DefaultLoadingManager;
|
|
|
|
|
|
+ Loader.call( this, manager );
|
|
|
|
|
|
parameters = parameters || {};
|
|
parameters = parameters || {};
|
|
|
|
|
|
- this.resourcePath = ( parameters.resourcePath !== undefined ) ? parameters.resourcePath : undefined;
|
|
|
|
|
|
+ this.resourcePath = ( parameters.resourcePath !== undefined ) ? parameters.resourcePath : '';
|
|
|
|
|
|
};
|
|
};
|
|
|
|
|
|
-LWOLoader.prototype = {
|
|
|
|
|
|
+LWOLoader.prototype = Object.assign( Object.create( Loader.prototype ), {
|
|
|
|
|
|
constructor: LWOLoader,
|
|
constructor: LWOLoader,
|
|
|
|
|
|
- crossOrigin: 'anonymous',
|
|
|
|
-
|
|
|
|
load: function ( url, onLoad, onProgress, onError ) {
|
|
load: function ( url, onLoad, onProgress, onError ) {
|
|
|
|
|
|
var self = this;
|
|
var self = this;
|
|
|
|
|
|
- var path = ( self.path === undefined ) ? extractParentUrl( url, 'Objects' ) : self.path;
|
|
|
|
|
|
+ var path = ( self.path === '' ) ? extractParentUrl( url, 'Objects' ) : self.path;
|
|
|
|
|
|
// give the mesh a default name based on the filename
|
|
// give the mesh a default name based on the filename
|
|
var modelName = url.split( path ).pop().split( '.' )[ 0 ];
|
|
var modelName = url.split( path ).pop().split( '.' )[ 0 ];
|
|
@@ -2087,27 +2085,6 @@ LWOLoader.prototype = {
|
|
|
|
|
|
},
|
|
},
|
|
|
|
|
|
- setCrossOrigin: function ( value ) {
|
|
|
|
-
|
|
|
|
- this.crossOrigin = value;
|
|
|
|
- return this;
|
|
|
|
-
|
|
|
|
- },
|
|
|
|
-
|
|
|
|
- setPath: function ( value ) {
|
|
|
|
-
|
|
|
|
- this.path = value;
|
|
|
|
- return this;
|
|
|
|
-
|
|
|
|
- },
|
|
|
|
-
|
|
|
|
- setResourcePath: function ( value ) {
|
|
|
|
-
|
|
|
|
- this.resourcePath = value;
|
|
|
|
- return this;
|
|
|
|
-
|
|
|
|
- },
|
|
|
|
-
|
|
|
|
parse: function ( iffBuffer, path, modelName ) {
|
|
parse: function ( iffBuffer, path, modelName ) {
|
|
|
|
|
|
lwoTree = new IFFParser().parse( iffBuffer );
|
|
lwoTree = new IFFParser().parse( iffBuffer );
|
|
@@ -2120,7 +2097,7 @@ LWOLoader.prototype = {
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
-};
|
|
|
|
|
|
+} );
|
|
|
|
|
|
// Parse the lwoTree object
|
|
// Parse the lwoTree object
|
|
function LWOTreeParser( textureLoader ) {
|
|
function LWOTreeParser( textureLoader ) {
|