Fix: smoke simulator flow sometimes produced NaN values, causing fire to disappear from the simulation.

This commit is contained in:
Miika Hamalainen 2013-02-11 13:28:18 +00:00
parent 7fcc1ac48b
commit 1647725913

@ -1583,7 +1583,7 @@ BLI_INLINE void apply_inflow_fields(SmokeFlowSettings *sfs, float emission_value
}
/* set fire reaction coordinate */
if (fuel && fuel[index]) {
if (fuel && fuel[index] > FLT_EPSILON) {
/* instead of using 1.0 for all new fuel add slight falloff
* to reduce flow blockiness */
float value = 1.0f - powf(1.0f - emission_value, 2.0f);