David Catuhe 8 年之前
父节点
当前提交
33e3ee5d45
共有 3 个文件被更改,包括 7962 次插入7940 次删除
  1. 3970 3970
      dist/preview release/babylon.d.ts
  2. 3970 3970
      dist/preview release/babylon.module.d.ts
  3. 22 0
      src/Mesh/babylon.mesh.ts

文件差异内容过多而无法显示
+ 3970 - 3970
dist/preview release/babylon.d.ts


文件差异内容过多而无法显示
+ 3970 - 3970
dist/preview release/babylon.module.d.ts


+ 22 - 0
src/Mesh/babylon.mesh.ts

@@ -651,6 +651,28 @@
                 return null;
             }
 
+            // Check if we need to recreate the submeshes
+            if (this.subMeshes && this.subMeshes.length > 0) {
+                var totalIndices = this.getIndices().length;
+                let needToRecreate = false;
+    
+                for (var submesh of this.subMeshes) {
+                    if (submesh.indexStart + submesh.indexCount >= totalIndices) {
+                        needToRecreate = true;
+                        break;
+                    }
+
+                    if (submesh.verticesStart + submesh.verticesCount >= totalVertices) {
+                        needToRecreate = true;
+                        break;
+                    }
+                }
+
+                if (!needToRecreate) {
+                    return;
+                }
+            }
+
             this.releaseSubMeshes();
             return new SubMesh(0, 0, totalVertices, 0, this.getTotalIndices(), this);
         }