-
Notifications
You must be signed in to change notification settings - Fork 0
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
Update inconsistency #15
Comments
This is on Firefox 15.0.1, Win7_64. |
This is not a bug. The update for entities and scenes is not called on a fixed time step. Rather, it is called per event. This is why moving the mouse causes a change, because mouse movement events are being fired (probably at 60Hz). The reason this was done was to simplify update functions.
Of course, there are down-falls.
There are two solutions. First, you could use You can get the time delta from In another project I'm working on I'm experiencing fishy behaviour even when accounting for time. My theory is that mouse position events are coming in so quickly that there is significant round-off error on the time delta. Although it is ultimately up to the browser, my mouse polls at 1000Hz, which means the delta between mouse events can be as low as 1ms, which is the smallest possible time delta greater than zero (since the browser only reports times to a millisecond accuracy). Once the ball update method is corrected, we can take a closer look at this issue. |
I tried doing what you suggested but it created some weird results, I logged the value of delta and got this from the console:
code (is it right?): var delta = updateParams.getTime().getDelta();
console.log("delta:", delta); If I use the following, then it is somewhat normalized, but still a barely-noticable inconsistency. var delta = updateParams.getTime().getDelta();
if ( Math.abs(delta) > 1000 )
return; |
Sorry, I thought I posted yesterday. Must have forgot to hit the comment button. That behaviour is definitely irregular. Please make a new branch for issue_15 and push your code that produces this log. There might be a bug in GFW but I'll have to take a look. |
Also I forgot to mention that this value only appears when I move my mouse. Added issue_15 branch. EDIT: It also occurs when holding down a keyboard key. |
No issue with Chrome Version 22.0.1229.79 m, so might be Firefox specific. |
So for example, the ball moves (as per Update function) consistently, but while I am moving the mouse over the webpage, it updates more quickly than it did when I did not move the mouse.
So moving the mouse = ball moves faster.
Is this a bug or something?
The text was updated successfully, but these errors were encountered: