From ac316a6526c71ff09468ceb288bf6db98c416fe2 Mon Sep 17 00:00:00 2001 From: mano-wii Date: Thu, 24 Jan 2019 10:20:25 -0200 Subject: Fix T59423: Mesh deform modifier bind bug causing spiky deformations. The intersection was being tested between ray and tri, the correct one is segment and tri. --- source/blender/editors/armature/meshlaplacian.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/source/blender/editors/armature/meshlaplacian.c b/source/blender/editors/armature/meshlaplacian.c index b427843085a..a1f0357d519 100644 --- a/source/blender/editors/armature/meshlaplacian.c +++ b/source/blender/editors/armature/meshlaplacian.c @@ -903,9 +903,10 @@ static void harmonic_ray_callback(void *userdata, int index, const BVHTreeRay *r face[1] = mdb->cagecos[mloop[lt->tri[1]].v]; face[2] = mdb->cagecos[mloop[lt->tri[2]].v]; - if (!isect_ray_tri_watertight_v3( - ray->origin, ray->isect_precalc, UNPACK3(face), &dist, NULL)) - { + bool isect_ray_tri = isect_ray_tri_watertight_v3( + ray->origin, ray->isect_precalc, UNPACK3(face), &dist, NULL); + + if (!isect_ray_tri || dist > isec->vec_length) { return; } -- cgit v1.2.3