Przeglądaj źródła

GLTFLoader: Add .setPath()

Takahiro 6 lat temu
rodzic
commit
f0832eaca0
1 zmienionych plików z 8 dodań i 0 usunięć
  1. 8 0
      examples/js/loaders/GLTFLoader.js

+ 8 - 0
examples/js/loaders/GLTFLoader.js

@@ -31,6 +31,7 @@ THREE.GLTFLoader = ( function () {
 
 			var loader = new THREE.FileLoader( scope.manager );
 
+			loader.setPath( this.path );
 			loader.setResponseType( 'arraybuffer' );
 
 			loader.load( url, function ( data ) {
@@ -64,6 +65,13 @@ THREE.GLTFLoader = ( function () {
 
 		},
 
+		setPath: function ( value ) {
+
+			this.path = value;
+			return this;
+
+		},
+
 		setResourcePath: function ( value ) {
 
 			this.resourcePath = value;