Changeset 622 for code/branches/FICN/src/orxonox/objects/WorldEntity.cc
- Timestamp:
- Dec 18, 2007, 6:03:54 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/FICN/src/orxonox/objects/WorldEntity.cc
r614 r622 82 82 BaseObject::loadParams(xmlElem); 83 83 84 85 86 87 84 if (xmlElem->Attribute("name")) 85 { 86 this->setName(xmlElem->Attribute("mesh")); 87 } 88 88 89 90 91 92 93 94 95 96 97 89 if (xmlElem->Attribute("position")) 90 { 91 std::vector<std::string> pos = tokenize(xmlElem->Attribute("position"),","); 92 float x, y, z; 93 String2Number<float>(x, pos[0]); 94 String2Number<float>(y, pos[1]); 95 String2Number<float>(z, pos[2]); 96 this->setPosition(x, y, z); 97 } 98 98 99 100 101 102 103 104 105 106 107 99 if (xmlElem->Attribute("direction")) 100 { 101 std::vector<std::string> pos = tokenize(xmlElem->Attribute("direction"),","); 102 float x, y, z; 103 String2Number<float>(x, pos[0]); 104 String2Number<float>(y, pos[1]); 105 String2Number<float>(z, pos[2]); 106 this->setDirection(x, y, z); 107 } 108 108 109 109 if (xmlElem->Attribute("yaw") || xmlElem->Attribute("pitch") || xmlElem->Attribute("roll")) … … 124 124 } 125 125 126 if (xmlElem->Attribute("scale")) 127 { 128 std::string scaleStr = xmlElem->Attribute("scale"); 129 float scale; 130 String2Number<float>(scale, scaleStr); 131 this->setScale(scale); 132 } 126 if (xmlElem->Attribute("scale")) 127 { 128 std::string scaleStr = xmlElem->Attribute("scale"); 129 float scale; 130 String2Number<float>(scale, scaleStr); 131 this->setScale(scale); 132 } 133 134 if (xmlElem->Attribute("rotationAxis")) 135 { 136 std::vector<std::string> pos = tokenize(xmlElem->Attribute("rotationAxis"),","); 137 float x, y, z; 138 String2Number<float>(x, pos[0]); 139 String2Number<float>(y, pos[1]); 140 String2Number<float>(z, pos[2]); 141 this->setRotationAxis(x, y, z); 142 } 143 144 if (xmlElem->Attribute("rotationRate")) 145 { 146 float rotationRate; 147 String2Number<float>(rotationRate, xmlElem->Attribute("rotationRate")); 148 this->setRotationRate(Degree(rotationRate)); 149 if (rotationRate != 0) 150 this->setStatic(false); 151 } 152 133 153 } 134 154
Note: See TracChangeset
for help on using the changeset viewer.