Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 7, 2018, 11:52:40 AM (6 years ago)
Author:
ottka
Message:

clean up of module :)

Location:
code/branches/OrxoKart_HS18
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • code/branches/OrxoKart_HS18/data/levels/OrxoKart1.oxw

    r12089 r12090  
    1313
    1414<?lua
    15   --include("templates/spaceshipPirate.oxt")
    1615  include("templates/OrxoKartKart.oxt")
    1716  include("overlays/OrxoKartHUD.oxo")
     
    1918
    2019<?lua
    21 MAZE_NUM_CELLS = 10
    22 MAZE_CELL_SIZE = 100
    23 MAZE_CELL_HEIGHT = 30
    24 MAZE_SIZE = MAZE_NUM_CELLS*MAZE_CELL_SIZE
    2520--number of tiles
    2621N = 11
     
    4843    <StaticEntity position="0,0,0" collisionType="static">
    4944      <attached>
    50         <!-- Walls and flags (physics and design)-->
    51         <!--
    52         <HoverOrigin
    53         -->
     45        <!-- Floor Physique and Design -->
    5446        <OrxoKartOrigin
    55 
    5647          numCells="<?lua print(N)?>"
    5748          cellSize="<?lua print(S)?>"
    58           cellHeight="<?lua print(MAZE_CELL_HEIGHT)?>"
    5949        />
    60        
     50      </attached>
    6151
    62         <!-- floor design -->
    63         <!--
    64         <Model
    65           position="<?lua print((N-1)*S/2)?>,0,<?lua print((N-1)*S/2)?>"
    66 
    67           scale3D="<?lua print(S)?>,8,<?lua print(S)?>"
    68           mesh="teststrecke.mesh"
    69         />
    70       -->
    71        
    72       </attached>
    7352      <collisionShapes>
    74         <!-- roof physics -->
    75         <!--
    76         <BoxCollisionShape
    77           position="<?lua print(MAZE_SIZE/2)?>,<?lua print(MAZE_CELL_HEIGHT+1)?>,<?lua print(MAZE_SIZE/2)?>"
    78           halfExtents="<?lua print(MAZE_SIZE/2)?>,1,<?lua print(MAZE_SIZE/2)?>"
    79         />
    80       -->
    81         <!-- floor physics -->
    82 
    83 
    84 
    85 
    86 
    87 
    88 
    89 
    90         <!--
    91         <BoxCollisionShape
    92           position="<?lua print((N-1)*S/2)?>,-1,<?lua print((N-1)*S/2)?>"
    93           halfExtents="<?lua print(S*N/2)?>,1,<?lua print(S*N/2)?>"
    94         /> 
    95 
    96       -->
     53        <!-- in case of additional collisionShapes besides the floor -->
    9754      </collisionShapes>
    9855
    9956    </StaticEntity>
    100 
    10157    <Light
    10258      type=directional
  • code/branches/OrxoKart_HS18/src/modules/orxokart/OrxoKart.cc

    r12089 r12090  
    6363            int n = this->origin_->getNumCells();
    6464            int s = this->origin_->getCellSize();
    65             int cellHeight = this->origin_->getCellHeight();
    6665
    6766            int levelcodeArray[] =  {1,1,1,1,1,1,1,1,0,0,0
     
    7675                                    ,0,0,0,0,1,0,0,0,0,0,1
    7776                                    ,0,0,0,0,1,1,1,2,1,1,1};
    78             int* levelcode = levelcodeArray;
    7977
    8078
  • code/branches/OrxoKart_HS18/src/modules/orxokart/OrxoKartOrigin.cc

    r12074 r12090  
    5353        XMLPortParam(OrxoKartOrigin, "numCells", setNumCells, getNumCells, xmlelement, mode);
    5454        XMLPortParam(OrxoKartOrigin, "cellSize", setCellSize, getCellSize, xmlelement, mode);
    55         XMLPortParam(OrxoKartOrigin, "cellHeight", setCellHeight, getCellHeight, xmlelement, mode);
    5655    }
    5756
  • code/branches/OrxoKart_HS18/src/modules/orxokart/OrxoKartOrigin.h

    r12074 r12090  
    6161                { return this->cellSize_; }
    6262
    63             inline void setCellHeight(int cellHeight)
    64                 { this->cellHeight_ = cellHeight; }
    65             inline int getCellHeight() const
    66                 { return this->cellHeight_; }
    67 
    6863        private:
    6964            void checkGametype();
     
    7166            int numCells_;
    7267            int cellSize_;
    73             int cellHeight_;
    7468    };
    7569}
  • code/branches/OrxoKart_HS18/src/modules/orxokart/OrxoKartTile.cc

    r12089 r12090  
    7373        Initializes a OrxoKartTile
    7474    @param x
    75         x-Coordinate of the Square that the Wall is attached to, 0-9, Origin is Bottom left
     75        x-Coordinate of the center of the Tile
    7676    @param y
    77         y-Coordinate of the Square that the Wall is attached to, 0-9, Origin is Bottom left
    78     @param cellSize
    79         The size of a cell
    80     @param cellHeight
    81         The height of a cell
    82     @param orientation
    83             Wall on the right side (1) or on top (2) of this square, 0-1       
     77        z-Coordinate of the center of the Tile
     78    @param s
     79        scaling factor of the map
     80    @param type
     81        type of tile. 1 for normal tile, 2 for Start/End tile     
    8482    */
    8583    void OrxoKartTile::init(int x, int z, int s, int type)
    8684    {
     85        // floor design according to its type
    8786        model_ = new Model(this->getContext());
    8887        if (type == 1) {
     
    9796        this->attach(model_);
    9897
     98
     99        //floor physics
    99100        cs_ = new BoxCollisionShape(this->getContext());
    100101        cs_->setHalfExtents(Vector3(s/2.0f, 1.0f, s/2.0f));
     
    102103
    103104        this->attachCollisionShape(cs_);
    104 
    105         /*
    106 
    107         int xSize_, zSize_, xPos_, zPos_;
    108 
    109         if(orientation == 1){
    110             xSize_ = cellSize/2;
    111             zSize_ = 2;
    112             zPos_ = x*cellSize;
    113             xPos_ = y*cellSize-cellSize/2;
    114         }
    115         else{
    116             xSize_ = 2;
    117             zSize_ = cellSize/2;
    118             zPos_ = x*cellSize-cellSize/2;
    119             xPos_ = y*cellSize;
    120         }
    121 
    122 
    123         model_ = new Model(this->getContext());
    124         model_->setMeshSource("CuboidBody.mesh");
    125         model_->setScale3D(Vector3(xSize_*1.0f, cellHeight*1.0f, zSize_*1.0f));
    126         model_->setPosition(Vector3(xPos_*1.0f, 0.0f, zPos_*1.0f));
    127 
    128         this->attach(model_);
    129 
    130         cs_ = new BoxCollisionShape(this->getContext());
    131         cs_->setHalfExtents(Vector3(xSize_*1.0f, cellHeight*1.0f, zSize_*1.0f));
    132         cs_->setPosition(Vector3(xPos_*1.0f, 0.0f, zPos_*1.0f));
    133 
    134         this->attachCollisionShape(cs_);
    135         */
    136105    }
    137106}
Note: See TracChangeset for help on using the changeset viewer.