diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-03-06 22:40:15 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-03-06 22:40:15 +0400 |
commit | 31d2ee9bf77bb991ea4779c47379b2cee84b27ed (patch) | |
tree | fd6f021356fc78d6dfeff9f18f601ce645dd7ffe /source/blender/modifiers/intern/MOD_simpledeform.c | |
parent | 7b7214c72233f72268f72d31fd8626a0f94e557e (diff) |
style cleanup, brackets in else/if, some indentation.
Diffstat (limited to 'source/blender/modifiers/intern/MOD_simpledeform.c')
-rw-r--r-- | source/blender/modifiers/intern/MOD_simpledeform.c | 35 |
1 files changed, 13 insertions, 22 deletions
diff --git a/source/blender/modifiers/intern/MOD_simpledeform.c b/source/blender/modifiers/intern/MOD_simpledeform.c index 4485346bf55..f8e50828ef8 100644 --- a/source/blender/modifiers/intern/MOD_simpledeform.c +++ b/source/blender/modifiers/intern/MOD_simpledeform.c @@ -74,8 +74,7 @@ static void simpleDeform_taper(const float factor, const float dcut[3], float *c co[1] = y + y*scale; co[2] = z; - if(dcut) - { + if (dcut) { co[0] += dcut[0]; co[1] += dcut[1]; co[2] += dcut[2]; @@ -93,9 +92,7 @@ static void simpleDeform_stretch(const float factor, const float dcut[3], float co[1] = y*scale; co[2] = z*(1.0f+factor); - - if(dcut) - { + if (dcut) { co[0] += dcut[0]; co[1] += dcut[1]; co[2] += dcut[2]; @@ -115,8 +112,7 @@ static void simpleDeform_twist(const float factor, const float *dcut, float *co) co[1] = x*sint + y*cost; co[2] = z; - if(dcut) - { + if(dcut) { co[0] += dcut[0]; co[1] += dcut[1]; co[2] += dcut[2]; @@ -132,16 +128,13 @@ static void simpleDeform_bend(const float factor, const float dcut[3], float *co sint = sin(theta); cost = cos(theta); - if(fabsf(factor) > 1e-7f) - { + if (fabsf(factor) > 1e-7f) { co[0] = -(y-1.0f/factor)*sint; co[1] = (y-1.0f/factor)*cost + 1.0f/factor; co[2] = z; } - - if(dcut) - { + if (dcut) { co[0] += cost*dcut[0]; co[1] += sint*dcut[0]; co[2] += dcut[2]; @@ -176,12 +169,10 @@ static void SimpleDeformModifier_do(SimpleDeformModifierData *smd, struct Object { transf = &tmp_transf; - if(smd->originOpts & MOD_SIMPLEDEFORM_ORIGIN_LOCAL) - { + if (smd->originOpts & MOD_SIMPLEDEFORM_ORIGIN_LOCAL) { space_transform_from_matrixs(transf, ob->obmat, smd->origin->obmat); } - else - { + else { copy_m4_m4(transf->local2target, smd->origin->obmat); invert_m4_m4(transf->target2local, transf->local2target); } @@ -230,17 +221,17 @@ static void SimpleDeformModifier_do(SimpleDeformModifierData *smd, struct Object { float weight = defvert_array_find_weight_safe(dvert, i, vgroup); - if(weight != 0.0f) - { + if (weight != 0.0f) { float co[3], dcut[3] = {0.0f, 0.0f, 0.0f}; - if(transf) space_transform_apply(transf, vertexCos[i]); + if(transf) { + space_transform_apply(transf, vertexCos[i]); + } copy_v3_v3(co, vertexCos[i]); - //Apply axis limits - if(smd->mode != MOD_SIMPLEDEFORM_MODE_BEND) //Bend mode shoulnt have any lock axis - { + /* Apply axis limits */ + if(smd->mode != MOD_SIMPLEDEFORM_MODE_BEND) { /* Bend mode shoulnt have any lock axis */ if(smd->axis & MOD_SIMPLEDEFORM_LOCK_AXIS_X) axis_limit(0, lock_axis, co, dcut); if(smd->axis & MOD_SIMPLEDEFORM_LOCK_AXIS_Y) axis_limit(1, lock_axis, co, dcut); } |