Changeset 4948 in orxonox.OLD for orxonox/trunk
- Timestamp:
- Jul 23, 2005, 11:50:51 AM (19 years ago)
- Location:
- orxonox/trunk/src/world_entities/weapons
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/world_entities/weapons/projectile.cc
r4941 r4948 52 52 */ 53 53 //delete this->projectileModel; 54 } 55 56 57 void 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 } 54 70 } 55 71 -
orxonox/trunk/src/world_entities/weapons/projectile.h
r4932 r4948 24 24 #include "vector.h" 25 25 26 class Vector;27 26 class ParticleEmitter; 28 27 … … 38 37 39 38 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 40 47 41 48 … … 50 57 float energyMin; 51 58 float energyMax; 52 59 bool bChargeable; //!< if the Projectile is Charegeable 53 60 54 61 float lifeCycle; //!< The percentage of the Lifetime done [0-1] 55 62 float lifeSpan; //!< The entire lifespan of the Shoot. in seconds 56 63 57 Vector flightDirection; //!< direction in which the shoot flighs64 Vector flightDirection; //!< DOF direction in which the shoot flighs 58 65 59 66 Vector velocity; //!< velocity of the projectile. -
orxonox/trunk/src/world_entities/weapons/test_bullet.cc
r4947 r4948 35 35 this->setClassID(CL_TEST_BULLET, "TestBullet"); 36 36 37 float modelSize = . 5;37 float modelSize = .3; 38 38 this->model = (Model*)ResourceManager::getInstance()->load("models/orx-rocket.obj", OBJ, RP_LEVEL, (void*) &modelSize); 39 40 this->energyMin = 1; 41 this->energyMax = 10; 39 42 } 40 43 -
orxonox/trunk/src/world_entities/weapons/test_gun.cc
r4947 r4948 113 113 114 114 this->setProjectile(CL_TEST_BULLET); 115 this->getProjectileFactory()->prepare(100);115 //this->getProjectileFactory()->prepare(100); 116 116 } 117 117 -
orxonox/trunk/src/world_entities/weapons/weapon.cc
r4947 r4948 25 25 #include "class_list.h" 26 26 #include "load_param.h" 27 #include "state.h" 28 #include "sound_engine.h" 29 #include "animation3d.h" 27 30 #include "vector.h" 28 #include "list.h"29 #include "state.h"30 #include "animation3d.h"31 #include "sound_engine.h"32 31 33 32 //////////////////// … … 108 107 if (this->projectileFactory == NULL) 109 108 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 } 110 118 }; 111 119
Note: See TracChangeset
for help on using the changeset viewer.