Changeset 871 for code/trunk/src/orxonox/objects/WorldEntity.cc
- Timestamp:
- Mar 9, 2008, 4:44:36 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/orxonox/objects/WorldEntity.cc
r790 r871 37 37 #include "../Orxonox.h" 38 38 #include "WorldEntity.h" 39 #include "core/XMLPort.h" 39 40 40 41 namespace orxonox … … 86 87 void WorldEntity::loadParams(TiXmlElement* xmlElem) 87 88 { 89 88 90 BaseObject::loadParams(xmlElem); 89 91 /* 90 92 if (xmlElem->Attribute("position")) 91 93 { … … 153 155 154 156 create(); 155 157 */ 158 } 159 160 void WorldEntity::setYawPitchRoll(const Degree& yaw, const Degree& pitch, const Degree& roll) 161 { 162 this->yaw(yaw); 163 this->pitch(pitch); 164 this->roll(roll); 165 } 166 167 /** 168 @brief XML loading and saving. 169 @param xmlelement The XML-element 170 @param loading Loading (true) or saving (false) 171 @return The XML-element 172 */ 173 void WorldEntity::XMLPort(Element& xmlelement, bool loading) 174 { 175 BaseObject::XMLPort(xmlelement, loading); 176 177 XMLPortParam(WorldEntity, "position", setPositionLoader2, getPosition, xmlelement, loading); 178 XMLPortParamLoadOnly(WorldEntity, "direction", setDirectionLoader, xmlelement, loading); 179 XMLPortParamLoadOnly(WorldEntity, "yawpitchroll", setYawPitchRoll, xmlelement, loading); 180 XMLPortParam(WorldEntity, "scale", setTotalScale, getScale, xmlelement, loading); 181 XMLPortParam(WorldEntity, "rotationAxis", setRotationAxisLoader, getRotationAxis, xmlelement, loading); 182 XMLPortParam(WorldEntity, "rotationRate", setRotationRate, getRotationRate, xmlelement, loading); 183 184 XMLPortObject(WorldEntity, WorldEntity, "attached", attachWorldEntity, getAttachedWorldEntity, xmlelement, loading); 156 185 } 157 186 … … 163 192 void WorldEntity::registerAllVariables() 164 193 { 165 // register coordinates194 /* // register coordinates 166 195 registerVar( (void*) &(this->getPosition().x), sizeof(this->getPosition().x), network::DATA); 167 196 registerVar( (void*) &(this->getPosition().y), sizeof(this->getPosition().y), network::DATA); … … 171 200 registerVar( (void*) &(this->getOrientation().x), sizeof(this->getOrientation().x), network::DATA); 172 201 registerVar( (void*) &(this->getOrientation().y), sizeof(this->getOrientation().y), network::DATA); 173 registerVar( (void*) &(this->getOrientation().z), sizeof(this->getOrientation().z), network::DATA); 202 registerVar( (void*) &(this->getOrientation().z), sizeof(this->getOrientation().z), network::DATA);*/ 174 203 // not needed at the moment, because we don't have prediction yet 175 204 /*// register velocity_ … … 183 212 registerVar( (void*) &(this->getRotationAxis().z), sizeof(this->getRotationAxis().z), network::DATA);*/ 184 213 } 214 215 void WorldEntity::attachWorldEntity(WorldEntity* entity) 216 { 217 this->attachedWorldEntities_.push_back(entity); 218 } 219 220 const WorldEntity* WorldEntity::getAttachedWorldEntity(unsigned int index) 221 { 222 if (index < this->attachedWorldEntities_.size()) 223 return this->attachedWorldEntities_[index]; 224 else 225 return 0; 226 } 185 227 }
Note: See TracChangeset
for help on using the changeset viewer.