BCLN and GOO advection fix

This commit is contained in:
jacksonmj 2011-02-09 17:19:48 +00:00
parent 3de4d163a5
commit 457ceeff0a
2 changed files with 12 additions and 16 deletions

View File

@ -1,15 +1,13 @@
#include <element.h>
int update_BCLN(UPDATE_FUNC_ARGS) {
if (!parts[i].life)
{
if (pv[y/CELL][x/CELL]>4.0f)
if (!parts[i].life && pv[y/CELL][x/CELL]>4.0f)
parts[i].life = rand()%40+80;
if (parts[i].life)
{
float advection = 0.1f;
parts[i].vx += advection*vx[y/CELL][x/CELL];
parts[i].vy += advection*vy[y/CELL][x/CELL];
parts[i].life = rand()%40+80;
}
}
if (!parts[i].ctype)
{

View File

@ -1,15 +1,13 @@
#include <element.h>
int update_GOO(UPDATE_FUNC_ARGS) {
if (!parts[i].life)
{
if (pv[y/CELL][x/CELL]>1.0f)
if (!parts[i].life && pv[y/CELL][x/CELL]>1.0f)
parts[i].life = rand()%80+300;
if (parts[i].life)
{
float advection = 0.1f;
parts[i].vx += advection*vx[y/CELL][x/CELL];
parts[i].vy += advection*vy[y/CELL][x/CELL];
parts[i].life = rand()%80+300;
}
}
return 0;
}