Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6431 in orxonox.OLD


Ignore:
Timestamp:
Jan 8, 2006, 12:52:23 AM (18 years ago)
Author:
bensch
Message:

orxonox/trunk: projectile inherits Energies from WorldEntity

Location:
trunk/src
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/gui/gl_gui/glgui_widget.cc

    r6300 r6431  
    107107}
    108108
     109void GLGuiWidget::hide()
     110{
     111  this->setVisibility(false);
     112}
     113
    109114
    110115void GLGuiWidget::draw() const
  • trunk/src/lib/gui/gl_gui/glgui_widget.h

    r6295 r6431  
    5050
    5151    void show();
    52     void hide() {};
     52    void hide();
    5353
    5454    void connectSignal(GLGuiSignalType signalType, const Executor& signal);
  • trunk/src/world_entities/weapons/bomb.cc

    r6222 r6431  
    4646  this->loadModel("models/projectiles/RadioActiveBomb.obj", 1.0);
    4747
    48   this->energyMin = 1;
    49   this->energyMax = 1;
     48  this->setMinEnergy(1);
     49  this->setMaxEnergy(10);
     50
    5051  this->lifeSpan = 15;
    5152
  • trunk/src/world_entities/weapons/guided_missile.cc

    r6426 r6431  
    4141  this->loadModel("models/projectiles/orx-rocket.obj", .3);
    4242
    43   this->energyMin = 1;
    44   this->energyMax = 10;
     43  this->setMinEnergy(1);
     44  this->setMaxEnergy(10);
    4545  this->lifeSpan = 10.0;
    4646  this->agility = 500;
     
    146146{
    147147
    148  
     148
    149149if (this->target != NULL && this->target->getParent() != PNode::getNullParent())
    150150   {
  • trunk/src/world_entities/weapons/laser.cc

    r6222 r6431  
    4242  this->loadModel("models/projectiles/laser.obj");
    4343
    44   this->energyMin = 1;
    45   this->energyMax = 10;
     44  this->setMinEnergy(1);
     45  this->setMaxEnergy(10);
    4646  this->lifeSpan = 5.0;
    4747
  • trunk/src/world_entities/weapons/projectile.cc

    r6142 r6431  
    5353
    5454
    55 void Projectile::setEnergies(float energyMin, float energyMax)
     55void Projectile::setMinEnergy(float energyMin)
    5656{
    5757  this->energyMin = energyMin;
    58   if (energyMax <= energyMin)
    59   {
    60     this->bChargeable = false;
    61     this->energyMax = energyMin;
    62   }
    63   else
    64   {
    65     this->bChargeable = true;
    66     this->energyMax = energyMax;
    67   }
    6858}
    6959
  • trunk/src/world_entities/weapons/projectile.h

    r6078 r6431  
    2323
    2424
    25     void setEnergies(float energyMin, float energyMax);
     25    void setMinEnergy(float energyMin);
    2626    /** @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; };
    3028    /** @returns if the Projectile can be charged */
    3129    inline bool isChageable() { return this->bChargeable; };
     
    5048    // energy
    5149    float                 energyMin;                 //!< The minimal Energy a Projectile needs to be emitted.
    52     float                 energyMax;                 //!< The maximal Energy a Projectile can take, before being emitted.
    5350    bool                  bChargeable;               //!< if the Projectile is Charegeable
    5451
  • trunk/src/world_entities/weapons/rocket.cc

    r6222 r6431  
    4242  this->loadModel("models/projectiles/orx-rocket.obj", .3);
    4343
    44   this->energyMin = 1;
    45   this->energyMax = 10;
     44  this->setMinEnergy(1);
     45  this->setMaxEnergy(10);
    4646  this->lifeSpan = 5;
    4747
  • trunk/src/world_entities/weapons/test_bullet.cc

    r6222 r6431  
    4242  this->loadModel("models/projectiles/orx-rocket.obj", .3);
    4343
    44   this->energyMin = 1;
    45   this->energyMax = 10;
     44  this->setMinEnergy(1);
     45  this->setMaxEnergy(10);
    4646  this->lifeSpan = 2;
    4747
  • trunk/src/world_entities/weapons/weapon.cc

    r6306 r6431  
    144144    // grabbing Parameters from the Projectile to have them at hand here.
    145145    Projectile* pj = dynamic_cast<Projectile*>(this->projectileFactory->resurrect());
    146     this->minCharge = pj->getEnergyMin();
    147     this->maxCharge = pj->getEnergyMax();
     146    this->minCharge = pj->getMinEnergy();
     147    this->maxCharge = pj->getMaxEnergy();
    148148    this->chargeable = pj->isChageable();
    149149    this->projectileFactory->kill(pj);
  • trunk/src/world_entities/world_entity.cc

    r6430 r6431  
    391391}
    392392
     393/**
     394 * @brief creates the EnergyWidget
     395 *
     396 * since not all entities need an EnergyWidget, it is only created on request.
     397 */
    393398void WorldEntity::createEnergyWidget()
    394399{
     
    397402    this->energyWidget = new GLGuiBar();
    398403    this->energyWidget->setSize2D(30,400);
    399     this->energyWidget->setAbsCoor2D(5,100);
     404    this->energyWidget->setAbsCoor2D(10,100);
    400405
    401406    this->updateEnergyWidget();
     
    405410}
    406411
     412/**
     413 * @param visibility shows or hides the energy-bar
     414 * (creates the widget if needed)
     415 */
    407416void WorldEntity::setEnergyWidgetVisibilit(bool visibility)
    408417{
     
    422431}
    423432
     433/**
     434 * @brief updates the EnergyWidget
     435 */
    424436void WorldEntity::updateEnergyWidget()
    425437{
Note: See TracChangeset for help on using the changeset viewer.