From ac9295f8f9ec5efa475fa8f2a56b3d975d6acc01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Constantin=20Ri=C3=9F?= Date: Thu, 14 Jan 2010 23:04:03 +0100 Subject: =?UTF-8?q?Kleine=20=C3=84nderung?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Temparray.h | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) (limited to 'Temparray.h') diff --git a/Temparray.h b/Temparray.h index 1274cfb..ac082b4 100644 --- a/Temparray.h +++ b/Temparray.h @@ -3,19 +3,21 @@ #include "Cubehole.h" #include "gl.h" +#include "Triangle.h" #include class Temparray { public: Temparray(float initialtemp, int x0, int y0, int z0); - ~Temparray(){ - + Temparray(){} + ~Temparray(){} + void calcTemp(int x, int y, int z, int line, int pos); + float& temperatureold(int x, int y, int z, int line, int pos) { + return temparrayold[x*sy*sz*6*4 + y*sz*6*4 + z*6*4 + line*4 + pos]; } - void setTemp(float temp, int x, int y, int z, int line, int pos){ - temperature(x, y, z, line, pos) = temp; - - calcAverage(); + float& temperaturenew(int x, int y, int z, int line, int pos) { + return temparraynew[x*sy*sz*6*4 + y*sz*6*4 + z*6*4 + line*4 + pos]; } void deactivateCube(int x, int y, int z){ for(int i=0; i<6; i++){ @@ -27,35 +29,30 @@ class Temparray std::list getTriangles(); private: - float *temparray; + float *temparrayold, *temparraynew; Cubehole *cubearray; int sx, sy, sz; float averagetemp; - float& temperature(int x, int y, int z, int line, int pos) { - return temparray[x*sy*sz*6*4 + y*sz*6*4 + z*6*4 + line*4 + pos]; - } Cubehole& cubehole(int x, int y, int z, int line) { return cubearray[x*sy*sz*6 + y*sz*6 + z*6 + line]; } - -// void setColor(int x, int y, int z, int line){ -// } void tempInit(float temp0, int x0, int y0, int z0){ for(int i=0; i