Reenabled air drag force for cloth sim.

This commit is contained in:
Lukas Tönne 2014-09-09 12:29:47 +02:00
parent e0b46b136e
commit 7896827f75

@ -502,19 +502,19 @@ static void cloth_calc_force(ClothModifierData *clmd, lVector &F, lMatrix &dFdX,
Cloth *cloth = clmd->clothObject; Cloth *cloth = clmd->clothObject;
unsigned int numverts = cloth->numverts; unsigned int numverts = cloth->numverts;
ClothVertex *verts = cloth->verts; ClothVertex *verts = cloth->verts;
float spring_air = clmd->sim_parms->Cvi * 0.01f; /* viscosity of air scaled in percent */ float drag = clmd->sim_parms->Cvi * 0.01f; /* viscosity of air scaled in percent */
float gravity[3] = {0,0,0}; float gravity[3] = {0,0,0};
// lVector diagonal(3*numverts);
// diagonal.setZero
TripletList coeff_dFdX, coeff_dFdV;
F.setZero(); F.setZero();
dFdX.setZero(); dFdX.setZero();
dFdV.setZero(); dFdV.setZero();
/* set dFdV jacobi matrix diagonal entries to -spring_air */ /* air drag */
// dFdV.setIdentity(); lMatrix_reserve_elems(dFdV, 1);
// initdiag_bfmatrix(dFdV, tm2); for (int i = 0; i < numverts; ++i) {
madd_v3_v3fl(lVector_v3(F, i), lVector_v3(V, i), -drag);
lMatrix_madd_m3(dFdV, I, -drag, i, i);
}
/* global acceleration (gravitation) */ /* global acceleration (gravitation) */
if (clmd->scene->physics_settings.flag & PHYS_GLOBAL_GRAVITY) { if (clmd->scene->physics_settings.flag & PHYS_GLOBAL_GRAVITY) {