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>2014-08-17 06:50:48 +0400
committerCampbell Barton <ideasman42@gmail.com>2014-08-17 06:50:48 +0400
commit1dd17bed4a7a322e6493914fee25ee9562e153ea (patch)
treebc1db4a3baa406634e1b66710b992391b22da801
parentbba80ed7afa8ccea14310f35f767749f5d04207e (diff)
Knife tool: simplify hit-depth calculation
-rw-r--r--source/blender/blenlib/intern/math_vector_inline.c5
-rw-r--r--source/blender/editors/mesh/editmesh_knife.c11
2 files changed, 4 insertions, 12 deletions
diff --git a/source/blender/blenlib/intern/math_vector_inline.c b/source/blender/blenlib/intern/math_vector_inline.c
index 0a990e0d63d..5529433f6c9 100644
--- a/source/blender/blenlib/intern/math_vector_inline.c
+++ b/source/blender/blenlib/intern/math_vector_inline.c
@@ -466,7 +466,7 @@ MINLINE float mul_project_m4_v3_zfac(float mat[4][4], const float co[3])
}
/**
- * Has the effect of mul_m3_v3(), on a single axis.
+ * Has the effect of #mul_m3_v3(), on a single axis.
*/
MINLINE float dot_m3_v3_row_x(float M[3][3], const float a[3])
{
@@ -482,7 +482,8 @@ MINLINE float dot_m3_v3_row_z(float M[3][3], const float a[3])
}
/**
- * Almost like mul_m4_v3(), misses adding translation.
+ * Has the effect of #mul_mat3_m4_v3(), on a single axis.
+ * (no adding translation)
*/
MINLINE float dot_m4_v3_row_x(float M[4][4], const float a[3])
{
diff --git a/source/blender/editors/mesh/editmesh_knife.c b/source/blender/editors/mesh/editmesh_knife.c
index 609f0183afd..4182d0ecf20 100644
--- a/source/blender/editors/mesh/editmesh_knife.c
+++ b/source/blender/editors/mesh/editmesh_knife.c
@@ -1224,16 +1224,7 @@ static void clip_to_ortho_planes(float v1[3], float v2[3], float d)
static void set_linehit_depth(KnifeTool_OpData *kcd, KnifeLineHit *lh)
{
- float vnear[3], vfar[3];
-
- ED_view3d_win_to_segment(kcd->ar, kcd->vc.v3d, lh->schit, vnear, vfar, true);
- mul_m4_v3(kcd->ob->imat, vnear);
- if (kcd->is_ortho && (kcd->vc.rv3d->persp != RV3D_CAMOB)) {
- if (kcd->ortho_extent == 0.0f)
- calc_ortho_extent(kcd);
- clip_to_ortho_planes(vnear, vfar, kcd->ortho_extent + 10.0f);
- }
- lh->m = len_v3v3(vnear, lh->cagehit);
+ lh->m = dot_m4_v3_row_z(kcd->vc.rv3d->persmatob, lh->cagehit);
}
/* Finds visible (or all, if cutting through) edges that intersects the current screen drag line */