소스 검색

ObjLoader: Ignore silently o/g line declarations that are not followed by any geometry (f) before a new o/g is started. Discussed in #6682.

Jonne Nauha 9 년 전
부모
커밋
0bca52669f
1개의 변경된 파일4개의 추가작업 그리고 0개의 파일을 삭제
  1. 4 0
      examples/js/loaders/OBJLoader.js

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

@@ -487,6 +487,10 @@ THREE.OBJLoader.prototype = {
 			var geometry = object.geometry;
 			var isLine = (geometry.type === 'Line');
 
+			// Skip o/g line declarations that did not follow with any faces
+			if ( geometry.vertices.length === 0 )
+				continue;
+
 			var buffergeometry = new THREE.BufferGeometry();
 
 			buffergeometry.addAttribute( 'position', new THREE.BufferAttribute( new Float32Array( geometry.vertices ), 3 ) );