Skip to content

Commit

Permalink
fix bug where liquids don't stabalize in radial gravity
Browse files Browse the repository at this point in the history
nx and ny are declared at the start of update_particles_i, but not reinitialized before the liquid attempts to move, so it will always try to move up and left first, and probably succeed.
  • Loading branch information
jacob1 committed Apr 26, 2014
1 parent 49996a8 commit d87e21c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/simulation/Simulation.cpp
Expand Up @@ -4532,6 +4532,8 @@ void Simulation::update_particles_i(int start, int inc)
rt = 10;
nxf = clear_xf;
nyf = clear_yf;
nx = (int)(parts[i].x+0.5f);
ny = (int)(parts[i].y+0.5f);
for (j=0;j<rt;j++)
{
switch (gravityMode)
Expand Down

0 comments on commit d87e21c

Please sign in to comment.