소스 검색

Merge pull request #7889 from Popov72/fix-submesh-recreation

Fix submesh recreation when it should not
David Catuhe 5 년 전
부모
커밋
18f4147d12
2개의 변경된 파일4개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 0
      dist/preview release/what's new.md
  2. 2 2
      src/Meshes/mesh.ts

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

@@ -96,4 +96,6 @@
 - Fix texture being inverted on the Y axis by default when using TextureAsset or AssetManager ([broederj](https://github.com/broederj))
 - Fix `TexturePacker` cross-origin image requests, fix falsy default options ([ludevik](https://github.com/ludevik))
 
+- Fix submesh recreation when it should not ([Popov72](https://github.com/Popov72)
+
 ## Breaking changes

+ 2 - 2
src/Meshes/mesh.ts

@@ -1113,12 +1113,12 @@ export class Mesh extends AbstractMesh implements IGetSetVerticesData {
                 needToRecreate = true;
             } else {
                 for (var submesh of this.subMeshes) {
-                    if (submesh.indexStart + submesh.indexCount >= totalIndices) {
+                    if (submesh.indexStart + submesh.indexCount > totalIndices) {
                         needToRecreate = true;
                         break;
                     }
 
-                    if (submesh.verticesStart + submesh.verticesCount >= totalVertices) {
+                    if (submesh.verticesStart + submesh.verticesCount > totalVertices) {
                         needToRecreate = true;
                         break;
                     }