Okay, thank you all for your replies.. I do appreciate it.

I *think* I'm starting to get it, and I think the confusion was in how I was perceiving - or what I thought I was perceiving - of time_step's function.

It kinda boils down to time_step controlling how far an object will move/rotate per frame based on the FPS, compared against the duration of one full "time_step cycle" (for lack of a better term).

Basically 1 second = 16 time_step ticks = CurrentFPS

It then divides 16 (one time_step "cycle" in ticks) by the CurrentFPS. The result is how much (what percentage) of a full time_step cycle was required to complete a single cycle/frame. It then takes that result and multiplies it by the amount the given object needs to move/rotate per cycle (or, per FPS), thus adjusting the actual distance the object moves or rotates per frame.

So if you are getting 60FPS, and you want that plane to rotate 2 degrees per cycle, it would, on its own rotate 120 degrees per second. Whereas, if you're getting 20FPS, it would be rotating 40 degrees per second, which is obviously not what you want.

So, at 60FPS, the time_step comes into play like this..

- What percentage of a full time_step cycle was required to render the last frame?
- At 60FPS, it took .27 (16 divided by 60, rounded up from .2666...) of a full time_step cycle for the last frame to render.
- So, we then multiply the base amount of rotation (2 degrees per cycle, or frame) by the amount of time it took for the last frame to render, which was .26 of a full time_step. 2 * .27 = .54
- So, at 60FPS, the object will rotate a total of .54 degrees per cycle/frame.

Note: With these numbers it actually comes out to 32.4 degrees per second, not 32 even.. so I guess I was a bit off somewhere, or will that happen at certain FPS?)

If it were running at 20FPS, it would then be:
16 divided by 20 = .8
2 degrees per cycle/frame * .8 = 1.6

So at 20FPS, the object is rotating 1.6 degrees per cycle/frame.

So... if I'm understanding it right, the function of time_step is to control how far the object in question moves/rotates per second, based on the current FPS.

If that's so, then that's what I wasn't getting. I was trying to wrap my head around it as a function of controlling time... not distance. Maybe not the most accurate way to describe it, but if I have the basics right, then I guess it's good enough for me for now :-p



Last edited by Preypacer; 01/02/09 04:40.