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

Fix submesh recreation when it should not

Popov72 пре 5 година
родитељ
комит
260e546ea6
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

@@ -95,4 +95,6 @@
 - Fix texture being inverted on the Y axis by default when using TextureAsset or AssetManager ([broederj](https://github.com/broederj))
 - 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 `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
 ## Breaking changes

+ 2 - 2
src/Meshes/mesh.ts

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