Changeset 5940 in orxonox.OLD for branches/height_map1/src/world_entities
- Timestamp:
- Dec 6, 2005, 8:04:48 PM (19 years ago)
- Location:
- branches/height_map1
- Files:
-
- 2 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/height_map1/src/world_entities/player.cc
r5767 r5940 282 282 //orthDirection = orthDirection.cross (direction); 283 283 284 if( this->bUp && this->getRelCoor().x < 20)284 if( this->bUp ) 285 285 accel += direction; 286 if( this->bDown && this->getRelCoor().x > -5)286 if( this->bDown ) 287 287 accel -= direction; 288 288 289 if( this->bLeft && TrackManager::getInstance()->getWidth() > -this->getRelCoor().z*2)289 if( this->bLeft ) 290 290 { 291 291 accel -=(orthDirection); … … 293 293 rotVal -= .4; 294 294 } 295 if( this->bRight && TrackManager::getInstance()->getWidth() > this->getRelCoor().z*2)295 if( this->bRight ) 296 296 { 297 297 accel += orthDirection; -
branches/height_map1/src/world_entities/terrain.cc
r5750 r5940 24 24 #include "resource_manager.h" 25 25 #include "model.h" 26 26 #include "height_map.h" 27 27 #include "glincl.h" 28 28 29 29 30 using namespace std; … … 36 37 Terrain::Terrain (const TiXmlElement* root) 37 38 { 39 38 40 this->init(); 39 this->loadParams(root); 40 41 // if (this->model != NULL) 42 //this->ssp = new SpatialSeparation((AbstractModel*)this->model, 10.0f); 41 42 // this->loadParams(root); 43 44 HeightMap * hm = new HeightMap(); 45 hm->load(); 46 this->model=hm; 47 48 /* this->model = new HeightMap(); 49 this->model->setName("HardCore"); 50 this->model->addVertex (-0.5, -0.5, 0.5); 51 this->model->addVertex (0.5, -0.5, 0.5); 52 this->model->addVertex (-0.5, 0.5, 0.5); 53 this->model->addVertex (0.5, 0.5, 0.5); 54 this->model->addVertex (-0.5, 0.5, -0.5); 55 this->model->addVertex (0.5, 0.5, -0.5); 56 this->model->addVertex (-0.5, -0.5, -0.5); 57 this->model->addVertex (0.5, -0.5, -0.5); 58 59 this->model->addVertexTexture (0.0, 0.0); 60 this->model->addVertexTexture (1.0, 0.0); 61 this->model->addVertexTexture (0.0, 1.0); 62 this->model->addVertexTexture (1.0, 1.0); 63 this->model->addVertexTexture (0.0, 2.0); 64 this->model->addVertexTexture (1.0, 2.0); 65 this->model->addVertexTexture (0.0, 3.0); 66 this->model->addVertexTexture (1.0, 3.0); 67 this->model->addVertexTexture (0.0, 4.0); 68 this->model->addVertexTexture (1.0, 4.0); 69 this->model->addVertexTexture (2.0, 0.0); 70 this->model->addVertexTexture (2.0, 1.0); 71 this->model->addVertexTexture (-1.0, 0.0); 72 this->model->addVertexTexture (-1.0, 1.0); 73 74 this->model->addVertexNormal (0.0, 0.0, 1.0); 75 this->model->addVertexNormal (0.0, 0.0, 1.0); 76 this->model->addVertexNormal (0.0, 0.0, 1.0); 77 this->model->addVertexNormal (0.0, 0.0, 1.0); 78 this->model->addVertexNormal (0.0, 1.0, 0.0); 79 this->model->addVertexNormal (0.0, 1.0, 0.0); 80 this->model->addVertexNormal (0.0, 1.0, 0.0); 81 this->model->addVertexNormal (0.0, 1.0, 0.0); 82 this->model->addVertexNormal (0.0, 0.0, -1.0); 83 this->model->addVertexNormal (0.0, 0.0, -1.0); 84 this->model->addVertexNormal (0.0, 0.0, -1.0); 85 this->model->addVertexNormal (0.0, 0.0, -1.0); 86 this->model->addVertexNormal (0.0, -1.0, 0.0); 87 this->model->addVertexNormal (0.0, -1.0, 0.0); 88 this->model->addVertexNormal (0.0, -1.0, 0.0); 89 this->model->addVertexNormal (0.0, -1.0, 0.0); 90 this->model->addVertexNormal (1.0, 0.0, 0.0); 91 this->model->addVertexNormal (1.0, 0.0, 0.0); 92 this->model->addVertexNormal (1.0, 0.0, 0.0); 93 this->model->addVertexNormal (1.0, 0.0, 0.0); 94 this->model->addVertexNormal (-1.0, 0.0, 0.0); 95 this->model->addVertexNormal (-1.0, 0.0, 0.0); 96 this->model->addVertexNormal (-1.0, 0.0, 0.0); 97 this->model->addVertexNormal (-1.0, 0.0, 0.0); 98 99 this->model->addFace (4, VERTEX_TEXCOORD_NORMAL, 0,0,0, 1,1,1, 3,3,2, 2,2,3); 100 this->model->addFace (4, VERTEX_TEXCOORD_NORMAL, 2,2,4, 3,3,5, 5,5,6, 4,4,7); 101 this->model->addFace (4, VERTEX_TEXCOORD_NORMAL, 4,4,8, 5,5,9, 7,7,10, 6,6,11); 102 this->model->addFace (4, VERTEX_TEXCOORD_NORMAL, 6,6,12, 7,7,13, 1,9,14, 0,8,15); 103 this->model->addFace (4, VERTEX_TEXCOORD_NORMAL, 1,1,16, 7,10,17, 5,11,18, 3,3,19); 104 this->model->addFace (4, VERTEX_TEXCOORD_NORMAL, 6,12,20, 0,0,21, 2,2,22, 4,13,23); 105 106 this->model->finalize(); */ 107 108 /*if (this->model != NULL) 109 this->ssp = new SpatialSeparation((AbstractModel*)this->model, 10.0f);*/ 43 110 } 44 111 … … 56 123 if (!strstr(fileName, ".obj") || !strstr(fileName, ".OBJ") ) 57 124 { 58 this->loadModel(fileName); 125 this->model = NULL; 126 //this->loadModel(fileName); 59 127 } 60 128 else … … 135 203 Vector tmpRot = this->getAbsDir().getSpacialAxis(); 136 204 glRotatef (this->getAbsDir().getSpacialAxisAngle(), tmpRot.x, tmpRot.y, tmpRot.z ); 137 205 this->model->draw(); 138 206 if (this->objectList) 139 207 glCallList(this->objectList); … … 145 213 146 214 /* THIS IS ONLY FOR DEBUGGING INFORMATION */ 147 if (this->ssp != NULL)148 this->ssp->drawQuadtree();215 // if (this->ssp != NULL) 216 // this->ssp->drawQuadtree(); 149 217 } 150 218
Note: See TracChangeset
for help on using the changeset viewer.