提交 8fadffee 编写于 作者: M Mugen87

ColladaLoader2: Clean up

上级 f716813e
...@@ -17,14 +17,12 @@ THREE.ColladaLoader.prototype = { ...@@ -17,14 +17,12 @@ THREE.ColladaLoader.prototype = {
var scope = this; var scope = this;
var resourceDirectory = url.split( /[\\\/]/ ); var path = THREE.Loader.prototype.extractUrlBase( url );
resourceDirectory.pop();
resourceDirectory = resourceDirectory.join( '/' ) + '/';
var loader = new THREE.FileLoader( scope.manager ); var loader = new THREE.FileLoader( scope.manager );
loader.load( url, function ( text ) { loader.load( url, function ( text ) {
onLoad( scope.parse( text, resourceDirectory ) ); onLoad( scope.parse( text, path ) );
}, onProgress, onError ); }, onProgress, onError );
...@@ -46,7 +44,7 @@ THREE.ColladaLoader.prototype = { ...@@ -46,7 +44,7 @@ THREE.ColladaLoader.prototype = {
}, },
parse: function ( text, resourceDirectory ) { parse: function ( text, path ) {
function getElementsByTagName( xml, name ) { function getElementsByTagName( xml, name ) {
...@@ -3184,7 +3182,8 @@ THREE.ColladaLoader.prototype = { ...@@ -3184,7 +3182,8 @@ THREE.ColladaLoader.prototype = {
console.log( 'THREE.ColladaLoader: File version', version ); console.log( 'THREE.ColladaLoader: File version', version );
var asset = parseAsset( getElementsByTagName( collada, 'asset' )[ 0 ] ); var asset = parseAsset( getElementsByTagName( collada, 'asset' )[ 0 ] );
var textureLoader = new THREE.TextureLoader( this.manager ).setPath( resourceDirectory ); var textureLoader = new THREE.TextureLoader( this.manager );
textureLoader.setPath( path ).setCrossOrigin( this.crossOrigin );
// //
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册