From d0b6aa0c6406c0a22404d8999f889242cef54e1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Constantin=20Ri=C3=9F?= Date: Wed, 30 Dec 2009 12:37:26 +0100 Subject: Temparray fehler behoben. --- DisplayClass.cpp | 15 --------------- Temparray.h | 20 ++++++++++---------- 2 files changed, 10 insertions(+), 25 deletions(-) diff --git a/DisplayClass.cpp b/DisplayClass.cpp index 2c4489b..af71dcc 100644 --- a/DisplayClass.cpp +++ b/DisplayClass.cpp @@ -67,23 +67,8 @@ void DisplayClass::renderScene(unsigned long delta) { glRotatef(angle, 0.0, 1.0, 0.0); glRotatef(angle*2, 1.0, 0.0, 0.0); glRotatef(angle*3, 0.0, 0.0, 1.0); - glRotatef(-angle*5, 1.0, 1.0, 1.0); - /*std::list triangles = cubehole0.getTriangles(); - std::list t1 = cubehole1.getTriangles(); - triangles.splice(triangles.end(), t1); - std::list t2 = cubehole2.getTriangles(); - triangles.splice(triangles.end(), t2); - std::list t3 = cubehole3.getTriangles(); - triangles.splice(triangles.end(), t3); - std::list t4 = cubehole4.getTriangles(); - triangles.splice(triangles.end(), t4); - std::list t5 = cubehole5.getTriangles(); - triangles.splice(triangles.end(), t5); - - BSPTree tree(triangles);*/ - vmml::mat4f transform, inverseTransform; glGetFloatv(GL_MODELVIEW_MATRIX, transform.array); diff --git a/Temparray.h b/Temparray.h index 72b5068..fe9e91b 100644 --- a/Temparray.h +++ b/Temparray.h @@ -7,11 +7,11 @@ class Temparray { public: - Temparray(float initialtemp, int size0[3]){ - float *temperature = new float[size0[0]][size0[1]][size0[2]][4][6]; - Cubehole *cubearray = new Cubehole[size0[0]][size0[1]][size0[2]]; - tempInit(initialtemp, size0); - size[0] = size0[0]; size[1] = size0[1];size[2] = size0[2]; + Temparray(float initialtemp, int x0, int y0, int z0){ + float *temperature = new float[x0, y0, z0, 4, 6]; + Cubehole *cubearray = new Cubehole[x0, y0, z0]; + tempInit(initialtemp, x0, y0, z0); + size[0] = x0; size[1] = y0; size[2] = z0; } ~Temparray(){ delete[] temperature; @@ -19,7 +19,7 @@ class Temparray } void setTemp(float temp, int x, int y, int z, int direct, int pos){ - temperature[x][y][z][direct][pos] = temp; + temperature[x, y, z, direct, pos] = temp; } void deactivateCube(int x, int y, int z){ for(int i=0; i<4; i++){ @@ -35,10 +35,10 @@ class Temparray Cubehole *cubearray; int size[3]; - void tempInit(float temp0, int size0[3]){ - for(int i=0; i