Explorar o código

add removeAllMeshes to highlight layer

sebavan %!s(int64=5) %!d(string=hai) anos
pai
achega
936b8a2423
Modificáronse 1 ficheiros con 18 adicións e 0 borrados
  1. 18 0
      src/Layers/highlightLayer.ts

+ 18 - 0
src/Layers/highlightLayer.ts

@@ -686,6 +686,24 @@ export class HighlightLayer extends EffectLayer {
     }
 
     /**
+     * Remove all the meshes currently referenced in the highlight layer
+     */
+    public removeAllMeshes(): void {
+        if (!this._meshes) {
+            return;
+        }
+
+        for (const uniqueId in this._meshes) {
+            if (this._meshes.hasOwnProperty(uniqueId)) {
+                const mesh = this._meshes[uniqueId];
+                if (mesh) {
+                    this.removeMesh(mesh.mesh);
+                }
+            }
+        }
+    }
+
+    /**
      * Force the stencil to the normal expected value for none glowing parts
      */
     private _defaultStencilReference(mesh: Mesh) {