From e03b7176877d27f4dd42dd698a85a1f046f9202a Mon Sep 17 00:00:00 2001 From: mano-wii Date: Mon, 17 Jun 2019 09:16:13 -0300 Subject: Fix T65620: Sculpting brush size jumping. The PBVHs raycast function calls `isect_ray_tri_epsilon_v3` with epsilon `0.1` which is inaccurate and may result in the problem presented in T65620. The solution is to use `isect_ray_tri_watertight_v3` instead `isect_ray_tri_epsilon_v3`. This can positively affect other areas as well. Reviewers: brecht, campbellbarton Differential Revision: https://developer.blender.org/D5083 --- source/blender/blenkernel/intern/pbvh_bmesh.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'source/blender/blenkernel/intern/pbvh_bmesh.c') diff --git a/source/blender/blenkernel/intern/pbvh_bmesh.c b/source/blender/blenkernel/intern/pbvh_bmesh.c index cb4505880e2..1d8088c6605 100644 --- a/source/blender/blenkernel/intern/pbvh_bmesh.c +++ b/source/blender/blenkernel/intern/pbvh_bmesh.c @@ -1508,7 +1508,7 @@ static bool pbvh_bmesh_collapse_short_edges(EdgeQueueContext *eq_ctx, bool pbvh_bmesh_node_raycast(PBVHNode *node, const float ray_start[3], - const float ray_normal[3], + struct IsectRayPrecalc *isect_precalc, float *depth, bool use_original) { @@ -1518,7 +1518,7 @@ bool pbvh_bmesh_node_raycast(PBVHNode *node, for (int i = 0; i < node->bm_tot_ortri; i++) { const int *t = node->bm_ortri[i]; hit |= ray_face_intersection_tri(ray_start, - ray_normal, + isect_precalc, node->bm_orco[t[0]], node->bm_orco[t[1]], node->bm_orco[t[2]], @@ -1537,7 +1537,7 @@ bool pbvh_bmesh_node_raycast(PBVHNode *node, BM_face_as_array_vert_tri(f, v_tri); hit |= ray_face_intersection_tri( - ray_start, ray_normal, v_tri[0]->co, v_tri[1]->co, v_tri[2]->co, depth); + ray_start, isect_precalc, v_tri[0]->co, v_tri[1]->co, v_tri[2]->co, depth); } } } @@ -1547,7 +1547,7 @@ bool pbvh_bmesh_node_raycast(PBVHNode *node, bool BKE_pbvh_bmesh_node_raycast_detail(PBVHNode *node, const float ray_start[3], - const float ray_normal[3], + struct IsectRayPrecalc *isect_precalc, float *depth, float *r_edge_length) { @@ -1568,7 +1568,7 @@ bool BKE_pbvh_bmesh_node_raycast_detail(PBVHNode *node, bool hit_local; BM_face_as_array_vert_tri(f, v_tri); hit_local = ray_face_intersection_tri( - ray_start, ray_normal, v_tri[0]->co, v_tri[1]->co, v_tri[2]->co, depth); + ray_start, isect_precalc, v_tri[0]->co, v_tri[1]->co, v_tri[2]->co, depth); if (hit_local) { f_hit = f; -- cgit v1.2.3