Game Development Reference
In-Depth Information
Coupled or decoupled. There are two main approaches to solving friction—
coupled and decoupled. In the coupled approach, the maximum friction force
changes while iterating, basically trying to solve a nonlinear problem with a tool-
box that is designed for linear problems (Gauss-Seidel), which may sound inap-
propriate but actually works fairly well in practice. The decoupled involves using
a fixed maximum friction force that is determined before iterating. In the case of
decoupled friction, there are two popular methods: either using the normal force
from the last time step, which requires some bookkeeping, or using a fixed value,
regardless of normal force. Such a fixed value is often based on the normal force
to keep the body at rest when affected by gravity. This may sound like a very
crude approximation, but it works surprisingly well, requires no bookkeeping,
and is perfectly linear. The main drawback is, of course, that friction is unaf-
fected by how much pressure is on the object. An object at the bottom of a stack
slides out just as easily as the ones on top!
Friction in stacks. It is worth mentioning the importance of proper friction for
handling stable stacking. Even in a scenario that seems largely unaffected by
friction, like a pyramid of boxes, friction plays a very important role. Remember
that the solver causes objects to rotate as an artifact of Gauss-Seidel iteration.
This rotation introduces a tangential motion that causes a stack to tip over if no
friction is used.
Friction drift. Remember the description above, about early solver termination
causing stacked objects to sink into each other? The exact same thing happens to
friction constraints, so if not compensated for, stacked objects might slide around
slowly on top of each other, eventually causing the whole thing to fall over. Track-
ing friction drift is cumbersome because it involves tracking pairs of objects over
several frames. For penetration depth it is rather straightforward since the desired
configuration is determined by the shape of the objects. For static friction, it is
not quite that easy. Static friction can be seen as a temporary joint holding two
objects together in the contact plane. If the maximum joint force is exceeded,
the objects should actually slide, but as long as the force is within the maximum
friction force, the relative net motion should ideally be zero. Hence, any motion
that actually occurs is due to early solver termination, linearization, or any other
of our artifact friends. Measuring this drift and compensating for it over time can
therefore help maintain stable stacking and natural friction behavior.
2.5.5 Shock Propagation
As a way to counteract the squishiness of iterative solvers, a shock-propagation
scheme can be used. The idea is to analyze the configuration and set up the
Search Nedrilad ::




Custom Search