From 305d341ec2c2c5c6485ad6cd719e9472e4bb460d Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 13 May 2012 11:05:52 +0000 Subject: code cleanup: use vector math function minmax_v3v3_v3() and other minor vector function edits. --- source/blender/modifiers/intern/MOD_cast.c | 6 +++--- source/blender/modifiers/intern/MOD_solidify.c | 7 +++---- 2 files changed, 6 insertions(+), 7 deletions(-) (limited to 'source/blender/modifiers') diff --git a/source/blender/modifiers/intern/MOD_cast.c b/source/blender/modifiers/intern/MOD_cast.c index c4772895b03..5e791a9f748 100644 --- a/source/blender/modifiers/intern/MOD_cast.c +++ b/source/blender/modifiers/intern/MOD_cast.c @@ -367,16 +367,16 @@ static void cuboid_do( float vec[3]; /* let the center of the ctrl_ob be part of the bound box: */ - DO_MINMAX(center, min, max); + minmax_v3v3_v3(min, max, center); for (i = 0; i < numVerts; i++) { sub_v3_v3v3(vec, vertexCos[i], center); - DO_MINMAX(vec, min, max); + minmax_v3v3_v3(min, max, vec); } } else { for (i = 0; i < numVerts; i++) { - DO_MINMAX(vertexCos[i], min, max); + minmax_v3v3_v3(min, max, vertexCos[i]); } } diff --git a/source/blender/modifiers/intern/MOD_solidify.c b/source/blender/modifiers/intern/MOD_solidify.c index 264d84af81e..0ca4d8dcd4f 100644 --- a/source/blender/modifiers/intern/MOD_solidify.c +++ b/source/blender/modifiers/intern/MOD_solidify.c @@ -558,9 +558,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, /* flip vertex normals for copied verts */ mv = mvert + numVerts; for (i = 0; i < numVerts; i++, mv++) { - mv->no[0] = -mv->no[0]; - mv->no[1] = -mv->no[1]; - mv->no[2] = -mv->no[2]; + negate_v3_short(mv->no); } if (smd->flag & MOD_SOLIDIFY_RIM) { @@ -692,7 +690,8 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, } #ifdef SOLIDIFY_SIDE_NORMALS - normal_quad_v3(nor, mvert[ml[j - 4].v].co, + normal_quad_v3(nor, + mvert[ml[j - 4].v].co, mvert[ml[j - 3].v].co, mvert[ml[j - 2].v].co, mvert[ml[j - 1].v].co); -- cgit v1.2.3