Преглед изворни кода

Merge pull request #3408 from RaananW/#3406

getHierarchyBoundingVectors - make sure we have the right params and functions.
David Catuhe пре 7 година
родитељ
комит
4e966c954e
1 измењених фајлова са 5 додато и 3 уклоњено
  1. 5 3
      src/Mesh/babylon.abstractMesh.ts

+ 5 - 3
src/Mesh/babylon.abstractMesh.ts

@@ -893,12 +893,14 @@
                 for (var descendant of descendants) {
                     let childMesh = <AbstractMesh>descendant;
 
+                    //make sure we have the needed params to get mix and max
+                    if (!childMesh.getBoundingInfo || childMesh.getTotalVertices() === 0) {
+                        continue;
+                    }
+
                     childMesh.computeWorldMatrix(true);
                     let childBoundingInfo = childMesh.getBoundingInfo();
 
-                    if (childMesh.getTotalVertices() === 0) {
-                        continue;
-                    }
                     let boundingBox = childBoundingInfo.boundingBox;
 
                     var minBox = boundingBox.minimumWorld;