-
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
Base zoom speed on browser refresh rate #12211
base: main
Are you sure you want to change the base?
Conversation
Thank you for the pull request, @lukemckinstry! ✅ We can confirm we have a CLA on file for you. |
1cdf741
to
6712b1d
Compare
posted this for initial review/feedback/discussion @ggetz. I still need to add unit tests. |
This looks somewhat similar to what I dumped into a forum thread a while ago. The goal there was also to have an "average frame rate over the last In that forum thread, I put this into some The purpose of that tl;dr : If there was "something" where a function like |
I like your idea to create a |
I like the idea of isolating the average FPS logic in one place. The update itself should probably still happen in |
1c3528c
to
b5ac693
Compare
@@ -162,6 +163,7 @@ function Scene(options) { | |||
this._frameState.scene3DOnly = defaultValue(options.scene3DOnly, false); | |||
this._removeCreditContainer = !hasCreditContainer; | |||
this._creditContainer = creditContainer; | |||
this._fpsTracker = new FpsTracker(); |
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.
Since we are accessing this from another class, can we expose this as fpsTracker
with a getter? It can be marked as @private
so it doesn't show up in the developer API documentation.
Description
Bases zoom speed on the render rate of the user's browser.
Added a field in frameState to track the timestamps of the 10 most recent renders.
Then when calculating the zoom distance on each frame, adjust it based on the fps zoom speed to provide consistent experience for browsers with different speeds.
The if the user wants faster or slower zoom, they can still adjust zoomFactor through the public api as before with the same effects.
Issue number and link
#12187
Testing plan
Author checklist
CONTRIBUTORS.md
CHANGES.md
with a short summary of my change