Changeset 589
- Timestamp:
- Dec 17, 2007, 7:14:41 PM (17 years ago)
- Location:
- code/branches/FICN/src/orxonox/objects
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/FICN/src/orxonox/objects/Mesh.cc
r586 r589 13 13 } 14 14 15 Mesh::Mesh(const std::string& file)15 void Mesh::setMesh(const std::string& file) 16 16 { 17 std::cout << "Mesh: 1\n";18 17 std::ostringstream name; 19 std::cout << "Mesh: 2\n";20 18 name << (Mesh::meshCounter_s++); 21 std::cout << "Mesh: 3, entity before creation: " << this->entity_ << "\n";22 std::cout << ("Mesh: name: Mesh" + name.str()) << std::endl;23 std::cout << "Mesh: file: " << file << std::endl;24 19 this->entity_ = Orxonox::getSingleton()->getSceneManager()->createEntity("Mesh" + name.str() + "gugus", file); 25 std::cout << "Mesh: 4, entity after creation: " << this->entity_ << "\n";26 20 } 27 21 -
code/branches/FICN/src/orxonox/objects/Mesh.h
r576 r589 12 12 public: 13 13 Mesh(); 14 Mesh(const std::string& file);15 14 ~Mesh(); 15 void setMesh(const std::string& file); 16 16 17 inline Ogre::Entity* getEntity() 17 18 { return this->entity_; } 19 20 inline const std::string& getName() const 21 { return this->entity_->getName(); } 18 22 19 23 private: -
code/branches/FICN/src/orxonox/objects/Model.cc
r586 r589 23 23 void Model::loadParams(TiXmlElement* xmlElem) 24 24 { 25 std::cout << "### START PARSING MODEL" << std::endl;26 25 WorldEntity::loadParams(xmlElem); 27 26 28 29 std::cout << "Model: 1\n";30 27 if (xmlElem->Attribute("mesh")) 31 28 { 32 std::cout << "Model: 2_1\n";33 29 std::string src = xmlElem->Attribute("mesh"); 34 std::cout << "Model: 2_2\n"; 35 std::cout << "Model: mesh before creation: " << &this->mesh_ << std::endl; 36 std::cout << "Model: entity before creation: " << this->mesh_.getEntity() << std::endl; 37 this->mesh_ = Mesh(src); 38 std::cout << "Model: 2_3\n"; 39 std::cout << "Model: entity after creation: " << this->mesh_.getEntity() << std::endl; 40 std::cout << "Model: mesh after creation: " << &this->mesh_ << std::endl; 41 std::cout << "Model: node: " << this->getNode() << std::endl; 42 43 //Entity *ent2 = Orxonox::getSingleton()->getSceneManager()->createEntity( "Robot2", "ogrehead.mesh" ); 44 //SceneNode *node2 = mSceneMgr->getRootSceneNode()->createChildSceneNode( "RobotNode2", Vector3( 50, 0, 0 ) ); 45 //node2->attachObject( ent2 ); 46 //this->attachObject( ent2 ); 47 //node2->attachObject( this->mesh_.getEntity() ); 48 this->attachObject( this->mesh_.getEntity() ); 49 50 // this->attachObject(this->mesh_.getEntity()); 51 std::cout << "Model: 2_4\n"; 30 this->mesh_.setMesh(src); 31 this->attachObject(this->mesh_.getEntity()); 52 32 } 53 std::cout << "Model: 3\n";54 std::cout << "### FINISHED PARSING MODEL" << std::endl;55 33 56 34 COUT(4) << "Loader: Created model" << std::endl; -
code/branches/FICN/src/orxonox/objects/WorldEntity.cc
r586 r589 46 46 RegisterObject(WorldEntity); 47 47 48 std::cout << "WE: const: 1_1\n";49 48 if (Orxonox::getSingleton()->getSceneManager()) 50 49 { 51 std::cout << "WE: const: 1_2\n";52 50 std::ostringstream name; 53 51 name << (WorldEntity::worldEntityCounter_s++); 54 52 this->setName("WorldEntity" + name.str()); 55 53 node_ = Orxonox::getSingleton()->getSceneManager()->getRootSceneNode()->createChildSceneNode(this->getName()); 56 std::cout << "WE: const: name: " << this->getName() << ", node: " << this->node_ << std::endl;57 54 } 58 std::cout << "WE: const: 1_3\n";59 55 60 56 this->bStatic_ = true; … … 84 80 void WorldEntity::loadParams(TiXmlElement* xmlElem) 85 81 { 86 std::cout << "### START PARSING WE" << std::endl;87 82 BaseObject::loadParams(xmlElem); 88 83 89 std::cout << "WE: 1\n";90 84 if (xmlElem->Attribute("name")) 91 85 { 92 std::cout << "WE: 2\n";93 86 this->setName(xmlElem->Attribute("mesh")); 94 87 } 95 std::cout << "WE: 3\n"; 88 96 89 if (xmlElem->Attribute("position")) 97 90 { 98 std::cout << "WE: 4\n";99 91 std::vector<std::string> pos = tokenize(xmlElem->Attribute("position"),","); 100 92 float x, y, z; … … 104 96 this->setPosition(x, y, z); 105 97 } 106 std::cout << "WE: 5\n"; 98 107 99 if (xmlElem->Attribute("direction")) 108 100 { 109 std::cout << "WE: 6\n";110 101 std::vector<std::string> pos = tokenize(xmlElem->Attribute("direction"),","); 111 102 float x, y, z; … … 115 106 this->setDirection(x, y, z); 116 107 } 117 std::cout << "WE: 7\n"; 108 118 109 if (xmlElem->Attribute("scale")) 119 110 { 120 std::cout << "WE: 8\n";121 111 std::string scaleStr = xmlElem->Attribute("scale"); 122 112 float scale; … … 124 114 this->setScale(scale); 125 115 } 126 std::cout << "WE: 9\n";127 std::cout << "### FINISHED PARSING WE" << std::endl;128 116 } 129 117 -
code/branches/FICN/src/orxonox/objects/WorldEntity.h
r586 r589 78 78 79 79 inline void attachObject(Ogre::MovableObject *obj) 80 { std::cout << "gux_1 " << this->node_ << " " << obj << "\n"; this->node_->attachObject(obj); std::cout << "gux_2\n"; }80 { this->node_->attachObject(obj); } 81 81 inline void attachObject(Mesh &mesh) 82 { std::cout << "gux_3 " << this->node_ << " " << &mesh << " " << mesh.getEntity() << "\n"; this->node_->attachObject(mesh.getEntity()); std::cout << "gux_4\n"; }82 { this->node_->attachObject(mesh.getEntity()); } 83 83 inline void detachObject(Ogre::MovableObject *obj) 84 84 { this->node_->detachObject(obj); }
Note: See TracChangeset
for help on using the changeset viewer.