Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/FICN/src/orxonox/objects/SceneNode.cc @ 567

Last change on this file since 567 was 560, checked in by landauf, 16 years ago
  • changed output from std::cout to COUT(level)
  • added SoftDebugLevel config-variable (its a hack, but it works fine)
File size: 1.1 KB
Line 
1#include <OgreSceneManager.h>
2#include <string>
3
4#include "../orxonox.h"
5#include "../../tinyxml/tinyxml.h"
6#include "../../misc/Tokenizer.h"
7#include "../../misc/String2Number.h"
8#include "../core/Debug.h"
9
10#include "SceneNode.h"
11
12namespace orxonox
13{
14    CreateFactory(SceneNode);
15
16    SceneNode::SceneNode()
17    {
18        RegisterObject(SceneNode);
19    }
20
21    SceneNode::~SceneNode()
22    {
23    }
24
25    void SceneNode::loadParams(TiXmlElement* xmlElem)
26    {
27        Ogre::SceneManager* mgr = orxonox::Orxonox::getSingleton()->getSceneManager();
28
29        if (xmlElem->Attribute("name") && xmlElem->Attribute("pos"))
30        {
31                std::string name = xmlElem->Attribute("name");
32
33                std::vector<std::string> pos = tokenize(xmlElem->Attribute("pos"),",");
34                float x, y, z;
35                String2Number<float>(x, pos[0]);
36                String2Number<float>(y, pos[1]);
37                String2Number<float>(z, pos[2]);
38
39
40                mgr->getRootSceneNode()->createChildSceneNode(name, Vector3(x,y,z));
41
42                COUT(4) << "Loader: Created node "<< name <<" : "<<x<<" " << y << " " << z  << std::endl << std::endl;
43        }
44   }
45}
Note: See TracBrowser for help on using the repository browser.