Browse Source

add modularized VRMLLoader

palortoff 6 years ago
parent
commit
8f43ad2e7f
1 changed files with 4 additions and 4 deletions
  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 ++;