| | |
| | | } |
| | | |
| | | addObject = (object) => { |
| | | this.scene.add(object); |
| | | this.objects.push(object); |
| | | this.scene?.add(object); |
| | | this.objects?.push(object); |
| | | } |
| | | |
| | | initScene = () => { |
| | |
| | | height * cameraPosScale, |
| | | height * cameraPosScale |
| | | ); |
| | | this.controls.target = new THREE.Vector3(0, maxHeight * 0.53, 0); |
| | | this.controls.target = new THREE.Vector3(0, maxHeight * 0.5, 0); |
| | | } |
| | | |
| | | destroy = () => { |
| | |
| | | this.dom?.removeEventListener("click", this.handleClickEvent); |
| | | this.camera = null; |
| | | this.objects = []; |
| | | while (this.dom?.firstChild) { |
| | | this.dom.removeChild(this.dom.firstChild); |
| | | if (this.dom) { |
| | | while (this.dom.firstChild) { |
| | | if (this.dom.contains(this.dom.firstChild)) { |
| | | this.dom.removeChild(this.dom.firstChild); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |