Explorar o código

Simplify _markSubMeshesAsMiscDirty and avoid doing loop over all meshes in scene

Popov72 %!s(int64=5) %!d(string=hai) anos
pai
achega
f61e4d1ea0
Modificáronse 1 ficheiros con 1 adicións e 10 borrados
  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());
     }
 
     /**