Prechádzať zdrojové kódy

Merge branch 'master' of https://github.com/BabylonJS/Babylon.js

David Catuhe 5 rokov pred
rodič
commit
02dba23cfb
2 zmenil súbory, kde vykonal 2 pridanie a 1 odobranie
  1. 1 0
      dist/preview release/what's new.md
  2. 1 1
      src/Meshes/mesh.ts

+ 1 - 0
dist/preview release/what's new.md

@@ -216,6 +216,7 @@
 - Fix bug when using shadows + instances + transparent meshes + `transparencyShadow = false` ([Popov72](https://github.com/Popov72))
 - Incorrect initialization when reattaching XR pointer selection  ([#8227](https://github.com/BabylonJS/Babylon.js/issues/8227)) ([RaananW](https://github.com/RaananW))
 - Fixed `DracoCompression` to not load empty data into attributes ([bghgary](https://github.com/bghgary))
+- Fixed `Mesh.subdivide` where one face could be lost depending on the number of subdivision  ([Popov72](https://github.com/Popov72))
 
 ## Breaking changes
 

+ 1 - 1
src/Meshes/mesh.ts

@@ -1199,7 +1199,7 @@ export class Mesh extends AbstractMesh implements IGetSetVerticesData {
                 break;
             }
 
-            SubMesh.CreateFromIndices(0, offset, Math.min(subdivisionSize, totalIndices - offset), this);
+            SubMesh.CreateFromIndices(0, offset, index === count - 1 ? totalIndices - offset : subdivisionSize, this);
 
             offset += subdivisionSize;
         }