Browse Source

ColladaLoader: Added possibility to manually set path

see https://github.com/mrdoob/three.js/issues/12609
Pascal Häusler 7 years ago
parent
commit
18b700af3c
1 changed files with 10 additions and 3 deletions
  1. 10 3
      examples/js/loaders/ColladaLoader.js

+ 10 - 3
examples/js/loaders/ColladaLoader.js

@@ -18,10 +18,11 @@ THREE.ColladaLoader.prototype = {
 	load: function ( url, onLoad, onProgress, onError ) {
 	load: function ( url, onLoad, onProgress, onError ) {
 
 
 		var scope = this;
 		var scope = this;
-
-		var path = THREE.Loader.prototype.extractUrlBase( url );
-
+		
+                scope.path = scope.path === undefined ? THREE.Loader.prototype.extractUrlBase( url ) : scope.path; 
+		
 		var loader = new THREE.FileLoader( scope.manager );
 		var loader = new THREE.FileLoader( scope.manager );
+		loader.setPath( scope.path );
 		loader.load( url, function ( text ) {
 		loader.load( url, function ( text ) {
 
 
 			onLoad( scope.parse( text, path ) );
 			onLoad( scope.parse( text, path ) );
@@ -29,6 +30,12 @@ THREE.ColladaLoader.prototype = {
 		}, onProgress, onError );
 		}, onProgress, onError );
 
 
 	},
 	},
+	
+	setPath: function ( value ) {
+
+		this.path = value;
+
+	},
 
 
 	options: {
 	options: {