Changeset 7036
- Timestamp:
- May 31, 2010, 9:02:48 AM (15 years ago)
- Location:
- code/branches/presentation3
- Files:
-
- 28 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/presentation3/data/levels/Level(Deathmatch).oxw
r7032 r7036 1 1 <?lua 2 include("stats.oxo") 3 include("hudtemplates3.oxo") 4 include("underattackhud.oxo") 5 include("templates/spaceship_assff.oxt") 6 include("templates/spaceship_pirate.oxt") 7 include("templates/spaceship_Transporter.oxt") 2 include("stats.oxo") 3 include("hudtemplates3.oxo") 4 include("underattackhud.oxo") 5 include("templates/spaceship_assff.oxt") 6 include("templates/spaceship_pirate.oxt") 7 include("templates/spaceship_Transporter.oxt") 8 include("templates/lodinformation.oxt") 8 9 ?> 9 10 … … 60 61 gametype=TeamDeathmatch 61 62 > 62 <lodinformation>63 <MeshLodInformation mesh=Transporter.mesh lodQuality=10/>64 </lodinformation>63 <templates> 64 <Template link=lodtemplate_default /> 65 </templates> 65 66 66 67 <!-- Ausgang: Szene ===> ambientlight/skybox --> -
code/branches/presentation3/data/levels/Level(UnderAttack).oxw
r7032 r7036 1 1 <?lua 2 include("stats.oxo") 3 include("hudtemplates3.oxo") 4 include("underattackhud.oxo") 5 include("templates/spaceship_assff.oxt") 6 include("templates/spaceship_pirate.oxt") 7 include("templates/spaceship_destroyer.oxt") 2 include("stats.oxo") 3 include("hudtemplates3.oxo") 4 include("underattackhud.oxo") 5 include("templates/spaceship_assff.oxt") 6 include("templates/spaceship_pirate.oxt") 7 include("templates/spaceship_destroyer.oxt") 8 include("templates/lodinformation.oxt") 8 9 ?> 9 10 … … 14 15 gametype=UnderAttack 15 16 > 17 <templates> 18 <Template link=lodtemplate_default /> 19 </templates> 16 20 17 21 <!-- Ausgang: Szene ===> ambientlight/skybox --> -
code/branches/presentation3/data/levels/Quest_PirateAttack.oxw
r7032 r7036 5 5 include("templates/spaceship_HXY_SL.oxt") 6 6 include("templates/spaceship_pirate.oxt") 7 include("templates/lodinformation.oxt") 7 8 ?> 8 9 … … 35 36 gametype=TeamDeathmatch 36 37 > 38 39 <templates> 40 <Template link=lodtemplate_default /> 41 </templates> 37 42 38 43 <Scene -
code/branches/presentation3/data/levels/events.oxw
r6417 r7036 4 4 include("templates/spaceship_assff.oxt") 5 5 include("templates/spaceship_H2.oxt") 6 include("templates/lodinformation.oxt") 6 7 ?> 7 8 … … 10 11 description = "A simple level to test the event-system (with comments)" 11 12 > 13 <templates> 14 <Template link=lodtemplate_default /> 15 </templates> 16 12 17 <Scene 13 18 ambientlight = "0.5, 0.5, 0.5" -
code/branches/presentation3/data/levels/mylevel.oxw
r7032 r7036 6 6 include("templates/spaceship_pirate.oxt") 7 7 include("templates/spaceship_Transporter.oxt") 8 include("templates/lodinformation.oxt") 8 9 ?> 9 10 -
code/branches/presentation3/data/levels/pickups.oxw
r7034 r7036 8 8 include("templates/spaceship_pirate.oxt") 9 9 include("templates/pickup_representation_templates.oxt") 10 include("templates/lodinformation.oxt") 10 11 ?> 11 12 … … 14 15 description = "Just a few tests" 15 16 > 17 <templates> 18 <Template link=lodtemplate_default /> 19 </templates> 16 20 <Scene 17 21 ambientlight = "0.8, 0.8, 0.8" -
code/branches/presentation3/data/levels/presentation.oxw
r6417 r7036 3 3 include("stats.oxo") 4 4 include("templates/spaceship_assff.oxt") 5 include("templates/lodinformation.oxt") 5 6 ?> 6 7 … … 9 10 description = "Just a few tests" 10 11 > 12 <templates> 13 <Template link=lodtemplate_default /> 14 </templates> 11 15 <Scene 12 16 ambientlight = "0.3, 0.3, 0.3" -
code/branches/presentation3/data/levels/presentation09.oxw
r7007 r7036 4 4 include("templates/spaceship_assff.oxt") 5 5 include("templates/spaceship_H2.oxt") 6 include("templates/lodinformation.oxt") 6 7 ?> 7 8 … … 11 12 12 13 > 14 <templates> 15 <Template link=lodtemplate_default /> 16 </templates> 13 17 <Scene 14 18 ambientlight = "0.5, 0.5, 0.5" -
code/branches/presentation3/data/levels/presentation09b.oxw
r7007 r7036 6 6 include("templates/spaceship_pirate.oxt") 7 7 include("templates/pickup_representation_templates.oxt") 8 include("templates/lodinformation.oxt") 8 9 ?> 9 10 … … 13 14 gametype = TeamDeathmatch 14 15 > 16 <templates> 17 <Template link=lodtemplate_default /> 18 </templates> 15 19 <Scene 16 20 ambientlight = "0.5, 0.5, 0.5" -
code/branches/presentation3/data/levels/presentationHS09.oxw
r7007 r7036 6 6 include("templates/spaceship_pirate.oxt") 7 7 include("templates/pickup_representation_templates.oxt") 8 include("templates/lodinformation.oxt") 8 9 ?> 9 10 … … 14 15 hasPhysics = true 15 16 > 17 <templates> 18 <Template link=lodtemplate_default /> 19 </templates> 16 20 <Scene 17 21 ambientlight = "0.6, 0.4, 0.4" -
code/branches/presentation3/data/levels/presentationHS09b.oxw
r7007 r7036 2 2 include("stats.oxo") 3 3 include("hudtemplates3.oxo") 4 include("templates/lodinformation.oxt") 4 5 ?> 5 6 … … 19 20 gametype = TeamDeathmatch 20 21 > 22 <templates> 23 <Template link=lodtemplate_default /> 24 </templates> 21 25 <Scene 22 26 ambientlight = "0.8, 0.8, 0.8" -
code/branches/presentation3/data/levels/presentationLOD.oxw
r7007 r7036 2 2 include("stats.oxo") 3 3 include("hudtemplates3.oxo") 4 include("templates/lodinformation.oxt") 4 5 ?> 5 6 … … 13 14 description = "Just a few tests" 14 15 > 16 <templates> 17 <Template link=lodtemplate_default /> 18 </templates> 15 19 <Scene 16 20 ambientlight = "0.8, 0.8, 0.8" -
code/branches/presentation3/data/levels/presentationLODdif.oxw
r7007 r7036 14 14 description = "Just a few tests" 15 15 > 16 <templates> 17 <Template link=lodtemplate_default /> 18 </templates> 16 19 17 20 <lodinformation> -
code/branches/presentation3/data/levels/presentation_dm.oxw
r7007 r7036 4 4 include("templates/spaceship_assff.oxt") 5 5 include("templates/spaceship_H2.oxt") 6 include("templates/lodinformation.oxt") 6 7 ?> 7 8 … … 10 11 description = "A simple testlevel" 11 12 > 13 <templates> 14 <Template link=lodtemplate_default /> 15 </templates> 12 16 <Scene 13 17 ambientlight = "0.5, 0.5, 0.5" -
code/branches/presentation3/data/levels/presentation_pong.oxw
r7007 r7036 3 3 include("stats.oxo") 4 4 include("ponghud.oxo") 5 include("templates/lodinformation.oxt") 5 6 ?> 6 7 -
code/branches/presentation3/data/levels/princessaeryn.oxw
r7007 r7036 3 3 include("stats.oxo") 4 4 include("templates/spaceship_assff.oxt") 5 include("templates/lodinformation.oxt") 5 6 ?> 6 7 … … 22 23 width = 50 23 24 /> 25 26 <templates> 27 <Template link=lodtemplate_default /> 28 </templates> 24 29 25 30 <Scene -
code/branches/presentation3/data/levels/quest_test.oxw
r7032 r7036 5 5 include("templates/spaceship_HXY_SL.oxt") 6 6 include("templates/spaceship_pirate.oxt") 7 include("templates/lodinformation.oxt") 7 8 ?> 8 9 … … 32 33 width = 50 33 34 /> 35 36 <templates> 37 <Template link=lodtemplate_default /> 38 </templates> 34 39 35 40 <Scene -
code/branches/presentation3/data/levels/sound.oxw
r7007 r7036 2 2 include("stats.oxo") 3 3 include("hudtemplates3.oxo") 4 include("templates/lodinformation.oxt") 4 5 ?> 5 6 … … 13 14 description = "Just a few tests" 14 15 > 16 <templates> 17 <Template link=lodtemplate_default /> 18 </templates> 19 15 20 <Scene 16 21 ambientlight = "0.8, 0.8, 0.8" -
code/branches/presentation3/data/levels/templates/lodinformation.oxt
r7020 r7036 1 1 <Template name=lodtemplate_default defaults=false> 2 2 <Level> 3 <lodinformation> 4 <MeshLodInformation mesh=Carrier.mesh lodQuality=1.8 /> 5 <MeshLodInformation mesh=assff.mesh lodQuality=3 /> 6 <MeshLodInformation mesh=Transporter.mesh lodQuality=5 /> 7 <MeshLodInformation mesh=rocket.mesh lodQuality=5 enabled=true /> 8 </lodinformation> 3 <lodinformation> 4 <MeshLodInformation mesh=Carrier.mesh lodQuality=1.8 /> 5 <MeshLodInformation mesh=assff.mesh lodQuality=3 /> 6 <MeshLodInformation mesh=rocket.mesh lodQuality=5 enabled=true /> 7 <MeshLodInformation mesh=laserbeam.mesh enabled=false /> 8 <MeshLodInformation mesh=HXY.mesh enabled=true numLevels=8 /> 9 <MeshLodInformation mesh=Transporter.mesh enabled=true numLevels=8 /> 10 </lodinformation> 9 11 </Level> 10 12 </Template> -
code/branches/presentation3/data/levels/test_ghost.oxw
r7007 r7036 4 4 include("templates/spaceship_ghost.oxt") 5 5 include("templates/spaceship_pirate.oxt") 6 include("templates/lodinformation.oxt") 6 7 ?> 7 8 … … 11 12 12 13 > 14 <templates> 15 <Template link=lodtemplate_default /> 16 </templates> 17 13 18 <Scene 14 19 ambientlight = "0.5, 0.5, 0.5" -
code/branches/presentation3/data/levels/test_stars.oxw
r7032 r7036 13 13 description = "Just a few tests" 14 14 > 15 <templates> 16 <Template link=lodtemplate_default /> 17 </templates> 15 18 <Scene 16 19 ambientlight = "0.8, 0.8, 0.8" -
code/branches/presentation3/data/levels/tutorial.oxw
r7018 r7036 9 9 description = "A simple testlevel" 10 10 > 11 <templates> 12 <Template link=lodtemplate_default /> 13 </templates> 11 14 <Scene 12 15 ambientlight = "0.5, 0.5, 0.5" -
code/branches/presentation3/data/levels/waypoints.oxw
r7007 r7036 5 5 include("templates/spaceship_H2.oxt") 6 6 include("templates/spaceship_pirate.oxt") 7 include("templates/lodinformation.oxt") 7 8 ?> 8 9 … … 11 12 description = "Testing waypoings for AI controlled spaceships." 12 13 > 14 <templates> 15 <Template link=lodtemplate_default /> 16 </templates> 13 17 <Scene 14 18 ambientlight = "0.5, 0.5, 0.5" -
code/branches/presentation3/src/orxonox/Level.cc
r6961 r7036 145 145 { 146 146 std::string meshName = lodInformation->getMeshName(); 147 this->lodInformation_.insert(std::make_pair(meshName,lodInformation)); 147 // this->lodInformation_.insert(std::make_pair(meshName,lodInformation)); 148 if( this->lodInformation_.find(meshName) != this->lodInformation_.end()) 149 CCOUT(4) << "replacing lod information for " << meshName << endl; 150 this->lodInformation_[meshName] = lodInformation; 148 151 } 149 152 -
code/branches/presentation3/src/orxonox/graphics/MeshLodInformation.cc
r7020 r7036 41 41 42 42 MeshLodInformation::MeshLodInformation(BaseObject* creator) 43 : BaseObject(creator), lodLevel_( -1), bEnabled_(true)43 : BaseObject(creator), lodLevel_(5), bEnabled_(true), numLevels_(10), reductionRate_(0.15) 44 44 { 45 45 RegisterObject(MeshLodInformation); … … 56 56 XMLPortParam(MeshLodInformation, "lodQuality", setLodLevel, getLodLevel, xmlelement, mode); 57 57 XMLPortParam(MeshLodInformation, "enabled", setEnabled, getEnabled, xmlelement, mode); 58 XMLPortParam(MeshLodInformation, "numLevels", setNumLevels, getNumLevels, xmlelement, mode); 59 XMLPortParam(MeshLodInformation, "reductionRate", setReductionRate, getReductionRate, xmlelement, mode); 58 60 } 59 61 -
code/branches/presentation3/src/orxonox/graphics/MeshLodInformation.h
r7020 r7036 47 47 std::string getMeshName(); 48 48 bool getEnabled(){ return this->bEnabled_; } 49 unsigned int getNumLevels(){ return this->numLevels_; } 50 float getReductionRate(){ return this->reductionRate_; } 49 51 50 52 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); … … 53 55 void setLodLevel(float lodLevel); 54 56 void setMeshSource(std::string meshSource); 55 void setEnabled( bool enabled ){ this->bEnabled_ = true; } 57 void setEnabled( bool enabled ){ this->bEnabled_ = enabled; } 58 void setNumLevels( unsigned int num ){ this->numLevels_ = num; } 59 void setReductionRate( float rate ){ this->reductionRate_ = rate; } 56 60 std::string getMeshSource(); 57 61 std::string meshSource_; 58 62 float lodLevel_; 59 63 bool bEnabled_; 64 unsigned int numLevels_; 65 float reductionRate_; 60 66 61 67 }; -
code/branches/presentation3/src/orxonox/graphics/Model.cc
r7024 r7036 42 42 CreateFactory(Model); 43 43 44 Model::Model(BaseObject* creator) : StaticEntity(creator) 44 Model::Model(BaseObject* creator) : 45 StaticEntity(creator), bCastShadows_(true), lodLevel_(5), bLodEnabled_(true), numLodLevels_(10), lodReductionRate_(.15) 45 46 { 46 47 RegisterObject(Model); 47 48 48 this->bCastShadows_ = true;49 50 49 this->registerVariables(); 51 //LoD52 this->lodLevel_=5;53 50 } 54 51 … … 102 99 103 100 //LOD 104 if(this->mesh_.getEntity()->getMesh()->getNumLodLevels()==1 105 &&this->meshSrc_!="laserbeam.mesh") 101 if( this->mesh_.getEntity()->getMesh()->getNumLodLevels()==1 ) 106 102 { 107 103 Level* level = this->getLevel(); … … 109 105 assert( level != 0 ); 110 106 111 if( level->getLodInfo(this->meshSrc_)!=0 ) 112 setLodLevel(level->getLodInfo(this->meshSrc_)->getLodLevel()); 113 if( level->getLodInfo(this->meshSrc_)==0 || level->getLodInfo(this->meshSrc_)->getEnabled() ) 107 MeshLodInformation* lodInfo = level->getLodInfo(this->meshSrc_); 108 if( lodInfo ) 114 109 { 115 110 setLodLevel(lodInfo->getLodLevel()); 111 this->bLodEnabled_ = lodInfo->getEnabled(); 112 this->numLodLevels_ = lodInfo->getNumLevels(); 113 this->lodReductionRate_ = lodInfo->getReductionRate(); 114 } 115 if( this->numLodLevels_>10 ) 116 { 117 CCOUT(2) << "More than 10 LoD levels requested. Creating only 10." << endl; 118 this->numLodLevels_ = 10; 119 } 120 if( this->bLodEnabled_ ) 121 { 116 122 float volume = this->mesh_.getEntity()->getBoundingBox().volume(); 117 123 // float scaleFactor = 1; … … 139 145 float factor = volume/3/lodLevel_; 140 146 141 COUT(4) <<"LodLevel set with factor: "<<factor<<std::endl;147 COUT(4) << "LodLevel set with factor: " << factor << endl; 142 148 143 149 distList.push_back(70.0f*factor); … … 151 157 distList.push_back(310.0f*factor); 152 158 distList.push_back(330.0f*factor); 153 154 float reductionValue = 0.15f;159 while(distList.size()>this->numLodLevels_) 160 distList.pop_back(); 155 161 156 162 157 163 //Generiert LOD-Levels 158 this->mesh_.getEntity()->getMesh()->generateLodLevels(distList, Ogre::ProgressiveMesh::VRQ_PROPORTIONAL, reductionValue);164 this->mesh_.getEntity()->getMesh()->generateLodLevels(distList, Ogre::ProgressiveMesh::VRQ_PROPORTIONAL, this->lodReductionRate_); 159 165 } 160 166 else … … 166 172 what = "<0"; 167 173 168 COUT(4)<<"LodLevel not set because lodLevel("<<lodLevel_<<") was "<<what<<"." <<std::endl;174 COUT(4)<<"LodLevel not set because lodLevel("<<lodLevel_<<") was "<<what<<"." << endl; 169 175 } 170 176 } 177 else 178 COUT(4) << "LodLevel for " << this->meshSrc_ << " not set because is disabled." << endl; 171 179 } 172 180 } -
code/branches/presentation3/src/orxonox/graphics/Model.h
r6937 r7036 79 79 //LoD 80 80 float lodLevel_; 81 bool bLodEnabled_; 82 unsigned int numLodLevels_; 83 float lodReductionRate_; 84 81 85 }; 82 86 }
Note: See TracChangeset
for help on using the changeset viewer.