diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-04-16 18:23:24 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-04-16 18:24:20 +0300 |
commit | 9a11aeb300cef2eef5df3b606468a6bcdaca3550 (patch) | |
tree | 7265ef366b503021c8d18497d04b49a374309829 /source/blender/blenkernel/intern/softbody.c | |
parent | 3a14a0381288ae9f49d1ab489a250cd29a00e771 (diff) | |
parent | 95eb9f22e69622c5817707fa9534521613e7d7cc (diff) |
Merge branch 'master' into blender2.8
Diffstat (limited to 'source/blender/blenkernel/intern/softbody.c')
-rw-r--r-- | source/blender/blenkernel/intern/softbody.c | 54 |
1 files changed, 28 insertions, 26 deletions
diff --git a/source/blender/blenkernel/intern/softbody.c b/source/blender/blenkernel/intern/softbody.c index 1fb95bd3115..ebdc1b327d8 100644 --- a/source/blender/blenkernel/intern/softbody.c +++ b/source/blender/blenkernel/intern/softbody.c @@ -662,11 +662,13 @@ static void add_2nd_order_roller(Object *ob, float UNUSED(stiffness), int *count notthis = bs->v2; } else { - if (v0 == bs->v2) { - bpo = sb->bpoint+bs->v1; - notthis = bs->v1; - } - else {printf("oops we should not get here - add_2nd_order_springs");} + if (v0 == bs->v2) { + bpo = sb->bpoint+bs->v1; + notthis = bs->v1; + } + else { + printf("oops we should not get here - add_2nd_order_springs"); + } } if (bpo) {/* so now we have a 2nd order humpdidump */ for (c=bpo->nofsprings;c>0;c--) { @@ -1955,12 +1957,12 @@ static int _softbody_calc_forces_slice_in_a_thread(Scene *scene, Object *ob, flo /* intitialize */ if (sb) { - /* check conditions for various options */ - /* +++ could be done on object level to squeeze out the last bits of it */ - do_selfcollision=((ob->softflag & OB_SB_EDGES) && (sb->bspring)&& (ob->softflag & OB_SB_SELF)); - do_springcollision=do_deflector && (ob->softflag & OB_SB_EDGES) &&(ob->softflag & OB_SB_EDGECOLL); - do_aero=((sb->aeroedge)&& (ob->softflag & OB_SB_EDGES)); - /* --- could be done on object level to squeeze out the last bits of it */ + /* check conditions for various options */ + /* +++ could be done on object level to squeeze out the last bits of it */ + do_selfcollision=((ob->softflag & OB_SB_EDGES) && (sb->bspring)&& (ob->softflag & OB_SB_SELF)); + do_springcollision=do_deflector && (ob->softflag & OB_SB_EDGES) &&(ob->softflag & OB_SB_EDGECOLL); + do_aero=((sb->aeroedge)&& (ob->softflag & OB_SB_EDGES)); + /* --- could be done on object level to squeeze out the last bits of it */ } else { printf("Error expected a SB here\n"); @@ -2755,7 +2757,7 @@ static void apply_spring_memory(Object *ob) l = len_v3v3(bp1->pos, bp2->pos); r = bs->len/l; if (( r > 1.05f) || (r < 0.95f)) { - bs->len = ((100.0f - b) * bs->len + b*l)/100.0f; + bs->len = ((100.0f - b) * bs->len + b*l)/100.0f; } } } @@ -2803,10 +2805,10 @@ static void springs_from_mesh(Object *ob) sb= ob->soft; if (me && sb) { - /* using bp->origS as a container for spring calcualtions here - * will be overwritten sbObjectStep() to receive - * actual modifier stack positions - */ + /* using bp->origS as a container for spring calcualtions here + * will be overwritten sbObjectStep() to receive + * actual modifier stack positions + */ if (me->totvert) { bp= ob->soft->bpoint; for (a=0; a<me->totvert; a++, bp++) { @@ -3469,16 +3471,16 @@ static void softbody_reset(Object *ob, SoftBody *sb, float (*vertexCos)[3], int SB_estimate_transform(ob, NULL, NULL, NULL); } switch (ob->type) { - case OB_MESH: - if (ob->softflag & OB_SB_FACECOLL) mesh_faces_to_scratch(ob); - break; - case OB_LATTICE: - break; - case OB_CURVE: - case OB_SURF: - break; - default: - break; + case OB_MESH: + if (ob->softflag & OB_SB_FACECOLL) mesh_faces_to_scratch(ob); + break; + case OB_LATTICE: + break; + case OB_CURVE: + case OB_SURF: + break; + default: + break; } } |