-
-
Notifications
You must be signed in to change notification settings - Fork 35.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OrbitControls stays in incorrect state after pointercancel event #25505
Comments
So the I wonder if this issue can be fixed by simply adding |
I've added the line to a branch for testing? Can you still reproduce the issue with the following link? |
No, that change fixes this issue. Thanks for the quick response. As for your questions: I didn't find any specifics on what exactly triggers
Yes. In fact, that is my current workaround: trigger a fake
I'm not very familiar with the details of OrbitControls, but probably the other steps taken in |
Yes, that makes sense. We probably can remove the scope.domElement.addEventListener( 'pointercancel', onPointerUp ); |
is this related ? On android when two fingers are active and i use the third finger to a system action (like pull down notification drawer) orbitcontrols gets stuck in a locked state renn.mp4 |
@optimus007 Does this still happen with: https://rawcdn.githack.com/Mugen87/three.js/dev75/examples/misc_controls_orbit.html |
Yeah, .. still happens Record_2023-02-24-15-25-18.mp4 |
Then this seems to be a different problem. It's best to file a new issue. |
Description
Opening a page with OrbitControls on an iPad can result in several errors when moving the scene with two fingers closely pinched together.
Probably it's the same in any case where
pointercancel
would be fired, but this is the scenario which we can consistently reproduce on multiple devices. Surface tables or Android phones don't fire this event (in this case at least).Reproduction steps
window.addEventListener('error', e=>{...})
)The error handler will fire several times.
Code
The error triggered regardless of user code.
As far as I could tell, the problem is that in
OrbitControls.js
, inonPointerCancel
, the pointer is removed, butstate
is not changed. So if we were in the middle of a panning or zooming gesture for example (state = TOUCH_DOLLY_PAN
), the next call toonPointerMove
will eventually end up ingetSecondPointerPosition
, which will throw when trying to read the position of the nonexistent second pointer.Live example
Screenshots
No response
Version
r149
Device
Mobile
Browser
Safari
OS
iOS
The text was updated successfully, but these errors were encountered: