diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-09-25 15:38:30 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-09-25 15:38:30 +0400 |
commit | 8bbe81db4deaeab0e34a25bb4cf9332374ba6860 (patch) | |
tree | 2a321e8b196eb8a90856faac60d7d69ccf847f22 | |
parent | 3c05662f5e03e1d3d86e4ed081301f83ed72e26b (diff) |
knife was projecting vertex locations to the screen when it wasnt needed.
-rw-r--r-- | source/blender/editors/mesh/editmesh_knife.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/source/blender/editors/mesh/editmesh_knife.c b/source/blender/editors/mesh/editmesh_knife.c index 3fc195d3da3..4acc2df96fb 100644 --- a/source/blender/editors/mesh/editmesh_knife.c +++ b/source/blender/editors/mesh/editmesh_knife.c @@ -1358,13 +1358,16 @@ static BMEdgeHit *knife_edge_tri_isect(KnifeTool_OpData *kcd, BMBVHTree *bmtree, /* both kfe ends are in cutting triangle */ n_isects = 2; } - else if (isect_line_tri_epsilon_v3(kfe->v1->cageco, kfe->v2->cageco, v1, v2, v3, &lambda, NULL, depsilon)) { + else if (isect_line_tri_epsilon_v3(kfe->v1->cageco, kfe->v2->cageco, v1, v2, v3, + &lambda, NULL, depsilon)) + { /* kfe intersects cutting triangle lambda of the way along kfe */ interp_v3_v3v3(isects[0], kfe->v1->cageco, kfe->v2->cageco, lambda); n_isects = 1; } + for (j = 0; j < n_isects; j++) { - float p[3], no[3], view[3], sp[2]; + float p[3]; copy_v3_v3(p, isects[j]); if (kcd->curr.vert && len_squared_v3v3(kcd->curr.vert->cageco, p) < depsilon_sq) { @@ -1384,16 +1387,18 @@ static BMEdgeHit *knife_edge_tri_isect(KnifeTool_OpData *kcd, BMBVHTree *bmtree, continue; } - knife_project_v2(kcd, p, sp); - ED_view3d_unproject(mats, view, sp[0], sp[1], 0.0f); - mul_m4_v3(kcd->ob->imat, view); - if (kcd->cut_through) { f_hit = NULL; } else { /* check if this point is visible in the viewport */ - float p1[3], lambda1; + float p1[3], no[3], view[3], sp[2]; + float lambda1; + + /* screen projection */ + knife_project_v2(kcd, p, sp); + ED_view3d_unproject(mats, view, sp[0], sp[1], 0.0f); + mul_m4_v3(kcd->ob->imat, view); /* if face isn't planer, p may be behind the current tesselated tri, * so move it onto that and then a little towards eye */ |