From c325d4761715dbb2dca69660310556657605266b Mon Sep 17 00:00:00 2001 From: Sander Moolin Date: Thu, 25 Mar 2021 10:12:11 -0400 Subject: [PATCH] note on touch --- src/core/Raycaster.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/core/Raycaster.js b/src/core/Raycaster.js index bf6b545..ec7437c 100644 --- a/src/core/Raycaster.js +++ b/src/core/Raycaster.js @@ -138,10 +138,11 @@ export default { this.pointer.y = - ((evt.y - canvasTop) / this.three.size.height) * 2 + 1; }, onTouchMove(evt) { - const touch = evt.touches[0] - const { top: canvasTop, left: canvasLeft } = this.three.mouse_move_element.getBoundingClientRect() - this.pointer.x = ((touch.x - canvasLeft) / this.three.size.width) * 2 - 1 - this.pointer.y = -((touch.y - canvasTop) / this.three.size.height) * 2 + 1 + console.log('TODO: handle touch') + // const touch = evt.touches[0] + // const { top: canvasTop, left: canvasLeft } = this.three.mouse_move_element.getBoundingClientRect() + // this.pointer.x = ((touch.x - canvasLeft) / this.three.size.width) * 2 - 1 + // this.pointer.y = -((touch.y - canvasTop) / this.three.size.height) * 2 + 1 } }, render() {