-
-
Notifications
You must be signed in to change notification settings - Fork 35.5k
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: Fix offscreen and cleanup #27522
OrbitControls: Fix offscreen and cleanup #27522
Conversation
Attaching the This PR's solutions is not sufficient to guarantee correct interception, as can be shown in the following webgl_controls_map example By clicking any of the options in UI and holding ctrl while scrolling, you can notice the zoom speed gets much faster. This is because the GUI is above This is part of the reason of why I was unsure about using this solution in the first place, it is finnicky.
Are you able to provide a bit more information on how it broke, and perhaps an example of the usage so we can see if there's a different solution here? |
I see, would it work if instead of document we were using The current issue is that |
I'm afraid We could try |
@sciecode can you confirm if the behavior is now correct please? |
Sure, the behaviour on main thread will be correct. However it may not be correct when using a If you are implementing your virtual handler based on the manual guide, you'll need to make some changes: Worker
Main-Thread
Everything should work as intended, afterwards. I'll make these changes to the manual soon. |
Alright, I removed the condition and added a comment to prevent developers from replacing the const document = scope.domElement.getRootNode(); // offscreen canvas compatibility Looking forward to your PR on the manual @sciecode, thanks for that. |
Thank you ❤️ I'll try to get the Manual changes done over the weekend, and will tag you when the PR is done. |
* fix offscreen canvas and lint * feedbacks * added comment and removed if condition based on feedback
@sciecode have you made the change somewhere ? Can't see it in last release. |
@sciecode @RenaudRohlinger Thanks for everyones work with this. It would be great to have the manual updated with the required changes. As it stands, following the manual does not work, as I'm encountering the issue with Also, @RenaudRohlinger are you using an alternative implementation different to that of the manual? Or you were able to implement the changes that were mentioned above? |
@RenaudRohlinger: I got it running! Thanks a lot for your hard work in explaining something complex in such a great way. Should this also support zoom and pan on mobile/touch devices as mouse movement handling outside the window on desktop devices? If this is currently missing are there any plans to implement it or is this a current limitation we have to live with? |
#27446 broke the offscreen canvas support (yes it is possible to use controls such as OrbitControls in workers by using virtual dom elements).
Also code syntax wasn't correct so I cleaned up the file to align with the lint rules.
This contribution is funded by Utsubo