Browse Source

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 years ago
parent
commit
27f42fbe90
1 changed files with 7 additions and 0 deletions
  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' );
 
 		}
+		
+		if ( text.indexOf( '\\\n' ) !== - 1) {
+
+			// join lines separated by a line continuation character (\)
+			text = text.replace( /\\\n/g, '' );
+
+		}
 
 		var lines = text.split( '\n' );
 		var line = '', lineFirstChar = '', lineSecondChar = '';