Game Development Reference
In-Depth Information
(a)
(b)
(c)
(d)
Known positions
Figure 17.7 Random intermediate movement (as per (Redon, 2002))
have the same positions of the object at the discrete moments as the real movement;
continuously shift from the real position of the object at moment t n to the real
position of the object at moment t n + 1 ;
be as close as possible to the real movement when it is known. This constraint is
difficult to quantify in the absence of information regarding the real movement.
The real movement of the object between two states cannot be seen by the user and can
be replaced with a random movement. Since the real positions are maintained at the
successive discrete moments, only the local movement of the object is modified and its
global movement is maintained. Figure 17.7 illustrates the same (on the left, real path;
on the right, random path interpolated on the basis of known moments). Considering
the selected interpolation (random), we make the following assumption: If a collision
is detected in the time interval [ t n , t n + 1 ], then there is certainly a collision. This can
naturally be wrong, mainly when the interpolated path is very different than the real
path of the objects. Replacing the movement of objects by a randommovement between
two successive discrete moments t n and t n + 1 has another consequence. If a collision
takes place between these two moments, for any pair of objects, the application may
require defining the state of all the objects at the moment of the collision. It is thus