diff options
author | Miika Hamalainen <blender@miikah.org> | 2013-02-12 00:22:47 +0400 |
---|---|---|
committer | Miika Hamalainen <blender@miikah.org> | 2013-02-12 00:22:47 +0400 |
commit | 1c4f704d5c6385c891057404fab462b5cc8121df (patch) | |
tree | 8b3a926a4262de551e75488681d6319b127280db /intern/smoke | |
parent | 3dfd736d456c79d8ab7c517e68e990040555d223 (diff) |
Smoke simulator: add more float precision checks to make sure other data types don't get messed up either. (Relating previous fire fixes)
Diffstat (limited to 'intern/smoke')
-rw-r--r-- | intern/smoke/intern/FLUID_3D.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/intern/smoke/intern/FLUID_3D.cpp b/intern/smoke/intern/FLUID_3D.cpp index a1d39286a90..5f0b2439200 100644 --- a/intern/smoke/intern/FLUID_3D.cpp +++ b/intern/smoke/intern/FLUID_3D.cpp @@ -1654,7 +1654,7 @@ void FLUID_3D::processBurn(float *fuel, float *smoke, float *react, float *flame fuel[index] -= burning_rate * dt; if (fuel[index] < 0.0f) fuel[index] = 0.0f; /* process reaction coordinate */ - if (orig_fuel) { + if (orig_fuel > FLT_EPSILON) { react[index] *= fuel[index]/orig_fuel; react_coord = react[index]; } @@ -1681,7 +1681,7 @@ void FLUID_3D::processBurn(float *fuel, float *smoke, float *react, float *flame heat[index] = (1.0f-flame[index])*ignition_point + flame[index]*temp_max; /* mix new color */ - if (r && smoke_emit) { + if (r && smoke_emit > FLT_EPSILON) { float smoke_factor = smoke[index]/(orig_smoke+smoke_emit); r[index] = (r[index] + _flame_smoke_color[0] * smoke_emit) * smoke_factor; g[index] = (g[index] + _flame_smoke_color[1] * smoke_emit) * smoke_factor; |