Skip to content
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

Multitouch fix for TrackballControls #7406

Merged
merged 2 commits into from
Oct 22, 2015
Merged

Multitouch fix for TrackballControls #7406

merged 2 commits into from
Oct 22, 2015

Conversation

shshaw
Copy link
Contributor

@shshaw shshaw commented Oct 22, 2015

Fix for #7185. After using two fingers, the camera would rapidly rotate if both fingers were not removed simultaneously. Adding in a state check in touchend prevents the jump from the null _movePrev, allowing users to quickly go from zooming and panning to rotating.

Fix for mrdoob#7185. After using two fingers, the camera would rapidly rotate if both fingers were not removed simultaneously. Adding in some state checks in `touchmove` and `touchend` prevents the jump from the null `_movePrev`, allowing users to quickly go from zooming and panning to rotating.
mrdoob added a commit that referenced this pull request Oct 22, 2015
Multitouch fix for TrackballControls
@mrdoob mrdoob merged commit 69f9617 into mrdoob:dev Oct 22, 2015
@mrdoob
Copy link
Owner

mrdoob commented Oct 22, 2015

Thanks!

@mrdoob
Copy link
Owner

mrdoob commented Oct 22, 2015

@shshaw I've refactored TrackballControls a bit. Do you mind double checking that all works as expected?

@shshaw
Copy link
Contributor Author

shshaw commented Oct 22, 2015

Getting some oddities when I use 3 fingers then take one off, likely related to the default switch.

Also, the conditional on touchend for if ( _state !== STATE.TOUCH_ROTATE ) { under case 1: needs to be there, otherwise the same camera rotation issue occurs.

Will play with it some more to see if I can isolate it.

@mrdoob
Copy link
Owner

mrdoob commented Oct 22, 2015

Will play with it some more to see if I can isolate it more.

Thanks!

shshaw added a commit to shshaw/three.js that referenced this pull request Oct 22, 2015
* Removed unnecessary `default` case for two or more touches on `touchend` to prevent issues with 3 or more touches.
* Reset zoom distances on `case 0` and `case 1`. I couldn't combine them easily without doing a separate `if` statement.
* Simplified `case 1` action to set `_moveCurr` and `_movePrev` to the current touch position preventing camera jumping next time `touchmove` is called.

Related to issue mrdoob#7185 and pull request mrdoob#7406
@shshaw shshaw mentioned this pull request Oct 22, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants