ソースを参照

Merge pull request #14838 from Mugen87/dev9

VRMLLoader: Fixed parsing bug when comments were present in the file.
Mr.doob 7 年 前
コミット
0380d52352
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 ];
 			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://gun.teipir.gr/VRML-amgem/spec/part1/grammar.html)
+			line = line.replace( /(#.*)/, '' );
+
 			// split lines with {..{ or {..[ - some have both
 			// split lines with {..{ or {..[ - some have both
 			if ( /{.*[{\[]/.test( line ) ) {
 			if ( /{.*[{\[]/.test( line ) ) {