| 565 | // Call this when you are finished with the SplatMesh and want to free |
| 566 | // any buffers it holds (via packedSplats). |
| 567 | dispose() { |
| 568 | if ( |
| 569 | this.splats && |
| 570 | this.splats !== this.packedSplats && |
| 571 | this.splats !== this.extSplats |
| 572 | ) { |
| 573 | this.splats.dispose(); |
| 574 | this.splats = undefined; |
| 575 | } |
| 576 | if (this.packedSplats) { |
| 577 | this.packedSplats.dispose(); |
| 578 | this.packedSplats = undefined; |
| 579 | } |
| 580 | if (this.extSplats) { |
| 581 | this.extSplats.dispose(); |
| 582 | this.extSplats = undefined; |
| 583 | } |
| 584 | } |
| 585 | |
| 586 | // Returns axis-aligned bounding box of the SplatMesh. If centers_only is true, |
| 587 | // only the centers of the splats are used to compute the bounding box. |