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-01-24 15:20:25 +0300
committermano-wii <germano.costa@ig.com.br>2019-01-24 15:20:59 +0300
commitac316a6526c71ff09468ceb288bf6db98c416fe2 (patch)
treeb600bad57c6f8579977ecd8d2b2f2b941db7ab14 /source/blender/editors/armature/meshlaplacian.c
parent7faf0c8c2ff715b09feede8a58ea33bfeb0fa2da (diff)
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.
Diffstat (limited to 'source/blender/editors/armature/meshlaplacian.c')
-rw-r--r--source/blender/editors/armature/meshlaplacian.c7
1 files 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;
}