Explorar el Código

Update babylon.mesh.ts

Fixed bug when cloning a mesh without any geometry (loaded from asset loader for example)
Temechon hace 10 años
padre
commit
87cd48f08f
Se han modificado 1 ficheros con 4 adiciones y 2 borrados
  1. 4 2
      Babylon/Mesh/babylon.mesh.ts

+ 4 - 2
Babylon/Mesh/babylon.mesh.ts

@@ -762,7 +762,9 @@
             var result = new BABYLON.Mesh(name, this.getScene());
 
             // Geometry
-            this._geometry.applyToMesh(result);
+            if (this._geometry) {
+                this._geometry.applyToMesh(result);
+            }
 
             // Deep copy
             BABYLON.Tools.DeepCopy(this, result, ["name", "material", "skeleton"], []);
@@ -1197,4 +1199,4 @@
             return newMesh;
         }
     }
-} 
+}