December 2002
Intermediate to advanced
648 pages
19h 53m
English
What value should we use for an animation’s dt ? We’d like to make it somewhat independent of the speed at which our program is running. The run speed can be influenced not only by your processor speed, but also by the size of your game window, and whether or not you have multiple views or documents open in your game. As far as possible, we’d like the apparent speed of our moving creatures to stay the same.
What exactly does this mean? As we discuss in Chapter 7: Simulating Physics, we give each simulation object a vector _position and a vector _velocity. For each update cycle, we compute an appropriate time step dt, we update our _velocity, and then we use the standard rule:
_position = _position ...
Read now
Unlock full access