Ignore velocity changes when the cloth solver does not converge.

This helps keep the simulation stable as long as there are only a few
substeps that become too constrained for the solver.

Eventually we need better feedback about these solver results, so that
artists can tweak situations specifically to resolve bad solver results.
This is somewhat similar to the camera tracker, which also can run into
cases that cannot be resolved and have to be fixed manually.
This commit is contained in:
Lukas Tönne 2014-09-12 15:02:37 +02:00
parent 3119d718f8
commit 8532cf206e
1 changed files with 4 additions and 2 deletions

View File

@ -2430,8 +2430,10 @@ static bool simulate_implicit_euler(Implicit_Data *id, float dt)
// itend();
// printf("cg_filtered calc time: %f\n", (float)itval());
// advance velocities
add_lfvector_lfvector(id->Vnew, id->V, id->dV, numverts);
if (ok) {
// advance velocities
add_lfvector_lfvector(id->Vnew, id->V, id->dV, numverts);
}
del_lfvector(dFdXmV);