Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/FICN/src/orxonox/objects/Model.cc @ 661

Last change on this file since 661 was 646, checked in by landauf, 17 years ago
  • added very bad collision detection (presentation hack :D)
  • added explosions
  • fixed bug in ParticleInterface (it tried to delete SceneManager)

AND:

  • fixed one of the most amazing bugs ever! (the game crashed when I deleted an object through a timer-function. because the timer-functions is called by an iterator, the iterator indirectly delted its object. by overloading the (it++) operator, i was able to solve this problem)
File size: 1019 bytes
RevLine 
[576]1#include <string>
2
3#include "Model.h"
4#include "../core/CoreIncludes.h"
[614]5#include "../Orxonox.h"
[576]6#include "../../tinyxml/tinyxml.h"
7#include "../../misc/Tokenizer.h"
8#include "../../misc/String2Number.h"
9
10namespace orxonox
11{
12    CreateFactory(Model);
13
14    Model::Model()
15    {
16        RegisterObject(Model);
17    }
18
19    Model::~Model()
20    {
21    }
22
23    void Model::loadParams(TiXmlElement* xmlElem)
24    {
[583]25        WorldEntity::loadParams(xmlElem);
[576]26
[622]27        if (xmlElem->Attribute("mesh"))
28        {
[630]29            meshSrc_ = xmlElem->Attribute("mesh");
[586]30        }
[631]31        create();
[630]32    }
[646]33
[630]34    bool Model::create(){
[631]35      if(meshSrc_.compare("")!=0){
36        this->mesh_.setMesh(meshSrc_);
37        this->attachObject(this->mesh_.getEntity());
38        COUT(4) << "Loader: Created model" << std::endl;
39      }
40      registerAllVariables();
[630]41      return true;
[576]42    }
[646]43
[630]44    void Model::registerAllVariables(){
45      registerVar(&meshSrc_, meshSrc_.length()+1, network::STRING);
46    }
[576]47}
Note: See TracBrowser for help on using the repository browser.