diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-06-03 22:25:57 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-06-03 22:25:57 +0400 |
commit | 4413024cdcf68c911c7de0ee3eea3221bef48b90 (patch) | |
tree | 4a1582557f85da8dda0029b12e6bf85c937fda34 /source/blender/blenkernel | |
parent | fea490c73e361409f4d52c787d9ceed9655adb13 (diff) | |
parent | f9856c1c2da8139651eb59ff3bf174065d0f628c (diff) |
svn merge ^/trunk/blender -r47325:47381
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/intern/DerivedMesh.c | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/collision.c | 12 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/smoke.c | 2 |
3 files changed, 12 insertions, 4 deletions
diff --git a/source/blender/blenkernel/intern/DerivedMesh.c b/source/blender/blenkernel/intern/DerivedMesh.c index 7130776d05a..3f28a4afe8d 100644 --- a/source/blender/blenkernel/intern/DerivedMesh.c +++ b/source/blender/blenkernel/intern/DerivedMesh.c @@ -426,7 +426,7 @@ void DM_update_tessface_data(DerivedMesh *dm) /* Find out loop indices. */ /* XXX Is there a better way to do this? */ - /* NOTE: This assumes tessface are valid and in sync with loop/poly… Else, most likely, segfault! */ + /* NOTE: This assumes tessface are valid and in sync with loop/poly... Else, most likely, segfault! */ for (i = mp[polyindex[mf_idx]].loopstart, not_done = mf_len; not_done; i++) { MLoop *tml = &ml[i]; if (tml->v == mf->v1) { diff --git a/source/blender/blenkernel/intern/collision.c b/source/blender/blenkernel/intern/collision.c index e680d9889cd..32e9dd7508b 100644 --- a/source/blender/blenkernel/intern/collision.c +++ b/source/blender/blenkernel/intern/collision.c @@ -302,6 +302,10 @@ static int cloth_collision_response_static ( ClothModifierData *clmd, CollisionM // Apply repulse impulse if distance too short // I_r = -min(dt*kd, m(0, 1d/dt - v_n)) + // DG: this formula ineeds to be changed for this code since we apply impulses/repulses like this: + // v += impulse; x_new = x + v; + // We don't use dt!! + // DG TODO: Fix usage of dt here! spf = (float)clmd->sim_parms->stepsPerFrame / clmd->sim_parms->timescale; d = clmd->coll_parms->epsilon*8.0f/9.0f + epsilon2*8.0f/9.0f - collpair->distance; @@ -324,7 +328,10 @@ static int cloth_collision_response_static ( ClothModifierData *clmd, CollisionM else { // Apply repulse impulse if distance too short - // I_r = -min(dt*kd, m(0, 1d/dt - v_n)) + // I_r = -min(dt*kd, max(0, 1d/dt - v_n)) + // DG: this formula ineeds to be changed for this code since we apply impulses/repulses like this: + // v += impulse; x_new = x + v; + // We don't use dt!! float spf = (float)clmd->sim_parms->stepsPerFrame / clmd->sim_parms->timescale; float d = clmd->coll_parms->epsilon*8.0f/9.0f + epsilon2*8.0f/9.0f - collpair->distance; @@ -332,7 +339,8 @@ static int cloth_collision_response_static ( ClothModifierData *clmd, CollisionM // stay on the safe side and clamp repulse float repulse = d*1.0f/spf; - float impulse = repulse / (3.0f * ( 1.0f + w1*w1 + w2*w2 + w3*w3 )); // original 2.0 / 0.25 + float impulse = repulse / ( 3.0 * ( 1.0f + w1*w1 + w2*w2 + w3*w3 )); // original 2.0 / 0.25 + VECADDMUL ( i1, collpair->normal, impulse ); VECADDMUL ( i2, collpair->normal, impulse ); VECADDMUL ( i3, collpair->normal, impulse ); diff --git a/source/blender/blenkernel/intern/smoke.c b/source/blender/blenkernel/intern/smoke.c index 46286eb6cf9..7a5465edf02 100644 --- a/source/blender/blenkernel/intern/smoke.c +++ b/source/blender/blenkernel/intern/smoke.c @@ -1172,7 +1172,7 @@ static void update_obstacles(Scene *scene, Object *ob, SmokeDomainSettings *sds, sub_v3_v3v3(vel, pos, oldpos); /* Scale velocity to incorperate the object movement during this step */ - mul_v3_fl(vel, 1.0 / (totalsteps * dt)); + mul_v3_fl(vel, 1.0 / (totalsteps * dt * sds->scale)); // mul_v3_fl(vel, 1.0 / dt); // DG TODO: cap velocity to maxVelMag (or maxvel) |