Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5940 in orxonox.OLD for branches/height_map1


Ignore:
Timestamp:
Dec 6, 2005, 8:04:48 PM (19 years ago)
Author:
bottac
Message:
 
Location:
branches/height_map1
Files:
4 edited
1 copied

Legend:

Unmodified
Added
Removed
  • branches/height_map1/src/lib/graphics/importer/Makefile.am

    r5861 r5940  
    1010                           material.cc \
    1111                           texture.cc \
    12                            texture_sequence.cc
     12                           texture_sequence.cc \
     13                           height_map.cc
    1314
    1415
     
    2324                 texture_sequence.h \
    2425                 anorms.h \
    25                  anormtab.h
     26                 anormtab.h \
     27                 height_map.h
  • branches/height_map1/src/story_entities/world.cc

    r5819 r5940  
    380380
    381381  //        TrackManager::getInstance()->setBindSlave(env);
    382   PNode* tn = TrackManager::getInstance()->getTrackNode();
    383   tn->addChild(this->localPlayer);
    384 
     382  //PNode* tn = TrackManager::getInstance()->getTrackNode();
     383  //tn->addChild(this->localPlayer);
     384
     385  PNode* tn = this->localPlayer;
    385386  //localCamera->setParent(TrackNode::getInstance());
    386387  tn->addChild(this->localCamera);
  • branches/height_map1/src/world_entities/player.cc

    r5767 r5940  
    282282  //orthDirection = orthDirection.cross (direction);
    283283
    284   if( this->bUp && this->getRelCoor().x < 20)
     284  if( this->bUp )
    285285    accel += direction;
    286   if( this->bDown && this->getRelCoor().x > -5)
     286  if( this->bDown )
    287287    accel -= direction;
    288288
    289   if( this->bLeft && TrackManager::getInstance()->getWidth() > -this->getRelCoor().z*2)
     289  if( this->bLeft )
    290290  {
    291291    accel -=(orthDirection);
     
    293293    rotVal -= .4;
    294294  }
    295   if( this->bRight && TrackManager::getInstance()->getWidth() > this->getRelCoor().z*2)
     295  if( this->bRight )
    296296  {
    297297    accel += orthDirection;
  • branches/height_map1/src/world_entities/terrain.cc

    r5750 r5940  
    2424#include "resource_manager.h"
    2525#include "model.h"
    26 
     26#include "height_map.h"
    2727#include "glincl.h"
     28
    2829
    2930using namespace std;
     
    3637Terrain::Terrain (const TiXmlElement* root)
    3738{
     39
    3840  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);*/
    43110}
    44111
     
    56123  if (!strstr(fileName, ".obj") || !strstr(fileName, ".OBJ") )
    57124    {
    58       this->loadModel(fileName);
     125      this->model = NULL;
     126        //this->loadModel(fileName);
    59127    }
    60128  else
     
    135203  Vector tmpRot = this->getAbsDir().getSpacialAxis();
    136204  glRotatef (this->getAbsDir().getSpacialAxisAngle(), tmpRot.x, tmpRot.y, tmpRot.z );
    137 
     205  this->model->draw();
    138206  if (this->objectList)
    139207    glCallList(this->objectList);
     
    145213
    146214  /* THIS IS ONLY FOR DEBUGGING INFORMATION */
    147   if (this->ssp != NULL)
    148     this->ssp->drawQuadtree();
     215 // if (this->ssp != NULL)
     216 //   this->ssp->drawQuadtree();
    149217}
    150218
Note: See TracChangeset for help on using the changeset viewer.