소스 검색

VRMLLoader: Fixed parsing bug when comments were present in the file.

Mugen87 7 년 전
부모
커밋
3f48ca634c
1개의 변경된 파일4개의 추가작업 그리고 0개의 파일을 삭제
  1. 4 0
      examples/js/loaders/VRMLLoader.js

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

@@ -1050,6 +1050,10 @@ THREE.VRMLLoader.prototype = {
 
 			var line = lines[ i ];
 
+			// The # symbol indicates that all subsequent text, until the end of the line is a comment,
+			// and should be ignored. (see http://www.agocg.ac.uk/train/vrml2rep/part1/guide3.htm)
+			line = line.replace( /(#.*)/, '' );
+
 			// split lines with {..{ or {..[ - some have both
 			if ( /{.*[{\[]/.test( line ) ) {