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:
authorGermano <germano.costa@ig.com.br>2018-05-04 14:29:00 +0300
committerGermano <germano.costa@ig.com.br>2018-05-04 14:29:00 +0300
commit8c6a1d8f954e91bb676d97c8f0f7f162b41db4c3 (patch)
tree898d0819381d169c6cf8da12e848788378995198 /source/blender/blenkernel
parentfa11dc673074462e4cf24bf7aeb647cab07bd820 (diff)
Mesh Remap: Face Data: Do not use large epsilon values to create bvhtree.
If you need the approximation, use raycast radius.
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r--source/blender/blenkernel/intern/mesh_remap.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/source/blender/blenkernel/intern/mesh_remap.c b/source/blender/blenkernel/intern/mesh_remap.c
index 84994e80784..8e93be14f6b 100644
--- a/source/blender/blenkernel/intern/mesh_remap.c
+++ b/source/blender/blenkernel/intern/mesh_remap.c
@@ -2013,13 +2013,7 @@ void BKE_mesh_remap_calc_polys_from_dm(
BVHTreeRayHit rayhit = {0};
float hit_dist;
- if (mode & MREMAP_USE_NORPROJ) {
- bvhtree_from_mesh_looptri(
- &treedata, dm_src, MREMAP_RAYCAST_APPROXIMATE_BVHEPSILON(ray_radius), 2, 6);
- }
- else {
- bvhtree_from_mesh_get(&treedata, dm_src, BVHTREE_FROM_LOOPTRI, 2);
- }
+ bvhtree_from_mesh_get(&treedata, dm_src, BVHTREE_FROM_LOOPTRI, 2);
if (mode == MREMAP_MODE_POLY_NEAREST) {
nearest.index = -1;
@@ -2062,6 +2056,7 @@ void BKE_mesh_remap_calc_polys_from_dm(
BLI_space_transform_apply_normal(space_transform, tmp_no);
}
+ treedata.sphere_radius = ray_radius;
if (mesh_remap_bvhtree_query_raycast(
&treedata, &rayhit, tmp_co, tmp_no, ray_radius, max_dist, &hit_dist))
{
@@ -2211,8 +2206,9 @@ void BKE_mesh_remap_calc_polys_from_dm(
/* At this point, tmp_co is a point on our poly surface, in mesh_src space! */
while (n--) {
+ treedata.sphere_radius = ray_radius / w;
if (mesh_remap_bvhtree_query_raycast(
- &treedata, &rayhit, tmp_co, tmp_no, ray_radius / w, max_dist, &hit_dist))
+ &treedata, &rayhit, tmp_co, tmp_no, treedata.sphere_radius, max_dist, &hit_dist))
{
const MLoopTri *lt = &treedata.looptri[rayhit.index];