diff options
author | Campbell Barton <ideasman42@gmail.com> | 2015-05-17 09:47:44 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2015-05-17 10:25:57 +0300 |
commit | 02cbc3c1e0be505724eb79f15d75adf6089063fe (patch) | |
tree | 75a2cb95a918192b35ac73abdd1a569280aa1048 /source/blender/blenkernel/intern/softbody.c | |
parent | daeb3069cfbc0e5997e6d850adc968d17864baba (diff) |
Cleanup: indentation
Diffstat (limited to 'source/blender/blenkernel/intern/softbody.c')
-rw-r--r-- | source/blender/blenkernel/intern/softbody.c | 46 |
1 files changed, 28 insertions, 18 deletions
diff --git a/source/blender/blenkernel/intern/softbody.c b/source/blender/blenkernel/intern/softbody.c index 3cc2337d4f1..607f89699a4 100644 --- a/source/blender/blenkernel/intern/softbody.c +++ b/source/blender/blenkernel/intern/softbody.c @@ -1035,6 +1035,7 @@ static int sb_detect_aabb_collisionCached(float UNUSED(force[3]), unsigned int U ccd_Mesh *ccdm = BLI_ghashIterator_getValue (ihash); ob = BLI_ghashIterator_getKey (ihash); + { /* only with deflecting set */ if (ob->pd && ob->pd->deflect) { #if 0 /* UNUSED */ @@ -1076,6 +1077,7 @@ static int sb_detect_aabb_collisionCached(float UNUSED(force[3]), unsigned int U } } /* if (ob->pd && ob->pd->deflect) */ BLI_ghashIterator_step(ihash); + } } /* while () */ BLI_ghashIterator_free(ihash); return deflected; @@ -1114,6 +1116,7 @@ static int sb_detect_face_pointCached(float face_v1[3], float face_v2[3], float ccd_Mesh *ccdm = BLI_ghashIterator_getValue (ihash); ob = BLI_ghashIterator_getKey (ihash); + { /* only with deflecting set */ if (ob->pd && ob->pd->deflect) { MVert *mvert= NULL; @@ -1177,6 +1180,7 @@ static int sb_detect_face_pointCached(float face_v1[3], float face_v2[3], float } /* if (mvert) */ } /* if (ob->pd && ob->pd->deflect) */ BLI_ghashIterator_step(ihash); + } } /* while () */ BLI_ghashIterator_free(ihash); return deflected; @@ -1206,6 +1210,7 @@ static int sb_detect_face_collisionCached(float face_v1[3], float face_v2[3], fl ccd_Mesh *ccdm = BLI_ghashIterator_getValue (ihash); ob = BLI_ghashIterator_getKey (ihash); + { /* only with deflecting set */ if (ob->pd && ob->pd->deflect) { MFace *mface= NULL; @@ -1315,6 +1320,7 @@ static int sb_detect_face_collisionCached(float face_v1[3], float face_v2[3], fl }/* while a */ } /* if (ob->pd && ob->pd->deflect) */ BLI_ghashIterator_step(ihash); + } } /* while () */ BLI_ghashIterator_free(ihash); return deflected; @@ -1434,6 +1440,7 @@ static int sb_detect_edge_collisionCached(float edge_v1[3], float edge_v2[3], fl ccd_Mesh *ccdm = BLI_ghashIterator_getValue (ihash); ob = BLI_ghashIterator_getKey (ihash); + { /* only with deflecting set */ if (ob->pd && ob->pd->deflect) { MFace *mface= NULL; @@ -1555,6 +1562,7 @@ static int sb_detect_edge_collisionCached(float edge_v1[3], float edge_v2[3], fl }/* while a */ } /* if (ob->pd && ob->pd->deflect) */ BLI_ghashIterator_step(ihash); + } } /* while () */ BLI_ghashIterator_free(ihash); return deflected; @@ -1762,6 +1770,7 @@ static int sb_detect_vertex_collisionCached(float opco[3], float facenormal[3], ccd_Mesh *ccdm = BLI_ghashIterator_getValue (ihash); ob = BLI_ghashIterator_getKey (ihash); + { /* only with deflecting set */ if (ob->pd && ob->pd->deflect) { MFace *mface= NULL; @@ -1799,7 +1808,7 @@ static int sb_detect_vertex_collisionCached(float opco[3], float facenormal[3], else { /*aye that should be cached*/ printf("missing cache error\n"); - BLI_ghashIterator_step(ihash); + BLI_ghashIterator_step(ihash); continue; } @@ -1917,16 +1926,16 @@ static int sb_detect_vertex_collisionCached(float opco[3], float facenormal[3], if (facedist > outerfacethickness*ff) force_mag_norm =(float)force_mag_norm*fa*(facedist - outerfacethickness)*(facedist - outerfacethickness); *damp=ob->pd->pdef_sbdamp; - if (facedist > 0.0f) { - *damp *= (1.0f - facedist/outerfacethickness); - Vec3PlusStVec(outerforceaccu, force_mag_norm, d_nvect); - deflected = 3; + if (facedist > 0.0f) { + *damp *= (1.0f - facedist/outerfacethickness); + Vec3PlusStVec(outerforceaccu, force_mag_norm, d_nvect); + deflected = 3; - } - else { - Vec3PlusStVec(innerforceaccu, force_mag_norm, d_nvect); - if (deflected < 2) deflected = 2; - } + } + else { + Vec3PlusStVec(innerforceaccu, force_mag_norm, d_nvect); + if (deflected < 2) deflected = 2; + } if ((mprevvert) && (*damp > 0.0f)) { choose_winner(ve, opco, nv1, nv3, nv4, vv1, vv3, vv4); @@ -1997,6 +2006,7 @@ static int sb_detect_vertex_collisionCached(float opco[3], float facenormal[3], }/* while a */ } /* if (ob->pd && ob->pd->deflect) */ BLI_ghashIterator_step(ihash); + } } /* while () */ if (deflected == 1) { // no face but 'outer' edge cylinder sees vert @@ -2335,14 +2345,14 @@ static int _softbody_calc_forces_slice_in_a_thread(Scene *scene, Object *ob, flo float kd = 1.0f; if (sb_deflect_face(ob, bp->pos, facenormal, defforce, &cf, timenow, vel, &intrusion)) { - if (intrusion < 0.0f) { - sb->scratch->flag |= SBF_DOFUZZY; - bp->loc_flag |= SBF_DOFUZZY; - bp->choke = sb->choke*0.01f; - } + if (intrusion < 0.0f) { + sb->scratch->flag |= SBF_DOFUZZY; + bp->loc_flag |= SBF_DOFUZZY; + bp->choke = sb->choke*0.01f; + } - sub_v3_v3v3(cfforce, bp->vec, vel); - Vec3PlusStVec(bp->force, -cf*50.0f, cfforce); + sub_v3_v3v3(cfforce, bp->vec, vel); + Vec3PlusStVec(bp->force, -cf*50.0f, cfforce); Vec3PlusStVec(bp->force, kd, defforce); } @@ -3484,7 +3494,7 @@ static void makelatticesprings(Lattice *lt, BodySpring *bs, int dostiff, Object bs->v1 = bpc; bs->v2 = bpc+dw+dv-1; bs->springtype=SB_BEND; - bs->len= globallen((bp+dw+dv-1)->vec, bp->vec, ob); + bs->len= globallen((bp+dw+dv-1)->vec, bp->vec, ob); bs++; } } |