Skip to content

Commit

Permalink
Make Batch.destroy public as it’s useful for destroying manually crea…
Browse files Browse the repository at this point in the history
…ted batch groups (#7340)

* Make Batch.destroy public as it’s useful for destroying manually created batch groups

* change

---------

Co-authored-by: Martin Valigursky <[email protected]>
  • Loading branch information
mvaligursky and Martin Valigursky authored Feb 10, 2025
1 parent 60011a7 commit 68f020d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/scene/batching/batch.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { BoundingBox } from '../../core/shape/bounding-box.js';

/**
* @import { MeshInstance } from '../mesh-instance.js'
* @import { Scene } from '../scene.js'
*/

/**
Expand Down Expand Up @@ -57,7 +58,12 @@ class Batch {
this.batchGroupId = batchGroupId;
}

// Removes the batch meshes from all layers and destroys it
/**
* Removes the batch from the layers and destroys it.
*
* @param {Scene} scene - The scene.
* @param {number[]} layers - The layers to remove the batch from.
*/
destroy(scene, layers) {
if (this.meshInstance) {
this.removeFromLayers(scene, layers);
Expand Down

0 comments on commit 68f020d

Please sign in to comment.