Changeset 6786 for code/branches/lod/src
- Timestamp:
- Apr 26, 2010, 4:05:45 PM (15 years ago)
- Location:
- code/branches/lod/src/orxonox
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/lod/src/orxonox/Level.cc
r6691 r6786 141 141 142 142 //LoD 143 void Level::addLodInfo( constMeshLodInformation* lodInformation)143 void Level::addLodInfo(MeshLodInformation* lodInformation) 144 144 { 145 145 // std::pair<std::map<std::string,MeshLodInformation*>::iterator,bool> it 146 146 // = 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>); 148 150 } 149 151 150 MeshLodInformation* Level::getLodInfo(string meshName) const152 const MeshLodInformation* Level::getLodInfo(std::string meshName) const 151 153 { 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; 154 156 155 157 return 0; -
code/branches/lod/src/orxonox/Level.h
r6691 r6786 62 62 BaseObject* getObject(unsigned int index) const; 63 63 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; 66 67 67 68 void setGametypeString(const std::string& gametype); -
code/branches/lod/src/orxonox/graphics/MeshLodInformation.cc
r6724 r6786 40 40 CreateFactory(MeshLodInformation); 41 41 42 MeshLodInformation::MeshLodInformation(BaseObject* creator) : StaticEntity(creator) 42 MeshLodInformation::MeshLodInformation(BaseObject* creator) 43 : BaseObject(creator), lodLevel_(-1) 43 44 { 44 45 RegisterObject(MeshLodInformation); … … 56 57 } 57 58 58 std::string getMeshName()59 std::string MeshLodInformation::getMeshName() 59 60 { 60 if(mesh!=null) 61 return mesh; 62 return ""; 61 return MeshLodInformation::getMeshSource(); 63 62 } 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 } 65 80 66 81 } -
code/branches/lod/src/orxonox/graphics/MeshLodInformation.h
r6724 r6786 40 40 class _OrxonoxExport MeshLodInformation : public BaseObject 41 41 { 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 42 50 public: 43 51 MeshLodInformation(BaseObject* creator); -
code/branches/lod/src/orxonox/graphics/Model.cc
r6691 r6786 102 102 #endif 103 103 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; 114 105 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; 116 118 117 119
Note: See TracChangeset
for help on using the changeset viewer.