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/effect.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/effect.c')
-rw-r--r--source/blender/blenkernel/intern/effect.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/effect.c b/source/blender/blenkernel/intern/effect.c
index 6459e2ee7e6..bf53acc1d95 100644
--- a/source/blender/blenkernel/intern/effect.c
+++ b/source/blender/blenkernel/intern/effect.c
@@ -391,6 +391,7 @@ static void eff_tri_ray_hit(void *UNUSED(userData), int UNUSED(index), const BVH
// get visibility of a wind ray
static float eff_calc_visibility(ListBase *colliders, EffectorCache *eff, EffectorData *efd, EffectedPoint *point)
{
+ const int raycast_flag = BVH_RAYCAST_DEFAULT & ~(BVH_RAYCAST_WATERTIGHT);
ListBase *colls = colliders;
ColliderCache *col;
float norm[3], len = 0.0;
@@ -422,7 +423,10 @@ static float eff_calc_visibility(ListBase *colliders, EffectorCache *eff, Effect
hit.dist = len + FLT_EPSILON;
/* check if the way is blocked */
- if (BLI_bvhtree_ray_cast(collmd->bvhtree, point->loc, norm, 0.0f, &hit, eff_tri_ray_hit, NULL)>=0) {
+ if (BLI_bvhtree_ray_cast_ex(
+ collmd->bvhtree, point->loc, norm, 0.0f, &hit,
+ eff_tri_ray_hit, NULL, raycast_flag) != -1)
+ {
absorption= col->ob->pd->absorption;
/* visibility is only between 0 and 1, calculated from 1-absorption */