diff options
author | Campbell Barton <ideasman42@gmail.com> | 2016-05-11 07:33:49 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2016-05-11 08:01:27 +0300 |
commit | 35531657e5bce413539685ac30e22f546486bd89 (patch) | |
tree | 913701c0a5b9a8a7d5b8d7594996957721c73791 /source/blender/editors | |
parent | a18f4d2bc69aa4707fb0efa92d28297d06be060e (diff) |
BLI_kdopbvh: Use distance for BLI_bvhtree_ray_cast_all
Pass distance argument so its possible to limit the range we get all hits from.
Other changes:
- Use boundbox test before calling callback, avoids redundant calls.
- Remove meaningless return value.
- Add doc string, explaining purpose of this function.
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/physics/particle_edit.c | 4 | ||||
-rw-r--r-- | source/blender/editors/transform/transform_snap.c | 4 |
2 files changed, 5 insertions, 3 deletions
diff --git a/source/blender/editors/physics/particle_edit.c b/source/blender/editors/physics/particle_edit.c index 2ae1254f9e6..3da3a451d66 100644 --- a/source/blender/editors/physics/particle_edit.c +++ b/source/blender/editors/physics/particle_edit.c @@ -4111,7 +4111,9 @@ static bool shape_cut_test_point(PEData *data, ParticleCacheKey *key) userdata.bvhdata = data->shape_bvh; userdata.num_hits = 0; - BLI_bvhtree_ray_cast_all(shape_bvh->tree, key->co, dir, 0.0f, point_inside_bvh_cb, &userdata); + BLI_bvhtree_ray_cast_all( + shape_bvh->tree, key->co, dir, 0.0f, BVH_RAYCAST_DIST_MAX, + point_inside_bvh_cb, &userdata); /* for any point inside a watertight mesh the number of hits is uneven */ return (userdata.num_hits % 2) == 1; diff --git a/source/blender/editors/transform/transform_snap.c b/source/blender/editors/transform/transform_snap.c index eb601db358f..bcbe1f582b7 100644 --- a/source/blender/editors/transform/transform_snap.c +++ b/source/blender/editors/transform/transform_snap.c @@ -1486,7 +1486,7 @@ static bool peelDerivedMesh( data.depth_peels = depth_peels; BLI_bvhtree_ray_cast_all( - data.bvhdata.tree, ray_start_local, ray_normal_local, 0.0f, + data.bvhdata.tree, ray_start_local, ray_normal_local, 0.0f, BVH_RAYCAST_DIST_MAX, peelRayCast_cb, &data); } @@ -1538,7 +1538,7 @@ static bool peelEditMesh( data.depth_peels = depth_peels; BLI_bvhtree_ray_cast_all( - data.bvhdata.tree, ray_start_local, ray_normal_local, 0.0f, + data.bvhdata.tree, ray_start_local, ray_normal_local, 0.0f, BVH_RAYCAST_DIST_MAX, peelEditMeshRayCast_cb, &data); } |