-
Notifications
You must be signed in to change notification settings - Fork 3.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
updating Camera.changed to account for changes in roll #11844
Conversation
Thanks @malaretv! I can confirm we have a CLA on file for you. |
camera._changed.raiseEvent( | ||
Math.max(rollChangedPercentage, headingChangedPercentage) | ||
); | ||
return; |
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 noticed there is no early return in the heading check previously. I believe this is because the function needs to clone the frustum before exiting, as is done below.
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.
Ah that makes sense. I'll remove the early return since previous behavior was okay.
I was trying to avoid the event maybe being fired multiple times, but maybe that is a non-issue -- or at the very least outside the scope of this one.
Thanks for the review!
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.
Thanks for your PR! I just have one comment.
Thank you for the review @ggetz . I've addressed the one comment |
Looks good! Thanks @malaretv! |
Description
I attempted to fix the remaining issues with #9365, which I think was closed prematurely.
Current behavior: For cases where camera is not pointed straight down to surface twistLeft/Right do not cause a Camera changed event to fire.
Attempted fix: Add a similar check performed for
heading
to be also performed forroll
. This seems to properly cause the change event to be triggered. I do not know if this is the most optimal fix, just copying what was done by others to handle this case too.Issue number and link
#9365 Can open a new issue if appropriate
Testing plan
I added a test case that listens for the Camera changed event for twistLeft after first telling the camera to lookUp by 45deg. This test failed before my changes, and passed after my changes.
Author checklist
CONTRIBUTORS.md
CHANGES.md
with a short summary of my change