浏览代码

add modularized VRMLLoader

palortoff 6 年之前
父节点
当前提交
8f43ad2e7f
共有 1 个文件被更改,包括 4 次插入4 次删除
  1. 4 4
      examples/jsm/loaders/VRMLLoader.js

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

@@ -1893,7 +1893,7 @@ var VRMLLoader = ( function () {
 
 					// an index of -1 indicates that the current face has ended and the next one begins
 
-					if ( index[ i + 3 ] === - 1 ) {
+					if ( index[ i + 3 ] === - 1 || i + 3 >= l ) {
 
 						i += 3;
 						start = i + 1;
@@ -1924,7 +1924,7 @@ var VRMLLoader = ( function () {
 
 					// an index of -1 indicates that the current face has ended and the next one begins
 
-					if ( index[ i + 3 ] === - 1 ) {
+					if ( index[ i + 3 ] === - 1 || i + 3 >= l ) {
 
 						i += 3;
 						start ++;
@@ -1972,7 +1972,7 @@ var VRMLLoader = ( function () {
 
 					// an index of -1 indicates that the current line has ended and the next one begins
 
-					if ( index[ i + 2 ] === - 1 ) {
+					if ( index[ i + 2 ] === - 1 || i + 2 >= l ) {
 
 						i += 2;
 
@@ -2002,7 +2002,7 @@ var VRMLLoader = ( function () {
 
 					// an index of -1 indicates that the current line has ended and the next one begins
 
-					if ( index[ i + 2 ] === - 1 ) {
+					if ( index[ i + 2 ] === - 1 || i + 2 >= l ) {
 
 						i += 2;
 						start ++;