diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2012-09-12 17:06:28 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2012-09-12 17:06:28 +0400 |
commit | 585cfff87ad8e996b336e8522efb1bce86cce567 (patch) | |
tree | 6413d118e9f5a03100dabc519bf8e0a1ebc9f560 /source | |
parent | 3d38ad1b17028320efbd112cdcd75f77279ef035 (diff) |
Fix #32031: particle distribution on degenerate faces could give NaN values,
which in this case caused NaN values in render lighting.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenlib/intern/math_geom.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/blenlib/intern/math_geom.c b/source/blender/blenlib/intern/math_geom.c index 76f4f26b728..53e9a6b66cb 100644 --- a/source/blender/blenlib/intern/math_geom.c +++ b/source/blender/blenlib/intern/math_geom.c @@ -2229,7 +2229,7 @@ void interp_weights_poly_v3(float *w, float v[][3], const int n, const float co[ t2 = mean_value_half_tan_v3(co, vmid, vnext); len = len_v3v3(co, vmid); - w[i] = (t1 + t2) / len; + w[i] = (len != 0.0f)? (t1 + t2) / len: 0.0f; totweight += w[i]; } @@ -2257,7 +2257,7 @@ void interp_weights_poly_v2(float *w, float v[][2], const int n, const float co[ t2 = mean_value_half_tan_v2(co, vmid, vnext); len = len_v2v2(co, vmid); - w[i] = (t1 + t2) / len; + w[i] = (len != 0.0f)? (t1 + t2) / len: 0.0f; totweight += w[i]; } |