Changeset 630 for code/branches/FICN/src/orxonox
- Timestamp:
- Dec 19, 2007, 12:04:49 AM (17 years ago)
- Location:
- code/branches/FICN/src/orxonox/objects
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/FICN/src/orxonox/objects/Model.cc
r622 r630 15 15 { 16 16 RegisterObject(Model); 17 registerAllVariables(); 17 18 } 18 19 … … 27 28 if (xmlElem->Attribute("mesh")) 28 29 { 29 std::string src = xmlElem->Attribute("mesh"); 30 this->mesh_.setMesh(src); 31 this->attachObject(this->mesh_.getEntity()); 30 meshSrc_ = xmlElem->Attribute("mesh"); 32 31 } 32 } 33 34 bool Model::create(){ 35 this->mesh_.setMesh(meshSrc_); 36 this->attachObject(this->mesh_.getEntity()); 33 37 34 COUT(4) << "Loader: Created model" << std::endl; 38 COUT(4) << "Loader: Created model" << std::endl; 39 return true; 40 } 41 42 void Model::registerAllVariables(){ 43 registerVar(&meshSrc_, meshSrc_.length()+1, network::STRING); 35 44 } 36 45 } -
code/branches/FICN/src/orxonox/objects/Model.h
r576 r630 14 14 ~Model(); 15 15 virtual void loadParams(TiXmlElement* xmlElem); 16 bool create(); 16 17 17 18 private: 19 std::string meshSrc_; 18 20 Mesh mesh_; 21 void registerAllVariables(); 19 22 }; 20 23 } -
code/branches/FICN/src/orxonox/objects/WorldEntity.cc
r622 r630 46 46 RegisterObject(WorldEntity); 47 47 48 registerAllVariables(); 48 49 if (Orxonox::getSingleton()->getSceneManager()) 49 50 { … … 151 152 } 152 153 154 create(); 155 153 156 } 154 157 158 bool WorldEntity::create(){ 159 return true; 160 } 161 155 162 void WorldEntity::registerAllVariables() 156 163 { 157 // to be implemented ! 164 // register coordinates 165 registerVar( (void*) &(this->getPosition().x), sizeof(this->getPosition().x), network::DATA); 166 registerVar( (void*) &(this->getPosition().y), sizeof(this->getPosition().y), network::DATA); 167 registerVar( (void*) &(this->getPosition().z), sizeof(this->getPosition().z), network::DATA); 168 // register orientation 169 registerVar( (void*) &(this->getOrientation().w), sizeof(this->getOrientation().w), network::DATA); 170 registerVar( (void*) &(this->getOrientation().x), sizeof(this->getOrientation().x), network::DATA); 171 registerVar( (void*) &(this->getOrientation().y), sizeof(this->getOrientation().y), network::DATA); 172 registerVar( (void*) &(this->getOrientation().z), sizeof(this->getOrientation().z), network::DATA); 173 // not needed at the moment, because we don't have prediction yet 174 /*// register velocity_ 175 registerVar( (void*) &(this->getVelocity().x), sizeof(this->getVelocity().x), network::DATA); 176 registerVar( (void*) &(this->getVelocity().y), sizeof(this->getVelocity().y), network::DATA); 177 registerVar( (void*) &(this->getVelocity().z), sizeof(this->getVelocity().z), network::DATA); 178 // register rotationAxis/rate 179 registerVar( (void*) &(this->getRotationRate()), sizeof(this->getRotationRate()), network::DATA); 180 registerVar( (void*) &(this->getRotationAxis().x), sizeof(this->getRotationAxis().x), network::DATA); 181 registerVar( (void*) &(this->getRotationAxis().y), sizeof(this->getRotationAxis().y), network::DATA); 182 registerVar( (void*) &(this->getRotationAxis().z), sizeof(this->getRotationAxis().z), network::DATA);*/ 158 183 } 159 184 } -
code/branches/FICN/src/orxonox/objects/WorldEntity.h
r622 r630 21 21 virtual void tick(float dt); 22 22 virtual void loadParams(TiXmlElement* xmlElem); 23 23 bool create(); 24 24 25 inline Ogre::SceneNode* getNode() 25 26 { return this->node_; }
Note: See TracChangeset
for help on using the changeset viewer.