diff options
author | Daniel Genrich <daniel.genrich@gmx.net> | 2008-04-09 20:38:26 +0400 |
---|---|---|
committer | Daniel Genrich <daniel.genrich@gmx.net> | 2008-04-09 20:38:26 +0400 |
commit | 906666a4d87b7812e0945acb5803be3ca43fcdbb (patch) | |
tree | 706cbe78eebbb004990ea6f32956de55bf608794 /source/blender/blenkernel/intern/cloth.c | |
parent | 235f793f28bebf1fdfbc94bf8fc2f0c3ac727c49 (diff) |
Cloth enhancement for upcomming cache changes: support different speed using clmd->sim_parms->timescale
Diffstat (limited to 'source/blender/blenkernel/intern/cloth.c')
-rw-r--r-- | source/blender/blenkernel/intern/cloth.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/cloth.c b/source/blender/blenkernel/intern/cloth.c index 1ece51a9425..6123b1b5e35 100644 --- a/source/blender/blenkernel/intern/cloth.c +++ b/source/blender/blenkernel/intern/cloth.c @@ -135,6 +135,7 @@ void cloth_init ( ClothModifierData *clmd ) clmd->sim_parms->firstcachedframe = -1.0; clmd->sim_parms->avg_spring_len = 0.0; clmd->sim_parms->presets = 2; /* cotton as start setting */ + clmd->sim_parms->timescale = 1.0f; /* speed factor, describes how fast cloth moves */ clmd->coll_parms->self_friction = 5.0; clmd->coll_parms->friction = 5.0; @@ -447,7 +448,7 @@ DerivedMesh *clothModifier_do(ClothModifierData *clmd,Object *ob, DerivedMesh *d } // unused in the moment, calculated seperately in implicit.c - clmd->sim_parms->dt = 1.0f / clmd->sim_parms->stepsPerFrame; + clmd->sim_parms->dt = clmd->sim_parms->timescale / clmd->sim_parms->stepsPerFrame; if ( ( clmd->clothObject == NULL ) || (clmd->clothObject && (numverts != clmd->clothObject->numverts )) ) { |