pchen66 / panolens.js

Javascript panorama viewer based on Three.js
https://pchen66.github.io/Panolens/
MIT License
2.79k stars 498 forks source link

Raycastingpoint NaN on Mobile Device after OnTap #427

Open oreMno opened 1 year ago

oreMno commented 1 year ago

Hi there, I have an issue on mobile devices, for getting an invalid Raycastingpoint onTap event.

Here, the description: Project https://pchen66.github.io/Panolens/examples/panorama_infospot.html What To Do Open DevTools on Chrome, set mobile devices and click/tap the panorama. Set a breakpoint on panolens.min.js inside OnTap. OnTap() is reached after OnMouseDown and no value is defined for a.clientX or clientY, because of touchEvent this.raycasterPoint.x = (a.clientX - c.left) / g.clientWidth 2 - 1; this.raycasterPoint.y = 2 -((a.clientY - d) / h) + 1;

Do you have any idea how to fix this for mobile device?