소스 검색

Simplify _markSubMeshesAsMiscDirty and avoid doing loop over all meshes in scene

Popov72 5 년 전
부모
커밋
f61e4d1ea0
1개의 변경된 파일1개의 추가작업 그리고 10개의 파일을 삭제
  1. 1 10
      src/Meshes/abstractMesh.ts

+ 1 - 10
src/Meshes/abstractMesh.ts

@@ -845,16 +845,7 @@ export class AbstractMesh extends TransformNode implements IDisposable, ICullabl
 
     /** @hidden */
     public _markSubMeshesAsMiscDirty() {
-        if (!this.subMeshes) {
-            return;
-        }
-
-        for (var subMesh of this.subMeshes) {
-            var material = subMesh.getMaterial();
-            if (material) {
-                material.markAsDirty(Constants.MATERIAL_MiscDirtyFlag);
-            }
-        }
+        this._markSubMeshesAsDirty((defines) => defines.markAsMiscDirty());
     }
 
     /**