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:
authorCampbell Barton <ideasman42@gmail.com>2014-08-19 11:41:55 +0400
committerCampbell Barton <ideasman42@gmail.com>2014-08-19 11:58:07 +0400
commit95ae98caead10e072753fa1b5b80c8f086355cb5 (patch)
treee506cf882fe24d5ea8c2ddba6db6634b8471f8cf /source/blender/blenkernel/intern/dynamicpaint.c
parent1dbadf16a83963a0b29f4c6db0ed255b3a89322e (diff)
Fix T41479: BLI_bvhtree_find_nearest inaccurate
Gives noticeably better results for shrink-wrap (even in simple cases)
Diffstat (limited to 'source/blender/blenkernel/intern/dynamicpaint.c')
-rw-r--r--source/blender/blenkernel/intern/dynamicpaint.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/source/blender/blenkernel/intern/dynamicpaint.c b/source/blender/blenkernel/intern/dynamicpaint.c
index 11737bccef2..4719013e2f8 100644
--- a/source/blender/blenkernel/intern/dynamicpaint.c
+++ b/source/blender/blenkernel/intern/dynamicpaint.c
@@ -2942,9 +2942,10 @@ static void mesh_faces_nearest_point_dp(void *userdata, int index, const float c
do {
float nearest_tmp[3], dist_sq;
- int vertex, edge;
-
- dist_sq = nearest_point_in_tri_surface_squared(t0, t1, t2, co, &vertex, &edge, nearest_tmp);
+
+ closest_on_tri_to_point_v3(nearest_tmp, co, t0, t1, t2);
+ dist_sq = len_squared_v3v3(co, nearest_tmp);
+
if (dist_sq < nearest->dist_sq) {
nearest->index = index;
nearest->dist_sq = dist_sq;