Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3566 in orxonox.OLD for orxonox/trunk


Ignore:
Timestamp:
Mar 15, 2005, 11:22:51 PM (20 years ago)
Author:
bensch
Message:

orxonox/trunk: updated the terrain class to more functionality
view goes farther 2000 instead of 250
model gets deleted by world_entity instead of childs

Location:
orxonox/trunk/src
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/camera.cc

    r3551 r3566  
    201201  // TO DO: implement options for frustum generation
    202202  //glFrustum(-1.0, 1.0, -1.0, 1.0, 1.5, 250.0);
    203   gluPerspective(60, 1.2f, 0.1, 250);
     203  gluPerspective(60, 1.2f, 0.1, 2000);
    204204 
    205205  //Vector up(0,0,1);
  • orxonox/trunk/src/story_entities/world.cc

    r3565 r3566  
    6969  cn->reset();
    7070
    71   //delete this->localCamera;
    7271  delete this->nullParent;
    7372  delete this->entities;
    74   //delete this->skySphere;
    75 
    76   //delete this->trackManager;
     73
     74  delete this->trackManager;
     75
    7776
    7877  /*
     
    173172      this->glmis->step();
    174173
    175       /*
    176         tmpCurve->addNode(Vector(10,  -1,  -1));
    177         tmpCurve->addNode(Vector(10,  -2,   2));
    178         tmpCurve->addNode(Vector(10,   3,   3));
    179         tmpCurve->addNode(Vector(10,   4,  -4), 0);
    180         tmpCurve->addNode(Vector(10,  -1,  -1));
    181         tmpCurve->addNode(Vector(10,  -2,   2));
    182         tmpCurve->addNode(Vector(10,   3,   3));
    183         tmpCurve->addNode(Vector(10,   4,  -4), 0);
    184         tmpCurve->debug();
    185       */
    186174      switch(this->debugWorldNr)
    187175        {
     
    306294  glEndList();
    307295
    308   terrain = new Terrain(TERRAIN_DAVE);
     296  terrain = new Terrain("nGround.obj");
     297  terrain->setRelCoor(&Vector(0,-10,0));
    309298  this->spawn(terrain);
    310299  // LIGHT initialisation
     
    334323  cn->enable(true);
    335324
    336   //glMap1f (GL_MAP1_VERTEX_3, 0.0, 1.0, 3, 4, &ctrlpoints[0][0]);
    337   //glEnable (GL_MAP1_VERTEX_3);
    338  
    339   //theNurb = gluNewNurbsRenderer ();
    340   //gluNurbsProperty (theNurb, GLU_NURBS_MODE, GLU_NURBS_TESSELLATOR);
    341   //gluNurbsProperty (theNurb, GLU_NURBS_VERTEX, vertexCallback );
    342 
    343325}
    344326
     
    387369ErrorMessage World::destroy()
    388370{
    389   delete trackManager;
     371
    390372}
    391373
  • orxonox/trunk/src/world_entities/environment.cc

    r3526 r3566  
    3636Environment::~Environment ()
    3737{
    38   delete this->model;
     38
    3939}
    4040
  • orxonox/trunk/src/world_entities/player.cc

    r3544 r3566  
    3737Player::~Player ()
    3838{
    39   delete this->model;
     39
    4040}
    4141
  • orxonox/trunk/src/world_entities/primitive.cc

    r3544 r3566  
    3636Primitive::~Primitive ()
    3737{
    38   delete this->model;
     38
    3939}
    4040
  • orxonox/trunk/src/world_entities/skysphere.cc

    r3559 r3566  
    7171  this->sphereObj = gluNewQuadric();
    7272  gluQuadricTexture(this->sphereObj, GL_TRUE);
    73   this->setRadius(220.0);
     73  this->setRadius(1900.0);
    7474
    7575  this->skyMaterial = new Material("Sky");
  • orxonox/trunk/src/world_entities/terrain.cc

    r3565 r3566  
    3232
    3333/**
     34   \brief Constructor for loading a Terrain out of a file
     35   \param fileName The file to load data from.
     36 
     37   this either loads out of an OBJ-file, or loads a heightmap if no .obj-extension is found.
     38*/
     39Terrain::Terrain(char* fileName)
     40{
     41  this->init();
     42
     43  if (strstr(fileName, ".obj") || strstr(fileName, ".OBJ"))
     44    {
     45      this->model = (OBJModel*)new OBJModel(fileName);
     46    }
     47  else
     48    {
     49      // load the hightMap here.
     50    }
     51}
     52
     53/**
    3454   \brief a Constructor for the Debug-Worlds
    3555
     
    4262}
    4363
    44 
    4564/**
    4665   \brief standard deconstructor
     
    5776{
    5877   this->setClassName ("Terrain");
     78
    5979   this->objectList = 0;
    6080}
     81
    6182
    6283
     
    7596  glMultMatrixf((float*)matrix);
    7697
    77   glCallList(objectList);
     98  if (objectList)
     99    glCallList(objectList);
     100  else if (model)
     101    model->draw();
    78102  //  this->model->draw();
    79103  glPopMatrix();
  • orxonox/trunk/src/world_entities/terrain.h

    r3564 r3566  
    2525 public:
    2626  Terrain();
     27  Terrain(char* fileName);
    2728  Terrain(DebugTerrain debugTerrain);
    2829  virtual ~Terrain();
     
    3334
    3435 private:
    35 
    3636  int objectList;
    3737};
  • orxonox/trunk/src/world_entities/world_entity.cc

    r3564 r3566  
    4848{
    4949  // if( collisioncluster != NULL) delete collisioncluster;
    50 
     50  delete this->model;
    5151}
    5252
  • orxonox/trunk/src/world_entities/world_entity.h

    r3564 r3566  
    99#include "stdincl.h"
    1010#include "p_node.h"
    11 #include "model.h"
     11#include "objModel.h"
    1212
    1313//class CollisionCluster;
    14 class OBJModel;
    1514
    1615//! Basic class from which all interactive stuff in the world is derived from
Note: See TracChangeset for help on using the changeset viewer.