Browse Source

Accept primitive.indices=0 in GLTFLoader

Takahiro 8 years ago
parent
commit
3abec128f1
2 changed files with 4 additions and 4 deletions
  1. 2 2
      examples/js/loaders/GLTF2Loader.js
  2. 2 2
      examples/js/loaders/GLTFLoader.js

+ 2 - 2
examples/js/loaders/GLTF2Loader.js

@@ -1632,7 +1632,7 @@ THREE.GLTF2Loader = ( function () {
 
 						}
 
-						if ( primitive.indices ) {
+						if ( primitive.indices !== undefined ) {
 
 							geometry.setIndex( dependencies.accessors[ primitive.indices ] );
 
@@ -1682,7 +1682,7 @@ THREE.GLTF2Loader = ( function () {
 
 						var meshNode;
 
-						if ( primitive.indices ) {
+						if ( primitive.indices !== undefined ) {
 
 							geometry.setIndex( dependencies.accessors[ primitive.indices ] );
 

+ 2 - 2
examples/js/loaders/GLTFLoader.js

@@ -1644,7 +1644,7 @@ THREE.GLTFLoader = ( function () {
 
 						}
 
-						if ( primitive.indices ) {
+						if ( primitive.indices !== undefined ) {
 
 							geometry.setIndex( dependencies.accessors[ primitive.indices ] );
 
@@ -1694,7 +1694,7 @@ THREE.GLTFLoader = ( function () {
 
 						var meshNode;
 
-						if ( primitive.indices ) {
+						if ( primitive.indices !== undefined ) {
 
 							geometry.setIndex( dependencies.accessors[ primitive.indices ] );