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