Index: code/branches/OrxoKart_HS18/data/levels/OrxoKart1.oxw
===================================================================
--- code/branches/OrxoKart_HS18/data/levels/OrxoKart1.oxw	(revision 12082)
+++ code/branches/OrxoKart_HS18/data/levels/OrxoKart1.oxw	(revision 12089)
@@ -61,5 +61,5 @@
 
         <!-- floor design -->
-        
+        <!--
         <Model
           position="<?lua print((N-1)*S/2)?>,0,<?lua print((N-1)*S/2)?>"
@@ -68,5 +68,5 @@
           mesh="teststrecke.mesh"
         />
-      
+      -->
         
       </attached> 
@@ -81,294 +81,5 @@
         <!-- floor physics -->
 
-<!-- tile number 0-->
-<BoxCollisionShape
-position="<?lua print((N-1-0)*S) ?>,-1, <?lua print(0*S) ?>"
-halfExtents="<?lua print(S/2) ?>,1, <?lua print(S/2) ?>"
-/>
-<!-- tile number 1-->
-<BoxCollisionShape
-position="<?lua print((N-1-0)*S) ?>,-1, <?lua print(1*S) ?>"
-halfExtents="<?lua print(S/2) ?>,1, <?lua print(S/2) ?>"
-/>
-<!-- tile number 2-->
-<BoxCollisionShape
-position="<?lua print((N-1-0)*S) ?>,-1, <?lua print(2*S) ?>"
-halfExtents="<?lua print(S/2) ?>,1, <?lua print(S/2) ?>"
-/>
-<!-- tile number 3-->
-<BoxCollisionShape
-position="<?lua print((N-1-0)*S) ?>,-1, <?lua print(3*S) ?>"
-halfExtents="<?lua print(S/2) ?>,1, <?lua print(S/2) ?>"
-/>
-<!-- tile number 4-->
-<BoxCollisionShape
-position="<?lua print((N-1-0)*S) ?>,-1, <?lua print(4*S) ?>"
-halfExtents="<?lua print(S/2) ?>,1, <?lua print(S/2) ?>"
-/>
-<!-- tile number 5-->
-<BoxCollisionShape
-position="<?lua print((N-1-0)*S) ?>,-1, <?lua print(5*S) ?>"
-halfExtents="<?lua print(S/2) ?>,1, <?lua print(S/2) ?>"
-/>
-<!-- tile number 6-->
-<BoxCollisionShape
-position="<?lua print((N-1-0)*S) ?>,-1, <?lua print(6*S) ?>"
-halfExtents="<?lua print(S/2) ?>,1, <?lua print(S/2) ?>"
-/>
-<!-- tile number 7-->
-<BoxCollisionShape
-position="<?lua print((N-1-0)*S) ?>,-1, <?lua print(7*S) ?>"
-halfExtents="<?lua print(S/2) ?>,1, <?lua print(S/2) ?>"
-/>
-<!-- tile number 8-->
-<BoxCollisionShape
-position="<?lua print((N-1-1)*S) ?>,-1, <?lua print(0*S) ?>"
-halfExtents="<?lua print(S/2) ?>,1, <?lua print(S/2) ?>"
-/>
-<!-- tile number 9-->
-<BoxCollisionShape
-position="<?lua print((N-1-1)*S) ?>,-1, <?lua print(7*S) ?>"
-halfExtents="<?lua print(S/2) ?>,1, <?lua print(S/2) ?>"
-/>
-<!-- tile number 10-->
-<BoxCollisionShape
-position="<?lua print((N-1-1)*S) ?>,-1, <?lua print(8*S) ?>"
-halfExtents="<?lua print(S/2) ?>,1, <?lua print(S/2) ?>"
-/>
-<!-- tile number 11-->
-<BoxCollisionShape
-position="<?lua print((N-1-1)*S) ?>,-1, <?lua print(9*S) ?>"
-halfExtents="<?lua print(S/2) ?>,1, <?lua print(S/2) ?>"
-/>
-<!-- tile number 12-->
-<BoxCollisionShape
-position="<?lua print((N-1-2)*S) ?>,-1, <?lua print(0*S) ?>"
-halfExtents="<?lua print(S/2) ?>,1, <?lua print(S/2) ?>"
-/>
-<!-- tile number 13-->
-<BoxCollisionShape
-position="<?lua print((N-1-2)*S) ?>,-1, <?lua print(2*S) ?>"
-halfExtents="<?lua print(S/2) ?>,1, <?lua print(S/2) ?>"
-/>
-<!-- tile number 14-->
-<BoxCollisionShape
-position="<?lua print((N-1-2)*S) ?>,-1, <?lua print(3*S) ?>"
-halfExtents="<?lua print(S/2) ?>,1, <?lua print(S/2) ?>"
-/>
-<!-- tile number 15-->
-<BoxCollisionShape
-position="<?lua print((N-1-2)*S) ?>,-1, <?lua print(4*S) ?>"
-halfExtents="<?lua print(S/2) ?>,1, <?lua print(S/2) ?>"
-/>
-<!-- tile number 16-->
-<BoxCollisionShape
-position="<?lua print((N-1-2)*S) ?>,-1, <?lua print(5*S) ?>"
-halfExtents="<?lua print(S/2) ?>,1, <?lua print(S/2) ?>"
-/>
-<!-- tile number 17-->
-<BoxCollisionShape
-position="<?lua print((N-1-2)*S) ?>,-1, <?lua print(9*S) ?>"
-halfExtents="<?lua print(S/2) ?>,1, <?lua print(S/2) ?>"
-/>
-<!-- tile number 18-->
-<BoxCollisionShape
-position="<?lua print((N-1-2)*S) ?>,-1, <?lua print(10*S) ?>"
-halfExtents="<?lua print(S/2) ?>,1, <?lua print(S/2) ?>"
-/>
-<!-- tile number 19-->
-<BoxCollisionShape
-position="<?lua print((N-1-3)*S) ?>,-1, <?lua print(0*S) ?>"
-halfExtents="<?lua print(S/2) ?>,1, <?lua print(S/2) ?>"
-/>
-<!-- tile number 20-->
-<BoxCollisionShape
-position="<?lua print((N-1-3)*S) ?>,-1, <?lua print(1*S) ?>"
-halfExtents="<?lua print(S/2) ?>,1, <?lua print(S/2) ?>"
-/>
-<!-- tile number 21-->
-<BoxCollisionShape
-position="<?lua print((N-1-3)*S) ?>,-1, <?lua print(2*S) ?>"
-halfExtents="<?lua print(S/2) ?>,1, <?lua print(S/2) ?>"
-/>
-<!-- tile number 22-->
-<BoxCollisionShape
-position="<?lua print((N-1-3)*S) ?>,-1, <?lua print(5*S) ?>"
-halfExtents="<?lua print(S/2) ?>,1, <?lua print(S/2) ?>"
-/>
-<!-- tile number 23-->
-<BoxCollisionShape
-position="<?lua print((N-1-3)*S) ?>,-1, <?lua print(6*S) ?>"
-halfExtents="<?lua print(S/2) ?>,1, <?lua print(S/2) ?>"
-/>
-<!-- tile number 24-->
-<BoxCollisionShape
-position="<?lua print((N-1-3)*S) ?>,-1, <?lua print(10*S) ?>"
-halfExtents="<?lua print(S/2) ?>,1, <?lua print(S/2) ?>"
-/>
-<!-- tile number 25-->
-<BoxCollisionShape
-position="<?lua print((N-1-4)*S) ?>,-1, <?lua print(6*S) ?>"
-halfExtents="<?lua print(S/2) ?>,1, <?lua print(S/2) ?>"
-/>
-<!-- tile number 26-->
-<BoxCollisionShape
-position="<?lua print((N-1-4)*S) ?>,-1, <?lua print(8*S) ?>"
-halfExtents="<?lua print(S/2) ?>,1, <?lua print(S/2) ?>"
-/>
-<!-- tile number 27-->
-<BoxCollisionShape
-position="<?lua print((N-1-4)*S) ?>,-1, <?lua print(9*S) ?>"
-halfExtents="<?lua print(S/2) ?>,1, <?lua print(S/2) ?>"
-/>
-<!-- tile number 28-->
-<BoxCollisionShape
-position="<?lua print((N-1-4)*S) ?>,-1, <?lua print(10*S) ?>"
-halfExtents="<?lua print(S/2) ?>,1, <?lua print(S/2) ?>"
-/>
-<!-- tile number 29-->
-<BoxCollisionShape
-position="<?lua print((N-1-5)*S) ?>,-1, <?lua print(0*S) ?>"
-halfExtents="<?lua print(S/2) ?>,1, <?lua print(S/2) ?>"
-/>
-<!-- tile number 30-->
-<BoxCollisionShape
-position="<?lua print((N-1-5)*S) ?>,-1, <?lua print(1*S) ?>"
-halfExtents="<?lua print(S/2) ?>,1, <?lua print(S/2) ?>"
-/>
-<!-- tile number 31-->
-<BoxCollisionShape
-position="<?lua print((N-1-5)*S) ?>,-1, <?lua print(2*S) ?>"
-halfExtents="<?lua print(S/2) ?>,1, <?lua print(S/2) ?>"
-/>
-<!-- tile number 32-->
-<BoxCollisionShape
-position="<?lua print((N-1-5)*S) ?>,-1, <?lua print(3*S) ?>"
-halfExtents="<?lua print(S/2) ?>,1, <?lua print(S/2) ?>"
-/>
-<!-- tile number 33-->
-<BoxCollisionShape
-position="<?lua print((N-1-5)*S) ?>,-1, <?lua print(4*S) ?>"
-halfExtents="<?lua print(S/2) ?>,1, <?lua print(S/2) ?>"
-/>
-<!-- tile number 34-->
-<BoxCollisionShape
-position="<?lua print((N-1-5)*S) ?>,-1, <?lua print(5*S) ?>"
-halfExtents="<?lua print(S/2) ?>,1, <?lua print(S/2) ?>"
-/>
-<!-- tile number 35-->
-<BoxCollisionShape
-position="<?lua print((N-1-5)*S) ?>,-1, <?lua print(6*S) ?>"
-halfExtents="<?lua print(S/2) ?>,1, <?lua print(S/2) ?>"
-/>
-<!-- tile number 36-->
-<BoxCollisionShape
-position="<?lua print((N-1-5)*S) ?>,-1, <?lua print(8*S) ?>"
-halfExtents="<?lua print(S/2) ?>,1, <?lua print(S/2) ?>"
-/>
-<!-- tile number 37-->
-<BoxCollisionShape
-position="<?lua print((N-1-6)*S) ?>,-1, <?lua print(0*S) ?>"
-halfExtents="<?lua print(S/2) ?>,1, <?lua print(S/2) ?>"
-/>
-<!-- tile number 38-->
-<BoxCollisionShape
-position="<?lua print((N-1-6)*S) ?>,-1, <?lua print(8*S) ?>"
-halfExtents="<?lua print(S/2) ?>,1, <?lua print(S/2) ?>"
-/>
-<!-- tile number 39-->
-<BoxCollisionShape
-position="<?lua print((N-1-7)*S) ?>,-1, <?lua print(0*S) ?>"
-halfExtents="<?lua print(S/2) ?>,1, <?lua print(S/2) ?>"
-/>
-<!-- tile number 40-->
-<BoxCollisionShape
-position="<?lua print((N-1-7)*S) ?>,-1, <?lua print(8*S) ?>"
-halfExtents="<?lua print(S/2) ?>,1, <?lua print(S/2) ?>"
-/>
-<!-- tile number 41-->
-<BoxCollisionShape
-position="<?lua print((N-1-8)*S) ?>,-1, <?lua print(0*S) ?>"
-halfExtents="<?lua print(S/2) ?>,1, <?lua print(S/2) ?>"
-/>
-<!-- tile number 42-->
-<BoxCollisionShape
-position="<?lua print((N-1-8)*S) ?>,-1, <?lua print(1*S) ?>"
-halfExtents="<?lua print(S/2) ?>,1, <?lua print(S/2) ?>"
-/>
-<!-- tile number 43-->
-<BoxCollisionShape
-position="<?lua print((N-1-8)*S) ?>,-1, <?lua print(2*S) ?>"
-halfExtents="<?lua print(S/2) ?>,1, <?lua print(S/2) ?>"
-/>
-<!-- tile number 44-->
-<BoxCollisionShape
-position="<?lua print((N-1-8)*S) ?>,-1, <?lua print(3*S) ?>"
-halfExtents="<?lua print(S/2) ?>,1, <?lua print(S/2) ?>"
-/>
-<!-- tile number 45-->
-<BoxCollisionShape
-position="<?lua print((N-1-8)*S) ?>,-1, <?lua print(4*S) ?>"
-halfExtents="<?lua print(S/2) ?>,1, <?lua print(S/2) ?>"
-/>
-<!-- tile number 46-->
-<BoxCollisionShape
-position="<?lua print((N-1-8)*S) ?>,-1, <?lua print(8*S) ?>"
-halfExtents="<?lua print(S/2) ?>,1, <?lua print(S/2) ?>"
-/>
-<!-- tile number 47-->
-<BoxCollisionShape
-position="<?lua print((N-1-8)*S) ?>,-1, <?lua print(9*S) ?>"
-halfExtents="<?lua print(S/2) ?>,1, <?lua print(S/2) ?>"
-/>
-<!-- tile number 48-->
-<BoxCollisionShape
-position="<?lua print((N-1-8)*S) ?>,-1, <?lua print(10*S) ?>"
-halfExtents="<?lua print(S/2) ?>,1, <?lua print(S/2) ?>"
-/>
-<!-- tile number 49-->
-<BoxCollisionShape
-position="<?lua print((N-1-9)*S) ?>,-1, <?lua print(4*S) ?>"
-halfExtents="<?lua print(S/2) ?>,1, <?lua print(S/2) ?>"
-/>
-<!-- tile number 50-->
-<BoxCollisionShape
-position="<?lua print((N-1-9)*S) ?>,-1, <?lua print(10*S) ?>"
-halfExtents="<?lua print(S/2) ?>,1, <?lua print(S/2) ?>"
-/>
-<!-- tile number 51-->
-<BoxCollisionShape
-position="<?lua print((N-1-10)*S) ?>,-1, <?lua print(4*S) ?>"
-halfExtents="<?lua print(S/2) ?>,1, <?lua print(S/2) ?>"
-/>
-<!-- tile number 52-->
-<BoxCollisionShape
-position="<?lua print((N-1-10)*S) ?>,-1, <?lua print(5*S) ?>"
-halfExtents="<?lua print(S/2) ?>,1, <?lua print(S/2) ?>"
-/>
-<!-- tile number 53-->
-<BoxCollisionShape
-position="<?lua print((N-1-10)*S) ?>,-1, <?lua print(6*S) ?>"
-halfExtents="<?lua print(S/2) ?>,1, <?lua print(S/2) ?>"
-/>
-<!-- tile number 54-->
-<BoxCollisionShape
-position="<?lua print((N-1-10)*S) ?>,-1, <?lua print(7*S) ?>"
-halfExtents="<?lua print(S/2) ?>,1, <?lua print(S/2) ?>"
-/>
-<!-- tile number 55-->
-<BoxCollisionShape
-position="<?lua print((N-1-10)*S) ?>,-1, <?lua print(8*S) ?>"
-halfExtents="<?lua print(S/2) ?>,1, <?lua print(S/2) ?>"
-/>
-<!-- tile number 56-->
-<BoxCollisionShape
-position="<?lua print((N-1-10)*S) ?>,-1, <?lua print(9*S) ?>"
-halfExtents="<?lua print(S/2) ?>,1, <?lua print(S/2) ?>"
-/>
-<!-- tile number 57-->
-<BoxCollisionShape
-position="<?lua print((N-1-10)*S) ?>,-1, <?lua print(10*S) ?>"
-halfExtents="<?lua print(S/2) ?>,1, <?lua print(S/2) ?>"
-/>
+
 
 
Index: code/branches/OrxoKart_HS18/src/modules/orxokart/OrxoKart.cc
===================================================================
--- code/branches/OrxoKart_HS18/src/modules/orxokart/OrxoKart.cc	(revision 12082)
+++ code/branches/OrxoKart_HS18/src/modules/orxokart/OrxoKart.cc	(revision 12089)
@@ -61,6 +61,6 @@
             this->firstTick_ = false;
 
-            int numCells = this->origin_->getNumCells();
-            int cellSize = this->origin_->getCellSize();
+            int n = this->origin_->getNumCells();
+            int s = this->origin_->getCellSize();
             int cellHeight = this->origin_->getCellHeight();
 
@@ -75,25 +75,13 @@
                                     ,1,1,1,1,1,0,0,0,1,1,1
                                     ,0,0,0,0,1,0,0,0,0,0,1
-                                    ,0,0,0,0,1,1,1,1,1,1,1};
+                                    ,0,0,0,0,1,1,1,2,1,1,1};
             int* levelcode = levelcodeArray;
 
-            //Outer Walls
-            for(int i = 0; i<numCells; i++){
-                (new OrxoKartTile(origin_->getContext()))->init(0,        i+1,      cellSize, cellHeight, 1);
-                (new OrxoKartTile(origin_->getContext()))->init(numCells, i+1,      cellSize, cellHeight, 1);
-                (new OrxoKartTile(origin_->getContext()))->init(i+1,      0,        cellSize, cellHeight, 2);
-                (new OrxoKartTile(origin_->getContext()))->init(i+1,      numCells, cellSize, cellHeight, 2);
-            }
 
-            //Generate inner Walls according to levelcode
-            for(int y=0; y<numCells; y++){
-                for(int x=0; x<numCells; x++){
-                    switch(levelcode[ y * numCells + x ]){
-                        case 1: (new OrxoKartTile(origin_->getContext()))->init(x+1, numCells-y, cellSize, cellHeight, 1);
-                                break;
-                        case 3: (new OrxoKartTile(origin_->getContext()))->init(x+1, numCells-y, cellSize, cellHeight, 1);
-                        case 2: (new OrxoKartTile(origin_->getContext()))->init(x+1, numCells-y, cellSize, cellHeight, 0);
-                        default: break;
-                    }
+            //Generate floor according to levelcode
+            for(int i=0; i<n; i++){
+                for(int j=0; j<n; j++){
+                    if (int type = levelcodeArray[i*n + j])
+                    (new OrxoKartTile(origin_->getContext()))->init((n-1-i)*s, j*s, s, type);
                 }   
             }
Index: code/branches/OrxoKart_HS18/src/modules/orxokart/OrxoKartTile.cc
===================================================================
--- code/branches/OrxoKart_HS18/src/modules/orxokart/OrxoKartTile.cc	(revision 12082)
+++ code/branches/OrxoKart_HS18/src/modules/orxokart/OrxoKartTile.cc	(revision 12089)
@@ -83,6 +83,26 @@
             Wall on the right side (1) or on top (2) of this square, 0-1        
     */
-    void OrxoKartTile::init(int x, int y, int cellSize, int cellHeight, int orientation)
+    void OrxoKartTile::init(int x, int z, int s, int type)
     {
+        model_ = new Model(this->getContext());
+        if (type == 1) {
+           model_->setMeshSource("OrxoKartStreckenabschnitt.mesh"); 
+        }
+        else if (type == 2 ) {
+            model_->setMeshSource("OrxoKartStreckenabschnittZiel.mesh");
+        }
+        model_->setScale3D(Vector3(s*1.0f, 8.0f, s*1.0f));
+        model_->setPosition(Vector3(x*1.0f, 0.0f, z*1.0f));
+
+        this->attach(model_);
+
+        cs_ = new BoxCollisionShape(this->getContext());
+        cs_->setHalfExtents(Vector3(s/2.0f, 1.0f, s/2.0f));
+        cs_->setPosition(Vector3(x*1.0f, -1.0f, z*1.0f));
+
+        this->attachCollisionShape(cs_);
+
+        /*
+
         int xSize_, zSize_, xPos_, zPos_;
 
@@ -113,4 +133,5 @@
 
         this->attachCollisionShape(cs_);
+        */
     }
 }
Index: code/branches/OrxoKart_HS18/src/modules/orxokart/OrxoKartTile.h
===================================================================
--- code/branches/OrxoKart_HS18/src/modules/orxokart/OrxoKartTile.h	(revision 12082)
+++ code/branches/OrxoKart_HS18/src/modules/orxokart/OrxoKartTile.h	(revision 12089)
@@ -49,5 +49,5 @@
             virtual ~OrxoKartTile();
 
-            void init(int x, int y, int cellSize, int cellHeight, int orientation);
+            void init(int x, int z, int s, int type);
 
         private:
