Changeset 1596 for code/branches/core3/src/orxonox
- Timestamp:
- Jun 12, 2008, 10:53:51 PM (16 years ago)
- Location:
- code/branches/core3/src/orxonox
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/core3/src/orxonox/GraphicsEngine.cc
r1591 r1596 97 97 SetConfigValue(ogreLogLevelCritical_, 2).description("Corresponding orxonox debug level for ogre Critical"); 98 98 99 unsigned int old = this->detailLevelParticle_; 100 SetConfigValue(detailLevelParticle_, 2).description("O: off, 1: low, 2: normal, 3: high"); 101 102 if (this->detailLevelParticle_ != old) 103 for (ObjectList<ParticleInterface>::iterator it = ObjectList<ParticleInterface>::begin(); it; ++it) 104 it->detailLevelChanged(this->detailLevelParticle_); 99 SetConfigValue(detailLevelParticle_, 2).description("O: off, 1: low, 2: normal, 3: high").callback(&GraphicsEngine::detailLevelParticleChanged); 100 } 101 102 void GraphicsEngine::detailLevelParticleChanged() 103 { 104 for (ObjectList<ParticleInterface>::iterator it = ObjectList<ParticleInterface>::begin(); it; ++it) 105 it->detailLevelChanged(this->detailLevelParticle_); 105 106 } 106 107 -
code/branches/core3/src/orxonox/GraphicsEngine.h
r1563 r1596 56 56 public: 57 57 void setConfigValues(); 58 void detailLevelParticleChanged(); 58 59 bool setup(); 59 60 bool declareRessourceLocations(); -
code/branches/core3/src/orxonox/Settings.cc
r1535 r1596 68 68 void Settings::setConfigValues() 69 69 { 70 SetConfigValue(dataPath_, "../../Media/").description("Relative path to the game data."); 70 SetConfigValue(dataPath_, "../../Media/").description("Relative path to the game data.").callback(&Settings::dataPathChanged); 71 } 72 73 /** 74 @brief Callback function if the datapath has changed. 75 */ 76 void Settings::dataPathChanged() 77 { 71 78 if (dataPath_ != "" && dataPath_[dataPath_.size() - 1] != '/') 72 79 { -
code/branches/core3/src/orxonox/Settings.h
r1535 r1596 48 48 public: 49 49 void setConfigValues(); 50 void dataPathChanged(); 50 51 51 52 static const std::string& getDataPath(); -
code/branches/core3/src/orxonox/objects/ParticleProjectile.cc
r1563 r1596 32 32 #include "SpaceShip.h" 33 33 #include "core/CoreIncludes.h" 34 34 #include "core/ConfigValueIncludes.h" 35 35 namespace orxonox 36 36 { … … 52 52 this->particles_ = 0; 53 53 } 54 55 this->setConfigValues(); 54 56 } 55 57 … … 60 62 } 61 63 64 void ParticleProjectile::setConfigValues() 65 { 66 SetConfigValue(speed_, 5000.0).description("The speed of a projectile in units per second").callback(&ParticleProjectile::speedChanged); 67 } 68 69 void ParticleProjectile::speedChanged() 70 { 71 Projectile::speed_s = this->speed_; 72 if (this->owner_) 73 this->setVelocity(this->owner_->getInitialDir() * this->speed_); 74 } 75 62 76 void ParticleProjectile::changedVisibility() 63 77 { -
code/branches/core3/src/orxonox/objects/ParticleProjectile.h
r1558 r1596 44 44 virtual ~ParticleProjectile(); 45 45 virtual void changedVisibility(); 46 void setConfigValues(); 47 void speedChanged(); 46 48 47 49 private: -
code/branches/core3/src/orxonox/objects/Projectile.cc
r1592 r1596 44 44 namespace orxonox 45 45 { 46 float Projectile::speed_ = 5000;46 float Projectile::speed_s = 5000; 47 47 48 48 Projectile::Projectile(SpaceShip* owner) : owner_(owner) … … 74 74 SetConfigValue(damage_, 15.0).description("The damage caused by the projectile"); 75 75 SetConfigValue(lifetime_, 4.0).description("The time in seconds a projectile stays alive"); 76 SetConfigValue(speed_, 5000.0).description("The speed of a projectile in units per second"); 76 SetConfigValue(speed_, 5000.0).description("The speed of a projectile in units per second").callback(&Projectile::speedChanged); 77 } 77 78 79 void Projectile::speedChanged() 80 { 81 Projectile::speed_s = this->speed_; 78 82 if (this->owner_) 79 83 this->setVelocity(this->owner_->getInitialDir() * this->speed_); -
code/branches/core3/src/orxonox/objects/Projectile.h
r1552 r1596 42 42 virtual ~Projectile(); 43 43 void setConfigValues(); 44 void speedChanged(); 44 45 void destroyObject(); 45 46 virtual void tick(float dt); 46 47 47 48 static float getSpeed() 48 { return Projectile::speed_ ; }49 { return Projectile::speed_s; } 49 50 50 51 protected: … … 55 56 std::string explosionTemplateName_; 56 57 std::string smokeTemplateName_; 57 static float speed_; 58 protected: 59 static float speed_s; 60 float speed_; 61 private: 58 62 float lifetime_; 59 63 float damage_; -
code/branches/core3/src/orxonox/objects/RotatingProjectile.cc
r1584 r1596 65 65 void RotatingProjectile::setConfigValues() 66 66 { 67 SetConfigValue(colour_, ColourValue(1.0, 0.0, 0.0)); 67 SetConfigValue(colour_, ColourValue(1.0, 0.0, 0.0)).callback(&RotatingProjectile::colourChanged); 68 } 68 69 70 void RotatingProjectile::colourChanged() 71 { 69 72 if (this->isInitialized()) 70 73 { -
code/branches/core3/src/orxonox/objects/RotatingProjectile.h
r1558 r1596 14 14 virtual ~RotatingProjectile(); 15 15 void setConfigValues(); 16 void colourChanged(); 16 17 virtual void tick(float dt); 17 18 virtual void changedVisibility();
Note: See TracChangeset
for help on using the changeset viewer.