Fix T94499: Knife missed clipping check
The knife BVH raycast functionality was missing a check to discard points which were clipped.
This commit is contained in:
parent
1c5f09e8a8
commit
3b7ce70232
Notes:
blender-bot
2023-02-14 06:32:27 +01:00
Referenced by issue #94499, Geometry outside of Clipping Border prevents knife snapping
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue