From 7a3ea87bbff7a250e035d35c59f3784eec51bc47 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 8 Jul 2016 10:14:49 +1000 Subject: Cleanup: use normalize_v#_length --- source/blender/editors/mesh/editmesh_extrude.c | 3 +-- source/blender/editors/mesh/editmesh_rip.c | 3 +-- source/blender/editors/mesh/editmesh_utils.c | 10 +++------- 3 files changed, 5 insertions(+), 11 deletions(-) (limited to 'source/blender/editors/mesh') diff --git a/source/blender/editors/mesh/editmesh_extrude.c b/source/blender/editors/mesh/editmesh_extrude.c index 1dfb1cddd2c..d4c49833c2c 100644 --- a/source/blender/editors/mesh/editmesh_extrude.c +++ b/source/blender/editors/mesh/editmesh_extrude.c @@ -287,8 +287,7 @@ static int edbm_extrude_repeat_exec(bContext *C, wmOperator *op) short a; /* dvec */ - normalize_v3_v3(dvec, rv3d->persinv[2]); - mul_v3_fl(dvec, offs); + normalize_v3_v3_length(dvec, rv3d->persinv[2], offs); /* base correction */ copy_m3_m4(bmat, obedit->obmat); diff --git a/source/blender/editors/mesh/editmesh_rip.c b/source/blender/editors/mesh/editmesh_rip.c index 8868827a11f..e3e5863dc0e 100644 --- a/source/blender/editors/mesh/editmesh_rip.c +++ b/source/blender/editors/mesh/editmesh_rip.c @@ -153,8 +153,7 @@ static float edbm_rip_edge_side_measure( ED_view3d_project_float_v2_m4(ar, e->v2->co, e_v2_co, projectMat); sub_v2_v2v2(vec, cent, mid); - normalize_v2(vec); - mul_v2_fl(vec, 0.01f); + normalize_v2_length(vec, 0.01f); /* rather then adding to both verts, subtract from the mouse */ sub_v2_v2v2(fmval_tweak, fmval, vec); diff --git a/source/blender/editors/mesh/editmesh_utils.c b/source/blender/editors/mesh/editmesh_utils.c index 5101608246a..4fc61e0912e 100644 --- a/source/blender/editors/mesh/editmesh_utils.c +++ b/source/blender/editors/mesh/editmesh_utils.c @@ -1440,13 +1440,9 @@ bool BMBVH_EdgeVisible(struct BMBVHTree *tree, BMEdge *e, ARegion *ar, View3D *v sub_v3_v3v3(dir2, origin, co2); sub_v3_v3v3(dir3, origin, co3); - normalize_v3(dir1); - normalize_v3(dir2); - normalize_v3(dir3); - - mul_v3_fl(dir1, epsilon); - mul_v3_fl(dir2, epsilon); - mul_v3_fl(dir3, epsilon); + normalize_v3_length(dir1, epsilon); + normalize_v3_length(dir2, epsilon); + normalize_v3_length(dir3, epsilon); /* offset coordinates slightly along view vectors, to avoid * hitting the faces that own the edge.*/ -- cgit v1.2.3