Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

Last change on this file since 630 was 630, checked in by scheusso, 16 years ago

made Model and WorldEntity synchronisable

File size: 961 bytes
Line 
1#include <string>
2
3#include "Model.h"
4#include "../core/CoreIncludes.h"
5#include "../Orxonox.h"
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        registerAllVariables();
18    }
19
20    Model::~Model()
21    {
22    }
23
24    void Model::loadParams(TiXmlElement* xmlElem)
25    {
26        WorldEntity::loadParams(xmlElem);
27
28        if (xmlElem->Attribute("mesh"))
29        {
30            meshSrc_ = xmlElem->Attribute("mesh");
31        }
32    }
33   
34    bool Model::create(){
35      this->mesh_.setMesh(meshSrc_);
36      this->attachObject(this->mesh_.getEntity());
37
38      COUT(4) << "Loader: Created model" << std::endl;
39      return true;
40    }
41   
42    void Model::registerAllVariables(){
43      registerVar(&meshSrc_, meshSrc_.length()+1, network::STRING);
44    }
45}
Note: See TracBrowser for help on using the repository browser.