Quantcast
Channel: Question and Answer » libgdx
Viewing all articles
Browse latest Browse all 434

Why does physics interpolation give me periodic jumps/flickers?

$
0
0

I have seen this question but it didn’t solve the problem.

I have followed the same steps as in this article.

What I notice in my Android game is that my interpolation alpha (or fraction or accumulatorRatio) varies with this pattern as frames progress:

0.13
0.22
0.31
0.45
0.49
0.62
0.81
0.94
0.03
0.1

The above is an illustration but the point is that it goes from 0 to 1 and cycles back to 0 periodically. I believe this is due to the game frame rate being slight faster than the physics update interval.

Every time the interpolation alpha cycles around, it gives me a jitter (or jump).

Here is a log file: http://pastebin.com/3Yb7nVxX

The two columns are (i) interpolation alpha (ii) physics step count

The “jumps” happen roughly in lines 262 to 266 in the log.

Here is the code: http://pastebin.com/vWC7yNGM

What is causing these periodic “jumps”?

EDIT: Here is more detailed code: http://pastebin.com/PSZrntZP


Viewing all articles
Browse latest Browse all 434

Trending Articles