Changeset 583 for code/branches/FICN/src/orxonox/objects/WorldEntity.cc
- Timestamp:
- Dec 17, 2007, 4:54:42 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/FICN/src/orxonox/objects/WorldEntity.cc
r580 r583 32 32 #include "../core/CoreIncludes.h" 33 33 #include "../orxonox.h" 34 #include "../../tinyxml/tinyxml.h" 35 #include "../../misc/Tokenizer.h" 36 #include "../../misc/String2Number.h" 34 37 35 38 namespace orxonox … … 50 53 name << (WorldEntity::worldEntityCounter_s++); 51 54 this->setName("WorldEntity" + name.str()); 52 // don't set the node yet!53 55 //node_ = Orxonox::getSingleton()->getSceneManager()->getRootSceneNode()->createChildSceneNode(this->getName()); 54 56 std::cout << "blubbbi: " << this->getName() << " .. " << this->node_ << std::endl; … … 79 81 } 80 82 } 81 82 void WorldEntity::registerAllVariables(){ 83 84 void WorldEntity::loadParams(TiXmlElement* xmlElem) 85 { 86 BaseObject::loadParams(xmlElem); 87 88 std::cout << "1\n"; 89 if (xmlElem->Attribute("name")) 90 { 91 std::cout << "2\n"; 92 this->setName(xmlElem->Attribute("mesh")); 93 } 94 std::cout << "3\n"; 95 if (xmlElem->Attribute("position")) 96 { 97 std::cout << "4\n"; 98 std::vector<std::string> pos = tokenize(xmlElem->Attribute("position"),","); 99 float x, y, z; 100 String2Number<float>(x, pos[0]); 101 String2Number<float>(y, pos[1]); 102 String2Number<float>(z, pos[2]); 103 this->setPosition(x, y, z); 104 } 105 std::cout << "5\n"; 106 if (xmlElem->Attribute("direction")) 107 { 108 std::cout << "6\n"; 109 std::vector<std::string> pos = tokenize(xmlElem->Attribute("direction"),","); 110 float x, y, z; 111 String2Number<float>(x, pos[0]); 112 String2Number<float>(y, pos[1]); 113 String2Number<float>(z, pos[2]); 114 this->setDirection(x, y, z); 115 } 116 std::cout << "7\n"; 117 if (xmlElem->Attribute("scale")) 118 { 119 std::cout << "8\n"; 120 std::string scaleStr = xmlElem->Attribute("scale"); 121 float scale; 122 String2Number<float>(scale, scaleStr); 123 this->setScale(scale); 124 } 125 std::cout << "9\n"; 126 } 127 128 void WorldEntity::registerAllVariables() 129 { 83 130 // to be implemented ! 84 85 131 } 86 132 }
Note: See TracChangeset
for help on using the changeset viewer.