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:
authorBastien Montagne <montagne29@wanadoo.fr>2016-01-12 11:37:56 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2016-01-12 12:09:00 +0300
commitc6c223ade6470e7a9b61ea4a4a3ab6ed62abe79d (patch)
treefb9323466d1c45ff6a99db96fc649fe3e6374249 /source/blender/blenlib/intern/BLI_kdopbvh.c
parent90250f856817b68f29924be8a60152ec3a2486a8 (diff)
Fix T47164: [Scene.raycast] - True result when it should be False.
We cannot use FLT_MAX as initi distance for raycast... Renamed TRANSFORM_DIST_MAX_RAY to BVH_RAYCAST_DIST_MAX, moved it into BLI_kdopbvh, and use in RNA raycast callbacks (and all other places using that API).
Diffstat (limited to 'source/blender/blenlib/intern/BLI_kdopbvh.c')
-rw-r--r--source/blender/blenlib/intern/BLI_kdopbvh.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/blenlib/intern/BLI_kdopbvh.c b/source/blender/blenlib/intern/BLI_kdopbvh.c
index 3752751085f..f1ed49f74e0 100644
--- a/source/blender/blenlib/intern/BLI_kdopbvh.c
+++ b/source/blender/blenlib/intern/BLI_kdopbvh.c
@@ -1611,7 +1611,7 @@ static void dfs_raycast_all(BVHRayCastData *data, BVHNode *node)
if (node->totnode == 0) {
if (data->callback) {
data->hit.index = -1;
- data->hit.dist = FLT_MAX;
+ data->hit.dist = BVH_RAYCAST_DIST_MAX;
data->callback(data->userdata, node->index, &data->ray, &data->hit);
}
else {
@@ -1720,7 +1720,7 @@ int BLI_bvhtree_ray_cast_ex(
}
else {
data.hit.index = -1;
- data.hit.dist = FLT_MAX;
+ data.hit.dist = BVH_RAYCAST_DIST_MAX;
}
if (root) {
@@ -1747,7 +1747,7 @@ float BLI_bvhtree_bb_raycast(const float bv[6], const float light_start[3], cons
BVHRayCastData data;
float dist;
- data.hit.dist = FLT_MAX;
+ data.hit.dist = BVH_RAYCAST_DIST_MAX;
/* get light direction */
sub_v3_v3v3(data.ray.direction, light_end, light_start);
@@ -1792,7 +1792,7 @@ int BLI_bvhtree_ray_cast_all_ex(
bvhtree_ray_cast_data_precalc(&data, flag);
data.hit.index = -1;
- data.hit.dist = FLT_MAX;
+ data.hit.dist = BVH_RAYCAST_DIST_MAX;
if (root) {
dfs_raycast_all(&data, root);