summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--DisplayClass.cpp15
-rw-r--r--Temparray.h20
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<Triangle> triangles = cubehole0.getTriangles();
- std::list<Triangle> t1 = cubehole1.getTriangles();
- triangles.splice(triangles.end(), t1);
- std::list<Triangle> t2 = cubehole2.getTriangles();
- triangles.splice(triangles.end(), t2);
- std::list<Triangle> t3 = cubehole3.getTriangles();
- triangles.splice(triangles.end(), t3);
- std::list<Triangle> t4 = cubehole4.getTriangles();
- triangles.splice(triangles.end(), t4);
- std::list<Triangle> 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<size0[0]; i++){
- for(int j=0; j<size0[1]; j++){
- for(int k=0; k<size0[2]; k++){
+ void tempInit(float temp0, int x0, int y0, int z0){
+ for(int i=0; i<x0; i++){
+ for(int j=0; j<y0; j++){
+ for(int k=0; k<z0; k++){
for(int l=0; l<4; l++){
for(int m=0; m<6; m++){
setTemp(temp0, i, j, k, l, m);