Explorar o código

Merge pull request #9660 from Popov72/fix-instance-submesh-crash

Fix sub meshes of instances unsync with sub meshes from master mesh
sebavan %!s(int64=4) %!d(string=hai) anos
pai
achega
3978eee7e4
Modificáronse 1 ficheiros con 2 adicións e 0 borrados
  1. 2 0
      src/Meshes/geometry.ts

+ 2 - 0
src/Meshes/geometry.ts

@@ -292,6 +292,7 @@ export class Geometry implements IGetSetVerticesData {
                 mesh._boundingInfo = new BoundingInfo(this._extend.minimum, this._extend.maximum);
                 mesh._createGlobalSubMesh(false);
                 mesh.computeWorldMatrix(true);
+                mesh.synchronizeInstances();
             }
         }
 
@@ -551,6 +552,7 @@ export class Geometry implements IGetSetVerticesData {
 
         for (const mesh of this._meshes) {
             mesh._createGlobalSubMesh(true);
+            mesh.synchronizeInstances();
         }
 
         this.notifyUpdate();