浏览代码

GLTFLoader: Add .setPath()

Takahiro 6 年之前
父节点
当前提交
f0832eaca0
共有 1 个文件被更改,包括 8 次插入0 次删除
  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;