Game Development Reference

In-Depth Information

Damping can always be used to enforce stability on spring systems, even if the

forces are not constructed to be stable with the used integration scheme [Bhasin

and Liu 06].

Every system loses energy over time. In a physical sense, the energy is not lost

but goes into motion that is not visible to perception, such as heating the materials

or the surrounding system. Here, a simple damping model is used that will cause

the system to come to rest by just scaling the velocity by a certain factor at every

time step.

scaleVector(v.vel, v.factorDamping);

Damping forces can be constructed to drain energy from the system in a more

sophisticated way so global damping can be reduced. But in the end, a form of

global damping should still be implemented.

14.3 Neighborhood Interaction

For the following forces, the neighborhood (nbr(
i
))ofvertex
x
i
needs to be de-

fined. The neighborhood can be quite a general set of vertices; we just need an

applicable definition of it. If we do not have any connectivity information, we can

define it to be every vertex that is within a certain radius of another. For vertices

that form a lattice, the neighborhood can be the nearest-neighbor lattice sites. A

triangle mesh has connectivity information supplied by definition, for example, in

the form of a stream of vertices and a stream of triangles that group three vertices

into one surface fragment and store additional information that is needed on a

per-triangle level. (See
Figure 14.2
.)

Here, we define the vertex's ring-0 neighbors as its neighborhood. (This

equals the vertices that are grouped into one triangle with the vertex!) We also de-

fine each vertex as a neighbor of itself, which makes the formalism later simpler.

Figure 14.2.
Avertex
x
i
and its local neighborhood.