summaryrefslogtreecommitdiff
path: root/src/simulation/Air.cpp
diff options
context:
space:
mode:
authorSimon Robertshaw <simon@hardwired.org.uk>2012-07-29 11:18:07 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2012-07-29 11:18:07 (GMT)
commit824bde4cebd78aa04c9018171316f7533307e0ce (patch)
treed67afd50f83584e6b8a461193abd34eec929e0db /src/simulation/Air.cpp
parent1f914561b2049ac779d8a729d9e910c4915b280b (diff)
downloadpowder-824bde4cebd78aa04c9018171316f7533307e0ce.zip
powder-824bde4cebd78aa04c9018171316f7533307e0ce.tar.gz
clear_sim now clears air and gravity maps better, fixes issue #31
Diffstat (limited to 'src/simulation/Air.cpp')
-rw-r--r--src/simulation/Air.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/simulation/Air.cpp b/src/simulation/Air.cpp
index ff3ea6e..6d7b5dd 100644
--- a/src/simulation/Air.cpp
+++ b/src/simulation/Air.cpp
@@ -36,6 +36,15 @@ void Air::make_kernel(void) //used for velocity
for (i=-1; i<2; i++)
kernel[(i+1)+3*(j+1)] *= s;
}
+
+void Air::Clear()
+{
+ std::fill(&hv[0][0], &hv[0][0]+((XRES/CELL)*(YRES/CELL)), 273.15f + 22.0f);
+ std::fill(&pv[0][0], &pv[0][0]+((XRES/CELL)*(YRES/CELL)), 0.0f);
+ std::fill(&vy[0][0], &vy[0][0]+((XRES/CELL)*(YRES/CELL)), 0.0f);
+ std::fill(&vx[0][0], &vx[0][0]+((XRES/CELL)*(YRES/CELL)), 0.0f);
+}
+
void Air::update_airh(void)
{
int x, y, i, j;