()
| 367 | } |
| 368 | |
| 369 | clear() { |
| 370 | this.scene.traverse(obj => { |
| 371 | if (obj.isMesh && typeof obj.material === 'object' && obj.material !== null) { |
| 372 | Object.keys(obj.material).forEach(key => { |
| 373 | const matProp = obj.material[key]; |
| 374 | if (matProp !== null && typeof matProp === 'object' && typeof matProp.dispose === 'function') { |
| 375 | matProp.dispose(); |
| 376 | } |
| 377 | }); |
| 378 | obj.material.dispose(); |
| 379 | obj.geometry.dispose(); |
| 380 | } |
| 381 | }); |
| 382 | this.scene.clear(); |
| 383 | } |
| 384 | |
| 385 | dispose() { |
| 386 | cancelAnimationFrame(this.animationFrameId); |
no test coverage detected