Changeset 6877 for code/branches/lod/src/orxonox/graphics
- Timestamp:
- May 10, 2010, 3:35:48 PM (15 years ago)
- Location:
- code/branches/lod/src/orxonox/graphics
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
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.