diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-06-20 01:23:00 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-06-20 01:23:00 +0400 |
commit | 1ed8343d6da17076e43c06cce272c4b1d93f89a8 (patch) | |
tree | 0aa3de0428daac4d5b57241541a75f8c1a8e455f /source/blender/editors/mesh/editmesh_utils.c | |
parent | c33093ac085c117a0c3004c42def280c8c977ce3 (diff) |
add axis option to EDBM_verts_mirror_cache_begin
Diffstat (limited to 'source/blender/editors/mesh/editmesh_utils.c')
-rw-r--r-- | source/blender/editors/mesh/editmesh_utils.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/source/blender/editors/mesh/editmesh_utils.c b/source/blender/editors/mesh/editmesh_utils.c index 963b9cf134b..f3540fe62b7 100644 --- a/source/blender/editors/mesh/editmesh_utils.c +++ b/source/blender/editors/mesh/editmesh_utils.c @@ -1155,7 +1155,7 @@ static BMVert *cache_mirr_intptr_as_bmvert(intptr_t *index_lookup, int index) * \param maxdist Distance for close point test. * \param r_index Optional array to write into, as an alternative to a customdata layer (length of total verts). */ -void EDBM_verts_mirror_cache_begin_ex(BMEditMesh *em, const bool use_self, const bool use_select, +void EDBM_verts_mirror_cache_begin_ex(BMEditMesh *em, const int axis, const bool use_self, const bool use_select, /* extra args */ const bool is_topo, float maxdist, int *r_index) { @@ -1212,7 +1212,9 @@ void EDBM_verts_mirror_cache_begin_ex(BMEditMesh *em, const bool use_self, const v_mirr = cache_mirr_intptr_as_bmvert(mesh_topo_store.index_lookup, i); } else { - float co[3] = {-v->co[0], v->co[1], v->co[2]}; + float co[3]; + copy_v3_v3(co, v->co); + co[axis] *= -1.0f; v_mirr = BKE_bmbvh_find_vert_closest(tree, co, maxdist); } @@ -1239,14 +1241,16 @@ void EDBM_verts_mirror_cache_begin_ex(BMEditMesh *em, const bool use_self, const } } -void EDBM_verts_mirror_cache_begin(BMEditMesh *em, const bool use_self, const bool use_select) +void EDBM_verts_mirror_cache_begin(BMEditMesh *em, const int axis, + const bool use_self, const bool use_select) { Mesh *me = (Mesh *)em->ob->data; bool is_topo; is_topo = (me && (me->editflag & ME_EDIT_MIRROR_TOPO)); - EDBM_verts_mirror_cache_begin_ex(em, use_self, use_select, + EDBM_verts_mirror_cache_begin_ex(em, axis, + use_self, use_select, /* extra args */ is_topo, BM_SEARCH_MAXDIST_MIRR, NULL); } |