Changeset 12090 for code/branches/OrxoKart_HS18/src/modules
- Timestamp:
- Nov 7, 2018, 11:52:40 AM (6 years ago)
- Location:
- code/branches/OrxoKart_HS18/src/modules/orxokart
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/OrxoKart_HS18/src/modules/orxokart/OrxoKart.cc
r12089 r12090 63 63 int n = this->origin_->getNumCells(); 64 64 int s = this->origin_->getCellSize(); 65 int cellHeight = this->origin_->getCellHeight();66 65 67 66 int levelcodeArray[] = {1,1,1,1,1,1,1,1,0,0,0 … … 76 75 ,0,0,0,0,1,0,0,0,0,0,1 77 76 ,0,0,0,0,1,1,1,2,1,1,1}; 78 int* levelcode = levelcodeArray;79 77 80 78 -
code/branches/OrxoKart_HS18/src/modules/orxokart/OrxoKartOrigin.cc
r12074 r12090 53 53 XMLPortParam(OrxoKartOrigin, "numCells", setNumCells, getNumCells, xmlelement, mode); 54 54 XMLPortParam(OrxoKartOrigin, "cellSize", setCellSize, getCellSize, xmlelement, mode); 55 XMLPortParam(OrxoKartOrigin, "cellHeight", setCellHeight, getCellHeight, xmlelement, mode);56 55 } 57 56 -
code/branches/OrxoKart_HS18/src/modules/orxokart/OrxoKartOrigin.h
r12074 r12090 61 61 { return this->cellSize_; } 62 62 63 inline void setCellHeight(int cellHeight)64 { this->cellHeight_ = cellHeight; }65 inline int getCellHeight() const66 { return this->cellHeight_; }67 68 63 private: 69 64 void checkGametype(); … … 71 66 int numCells_; 72 67 int cellSize_; 73 int cellHeight_;74 68 }; 75 69 } -
code/branches/OrxoKart_HS18/src/modules/orxokart/OrxoKartTile.cc
r12089 r12090 73 73 Initializes a OrxoKartTile 74 74 @param x 75 x-Coordinate of the Square that the Wall is attached to, 0-9, Origin is Bottom left75 x-Coordinate of the center of the Tile 76 76 @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 84 82 */ 85 83 void OrxoKartTile::init(int x, int z, int s, int type) 86 84 { 85 // floor design according to its type 87 86 model_ = new Model(this->getContext()); 88 87 if (type == 1) { … … 97 96 this->attach(model_); 98 97 98 99 //floor physics 99 100 cs_ = new BoxCollisionShape(this->getContext()); 100 101 cs_->setHalfExtents(Vector3(s/2.0f, 1.0f, s/2.0f)); … … 102 103 103 104 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 */136 105 } 137 106 }
Note: See TracChangeset
for help on using the changeset viewer.