![]() ![]() pendulums, springs, orbiting planets, etc.) may steadily accumulate energy until the whole system blows apart.įortunately, it's not hard to replace Euler integration with something that is almost as simple, yet has none of these problems - specifically, a second-order symplectic integrator such as leapfrog integration or the closely related velocity Verlet method. In particular, objects that should oscillate steadily (e.g. It doesn't conserve energy, even if the underlying physics should. ![]() Even for games with a fixed physics timestep, changing the timestep during development can noticeably affect the game physics such as the distance that an object launched with a given force will fly, potentially breaking previously designed levels. The error depends on the timestep, meaning that changing the timestep changes object trajectories in a systematic way that may be noticed by players if the game uses a variable timestep. As others have noted in the comments, the basic Euler integration method described in tenpn's answer suffers from a few problems:Įven for simple motion, like ballistic jumping under constant gravity, it introduces a systematic error. ![]()
0 Comments
Leave a Reply. |