소스 검색

Merge pull request #5956 from brianzinn/master

Allow multiple spaces for vertex position/color definitions.
David Catuhe 6 년 전
부모
커밋
c87e5ebb0f
1개의 변경된 파일3개의 추가작업 그리고 2개의 파일을 삭제
  1. 3 2
      loaders/src/OBJ/objFileLoader.ts

+ 3 - 2
loaders/src/OBJ/objFileLoader.ts

@@ -847,9 +847,10 @@ export class OBJFileLoader implements ISceneLoaderPluginAsync, ISceneLoaderPlugi
             if (line.length === 0 || line.charAt(0) === '#') {
                 continue;
 
-                //Get information about one position possible for the vertices
+            //Get information about one position possible for the vertices
             } else if (this.vertexPattern.test(line)) {
-                result = line.split(' ');
+                result = line.match(/\S+/g)!;  // match will return non-null due to passing regex pattern
+
                 //Value of result with line: "v 1.0 2.0 3.0"
                 // ["v", "1.0", "2.0", "3.0"]
                 //Create a Vector3 with the position x, y, z