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-12-10 10:14:43 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-12-10 10:14:43 +0400
commitbc94b8300e86fe1af9b2d8c90329a12f4443725d (patch)
tree5829a2fc45bbeb2ee88068f4b69ca4af16bd41ae /source/blender/editors/mesh/editmesh_select.c
parent27ddd17ef9d2de30345449d3c01a486b855a4f26 (diff)
de-duplicate labda_PdistVL2Dfl() & line_point_factor_v2()
Diffstat (limited to 'source/blender/editors/mesh/editmesh_select.c')
-rw-r--r--source/blender/editors/mesh/editmesh_select.c16
1 files changed, 1 insertions, 15 deletions
diff --git a/source/blender/editors/mesh/editmesh_select.c b/source/blender/editors/mesh/editmesh_select.c
index c159b50b077..3335f03ac17 100644
--- a/source/blender/editors/mesh/editmesh_select.c
+++ b/source/blender/editors/mesh/editmesh_select.c
@@ -450,20 +450,6 @@ BMVert *EDBM_vert_find_nearest(ViewContext *vc, float *r_dist, const short sel,
}
}
-/* returns labda for closest distance v1 to line-piece v2 - v3 */
-float labda_PdistVL2Dfl(const float v1[2], const float v2[2], const float v3[2])
-{
- float rc[2], len;
-
- rc[0] = v3[0] - v2[0];
- rc[1] = v3[1] - v2[1];
- len = rc[0] * rc[0] + rc[1] * rc[1];
- if (len == 0.0f)
- return 0.0f;
-
- return (rc[0] * (v1[0] - v2[0]) + rc[1] * (v1[1] - v2[1])) / len;
-}
-
/* note; uses v3d, so needs active 3d window */
static void findnearestedge__doClosest(void *userData, BMEdge *eed, const float screen_co_a[2], const float screen_co_b[2], int UNUSED(index))
{
@@ -478,7 +464,7 @@ static void findnearestedge__doClosest(void *userData, BMEdge *eed, const float
if (distance < data->dist) {
if (data->vc.rv3d->rflag & RV3D_CLIPPING) {
- float labda = labda_PdistVL2Dfl(data->mval_fl, screen_co_a, screen_co_b);
+ float labda = line_point_factor_v2(data->mval_fl, screen_co_a, screen_co_b);
float vec[3];
vec[0] = eed->v1->co[0] + labda * (eed->v2->co[0] - eed->v1->co[0]);