[Orxonox-commit 7484] r12090 - in code/branches/OrxoKart_HS18: data/levels src/modules/orxokart

ottka at orxonox.net ottka at orxonox.net
Wed Nov 7 11:52:40 CET 2018


Author: ottka
Date: 2018-11-07 11:52:40 +0100 (Wed, 07 Nov 2018)
New Revision: 12090

Modified:
   code/branches/OrxoKart_HS18/data/levels/OrxoKart1.oxw
   code/branches/OrxoKart_HS18/src/modules/orxokart/OrxoKart.cc
   code/branches/OrxoKart_HS18/src/modules/orxokart/OrxoKartOrigin.cc
   code/branches/OrxoKart_HS18/src/modules/orxokart/OrxoKartOrigin.h
   code/branches/OrxoKart_HS18/src/modules/orxokart/OrxoKartTile.cc
Log:
clean up of module :)

Modified: code/branches/OrxoKart_HS18/data/levels/OrxoKart1.oxw
===================================================================
--- code/branches/OrxoKart_HS18/data/levels/OrxoKart1.oxw	2018-11-07 10:42:26 UTC (rev 12089)
+++ code/branches/OrxoKart_HS18/data/levels/OrxoKart1.oxw	2018-11-07 10:52:40 UTC (rev 12090)
@@ -12,16 +12,11 @@
 ?>
 
 <?lua
-  --include("templates/spaceshipPirate.oxt")
   include("templates/OrxoKartKart.oxt")
   include("overlays/OrxoKartHUD.oxo")
 ?>
 
 <?lua
-MAZE_NUM_CELLS = 10
-MAZE_CELL_SIZE = 100
-MAZE_CELL_HEIGHT = 30
-MAZE_SIZE = MAZE_NUM_CELLS*MAZE_CELL_SIZE
 --number of tiles
 N = 11
 --scaling factor
@@ -47,57 +42,18 @@
 
     <StaticEntity position="0,0,0" collisionType="static">
       <attached>
-        <!-- Walls and flags (physics and design)-->
-        <!--
-        <HoverOrigin
-        -->
+        <!-- Floor Physique and Design -->
         <OrxoKartOrigin
-
           numCells="<?lua print(N)?>"
           cellSize="<?lua print(S)?>"
-          cellHeight="<?lua print(MAZE_CELL_HEIGHT)?>"
         />
-        
+      </attached> 
 
-        <!-- floor design -->
-        <!--
-        <Model
-          position="<?lua print((N-1)*S/2)?>,0,<?lua print((N-1)*S/2)?>"
-
-          scale3D="<?lua print(S)?>,8,<?lua print(S)?>"
-          mesh="teststrecke.mesh"
-        />
-      -->
-        
-      </attached> 
       <collisionShapes>
-        <!-- roof physics -->
-        <!--
-        <BoxCollisionShape
-          position="<?lua print(MAZE_SIZE/2)?>,<?lua print(MAZE_CELL_HEIGHT+1)?>,<?lua print(MAZE_SIZE/2)?>"
-          halfExtents="<?lua print(MAZE_SIZE/2)?>,1,<?lua print(MAZE_SIZE/2)?>"
-        />
-      -->
-        <!-- floor physics -->
-
-
-
-
-
-
-
-
-        <!--
-        <BoxCollisionShape
-          position="<?lua print((N-1)*S/2)?>,-1,<?lua print((N-1)*S/2)?>"
-          halfExtents="<?lua print(S*N/2)?>,1,<?lua print(S*N/2)?>"
-        />  
-
-      -->
+        <!-- in case of additional collisionShapes besides the floor -->
       </collisionShapes>
 
     </StaticEntity>
-
     <Light
       type=directional
       position="-50,500,-50"

Modified: code/branches/OrxoKart_HS18/src/modules/orxokart/OrxoKart.cc
===================================================================
--- code/branches/OrxoKart_HS18/src/modules/orxokart/OrxoKart.cc	2018-11-07 10:42:26 UTC (rev 12089)
+++ code/branches/OrxoKart_HS18/src/modules/orxokart/OrxoKart.cc	2018-11-07 10:52:40 UTC (rev 12090)
@@ -62,7 +62,6 @@
 
             int n = this->origin_->getNumCells();
             int s = this->origin_->getCellSize();
-            int cellHeight = this->origin_->getCellHeight();
 
             int levelcodeArray[] =  {1,1,1,1,1,1,1,1,0,0,0
                                     ,1,0,0,0,0,0,0,1,1,1,0
@@ -75,7 +74,6 @@
                                     ,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,2,1,1,1};
-            int* levelcode = levelcodeArray;
 
 
             //Generate floor according to levelcode

Modified: code/branches/OrxoKart_HS18/src/modules/orxokart/OrxoKartOrigin.cc
===================================================================
--- code/branches/OrxoKart_HS18/src/modules/orxokart/OrxoKartOrigin.cc	2018-11-07 10:42:26 UTC (rev 12089)
+++ code/branches/OrxoKart_HS18/src/modules/orxokart/OrxoKartOrigin.cc	2018-11-07 10:52:40 UTC (rev 12090)
@@ -52,7 +52,6 @@
 
         XMLPortParam(OrxoKartOrigin, "numCells", setNumCells, getNumCells, xmlelement, mode);
         XMLPortParam(OrxoKartOrigin, "cellSize", setCellSize, getCellSize, xmlelement, mode);
-        XMLPortParam(OrxoKartOrigin, "cellHeight", setCellHeight, getCellHeight, xmlelement, mode);
     }
 
     void OrxoKartOrigin::checkGametype()

Modified: code/branches/OrxoKart_HS18/src/modules/orxokart/OrxoKartOrigin.h
===================================================================
--- code/branches/OrxoKart_HS18/src/modules/orxokart/OrxoKartOrigin.h	2018-11-07 10:42:26 UTC (rev 12089)
+++ code/branches/OrxoKart_HS18/src/modules/orxokart/OrxoKartOrigin.h	2018-11-07 10:52:40 UTC (rev 12090)
@@ -60,17 +60,11 @@
             inline int getCellSize() const
                 { return this->cellSize_; }
 
-            inline void setCellHeight(int cellHeight)
-                { this->cellHeight_ = cellHeight; }
-            inline int getCellHeight() const
-                { return this->cellHeight_; }
-
         private:
             void checkGametype();
        
             int numCells_;
             int cellSize_;
-            int cellHeight_;
     };
 }
 

Modified: code/branches/OrxoKart_HS18/src/modules/orxokart/OrxoKartTile.cc
===================================================================
--- code/branches/OrxoKart_HS18/src/modules/orxokart/OrxoKartTile.cc	2018-11-07 10:42:26 UTC (rev 12089)
+++ code/branches/OrxoKart_HS18/src/modules/orxokart/OrxoKartTile.cc	2018-11-07 10:52:40 UTC (rev 12090)
@@ -72,18 +72,17 @@
     @brief
         Initializes a OrxoKartTile
     @param x
-        x-Coordinate of the Square that the Wall is attached to, 0-9, Origin is Bottom left
+        x-Coordinate of the center of the Tile
     @param y
-        y-Coordinate of the Square that the Wall is attached to, 0-9, Origin is Bottom left
-    @param cellSize
-        The size of a cell
-    @param cellHeight
-        The height of a cell
-    @param orientation
-            Wall on the right side (1) or on top (2) of this square, 0-1        
+        z-Coordinate of the center of the Tile
+    @param s
+        scaling factor of the map
+    @param type
+        type of tile. 1 for normal tile, 2 for Start/End tile      
     */
     void OrxoKartTile::init(int x, int z, int s, int type)
     {
+        // floor design according to its type
         model_ = new Model(this->getContext());
         if (type == 1) {
            model_->setMeshSource("OrxoKartStreckenabschnitt.mesh"); 
@@ -96,42 +95,12 @@
 
         this->attach(model_);
 
+
+        //floor physics
         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_;
-
-        if(orientation == 1){
-            xSize_ = cellSize/2;
-            zSize_ = 2;
-            zPos_ = x*cellSize;
-            xPos_ = y*cellSize-cellSize/2;
-        }
-        else{
-            xSize_ = 2;
-            zSize_ = cellSize/2;
-            zPos_ = x*cellSize-cellSize/2;
-            xPos_ = y*cellSize;
-        }
-
-
-        model_ = new Model(this->getContext());
-        model_->setMeshSource("CuboidBody.mesh");
-        model_->setScale3D(Vector3(xSize_*1.0f, cellHeight*1.0f, zSize_*1.0f));
-        model_->setPosition(Vector3(xPos_*1.0f, 0.0f, zPos_*1.0f));
-
-        this->attach(model_);
-
-        cs_ = new BoxCollisionShape(this->getContext());
-        cs_->setHalfExtents(Vector3(xSize_*1.0f, cellHeight*1.0f, zSize_*1.0f));
-        cs_->setPosition(Vector3(xPos_*1.0f, 0.0f, zPos_*1.0f));
-
-        this->attachCollisionShape(cs_);
-        */
     }
 }



More information about the Orxonox-commit mailing list