Changeset 927 for code/branches/network/src/orxonox/objects/WorldEntity.cc
- Timestamp:
- Mar 26, 2008, 5:02:14 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/network/src/orxonox/objects/WorldEntity.cc
r871 r927 49 49 RegisterObject(WorldEntity); 50 50 51 if (Orxonox::getSingleton()->getSceneManager()) 52 { 53 std::ostringstream name; 54 name << (WorldEntity::worldEntityCounter_s++); 55 this->setName("WorldEntity" + name.str()); 56 this->node_ = Orxonox::getSingleton()->getSceneManager()->getRootSceneNode()->createChildSceneNode(this->getName()); 57 } 58 else 59 { 60 this->node_ = 0; 61 } 51 //create(); 62 52 63 53 this->bStatic_ = true; … … 67 57 this->rotationRate_ = 0; 68 58 this->momentum_ = 0; 59 60 if (Orxonox::getSingleton()->getSceneManager()) 61 { 62 std::ostringstream name; 63 name << (WorldEntity::worldEntityCounter_s++); 64 this->setName("WorldEntity" + name.str()); 65 this->node_ = Orxonox::getSingleton()->getSceneManager()->getRootSceneNode()->createChildSceneNode(this->getName()); 66 67 registerAllVariables(); 68 } 69 else 70 { 71 this->node_ = 0; 72 } 69 73 } 70 74 … … 89 93 90 94 BaseObject::loadParams(xmlElem); 95 create(); 91 96 /* 92 97 if (xmlElem->Attribute("position")) … … 185 190 } 186 191 187 bool WorldEntity::create(){188 registerAllVariables();189 return true;190 }191 192 192 193 void WorldEntity::registerAllVariables() 193 194 { 194 /*// register coordinates195 // register coordinates 195 196 registerVar( (void*) &(this->getPosition().x), sizeof(this->getPosition().x), network::DATA); 196 197 registerVar( (void*) &(this->getPosition().y), sizeof(this->getPosition().y), network::DATA); … … 200 201 registerVar( (void*) &(this->getOrientation().x), sizeof(this->getOrientation().x), network::DATA); 201 202 registerVar( (void*) &(this->getOrientation().y), sizeof(this->getOrientation().y), network::DATA); 202 registerVar( (void*) &(this->getOrientation().z), sizeof(this->getOrientation().z), network::DATA); */203 registerVar( (void*) &(this->getOrientation().z), sizeof(this->getOrientation().z), network::DATA); 203 204 // not needed at the moment, because we don't have prediction yet 204 / *// register velocity_205 // register velocity_ 205 206 registerVar( (void*) &(this->getVelocity().x), sizeof(this->getVelocity().x), network::DATA); 206 207 registerVar( (void*) &(this->getVelocity().y), sizeof(this->getVelocity().y), network::DATA); … … 210 211 registerVar( (void*) &(this->getRotationAxis().x), sizeof(this->getRotationAxis().x), network::DATA); 211 212 registerVar( (void*) &(this->getRotationAxis().y), sizeof(this->getRotationAxis().y), network::DATA); 212 registerVar( (void*) &(this->getRotationAxis().z), sizeof(this->getRotationAxis().z), network::DATA); */213 registerVar( (void*) &(this->getRotationAxis().z), sizeof(this->getRotationAxis().z), network::DATA); 213 214 } 214 215
Note: See TracChangeset
for help on using the changeset viewer.