diff --git a/source/blender/blenkernel/intern/cloth.c b/source/blender/blenkernel/intern/cloth.c index ecd478be8fd..802e14b683f 100644 --- a/source/blender/blenkernel/intern/cloth.c +++ b/source/blender/blenkernel/intern/cloth.c @@ -1112,6 +1112,9 @@ static int cloth_from_object(Object *ob, ClothModifierData *clmd, DerivedMesh *d // init our solver if ( solvers [clmd->sim_parms->solver_type].init ) solvers [clmd->sim_parms->solver_type].init ( ob, clmd ); + + if(cache_there) + implicit_set_positions(clmd); clmd->clothObject->tree = bvh_build_from_cloth ( clmd, clmd->coll_parms->epsilon ); diff --git a/source/blender/blenkernel/intern/collision.c b/source/blender/blenkernel/intern/collision.c index 8cadb7e5f1b..8f681ea9865 100644 --- a/source/blender/blenkernel/intern/collision.c +++ b/source/blender/blenkernel/intern/collision.c @@ -979,7 +979,7 @@ int cloth_bvh_objcollision(ClothModifierData * clmd, float step, float dt) Cloth *cloth=NULL; Object *coll_ob=NULL; BVH *cloth_bvh=NULL; - long i=0, j = 0, numfaces = 0, numverts = 0, k = 0; + long i=0, j = 0, numfaces = 0, numverts = 0; unsigned int result = 0, ic = 0, rounds = 0; // result counts applied collisions; ic is for debug output; ClothVertex *verts = NULL; float tnull[3] = {0,0,0}; diff --git a/source/blender/src/editmesh.c b/source/blender/src/editmesh.c index 7f9391238dd..ee7c73264e3 100644 --- a/source/blender/src/editmesh.c +++ b/source/blender/src/editmesh.c @@ -1122,12 +1122,12 @@ void load_editMesh(void) VECCOPY(cloth->verts[i].x, eve->co); Mat4MulVecfl ( G.obedit->obmat, cloth->verts[i].x ); - /* + // not physical correct but gives nicer results when commented VECSUB(temp, cloth->verts[i].x, temp); - VecMulf(temp, 1.0f / dt); + VecMulf(temp, 1.0f / (dt*10.0)); VECADD(cloth->verts[i].v, cloth->verts[i].v, temp); - */ + if(oldverts) { VECCOPY(mvert->co, oldverts[i].co); if(G.rt > 0) @@ -1171,12 +1171,9 @@ void load_editMesh(void) if(G.rt > 0) printf("loadmesh --> cloth_enabled cloth_write_cache\n"); cloth_write_cache(G.obedit, clmd, clmd->sim_parms->editedframe); + cloth_read_cache(G.obedit, clmd, G.scene->r.cfra); + implicit_set_positions(clmd); - /* in this case we have to get the data for the requested frame */ - if(clmd->sim_parms->editedframe != G.scene->r.cfra) - { - cloth_read_cache(G.obedit, clmd, G.scene->r.cfra); - } clmd->sim_parms->flags &= ~CLOTH_SIMSETTINGS_FLAG_EDITMODE; } else