Changeset 622 for code/branches/FICN/src/orxonox/objects
- Timestamp:
- Dec 18, 2007, 6:03:54 PM (17 years ago)
- Location:
- code/branches/FICN/src/orxonox/objects
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/FICN/src/orxonox/objects/Model.cc
r614 r622 25 25 WorldEntity::loadParams(xmlElem); 26 26 27 28 29 30 31 27 if (xmlElem->Attribute("mesh")) 28 { 29 std::string src = xmlElem->Attribute("mesh"); 30 this->mesh_.setMesh(src); 31 this->attachObject(this->mesh_.getEntity()); 32 32 } 33 33 -
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 -
code/branches/FICN/src/orxonox/objects/WorldEntity.h
r589 r622 123 123 { return this->node_->getOrientation(); } 124 124 125 inline void setStatic(bool bStatic) 126 { this->bStatic_ = bStatic; } 127 inline bool isStatic() 128 { return this->bStatic_; } 129 125 130 protected: 126 131 void registerAllVariables();
Note: See TracChangeset
for help on using the changeset viewer.