Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2012-08-14 12:44:35 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-08-14 12:44:35 +0400
commitf2074949e7a3dbf3a1dc5b51a0a3eee0eee9aada (patch)
tree1912a8eb416499bdba69f0955515b3d905c52024 /source/blender/editors/mesh
parent8d496b3bf2c58a0a161c20c987f414953a6d1e87 (diff)
code cleanup: reduce calling sqrt() when distances are only calculated for comparison use dist_squared_to_line_segment_v2().
Diffstat (limited to 'source/blender/editors/mesh')
-rw-r--r--source/blender/editors/mesh/editmesh_rip.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/source/blender/editors/mesh/editmesh_rip.c b/source/blender/editors/mesh/editmesh_rip.c
index f71ec56ca5f..8325e0a50d4 100644
--- a/source/blender/editors/mesh/editmesh_rip.c
+++ b/source/blender/editors/mesh/editmesh_rip.c
@@ -64,6 +64,7 @@ static float edbm_rip_rip_edgedist(ARegion *ar, float mat[][4],
ED_view3d_project_float_v2(ar, co1, vec1, mat);
ED_view3d_project_float_v2(ar, co2, vec2, mat);
+ /* TODO: use dist_squared_to_line_segment_v2() looks like we only ever use for comparison */
return dist_to_line_segment_v2(mvalf, vec1, vec2);
}
@@ -111,8 +112,8 @@ static float edbm_rip_edge_side_measure(BMEdge *e, BMLoop *e_l,
score = len_v2v2(e_v1_co, e_v2_co);
- if (dist_to_line_segment_v2(fmval_tweak, e_v1_co, e_v2_co) >
- dist_to_line_segment_v2(fmval, e_v1_co, e_v2_co))
+ if (dist_squared_to_line_segment_v2(fmval_tweak, e_v1_co, e_v2_co) >
+ dist_squared_to_line_segment_v2(fmval, e_v1_co, e_v2_co))
{
return score;
}