Game Development Reference
In-Depth Information
anchor positions used are the skinned positions for the particle on the character
rig. These data should easily be made available, since most game engines will
already have a skinning system in place. As a bonus, bone weightings should be
authored so the anchor points are in natural locations. This is what would be used
for the cloth verts, if there was no simulation.
It is useful to have a hard, immovable constraint where it is not possible to
move the cloth particle. Essentially, we don't simulate this particle at all so it
doesn't belong with the list of simulated particles, but it will exist as the member
of a constraint. A nice way to implement this is to move all those hard-pinned
particles to the end of the particle list and then terminate any particle update loops
early. During constraint updates, we don't want to update the position of any
hard-pinned vert.
We can vary the pinning strength. The pinning strength is a value we use to
apply only a portion of the constraint correction. With a value of 1.0, we would
move the particle all the way back to its anchor position. Applying a pinning
strength that is proportional to the distance from the skinned position helps make
it less apparent that there is a hard distance constraint being applied. Such a
distance-proportional pinning strength can be applied before and after a set pin-
ning radius. This gives a good deal of control. The pinning function now appears
as in Figure 12.1. As long as the pinning strength hits the maximum value of 1.0
before it moves over half the radius of the collision geometry, we can be confident
it is doing its job. Since the pinning strength reduces the constraint error by a pro-
portional amount each iteration, the effective strength is much more pronounced
Figure 12.1. Pinning function.
Search Nedrilad ::

Custom Search