diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2011-12-04 00:22:21 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2011-12-04 00:22:21 +0400 |
commit | f2ae6b158913e817c0aab43eafb599af337a274e (patch) | |
tree | e860dbb9965e004835cf7bc8dd5f29541cd172f9 /intern/cycles/util | |
parent | 4344d84c02809e58faaf9516ec6431f3194389c4 (diff) |
Fix #29444: cycles problem building BVH with NaN vertices.
Diffstat (limited to 'intern/cycles/util')
-rw-r--r-- | intern/cycles/util/util_boundbox.h | 5 | ||||
-rw-r--r-- | intern/cycles/util/util_math.h | 1 |
2 files changed, 5 insertions, 1 deletions
diff --git a/intern/cycles/util/util_boundbox.h b/intern/cycles/util/util_boundbox.h index 34cc1d6e11c..b4c5e4e71ca 100644 --- a/intern/cycles/util/util_boundbox.h +++ b/intern/cycles/util/util_boundbox.h @@ -21,6 +21,7 @@ #include <float.h> +#include "util_math.h" #include "util_transform.h" #include "util_types.h" @@ -71,7 +72,9 @@ public: bool valid(void) const { - return (min.x <= max.x) && (min.y <= max.y) && (min.z <= max.z); + return (min.x <= max.x) && (min.y <= max.y) && (min.z <= max.z) && + !(isnan(min.x) || isnan(min.y) || isnan(min.z)) && + !(isnan(max.x) || isnan(max.y) || isnan(max.z)); } BoundBox transformed(const Transform *tfm) diff --git a/intern/cycles/util/util_math.h b/intern/cycles/util/util_math.h index 2f9e00dbfcb..7c56f0fbb12 100644 --- a/intern/cycles/util/util_math.h +++ b/intern/cycles/util/util_math.h @@ -63,6 +63,7 @@ CCL_NAMESPACE_BEGIN #if(!defined(FREE_WINDOWS)) #define copysignf(x, y) ((float)_copysign(x, y)) #define hypotf(x, y) _hypotf(x, y) +#define isnan(x) _isnan(x) #endif #endif |