Changeset 6877 for code/branches
- Timestamp:
- May 10, 2010, 3:35:48 PM (15 years ago)
- Location:
- code/branches/lod
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/lod/data/levels/gametype_underattack.oxw
r5781 r6877 11 11 gametype = UnderAttack 12 12 > 13 14 <lodinformation> 15 <MeshLodInformation mesh=Carrier.mesh lodQuality=1 /> 16 </lodinformation> 17 13 18 <Scene 14 19 ambientlight = "0.5, 0.5, 0.5" -
code/branches/lod/src/orxonox/Level.cc
r6838 r6877 72 72 XMLPortParam(Level, "description", setDescription, getDescription, xmlelement, mode); 73 73 XMLPortParam(Level, "gametype", setGametypeString, getGametypeString, xmlelement, mode).defaultValues("Gametype"); 74 75 XMLPortObjectExtended(Level, BaseObject, "", addObject, getObject, xmlelement, mode, true, false); 74 76 75 XMLPortObject(Level, MeshLodInformation, "lodinformation", addLodInfo, getLodInfo, xmlelement, mode); 76 XMLPortObjectExtended(Level, BaseObject, "", addObject, getObject, xmlelement, mode, true, false); 77 77 } 78 78 … … 141 141 } 142 142 143 //LoD144 143 void Level::addLodInfo(MeshLodInformation* lodInformation) 145 144 { 146 // std::pair<std::map<std::string,MeshLodInformation*>::iterator,bool> it147 // = new std::pair<lodInformation->getMeshName(),lodInformation>;148 145 std::string meshName = lodInformation->getMeshName(); 149 146 this->lodInformation_.insert(std::make_pair(meshName,lodInformation)); 150 //this->lodInformation_[std::make_pair<meshName,lodInformation>);151 147 } 152 148 … … 157 153 158 154 return 0; 159 160 161 /*162 unsigned int i = 0;163 for (std::map<MeshLodInformation*>::const_iterator it = this->lodInformation_.begin(); it != this->lodInformation_.end(); ++it)164 {165 if (i == index)166 return (*it);167 ++i;168 }169 return 0;*/170 155 } 171 156 -
code/branches/lod/src/orxonox/graphics/MeshLodInformation.cc
r6852 r6877 53 53 SUPER(MeshLodInformation, XMLPort, xmlelement, mode); 54 54 55 XMLPortParam(MeshLodInformation, "lodQuality", setLodLevel, getLodLevel, xmlelement, mode).defaultValues(5);56 55 XMLPortParam(MeshLodInformation, "mesh", setMeshSource, getMeshSource, xmlelement, mode); 56 XMLPortParam(MeshLodInformation, "lodQuality", setLodLevel, getLodLevel, xmlelement, mode); 57 57 } 58 58 -
code/branches/lod/src/orxonox/graphics/Model.cc
r6852 r6877 61 61 SUPER(Model, XMLPort, xmlelement, mode); 62 62 63 //LoD64 63 XMLPortParam(Model, "lodLevel", setLodLevel, getLodLevel, xmlelement, mode).defaultValues(5); 65 64 … … 103 102 &&this->meshSrc_!="laserbeam.mesh") 104 103 { 105 float scaleFactor = getBiggestScale(this->getScale3D());106 BaseObject* creatorPtr = this ->getCreator();107 //TODO Doesn't work... 108 while(creatorPtr!= 0&&typeid(creatorPtr)!=typeid(new WorldEntity*))104 float scaleFactor = 1; 105 BaseObject* creatorPtr = this; 106 107 while(creatorPtr!=NULL&&orxonox_cast<WorldEntity*>(creatorPtr)) 109 108 { 110 109 scaleFactor *= getBiggestScale(((WorldEntity*) creatorPtr)->getScale3D()); 111 creatorPtr = this->getCreator();110 creatorPtr = creatorPtr->getCreator(); 112 111 } 113 112 … … 115 114 116 115 MeshLodInformation* lodInfo = level_->getLodInfo(this->meshSrc_); 116 117 117 if(lodInfo!=0) 118 118 setLodLevel(lodInfo->getLodLevel()); … … 126 126 #endif 127 127 128 if(lodLevel_>0 )128 if(lodLevel_>0&&lodLevel_<=5) 129 129 { 130 130 float factor = scaleFactor*5/lodLevel_; … … 143 143 distList.push_back(330.0f*factor); 144 144 145 float reductionValue = 0. 2f;145 float reductionValue = 0.15f; 146 146 147 147 … … 151 151 else 152 152 { 153 COUT(0)<<"LodLevel not set because lodLevel("<<lodLevel_<<") was < 0."<<std::endl; 153 std::string what; 154 if(lodLevel_>5) 155 what = ">5"; 156 else 157 what = "<0"; 158 159 COUT(0)<<"LodLevel not set because lodLevel("<<lodLevel_<<") was "<<what<<"."<<std::endl; 154 160 } 155 161 }
Note: See TracChangeset
for help on using the changeset viewer.