[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [54475] trunk/blender/intern/smoke/intern/ FLUID_3D.cpp: Smoke simulator: add more float precision checks to make sure other data types don' t get messed up either.
Miika Hamalainen
miika.hamalainen at kolumbus.fi
Mon Feb 11 21:22:47 CET 2013
Revision: 54475
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=54475
Author: miikah
Date: 2013-02-11 20:22:47 +0000 (Mon, 11 Feb 2013)
Log Message:
-----------
Smoke simulator: add more float precision checks to make sure other data types don't get messed up either. (Relating previous fire fixes)
Modified Paths:
--------------
trunk/blender/intern/smoke/intern/FLUID_3D.cpp
Modified: trunk/blender/intern/smoke/intern/FLUID_3D.cpp
===================================================================
--- trunk/blender/intern/smoke/intern/FLUID_3D.cpp 2013-02-11 20:21:10 UTC (rev 54474)
+++ trunk/blender/intern/smoke/intern/FLUID_3D.cpp 2013-02-11 20:22:47 UTC (rev 54475)
@@ -1654,7 +1654,7 @@
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 @@
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;
More information about the Bf-blender-cvs
mailing list