|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | getFullWidth = () => { | 
|---|
|  |  |  | return this.dom.offsetWidth; | 
|---|
|  |  |  | return this.dom?.offsetWidth; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | getFullHeight = () => { | 
|---|
|  |  |  | return this.dom.offsetHeight; | 
|---|
|  |  |  | return this.dom?.offsetHeight; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | addObject = (object) => { | 
|---|
|  |  |  | 
|---|
|  |  |  | renderer.toneMapping = THREE.ACESFilmicToneMapping; | 
|---|
|  |  |  | renderer.setPixelRatio(window.devicePixelRatio); | 
|---|
|  |  |  | renderer.setSize(this.getFullWidth(), this.getFullHeight()); | 
|---|
|  |  |  | this.dom.appendChild(renderer.domElement); | 
|---|
|  |  |  | this.dom?.appendChild(renderer.domElement); | 
|---|
|  |  |  | return renderer; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | initStats = () => { | 
|---|
|  |  |  | const stats = new Stats(); | 
|---|
|  |  |  | this.dom.appendChild(stats.dom); | 
|---|
|  |  |  | this.dom?.appendChild(stats.dom); | 
|---|
|  |  |  | if (!help) { | 
|---|
|  |  |  | stats.domElement.style.display = 'none'; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | this.handleClick(objName, x, y); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | this.dom.addEventListener("click", this.handleClickEvent, false); | 
|---|
|  |  |  | this.dom?.addEventListener("click", this.handleClickEvent, false); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | generateMesh = (fn) => { | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | rePerspective = (maxHeight) => { | 
|---|
|  |  |  | this.camera.position.set(-maxHeight * 0.8, maxHeight * 0.8, maxHeight * 0.8); | 
|---|
|  |  |  | this.controls.target = new THREE.Vector3(0, maxHeight * 0.55, 0); | 
|---|
|  |  |  | rePerspective = (maxHeight, normalHeight) => { | 
|---|
|  |  |  | const height = Math.max(maxHeight, normalHeight) | 
|---|
|  |  |  | const cameraPosScale = 0.7; | 
|---|
|  |  |  | this.camera.position.set( | 
|---|
|  |  |  | -height * cameraPosScale, | 
|---|
|  |  |  | height * cameraPosScale, | 
|---|
|  |  |  | height * cameraPosScale | 
|---|
|  |  |  | ); | 
|---|
|  |  |  | this.controls.target = new THREE.Vector3(0, maxHeight * 0.53, 0); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | destroy = () => { | 
|---|
|  |  |  | 
|---|
|  |  |  | this.controls.dispose(); | 
|---|
|  |  |  | this.controls = null; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | this.dom.removeEventListener("click", this.handleClickEvent); | 
|---|
|  |  |  | this.dom?.removeEventListener("click", this.handleClickEvent); | 
|---|
|  |  |  | this.camera = null; | 
|---|
|  |  |  | this.objects = []; | 
|---|
|  |  |  | while (this.dom?.firstChild) { | 
|---|