Browse Source

Add a comment about not updating sub meshes bounding info

Popov72 5 years ago
parent
commit
255ff7e2a0
1 changed files with 2 additions and 5 deletions
  1. 2 5
      loaders/src/glTF/2.0/glTFLoader.ts

+ 2 - 5
loaders/src/glTF/2.0/glTFLoader.ts

@@ -877,11 +877,8 @@ export class GLTFLoader implements IGLTFLoader {
                                 min.copyFromFloats(...mmin);
                                 max.copyFromFloats(...mmax);
                                 babylonMesh.getBoundingInfo().reConstruct(min, max);
-                                if (babylonMesh.subMeshes) {
-                                    for (let index = 0; index < babylonMesh.subMeshes.length; index++) {
-                                        babylonMesh.subMeshes[index].getBoundingInfo().reConstruct(min, max);
-                                    }
-                                }
+                                // Note: we don't need to update sub meshes bounding info because the GLTF loader does not create sub meshes
+                                // Each mesh has a single sub mesh which is a global sub mesh, meaning its bounding info is the bounding info of the mesh itself
                                 babylonMesh._updateBoundingInfo();
                             }
                         }