diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-10-30 18:22:49 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-10-30 18:22:49 +0400 |
commit | a1856a38f68b5fbb51194fe5f2d09315961bc67a (patch) | |
tree | 385e7974fb1c635eb4964f0f80ce4012924db936 /source/blender/bmesh/operators/bmo_removedoubles.c | |
parent | f4dea6d8294a8ee31e13324d0c80f6992e467ea2 (diff) |
minor improvement to vector api use, replace add, multiply by 0.5 with mid_v3_v3v3
Diffstat (limited to 'source/blender/bmesh/operators/bmo_removedoubles.c')
-rw-r--r-- | source/blender/bmesh/operators/bmo_removedoubles.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/source/blender/bmesh/operators/bmo_removedoubles.c b/source/blender/bmesh/operators/bmo_removedoubles.c index d3e98dd96c1..cd792f911a9 100644 --- a/source/blender/bmesh/operators/bmo_removedoubles.c +++ b/source/blender/bmesh/operators/bmo_removedoubles.c @@ -371,7 +371,7 @@ void bmo_collapse_exec(BMesh *bm, BMOperator *op) BMIter iter; BMEdge *e, **edges = NULL; BLI_array_declare(edges); - float min[3], max[3]; + float min[3], max[3], center[3]; int i, tot; BMO_op_callf(bm, op->flag, "collapse_uvs edges=%s", op, "edges"); @@ -400,13 +400,12 @@ void bmo_collapse_exec(BMesh *bm, BMOperator *op) minmax_v3v3_v3(min, max, e->v2->co); } - add_v3_v3v3(min, min, max); - mul_v3_fl(min, 0.5f); + mid_v3_v3v3(center, min, max); /* snap edges to a point. for initial testing purposes anyway */ for (i = 0; i < tot; i++) { - copy_v3_v3(edges[i]->v1->co, min); - copy_v3_v3(edges[i]->v2->co, min); + copy_v3_v3(edges[i]->v1->co, center); + copy_v3_v3(edges[i]->v2->co, center); if (edges[i]->v1 != edges[0]->v1) BMO_slot_map_ptr_insert(bm, &weldop, "targetmap", edges[i]->v1, edges[0]->v1); |