
7.3 The Contact Resolver Algorithm 135
iterationsUsed++;
}
}
The number of iterations we use to resolve interpenetrations might not be the
same as the number used in resolving collisions. We could implement the function to
use a different limit in each case. In practice, there is rarely any need to have different
values, as we can pass the same for both. As a simulation gets more complex with
interacting objects, the number of collision iterations needed will increase at roughly
the same rate as the number of interpenetration iterations. In the function above, I’ve
used one iteration limit for both parts.
The recalculation of the closing velocity and