浏览代码

[three] - workaround path trailing slash assumption in LoaderUtil

Dave Buchhofer 3 年之前
父节点
当前提交
173edb22ef
共有 1 个文件被更改,包括 6 次插入1 次删除
  1. 6 1
      src/three/GLTFExtensionLoader.js

+ 6 - 1
src/three/GLTFExtensionLoader.js

@@ -45,7 +45,12 @@ export class GLTFExtensionLoader extends LoaderBase {
 
 			// assume any pre-registered loader has paths configured as the user desires, but if we're making
 			// a new loader, use the working path during parse to support relative uris on other hosts
-			const resourcePath = loader.resourcePath || loader.path || this.workingPath;
+			let resourcePath = loader.resourcePath || loader.path || this.workingPath;
+			if ( ! /[\\/]$/.test( resourcePath ) ) {
+
+				resourcePath += '/';
+
+			}
 
 			loader.parse( buffer, resourcePath, model => {