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>2011-09-11 06:50:01 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-09-11 06:50:01 +0400
commit599cd56f535946726bc30e66e7ac483ec91ab6fd (patch)
treec0c09962558535a0a3435f1eed2669deb3b91094 /source/blender/blenkernel/intern/shrinkwrap.c
parent3a5f2272adc4ec821db16de95781b9ce653dda73 (diff)
minor edits / cleanup - no functional changes.
- use 'const float *' and array size in some function declarations. - replace macros for BLI_math functions INPF, VECCOPY, VECADD etc. - remove unused VertRen.clip struct member. - remove static squared_dist() from 2 files, replace with BLI_math function len_squared_v3v3(). - use vertex arrays for drawing clipping background in the 3D viewport.
Diffstat (limited to 'source/blender/blenkernel/intern/shrinkwrap.c')
-rw-r--r--source/blender/blenkernel/intern/shrinkwrap.c16
1 files changed, 3 insertions, 13 deletions
diff --git a/source/blender/blenkernel/intern/shrinkwrap.c b/source/blender/blenkernel/intern/shrinkwrap.c
index 7b04a72666d..d2d22aa213a 100644
--- a/source/blender/blenkernel/intern/shrinkwrap.c
+++ b/source/blender/blenkernel/intern/shrinkwrap.c
@@ -134,16 +134,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
@@ -195,7 +185,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;
@@ -328,7 +318,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;
}
@@ -469,7 +459,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;