Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6786 for code/branches/lod


Ignore:
Timestamp:
Apr 26, 2010, 4:05:45 PM (14 years ago)
Author:
kolibri7
Message:
 
Location:
code/branches/lod
Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • code/branches/lod/src/orxonox/Level.cc

    r6691 r6786  
    141141   
    142142    //LoD
    143     void Level::addLodInfo(const MeshLodInformation* lodInformation)
     143    void Level::addLodInfo(MeshLodInformation* lodInformation)
    144144    {
    145145//              std::pair<std::map<std::string,MeshLodInformation*>::iterator,bool> it
    146146//                  = new std::pair<lodInformation->getMeshName(),lodInformation>;
    147         this->lodInformation_.insert(std::pair<lodInformation->getMeshName(),lodInformation>);
     147                std::string meshName = lodInformation->getMeshName();
     148        this->lodInformation_.insert(std::make_pair(meshName,lodInformation));
     149                //this->lodInformation_[std::make_pair<meshName,lodInformation>);
    148150    }
    149151
    150     MeshLodInformation* Level::getLodInfo(string meshName) const
     152    const MeshLodInformation* Level::getLodInfo(std::string meshName) const
    151153    {
    152         if(this->lodInformation_.find(meshName)!=std::map::end)
    153             return this->lodInformation_.find(meshName);
     154        if(this->lodInformation_.find(meshName)!=this->lodInformation_.end())
     155            return this->lodInformation_.find(meshName)->second;
    154156       
    155157        return 0;
  • code/branches/lod/src/orxonox/Level.h

    r6691 r6786  
    6262            BaseObject* getObject(unsigned int index) const;
    6363
    64             void addLodInfo(const MeshLodInformation* object);
    65             MeshLodInformation* getLodInfo(unsigned int index) const;
     64            void addLodInfo(MeshLodInformation* object);
     65            const MeshLodInformation* getLodInfo(std::string meshName) const;
     66//            MeshLodInformation* getLodInfo(unsigned int index) const;
    6667
    6768            void setGametypeString(const std::string& gametype);
  • code/branches/lod/src/orxonox/graphics/MeshLodInformation.cc

    r6724 r6786  
    4040    CreateFactory(MeshLodInformation);
    4141
    42     MeshLodInformation::MeshLodInformation(BaseObject* creator) : StaticEntity(creator)
     42    MeshLodInformation::MeshLodInformation(BaseObject* creator)
     43        : BaseObject(creator), lodLevel_(-1)
    4344    {
    4445        RegisterObject(MeshLodInformation);
     
    5657    }
    5758   
    58     std::string getMeshName()
     59    std::string MeshLodInformation::getMeshName()
    5960    {
    60         if(mesh!=null)
    61             return mesh;
    62         return "";
     61                return MeshLodInformation::getMeshSource();
    6362    }
    64 
     63       
     64        void MeshLodInformation::setLodLevel(unsigned int lodLevel)
     65        {
     66                lodLevel_=lodLevel;
     67        }
     68        int MeshLodInformation::getLodLevel()
     69        {
     70                return lodLevel_;
     71        }
     72        void MeshLodInformation::setMeshSource(std::string meshSource)
     73        {
     74                meshSource_ = meshSource;
     75        }
     76        std::string MeshLodInformation::getMeshSource()
     77        {
     78                return meshSource_;
     79        }
    6580 
    6681}
  • code/branches/lod/src/orxonox/graphics/MeshLodInformation.h

    r6724 r6786  
    4040    class _OrxonoxExport MeshLodInformation : public BaseObject
    4141    {
     42                private:
     43                        void setLodLevel(unsigned int lodLevel);
     44                        int getLodLevel();
     45                        void setMeshSource(std::string meshSource);
     46                        std::string getMeshSource();
     47                        std::string meshSource_;
     48                        int lodLevel_;
     49               
    4250        public:
    4351            MeshLodInformation(BaseObject* creator);
  • code/branches/lod/src/orxonox/graphics/Model.cc

    r6691 r6786  
    102102#endif
    103103
    104                     distList.push_back(70.0f*scaleFactor);
    105                     distList.push_back(140.0f*scaleFactor);
    106                     distList.push_back(170.0f*scaleFactor);
    107                     distList.push_back(200.0f*scaleFactor);
    108                     distList.push_back(230.0f*scaleFactor);
    109                     distList.push_back(250.0f*scaleFactor);
    110                     distList.push_back(270.0f*scaleFactor);
    111                     distList.push_back(290.0f*scaleFactor);
    112                     distList.push_back(310.0f*scaleFactor);
    113                     distList.push_back(330.0f*scaleFactor);
     104                                        float factor = scaleFactor*scaleFactor*scaleFactor*scaleFactor;
    114105
    115                     float reductionValue = 0.2f;
     106                    distList.push_back(70.0f*factor);
     107                    distList.push_back(140.0f*factor);
     108                    distList.push_back(170.0f*factor);
     109                    distList.push_back(200.0f*factor);
     110                    distList.push_back(230.0f*factor);
     111                    distList.push_back(250.0f*factor);
     112                    distList.push_back(270.0f*factor);
     113                    distList.push_back(290.0f*factor);
     114                    distList.push_back(310.0f*factor);
     115                    distList.push_back(330.0f*factor);
     116
     117                    float reductionValue = 0.5f;
    116118
    117119                   
Note: See TracChangeset for help on using the changeset viewer.