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
path: root/source
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2018-08-01 09:39:34 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-08-01 09:39:34 +0300
commit3f5d3aa0573b0359761102c0da2d789c67803f7b (patch)
tree95bf0cc5ffc6b820e491ec637165d3925d521d07 /source
parentd6d29f9854298c2a8dda9bf0ed339fdfbd7f0337 (diff)
parent583b2f9a3d9d49a23e525b998c4b1893befa8dd0 (diff)
Merge branch 'master' into blender2.8
Diffstat (limited to 'source')
-rw-r--r--source/blender/blenlib/intern/math_geom.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/source/blender/blenlib/intern/math_geom.c b/source/blender/blenlib/intern/math_geom.c
index 9425931133a..c04fd79f7aa 100644
--- a/source/blender/blenlib/intern/math_geom.c
+++ b/source/blender/blenlib/intern/math_geom.c
@@ -2774,19 +2774,19 @@ bool isect_ray_aabb_v3_simple(
const float bb_min[3], const float bb_max[3],
float *tmin, float *tmax)
{
- double t[7];
+ double t[6];
float hit_dist[2];
const double invdirx = (dir[0] > 1e-35f || dir[0] < -1e-35f) ? 1.0 / (double)dir[0] : DBL_MAX;
const double invdiry = (dir[1] > 1e-35f || dir[1] < -1e-35f) ? 1.0 / (double)dir[1] : DBL_MAX;
const double invdirz = (dir[2] > 1e-35f || dir[2] < -1e-35f) ? 1.0 / (double)dir[2] : DBL_MAX;
- t[1] = (double)(bb_min[0] - orig[0]) * invdirx;
- t[2] = (double)(bb_max[0] - orig[0]) * invdirx;
- t[3] = (double)(bb_min[1] - orig[1]) * invdiry;
- t[4] = (double)(bb_max[1] - orig[1]) * invdiry;
- t[5] = (double)(bb_min[2] - orig[2]) * invdirz;
- t[6] = (double)(bb_max[2] - orig[2]) * invdirz;
- hit_dist[0] = (float)fmax(fmax(fmin(t[1], t[2]), fmin(t[3], t[4])), fmin(t[5], t[6]));
- hit_dist[1] = (float)fmin(fmin(fmax(t[1], t[2]), fmax(t[3], t[4])), fmax(t[5], t[6]));
+ t[0] = (double)(bb_min[0] - orig[0]) * invdirx;
+ t[1] = (double)(bb_max[0] - orig[0]) * invdirx;
+ t[2] = (double)(bb_min[1] - orig[1]) * invdiry;
+ t[3] = (double)(bb_max[1] - orig[1]) * invdiry;
+ t[4] = (double)(bb_min[2] - orig[2]) * invdirz;
+ t[5] = (double)(bb_max[2] - orig[2]) * invdirz;
+ hit_dist[0] = (float)fmax(fmax(fmin(t[0], t[1]), fmin(t[2], t[3])), fmin(t[4], t[5]));
+ hit_dist[1] = (float)fmin(fmin(fmax(t[0], t[1]), fmax(t[2], t[3])), fmax(t[4], t[5]));
if ((hit_dist[1] < 0.0f || hit_dist[0] > hit_dist[1])) {
return false;
}