Game Development Reference
In-Depth Information
The first message has already been delivered: we simply want you
to appreciate the shortcomings in Euler integration and be aware that
other methods exist that offer different trade-offs among accuracy, sta-
bility, and performance. Some integrators are better suited for different
purposes. Almost any integrator will work better than Euler integration
for the simulations people are currently interested in solving in real-time:
cloth, hair, fluid, and soft body simulation, combining dynamic physics
and pre-generated animation for articulated (especially humanoid) charac-
ters, and others. Anyone interested in these more advanced simulations
will find an understanding of integration methods to be a prerequisite.
The sources listed in the suggested reading in Section 12.7 are a good
start.
The second message is that although the higher-order methods are bet-
ter choices for the “high class” simulations we have named, for simulation
of rigid bodies, the trivial Euler integration is still often used. Why? In a
word: constraints. In some simulations, the force is a continuous function
of time or position, and has a nice Taylor series expansion that is well met
by the higher-order integration methods. Simulations based on spring-like
connections or those that deal with collisions in a soft, penalty-method-like
fashion behave like this. For such simulations, using a higher-order inte-
grator (which increases the number of “inner loop” trial steps and samples
per time step) offers a better reduction in error for a given amount of CPU
time, compared to reducing h (which takes more “outer loop” iterations).
However, the constraints in rigid-body simulations are often discontinuous
and inherently require an LCP-based approach. When these discontinu-
ous functions are approximated by Hooke's law, the spring constant must
be very large, and this leads to instability. In fact, the resulting differ-
ential equations are referred to as “stiff” equations, which are known to
require implicit rather than explicit integration. Unfortunately, velocity-
based constraint solvers—as we mentioned, these are currently a popular
type of simulation—operate by adjusting the velocities to satisfy the con-
straints, and essentially they need to be able to “see into the future” to
know how changes to the proposed adjusted velocity will affect the inte-
grated position and thus the satisfaction of the constraint. More sophisti-
cated methods of integration make this fortune-telling more complicated.
(The implicit integration methods used to solve stiff equations essentially
operate by “seeing into the future.”) In short, due to the current meth-
ods of resolving contact and joint constraints, decreasing the stepsize h
offers a more attractive use of CPU time than higher-order integrators,
at least according to the votes cast by designs of the more popular real-
time rigid-body simulators in use in video games right now. Perhaps put
more bluntly: stability is currently valued more than accuracy in real-time
simulation.
Search WWH ::




Custom Search