Fix [#36791]: Fire ignores force fields when smoke is set to 0.0

This commit is contained in:
Miika Hamalainen
2013-09-22 16:09:31 +00:00
parent aa8488421f
commit 771e607e82

View File

@@ -2386,6 +2386,7 @@ static void update_effectors(Scene *scene, Object *ob, SmokeDomainSettings *sds,
if (effectors)
{
float *density = smoke_get_density(sds->fluid);
float *fuel = smoke_get_fuel(sds->fluid);
float *force_x = smoke_get_force_x(sds->fluid);
float *force_y = smoke_get_force_y(sds->fluid);
float *force_z = smoke_get_force_z(sds->fluid);
@@ -2408,7 +2409,7 @@ static void update_effectors(Scene *scene, Object *ob, SmokeDomainSettings *sds,
float voxelCenter[3] = {0, 0, 0}, vel[3] = {0, 0, 0}, retvel[3] = {0, 0, 0};
unsigned int index = smoke_get_index(x, sds->res[0], y, sds->res[1], z);
if ((density[index] < FLT_EPSILON) || obstacle[index])
if ((MAX2(density[index], fuel[index]) < FLT_EPSILON) || obstacle[index])
continue;
vel[0] = velocity_x[index];