- Timestamp:
- May 3, 2010, 2:29:27 PM (15 years ago)
- Location:
- code/branches/lod/src/orxonox
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/lod/src/orxonox/Level.cc
r6828 r6838 126 126 this->objects_.push_back(object); 127 127 object->setGametype(this->getGametype()); 128 128 object->setLevel(this); 129 129 } 130 130 … … 144 144 void Level::addLodInfo(MeshLodInformation* lodInformation) 145 145 { 146 // 147 // 148 146 // std::pair<std::map<std::string,MeshLodInformation*>::iterator,bool> it 147 // = new std::pair<lodInformation->getMeshName(),lodInformation>; 148 std::string meshName = lodInformation->getMeshName(); 149 149 this->lodInformation_.insert(std::make_pair(meshName,lodInformation)); 150 150 //this->lodInformation_[std::make_pair<meshName,lodInformation>); 151 151 } 152 152 153 constMeshLodInformation* Level::getLodInfo(std::string meshName) const153 MeshLodInformation* Level::getLodInfo(std::string meshName) const 154 154 { 155 155 if(this->lodInformation_.find(meshName)!=this->lodInformation_.end()) -
code/branches/lod/src/orxonox/Level.h
r6786 r6838 57 57 void playerEntered(PlayerInfo* player); 58 58 void playerLeft(PlayerInfo* player); 59 60 MeshLodInformation* getLodInfo(std::string meshName) const; 61 59 62 60 63 private: … … 63 66 64 67 void addLodInfo(MeshLodInformation* object); 65 const MeshLodInformation* getLodInfo(std::string meshName) const;68 // const MeshLodInformation* getLodInfo(std::string meshName) const; 66 69 // MeshLodInformation* getLodInfo(unsigned int index) const; 67 70 -
code/branches/lod/src/orxonox/graphics/MeshLodInformation.h
r6786 r6838 42 42 private: 43 43 void setLodLevel(unsigned int lodLevel); 44 int getLodLevel();45 44 void setMeshSource(std::string meshSource); 46 45 std::string getMeshSource(); … … 52 51 virtual ~MeshLodInformation(); 53 52 53 int getLodLevel(); 54 54 std::string getMeshName(); 55 55 -
code/branches/lod/src/orxonox/graphics/Model.cc
r6828 r6838 29 29 #include "Model.h" 30 30 31 #include <OGRE/OgreEntity.h> 31 // What's this? With the directory in front the filename, my compiler can't find the file... 32 //#include <OGRE/OgreEntity.h> 33 #include <OgreEntity.h> 32 34 33 35 #include "core/CoreIncludes.h" … … 35 37 #include "core/XMLPort.h" 36 38 #include "Scene.h" 39 #include "graphics/MeshLodInformation.h" 40 #include "Level.h" 37 41 38 42 namespace orxonox … … 58 62 { 59 63 SUPER(Model, XMLPort, xmlelement, mode); 60 61 64 65 //LoD 62 66 XMLPortParam(Model, "lodLevel", setLodLevel, getLodLevel, xmlelement, mode).defaultValues(5); 63 67 64 68 XMLPortParam(Model, "mesh", setMeshSource, getMeshSource, xmlelement, mode); 65 69 XMLPortParam(Model, "shadow", setCastShadows, getCastShadows, xmlelement, mode).defaultValues(true); … … 98 102 if(scale3d.z>scaleFactor) 99 103 scaleFactor = scale3d.z; 100 104 105 Level* level_ = this->getLevel(); 106 107 MeshLodInformation* lodInfo = level_->getLodInfo(this->meshSrc_); 108 if(lodInfo!=0) 109 setLodLevel(lodInfo->getLodLevel()); 110 101 111 COUT(0) << this->meshSrc_<< " lodLevel_: " << this->lodLevel_ <<" scale: "<< scaleFactor << std::endl; 102 112 //Fuer Asteroiden perfekt
Note: See TracChangeset
for help on using the changeset viewer.