diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-09-11 12:28:16 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-09-11 12:28:16 +0400 |
commit | 0383fb53414366d4ede19622fbe5bb5e6f782a0f (patch) | |
tree | f9137000aeb86b710773e41743671e70f44b4463 /source/blender/blenkernel/intern/shrinkwrap.c | |
parent | 75b393612809252349bf4062bc45df14c1a5dfe5 (diff) | |
parent | ff04beb3e4681e6849030595c80ed692c3bd9be1 (diff) |
svn merge -r40104:40117 https://svn.blender.org/svnroot/bf-blender/trunk/blender
Diffstat (limited to 'source/blender/blenkernel/intern/shrinkwrap.c')
-rw-r--r-- | source/blender/blenkernel/intern/shrinkwrap.c | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/source/blender/blenkernel/intern/shrinkwrap.c b/source/blender/blenkernel/intern/shrinkwrap.c index fcdf30be992..362722ea191 100644 --- a/source/blender/blenkernel/intern/shrinkwrap.c +++ b/source/blender/blenkernel/intern/shrinkwrap.c @@ -136,16 +136,6 @@ static void space_transform_invert_normal(const SpaceTransform *data, float *no) } /* - * Returns the squared distance between two given points - */ -static float squared_dist(const float *a, const float *b) -{ - float tmp[3]; - VECSUB(tmp, a, b); - return INPR(tmp, tmp); -} - -/* * Shrinkwrap to the nearest vertex * * it builds a kdtree of vertexs we can attach to and then @@ -197,7 +187,7 @@ static void shrinkwrap_calc_nearest_vertex(ShrinkwrapCalcData *calc) //so we can initiate the "nearest.dist" with the expected value to that last hit. //This will lead in prunning of the search tree. if(nearest.index != -1) - nearest.dist = squared_dist(tmp_co, nearest.co); + nearest.dist = len_squared_v3v3(tmp_co, nearest.co); else nearest.dist = FLT_MAX; @@ -330,7 +320,7 @@ static void shrinkwrap_calc_normal_projection(ShrinkwrapCalcData *calc) normalize_v3(proj_axis); //Invalid projection direction - if(INPR(proj_axis, proj_axis) < FLT_EPSILON) + if(dot_v3v3(proj_axis, proj_axis) < FLT_EPSILON) return; } @@ -471,7 +461,7 @@ static void shrinkwrap_calc_nearest_surface_point(ShrinkwrapCalcData *calc) //so we can initiate the "nearest.dist" with the expected value to that last hit. //This will lead in prunning of the search tree. if(nearest.index != -1) - nearest.dist = squared_dist(tmp_co, nearest.co); + nearest.dist = len_squared_v3v3(tmp_co, nearest.co); else nearest.dist = FLT_MAX; |