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:
authormano-wii <germano.costa@ig.com.br>2020-01-30 14:40:22 +0300
committermano-wii <germano.costa@ig.com.br>2020-01-30 14:40:22 +0300
commit9112d19cf72d1f5b19046935ec018744a243efd3 (patch)
tree6b5ee2b6d953d594f54a6fdc85f5f3a8c6127e17 /source/blender/blenlib
parent2142288eae7322b923e0369c07d5013d9a160774 (diff)
parent944ab366578f2447c6c31370867e689fc661a972 (diff)
Merge branch 'blender-v2.82-release'
Diffstat (limited to 'source/blender/blenlib')
-rw-r--r--source/blender/blenlib/intern/BLI_kdopbvh.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/source/blender/blenlib/intern/BLI_kdopbvh.c b/source/blender/blenlib/intern/BLI_kdopbvh.c
index 252e7caa149..50381f2fb18 100644
--- a/source/blender/blenlib/intern/BLI_kdopbvh.c
+++ b/source/blender/blenlib/intern/BLI_kdopbvh.c
@@ -1819,11 +1819,16 @@ static void bvhtree_ray_cast_data_precalc(BVHRayCastData *data, int flag)
for (i = 0; i < 3; i++) {
data->ray_dot_axis[i] = dot_v3v3(data->ray.direction, bvhtree_kdop_axes[i]);
- data->idot_axis[i] = 1.0f / data->ray_dot_axis[i];
if (fabsf(data->ray_dot_axis[i]) < FLT_EPSILON) {
- data->ray_dot_axis[i] = 0.0;
+ data->ray_dot_axis[i] = 0.0f;
+ /* Sign is not important in this case, `data->index` is adjusted anyway. */
+ data->idot_axis[i] = FLT_MAX;
}
+ else {
+ data->idot_axis[i] = 1.0f / data->ray_dot_axis[i];
+ }
+
data->index[2 * i] = data->idot_axis[i] < 0.0f ? 1 : 0;
data->index[2 * i + 1] = 1 - data->index[2 * i];
data->index[2 * i] += 2 * i;