Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4005 in orxonox.OLD for orxonox/branches/ll2trunktemp


Ignore:
Timestamp:
Apr 28, 2005, 8:24:43 PM (20 years ago)
Author:
bensch
Message:

orxonox/branches/ll2trunktemp: tested loading of a different WorldEntity (SkyBox) and it works.

Location:
orxonox/branches/ll2trunktemp/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • orxonox/branches/ll2trunktemp/src/factory.h

    r4004 r4005  
    1515    this should be used at the beginning of all the Classes that should be loadable (in the cc-file)
    1616*/
    17 #define CREATE_FACTORY(x) tFactory<x>* global_ ## x ## Factory = new tFactory<x>(#x);
     17#define CREATE_FACTORY(x) tFactory<x>* global_ ## x ## Factory = new tFactory<x>(#x)
    1818
    1919
  • orxonox/branches/ll2trunktemp/src/story_entities/world.cc

    r4004 r4005  
    158158      this->setPath( name);
    159159    }
    160        
    161   this->localPlayer = NULL;
    162 
    163160}
    164161
     
    333330          //todo do this more elegant
    334331          if( element->Value() != NULL && !strcmp( element->Value(), "Player")) localPlayer = (Player*) created;
     332          if( element->Value() != NULL && !strcmp( element->Value(), "SkyBox")) skyBox = (SkyBox*) created;
    335333          element = element->NextSiblingElement();
    336334        }
     
    456454  lightMan->debug();
    457455  lightMan->setPosition(-5.0, 10.0, -40.0);
    458  
    459  
    460   // Create SkySphere
    461   this->skySphere = new Skysphere("../data/pictures/sky-replace.jpg");
    462   this->skySphere->setName("SkySphere");
    463   this->localCamera->addChild(this->skySphere);
    464   spawn(skySphere);
    465  
    466456 
    467457  //        trackManager->setBindSlave(env);
  • orxonox/branches/ll2trunktemp/src/world_entities/skybox.cc

    r3913 r4005  
    2828
    2929#include "skybox.h"
     30
    3031#include "stdincl.h"
     32#include "factory.h"
    3133
    3234#include "material.h"
     
    3638//#include "world_entity.h"
    3739
     40CREATE_FACTORY(SkyBox);
    3841
    3942using namespace std;
     
    4447*/
    4548SkyBox::SkyBox(char* fileName)
     49{
     50  this->init();
     51}
     52
     53SkyBox::SkyBox(TiXmlElement* root) : WorldEntity(root)
     54{
     55  this->init();
     56
     57  // Name Setup
     58  char* temp;
     59  const char* string;
     60
     61  // Model Loading     
     62  this->model = NULL;
     63  string = grabParameter( root, "materialset");
     64  if( string != NULL)
     65    this->setTexture(string, "jpg");
     66  else
     67    {
     68      PRINTF(0)("SkyBox is missing a proper 'MaterialSet'\n");
     69      this->model = (Model*)ResourceManager::getInstance()->load("cube", OBJ, RP_CAMPAIGN);
     70    }
     71  if( this->model == NULL)
     72    {
     73      PRINTF(0)("SkyBox model '%s' could not be loaded\n", string);
     74    }
     75}
     76
     77void SkyBox::init(void)
    4678{
    4779  this->setClassName("SkyBox");
  • orxonox/branches/ll2trunktemp/src/world_entities/skybox.h

    r3807 r4005  
    2222 public:
    2323  SkyBox(char* fileName = NULL);
     24  SkyBox(TiXmlElement* root);
     25
    2426  virtual ~SkyBox();
     27
     28  void init(void);
    2529
    2630  void setSize(float size);
Note: See TracChangeset for help on using the changeset viewer.