Changeset 6431 in orxonox.OLD for trunk/src/world_entities
- Timestamp:
- Jan 8, 2006, 12:52:23 AM (19 years ago)
- Location:
- trunk/src/world_entities
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/world_entities/weapons/bomb.cc
r6222 r6431 46 46 this->loadModel("models/projectiles/RadioActiveBomb.obj", 1.0); 47 47 48 this->energyMin = 1; 49 this->energyMax = 1; 48 this->setMinEnergy(1); 49 this->setMaxEnergy(10); 50 50 51 this->lifeSpan = 15; 51 52 -
trunk/src/world_entities/weapons/guided_missile.cc
r6426 r6431 41 41 this->loadModel("models/projectiles/orx-rocket.obj", .3); 42 42 43 this-> energyMin = 1;44 this-> energyMax = 10;43 this->setMinEnergy(1); 44 this->setMaxEnergy(10); 45 45 this->lifeSpan = 10.0; 46 46 this->agility = 500; … … 146 146 { 147 147 148 148 149 149 if (this->target != NULL && this->target->getParent() != PNode::getNullParent()) 150 150 { -
trunk/src/world_entities/weapons/laser.cc
r6222 r6431 42 42 this->loadModel("models/projectiles/laser.obj"); 43 43 44 this-> energyMin = 1;45 this-> energyMax = 10;44 this->setMinEnergy(1); 45 this->setMaxEnergy(10); 46 46 this->lifeSpan = 5.0; 47 47 -
trunk/src/world_entities/weapons/projectile.cc
r6142 r6431 53 53 54 54 55 void Projectile::set Energies(float energyMin, float energyMax)55 void Projectile::setMinEnergy(float energyMin) 56 56 { 57 57 this->energyMin = energyMin; 58 if (energyMax <= energyMin)59 {60 this->bChargeable = false;61 this->energyMax = energyMin;62 }63 else64 {65 this->bChargeable = true;66 this->energyMax = energyMax;67 }68 58 } 69 59 -
trunk/src/world_entities/weapons/projectile.h
r6078 r6431 23 23 24 24 25 void set Energies(float energyMin, float energyMax);25 void setMinEnergy(float energyMin); 26 26 /** @returns the minimal charched energy */ 27 inline float getEnergyMin() { return this->energyMin; }; 28 /** @returns the maximal charched energy */ 29 inline float getEnergyMax() { return this->energyMax; }; 27 inline float getMinEnergy() { return this->energyMin; }; 30 28 /** @returns if the Projectile can be charged */ 31 29 inline bool isChageable() { return this->bChargeable; }; … … 50 48 // energy 51 49 float energyMin; //!< The minimal Energy a Projectile needs to be emitted. 52 float energyMax; //!< The maximal Energy a Projectile can take, before being emitted.53 50 bool bChargeable; //!< if the Projectile is Charegeable 54 51 -
trunk/src/world_entities/weapons/rocket.cc
r6222 r6431 42 42 this->loadModel("models/projectiles/orx-rocket.obj", .3); 43 43 44 this-> energyMin = 1;45 this-> energyMax = 10;44 this->setMinEnergy(1); 45 this->setMaxEnergy(10); 46 46 this->lifeSpan = 5; 47 47 -
trunk/src/world_entities/weapons/test_bullet.cc
r6222 r6431 42 42 this->loadModel("models/projectiles/orx-rocket.obj", .3); 43 43 44 this-> energyMin = 1;45 this-> energyMax = 10;44 this->setMinEnergy(1); 45 this->setMaxEnergy(10); 46 46 this->lifeSpan = 2; 47 47 -
trunk/src/world_entities/weapons/weapon.cc
r6306 r6431 144 144 // grabbing Parameters from the Projectile to have them at hand here. 145 145 Projectile* pj = dynamic_cast<Projectile*>(this->projectileFactory->resurrect()); 146 this->minCharge = pj->get EnergyMin();147 this->maxCharge = pj->get EnergyMax();146 this->minCharge = pj->getMinEnergy(); 147 this->maxCharge = pj->getMaxEnergy(); 148 148 this->chargeable = pj->isChageable(); 149 149 this->projectileFactory->kill(pj); -
trunk/src/world_entities/world_entity.cc
r6430 r6431 391 391 } 392 392 393 /** 394 * @brief creates the EnergyWidget 395 * 396 * since not all entities need an EnergyWidget, it is only created on request. 397 */ 393 398 void WorldEntity::createEnergyWidget() 394 399 { … … 397 402 this->energyWidget = new GLGuiBar(); 398 403 this->energyWidget->setSize2D(30,400); 399 this->energyWidget->setAbsCoor2D( 5,100);404 this->energyWidget->setAbsCoor2D(10,100); 400 405 401 406 this->updateEnergyWidget(); … … 405 410 } 406 411 412 /** 413 * @param visibility shows or hides the energy-bar 414 * (creates the widget if needed) 415 */ 407 416 void WorldEntity::setEnergyWidgetVisibilit(bool visibility) 408 417 { … … 422 431 } 423 432 433 /** 434 * @brief updates the EnergyWidget 435 */ 424 436 void WorldEntity::updateEnergyWidget() 425 437 {
Note: See TracChangeset
for help on using the changeset viewer.