docs: Offscreen Canvas fix touch pick and 2 fingers interactions #29983
+36
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Picking doesn't work properly (sometimes at all) in touchscreens due to the lack of
clientX
andclientY
values in the proxy event. Added those.Added a
event.preventDefault()
intouchEventHandler()
because, for some unknown reason, mouse events get fired in touchscreens when doing a simple tap. Happens only at Offscreen Canvas. Tested on Chrome for Android and Firefox for Android. Same behavior both. Might be intended per specification? This is the best fix I found to handle it.2 or more fingers don't get fully handled in OrbitControls, resulting in a black screen when trying to pinch-to-zoom, among other scenarios. It expects a
pointerId
with our custom Pointer Event proxy. To be specific, it gets called here:three.js/examples/jsm/controls/OrbitControls.js
Lines 1069 to 1077 in beab9e8
Fixed that as well :)
Also, wanted to express how good it is to have a fully working example of Offscreen Canvas + OrbitControls. I've learned so much about workers and code structuring with it. Offscreen Canvas are desperately needed in a website I maintain to keep a javascript horizontal slider to move smoothly while loading and presenting a 3D object. Without this example, I don't think I would have been able to do it.
Thank you so much!