Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4607 in orxonox.OLD for orxonox/trunk/src


Ignore:
Timestamp:
Jun 12, 2005, 7:12:40 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: loading Terrain via XML

Location:
orxonox/trunk/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/story_entities/world.cc

    r4600 r4607  
    396396          if( element->Value() != NULL && !strcmp( element->Value(), "Player")) localPlayer = (Player*) created;
    397397          if( element->Value() != NULL && !strcmp( element->Value(), "SkyBox")) sky = (SkyBox*) created;
     398          if( element->Value() != NULL && !strcmp( element->Value(), "Terrain")) terrain = (Terrain*) created;
    398399          element = element->NextSiblingElement();
    399400          glmis->step(); //! \todo temporary
     
    444445  //  lightMan->setDiffuseColor(0,0,0);
    445446  //lightMan->debug();
    446   lightMan->setPosition(-5.0, 10.0, -40.0);
     447  lightMan->setPosition(-5.0, 50.0, -40.0);
     448  lightMan->addLight();
     449  lightMan->setPosition(100, 80, 60);
    447450
    448451  //        trackManager->setBindSlave(env);
     
    467470  //trackManager->debug(2);
    468471  glEndList();
    469 
    470   terrain = new Terrain("worlds/newGround.obj");
    471   terrain->setRelCoor(Vector(0,-10,0));
    472   this->spawn(terrain);
    473472
    474473  SoundEngine::getInstance()->setListener(this->localCamera);
  • orxonox/trunk/src/world_entities/terrain.cc

    r4597 r4607  
    1616
    1717#include "terrain.h"
    18 #include "stdincl.h"
     18
    1919#include "model.h"
    2020#include "vector.h"
    2121#include "glincl.h"
    2222
     23#include "factory.h"
     24#include "load_param.h"
     25
    2326using namespace std;
    2427
     28CREATE_FACTORY(Terrain);
    2529
    2630/**
     
    2832
    2933*/
    30 Terrain::Terrain ()
     34Terrain::Terrain (const TiXmlElement* root)
    3135{
    3236  this->init();
     37  this->loadParams(root);
    3338}
    3439
     
    6873
    6974*/
    70 Terrain::~Terrain ()
     75Terrain::~Terrain (void)
    7176{
    7277  if (objectList)
     
    8287}
    8388
    84 
     89void Terrain::loadParams(const TiXmlElement* root)
     90{
     91  static_cast<WorldEntity*>(this)->loadParams(root);
     92
     93  //LoadParam<Terrain>(root, "DebugTerrain",  );
     94
     95
     96}
    8597
    8698void Terrain::draw ()
  • orxonox/trunk/src/world_entities/terrain.h

    r4597 r4607  
    1414
    1515// FORWARD DEFINITION \\
     16class TiXmlElement;
    1617
    1718//! A simple method to call a desired debug world.
     
    2425
    2526 public:
    26   Terrain();
     27  Terrain(const TiXmlElement* root = NULL);
    2728  Terrain(const char* fileName);
    2829  Terrain(DebugTerrain debugTerrain);
    29   virtual ~Terrain();
    30   void init();
     30  virtual ~Terrain(void);
     31
     32  void init(void);
     33  void loadParams(const TiXmlElement* root);
    3134
    3235  void buildDebugTerrain(DebugTerrain debugTerrain);
Note: See TracChangeset for help on using the changeset viewer.