diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2013-02-15 01:40:28 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2013-02-15 01:40:28 +0400 |
commit | 6e03b70def962bf4c7ee346916c7472700c7f336 (patch) | |
tree | 9eb8584b80e51b2d88ded704e0eea7fe57750789 /intern/cycles/util/util_boundbox.h | |
parent | 40720fcdef87e914ff608234f39f58ff25cd73bd (diff) |
Fix cycles hair curves with NaN values not rendering with dynamic BVH. These NaN
values were breaking the bounding box computation, now they should have no influence.
Diffstat (limited to 'intern/cycles/util/util_boundbox.h')
-rw-r--r-- | intern/cycles/util/util_boundbox.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/intern/cycles/util/util_boundbox.h b/intern/cycles/util/util_boundbox.h index 0c857f906ee..7564c1f3c5c 100644 --- a/intern/cycles/util/util_boundbox.h +++ b/intern/cycles/util/util_boundbox.h @@ -61,15 +61,17 @@ public: __forceinline void grow(const float3& pt) { - min = ccl::min(min, pt); - max = ccl::max(max, pt); + /* the order of arguments to min is such that if pt is nan, it will not + * influence the resulting bounding box */ + min = ccl::min(pt, min); + max = ccl::max(pt, max); } __forceinline void grow(const float3& pt, float border) { float3 shift = {border, border, border, 0.0f}; - min = ccl::min(min, pt - shift); - max = ccl::max(max, pt + shift); + min = ccl::min(pt - shift, min); + max = ccl::max(pt + shift, max); } __forceinline void grow(const BoundBox& bbox) |