| | |
| | | let that = this; |
| | | const raycaster = new THREE.Raycaster(); |
| | | const mouse = new THREE.Vector2(); |
| | | this.dom.addEventListener("dblclick", (event) => { |
| | | }) |
| | | this.dom.addEventListener("click", (event) => { |
| | | this.handleClickEvent = (event) => { |
| | | let x, y; |
| | | if (event.changedTouches) { |
| | | x = event.changedTouches[0].pageX; |
| | |
| | | if (objName && this.handleClick) { |
| | | this.handleClick(objName, x, y); |
| | | } |
| | | }, false); |
| | | } |
| | | this.dom.addEventListener("click", this.handleClickEvent, false); |
| | | } |
| | | |
| | | generateMesh = (fn) => { |
| | |
| | | this.controls.dispose(); |
| | | this.controls = null; |
| | | } |
| | | this.dom.removeEventListener("click", this.handleClickEvent); |
| | | this.camera = null; |
| | | this.objects = []; |
| | | while (this.dom?.firstChild) { |