Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 589 for code/branches/FICN/src


Ignore:
Timestamp:
Dec 17, 2007, 7:14:41 PM (17 years ago)
Author:
landauf
Message:

finally found the damn fkng bug.

Location:
code/branches/FICN/src/orxonox/objects
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • code/branches/FICN/src/orxonox/objects/Mesh.cc

    r586 r589  
    1313    }
    1414
    15     Mesh::Mesh(const std::string& file)
     15    void Mesh::setMesh(const std::string& file)
    1616    {
    17         std::cout << "Mesh: 1\n";
    1817        std::ostringstream name;
    19         std::cout << "Mesh: 2\n";
    2018        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;
    2419        this->entity_ = Orxonox::getSingleton()->getSceneManager()->createEntity("Mesh" + name.str() + "gugus", file);
    25         std::cout << "Mesh: 4, entity after creation: " << this->entity_ << "\n";
    2620    }
    2721
  • code/branches/FICN/src/orxonox/objects/Mesh.h

    r576 r589  
    1212        public:
    1313            Mesh();
    14             Mesh(const std::string& file);
    1514            ~Mesh();
     15            void setMesh(const std::string& file);
     16
    1617            inline Ogre::Entity* getEntity()
    1718                { return this->entity_; }
     19
     20            inline const std::string& getName() const
     21                { return this->entity_->getName(); }
    1822
    1923        private:
  • code/branches/FICN/src/orxonox/objects/Model.cc

    r586 r589  
    2323    void Model::loadParams(TiXmlElement* xmlElem)
    2424    {
    25 std::cout << "### START PARSING MODEL" << std::endl;
    2625        WorldEntity::loadParams(xmlElem);
    2726
    28 
    29 std::cout << "Model: 1\n";
    3027        if (xmlElem->Attribute("mesh"))
    3128        {
    32 std::cout << "Model: 2_1\n";
    3329                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());
    5232        }
    53 std::cout << "Model: 3\n";
    54 std::cout << "### FINISHED PARSING MODEL" << std::endl;
    5533
    5634        COUT(4) << "Loader: Created model" << std::endl;
  • code/branches/FICN/src/orxonox/objects/WorldEntity.cc

    r586 r589  
    4646        RegisterObject(WorldEntity);
    4747
    48         std::cout << "WE: const: 1_1\n";
    4948        if (Orxonox::getSingleton()->getSceneManager())
    5049        {
    51         std::cout << "WE: const: 1_2\n";
    5250            std::ostringstream name;
    5351            name << (WorldEntity::worldEntityCounter_s++);
    5452            this->setName("WorldEntity" + name.str());
    5553            node_ = Orxonox::getSingleton()->getSceneManager()->getRootSceneNode()->createChildSceneNode(this->getName());
    56             std::cout << "WE: const: name: " << this->getName() << ", node: " << this->node_ << std::endl;
    5754        }
    58         std::cout << "WE: const: 1_3\n";
    5955
    6056        this->bStatic_ = true;
     
    8480    void WorldEntity::loadParams(TiXmlElement* xmlElem)
    8581    {
    86 std::cout << "### START PARSING WE" << std::endl;
    8782        BaseObject::loadParams(xmlElem);
    8883
    89         std::cout << "WE: 1\n";
    9084        if (xmlElem->Attribute("name"))
    9185        {
    92         std::cout << "WE: 2\n";
    9386                this->setName(xmlElem->Attribute("mesh"));
    9487        }
    95         std::cout << "WE: 3\n";
     88
    9689        if (xmlElem->Attribute("position"))
    9790        {
    98         std::cout << "WE: 4\n";
    9991                std::vector<std::string> pos = tokenize(xmlElem->Attribute("position"),",");
    10092                float x, y, z;
     
    10496                this->setPosition(x, y, z);
    10597        }
    106         std::cout << "WE: 5\n";
     98
    10799        if (xmlElem->Attribute("direction"))
    108100        {
    109         std::cout << "WE: 6\n";
    110101                std::vector<std::string> pos = tokenize(xmlElem->Attribute("direction"),",");
    111102                float x, y, z;
     
    115106                this->setDirection(x, y, z);
    116107        }
    117         std::cout << "WE: 7\n";
     108
    118109        if (xmlElem->Attribute("scale"))
    119110        {
    120         std::cout << "WE: 8\n";
    121111                    std::string scaleStr = xmlElem->Attribute("scale");
    122112                    float scale;
     
    124114                    this->setScale(scale);
    125115        }
    126         std::cout << "WE: 9\n";
    127 std::cout << "### FINISHED PARSING WE" << std::endl;
    128116    }
    129117
  • code/branches/FICN/src/orxonox/objects/WorldEntity.h

    r586 r589  
    7878
    7979      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); }
    8181      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()); }
    8383      inline void detachObject(Ogre::MovableObject *obj)
    8484        { this->node_->detachObject(obj); }
Note: See TracChangeset for help on using the changeset viewer.