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:
authormano-wii <germano.costa@ig.com.br>2019-06-17 15:16:13 +0300
committermano-wii <germano.costa@ig.com.br>2019-06-17 15:16:13 +0300
commite03b7176877d27f4dd42dd698a85a1f046f9202a (patch)
tree57930d5ffc7eb6c54529a59269a1c23a340c24da /source/blender/blenkernel/intern/pbvh_bmesh.c
parent5e7e49e00d46734281b28a82582e3e3dd37e609c (diff)
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
Diffstat (limited to 'source/blender/blenkernel/intern/pbvh_bmesh.c')
-rw-r--r--source/blender/blenkernel/intern/pbvh_bmesh.c10
1 files changed, 5 insertions, 5 deletions
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;