Last change
on this file since 562 was
560,
checked in by landauf, 17 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
|
Rev | Line | |
---|
[515] | 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" |
---|
[560] | 8 | #include "../core/Debug.h" |
---|
[515] | 9 | |
---|
| 10 | #include "SceneNode.h" |
---|
| 11 | |
---|
| 12 | namespace 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(); |
---|
[560] | 28 | |
---|
[515] | 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 | |
---|
[560] | 39 | |
---|
[515] | 40 | mgr->getRootSceneNode()->createChildSceneNode(name, Vector3(x,y,z)); |
---|
[560] | 41 | |
---|
| 42 | COUT(4) << "Loader: Created node "<< name <<" : "<<x<<" " << y << " " << z << std::endl << std::endl; |
---|
| 43 | } |
---|
[515] | 44 | } |
---|
| 45 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.