()
| 271 | // Call this when you are finished with the PackedSplats and want to free |
| 272 | // any buffers it holds. |
| 273 | dispose() { |
| 274 | if (this.target) { |
| 275 | this.target.dispose(); |
| 276 | this.target.texture.source.data = null; |
| 277 | this.target = null; |
| 278 | } |
| 279 | if (this.source) { |
| 280 | this.source.dispose(); |
| 281 | this.source.source.data = null; |
| 282 | this.source = null; |
| 283 | } |
| 284 | |
| 285 | this.packedArray = null; |
| 286 | |
| 287 | for (const key in this.extra) { |
| 288 | const dyno = this.extra[key] as DynoUniform< |
| 289 | DynoType, |
| 290 | string, |
| 291 | THREE.Texture |
| 292 | >; |
| 293 | if (dyno instanceof DynoUniform) { |
| 294 | const texture = dyno.value; |
| 295 | if (texture?.isTexture) { |
| 296 | texture.dispose(); |
| 297 | texture.source.data = null; |
| 298 | } |
| 299 | } |
| 300 | } |
| 301 | this.extra = {}; |
| 302 | |
| 303 | this.disposeLodSplats(); |
| 304 | } |
| 305 | |
| 306 | prepareFetchSplat() { |
| 307 | // console.info("PackedSplats.prepareFetchSplat"); |
nothing calls this directly
no test coverage detected