Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4948 in orxonox.OLD


Ignore:
Timestamp:
Jul 23, 2005, 11:50:51 AM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: small cleanup

Location:
orxonox/trunk/src/world_entities/weapons
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/world_entities/weapons/projectile.cc

    r4941 r4948  
    5252  */
    5353  //delete this->projectileModel;
     54}
     55
     56
     57void Projectile::setEnergies(float energyMin, float energyMax)
     58{
     59  this->energyMin = energyMin;
     60  if (energyMax <= energyMin)
     61  {
     62    this->bChargeable = false;
     63    this->energyMax = energyMin;
     64  }
     65  else
     66  {
     67    this->bChargeable = true;
     68    this->energyMax = energyMax;
     69  }
    5470}
    5571
  • orxonox/trunk/src/world_entities/weapons/projectile.h

    r4932 r4948  
    2424#include "vector.h"
    2525
    26 class Vector;
    2726class ParticleEmitter;
    2827
     
    3837
    3938
     39    void setEnergies(float energyMin, float energyMax);
     40    /** @returns the minimal charched energy */
     41    inline float getEnergyMin() { return this->energyMin; };
     42    /** @returns the maximal charched energy */
     43    inline float getEnergyMax() { return this->energyMax; };
     44    /** @returns if the Projectile can be charged */
     45    inline bool isChageable() { return this->bChargeable; };
     46
    4047
    4148
     
    5057    float                 energyMin;
    5158    float                 energyMax;
    52 
     59    bool                  bChargeable;               //!< if the Projectile is Charegeable
    5360
    5461    float                 lifeCycle;                 //!< The percentage of the Lifetime done [0-1]
    5562    float                 lifeSpan;                  //!< The entire lifespan of the Shoot. in seconds
    5663
    57     Vector                flightDirection;           //!< direction in which the shoot flighs
     64    Vector                flightDirection;           //!< DOF direction in which the shoot flighs
    5865
    5966    Vector                velocity;                  //!< velocity of the projectile.
  • orxonox/trunk/src/world_entities/weapons/test_bullet.cc

    r4947 r4948  
    3535  this->setClassID(CL_TEST_BULLET, "TestBullet");
    3636
    37   float modelSize = .5;
     37  float modelSize = .3;
    3838  this->model = (Model*)ResourceManager::getInstance()->load("models/orx-rocket.obj", OBJ, RP_LEVEL, (void*) &modelSize);
     39
     40  this->energyMin = 1;
     41  this->energyMax = 10;
    3942}
    4043
  • orxonox/trunk/src/world_entities/weapons/test_gun.cc

    r4947 r4948  
    113113
    114114  this->setProjectile(CL_TEST_BULLET);
    115   this->getProjectileFactory()->prepare(100);
     115  //this->getProjectileFactory()->prepare(100);
    116116}
    117117
  • orxonox/trunk/src/world_entities/weapons/weapon.cc

    r4947 r4948  
    2525#include "class_list.h"
    2626#include "load_param.h"
     27#include "state.h"
     28#include "sound_engine.h"
     29#include "animation3d.h"
    2730#include "vector.h"
    28 #include "list.h"
    29 #include "state.h"
    30 #include "animation3d.h"
    31 #include "sound_engine.h"
    3231
    3332////////////////////
     
    108107  if (this->projectileFactory == NULL)
    109108    return false;
     109  else
     110  {
     111    // grabbing Parameters from the Projectile to have them at hand here.
     112    this->projectileFactory->prepare(1);
     113    Projectile* pj = dynamic_cast<Projectile*>(this->projectileFactory->resurrect());
     114    this->minCharge = pj->getEnergyMin();
     115    this->maxCharge = pj->getEnergyMax();
     116    this->chargeable = pj->isChageable();
     117  }
    110118};
    111119
Note: See TracChangeset for help on using the changeset viewer.