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>2015-08-21 10:46:23 +0300
committerCampbell Barton <ideasman42@gmail.com>2015-08-21 10:48:33 +0300
commit59e166c568a57315b78c5ab812837c95923c300e (patch)
tree3bb1f901f1f1209fbee7449aeaa672c3487c88c6 /source/blender/blenkernel/intern/bvhutils.c
parent71919efd78149a305bea4db18d80f9434abeca33 (diff)
BVH-raycast: Use watertight intersections
By default watertight intersections are used, For callbacks where its not needed, BLI_bvhtree_ray_cast_ex can be called without the BVH_RAYCAST_WATERTIGHT flag. Fixes T45286
Diffstat (limited to 'source/blender/blenkernel/intern/bvhutils.c')
-rw-r--r--source/blender/blenkernel/intern/bvhutils.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/bvhutils.c b/source/blender/blenkernel/intern/bvhutils.c
index 2ecae21d494..fa2fcd97ec3 100644
--- a/source/blender/blenkernel/intern/bvhutils.c
+++ b/source/blender/blenkernel/intern/bvhutils.c
@@ -60,8 +60,14 @@ float bvhtree_ray_tri_intersection(
{
float dist;
+#ifdef USE_KDOPBVH_WATERTIGHT
+ if (isect_ray_tri_watertight_v3(ray->origin, ray->isect_precalc, v0, v1, v2, &dist, NULL))
+#else
if (isect_ray_tri_epsilon_v3(ray->origin, ray->direction, v0, v1, v2, &dist, NULL, FLT_EPSILON))
+#endif
+ {
return dist;
+ }
return FLT_MAX;
}