Quellcode durchsuchen

Simplified "s" line parsing

Kai Salmen vor 8 Jahren
Ursprung
Commit
686896b9b8
1 geänderte Dateien mit 3 neuen und 3 gelöschten Zeilen
  1. 3 3
      examples/js/loaders/OBJLoader.js

+ 3 - 3
examples/js/loaders/OBJLoader.js

@@ -589,7 +589,7 @@ THREE.OBJLoader = ( function () {
 
 				} else if ( lineFirstChar === "s" ) {
 
-					result = line.length > 1 ? line.substring( 1 ).trim().split( " " ) : [];
+					result = line.split( ' ' );
 
 					// smooth shading
 
@@ -611,9 +611,9 @@ THREE.OBJLoader = ( function () {
 					 * surfaces, smoothing groups are either turned on or off; there is no difference between values greater
 					 * than 0."
 					 */
-					if ( result.length > 0 ) {
+					if ( result.length > 1 ) {
 
-						var value = result[ 0 ].trim().toLowerCase();
+						var value = result[ 1 ].trim().toLowerCase();
 						state.object.smooth = ( value !== '0' && value !== 'off' );
 
 					} else {