-
-
Notifications
You must be signed in to change notification settings - Fork 412
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
Fix camera 3D absolute rotation bug #5726
Conversation
Ha! Nice! I'd gone with my quick fix (just use arcball) and was about to open a PR. This is better. 😃 (Though I think zooming is less useful in 3D anyway, because you can't change the center of the zoom.) |
I did not review the previous PR, so I don't know exactly what was the purpose of these lines. At least this fixes the problem, but someone who reviewed and understood should take a look and make sure (for example) that there's no other events we're ignoring unnecessarily. @jni @alisterburt |
I think the point is to not ignore the mouse wheel if zoom is active and not ignore relevant mouse events if pan is active. I did a
Something to watch out for... I think @kevinyamauchi and @alisterburt played around with the fly camera in the Dresden hackathon? |
I think we're fine, this function is only handling mouse events, right? |
Hey look just because your mouse doesn't have a full-size keyboard on it... 😜 |
Codecov Report
@@ Coverage Diff @@
## main #5726 +/- ##
=======================================
Coverage 89.83% 89.84%
=======================================
Files 608 608
Lines 51856 51856
=======================================
+ Hits 46587 46592 +5
+ Misses 5269 5264 -5
... and 4 files with indirect coverage changes Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
and event.type | ||
in ('mouse_move', 'mouse_press', 'mouse_release') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of managing allow list maybe revert logic of this if and use deny list for block calling super implementation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure how to reverse this in a sensible way... Something like this?
if
(not self.mouse_zoom and event.type == 'mouse_wheel')
or (not self.mouse_pan and event.type in ('mouse_move', 'mouse_press', 'mouse_release')
):
event.handled = False
else:
super().viewbox_mouse_event(event)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, but this logical clause not looking like full reverse
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just played around with other 3D mouse operations in this PR (shift+drag = move rotation centre, shift+right-click-drag = perspective projection) and they work fine:
(I call this composition "inside the asteroid field" 😜)
so I suggest we merge this as is for now, and iterate in future PRs if we encounter issues. I think it's important that our 3D camera on main gets fixed ASAP.
Now that I think about it, in 3D we probably only want to block events that have no modifier (rotate) or exactly shift (pan), and let through everything else. And maybe distringuish between pan and rotate... Or maybe we should just revert the change to 3D cameras ^^' |
In line with my comment above, I'm going to merge this to fix main, we can continue to iterate on the conditions in future PRs if we discover more issues with this approach! 🙏 |
@jni If you think that something should be improved on follow-up PR then please open a proper followup issue on merge of PR to not lost knowledge. |
# Fixes/Closes Closes #5725 # Description We were ignoring mouse release events. ## Type of change <!-- Please delete options that are not relevant. --> - [x] Bug-fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] This change requires a documentation update
# Fixes/Closes Closes #5725 # Description We were ignoring mouse release events. ## Type of change <!-- Please delete options that are not relevant. --> - [x] Bug-fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] This change requires a documentation update
# Fixes/Closes Closes #5725 # Description We were ignoring mouse release events. ## Type of change <!-- Please delete options that are not relevant. --> - [x] Bug-fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] This change requires a documentation update
# Fixes/Closes Closes #5725 # Description We were ignoring mouse release events. ## Type of change <!-- Please delete options that are not relevant. --> - [x] Bug-fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] This change requires a documentation update
Fixes/Closes
Closes #5725
Description
We were ignoring mouse release events.
Type of change