diff options
author | Cian Jinks <cjinks99@gmail.com> | 2022-06-13 21:24:43 +0300 |
---|---|---|
committer | Cian Jinks <cjinks99@gmail.com> | 2022-06-13 21:28:48 +0300 |
commit | 3b7ce7023267635b878a046a8ab8ecccf9e66718 (patch) | |
tree | f83b0b0ced947715013b331c9421ac7861fea494 /source/blender | |
parent | 1c5f09e8a8fcaeb85b0d423533ec5601473ab824 (diff) |
Fix T94499: Knife missed clipping check
The knife BVH raycast functionality was missing a check to discard
points which were clipped.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/editors/mesh/editmesh_knife.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/source/blender/editors/mesh/editmesh_knife.c b/source/blender/editors/mesh/editmesh_knife.c index c16b82e34bd..5680865ae67 100644 --- a/source/blender/editors/mesh/editmesh_knife.c +++ b/source/blender/editors/mesh/editmesh_knife.c @@ -1355,13 +1355,19 @@ static void knife_bvh_raycast_cb(void *userdata, #endif if (isect && dist < hit->dist) { + madd_v3_v3v3fl(hit->co, ray->origin, ray->direction, dist); + + /* Discard clipped points. */ + if (RV3D_CLIPPING_ENABLED(kcd->vc.v3d, kcd->vc.rv3d) && + ED_view3d_clipping_test(kcd->vc.rv3d, hit->co, false)) { + return; + } + hit->dist = dist; hit->index = index; copy_v3_v3(hit->no, ltri[0]->f->no); - madd_v3_v3v3fl(hit->co, ray->origin, ray->direction, dist); - kcd->bvh.looptris = em->looptris; copy_v2_v2(kcd->bvh.uv, uv); kcd->bvh.base_index = b; |