浏览代码

Handle line continuation character in OBJs (#9643)

This targets separate but logically joined lines (separated by a continuation character, e.g. `\`) and joins them.
Daniel Hritzkiv 9 年之前
父节点
当前提交
27f42fbe90
共有 1 个文件被更改,包括 7 次插入0 次删除
  1. 7 0
      examples/js/loaders/OBJLoader.js

+ 7 - 0
examples/js/loaders/OBJLoader.js

@@ -430,6 +430,13 @@ THREE.OBJLoader.prototype = {
 			text = text.replace( /\r\n/g, '\n' );
 			text = text.replace( /\r\n/g, '\n' );
 
 
 		}
 		}
+		
+		if ( text.indexOf( '\\\n' ) !== - 1) {
+
+			// join lines separated by a line continuation character (\)
+			text = text.replace( /\\\n/g, '' );
+
+		}
 
 
 		var lines = text.split( '\n' );
 		var lines = text.split( '\n' );
 		var line = '', lineFirstChar = '', lineSecondChar = '';
 		var line = '', lineFirstChar = '', lineSecondChar = '';