|
@@ -5,6 +5,7 @@
|
|
|
THREE.ObjectLoader = function ( manager ) {
|
|
THREE.ObjectLoader = function ( manager ) {
|
|
|
|
|
|
|
|
this.manager = ( manager !== undefined ) ? manager : THREE.DefaultLoadingManager;
|
|
this.manager = ( manager !== undefined ) ? manager : THREE.DefaultLoadingManager;
|
|
|
|
|
+ this.texturePath = '';
|
|
|
|
|
|
|
|
};
|
|
};
|
|
|
|
|
|
|
@@ -14,7 +15,7 @@ THREE.ObjectLoader.prototype = {
|
|
|
|
|
|
|
|
load: function ( url, onLoad, onProgress, onError ) {
|
|
load: function ( url, onLoad, onProgress, onError ) {
|
|
|
|
|
|
|
|
- if ( this.texturePath === undefined ) {
|
|
|
|
|
|
|
+ if ( this.texturePath === '' ) {
|
|
|
|
|
|
|
|
this.texturePath = url.substring( 0, url.lastIndexOf( '/' ) + 1 );
|
|
this.texturePath = url.substring( 0, url.lastIndexOf( '/' ) + 1 );
|
|
|
|
|
|
|
@@ -245,6 +246,9 @@ THREE.ObjectLoader.prototype = {
|
|
|
if ( data.bumpMap !== undefined ) {
|
|
if ( data.bumpMap !== undefined ) {
|
|
|
|
|
|
|
|
material.bumpMap = getTexture( data.bumpMap );
|
|
material.bumpMap = getTexture( data.bumpMap );
|
|
|
|
|
+ if ( data.bumpScale ) {
|
|
|
|
|
+ material.bumpScale = new THREE.Vector2( data.bumpScale, data.bumpScale );
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -263,6 +267,9 @@ THREE.ObjectLoader.prototype = {
|
|
|
if ( data.normalMap !== undefined ) {
|
|
if ( data.normalMap !== undefined ) {
|
|
|
|
|
|
|
|
material.normalMap = getTexture( data.normalMap );
|
|
material.normalMap = getTexture( data.normalMap );
|
|
|
|
|
+ if ( data.normalScale ) {
|
|
|
|
|
+ material.normalScale = new THREE.Vector2( data.normalScale, data.normalScale );
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|