Changeset 4927 in orxonox.OLD for orxonox/trunk
- Timestamp:
- Jul 21, 2005, 5:33:20 PM (19 years ago)
- Location:
- orxonox/trunk/src/world_entities/weapons
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/world_entities/weapons/projectile.cc
r4890 r4927 61 61 tick function 62 62 */ 63 void Projectile::setFlightDirection( QuaternionflightDirection)63 void Projectile::setFlightDirection(const Quaternion& flightDirection) 64 64 { 65 65 Vector v(1, 0, 0); … … 79 79 } 80 80 81 82 81 /** 83 * 82 * signal tick, time dependent things will be handled here 84 83 * @param time since last tick 85 84 */ -
orxonox/trunk/src/world_entities/weapons/projectile.h
r4890 r4927 34 34 virtual ~Projectile (); 35 35 36 void setFlightDirection( QuaternionflightDirection);36 void setFlightDirection(const Quaternion& flightDirection); 37 37 void setVelocity(const Vector &velocity); 38 38 void setLifeSpan(float lifeSpan); … … 54 54 55 55 float lifeCycle; //!< The percentage of the Lifetime done [0-1] 56 float lifeSpan; //!< The entire lifespan of the Shoot. 56 float lifeSpan; //!< The entire lifespan of the Shoot. in seconds 57 57 58 58 Vector flightDirection; //!< direction in which the shoot flighs -
orxonox/trunk/src/world_entities/weapons/test_gun.cc
r4910 r4927 64 64 if( this->leftRight == W_LEFT) 65 65 { 66 this-> projectileOffset = Vector(1.0, 0.0, -0.35);66 this->setEmissionPoint(1.0, 0.0, -0.35); 67 67 68 68 animation1->addKeyFrame(Vector(0, 0, 0), Quaternion(), 0.1, ANIM_LINEAR, ANIM_CONSTANT); … … 78 78 else if( this->leftRight == W_RIGHT) 79 79 { 80 this-> projectileOffset = Vector(1.0, 0.0, 0.5);80 this->setEmissionPoint(1.0, 0.0, 0.5); 81 81 82 82 this->objectComponent1->setRelCoor(Vector(0,0,0.35)); … … 105 105 this->setStateDuration(WS_DEACTIVATING, .4); 106 106 107 this-> energy = 100;108 this->minCharge = 2;107 this->increaseEnergy(100); 108 //this->minCharge = 2; 109 109 110 110 this->setActionSound(WA_SHOOT, "sound/shot1.wav"); … … 156 156 // weaponSource->play(); 157 157 158 pj->setAbsCoor(this->get AbsCoor() + this->projectileOffset);158 pj->setAbsCoor(this->getEmissionPoint()); 159 159 pj->setAbsDir(this->getAbsDir()); 160 160 pj->setVelocity(this->getVelocity()); -
orxonox/trunk/src/world_entities/weapons/test_gun.h
r4895 r4927 52 52 PNode* objectComponent3; 53 53 54 Vector projectileOffset;55 54 int leftRight; // this will become an enum 56 55 -
orxonox/trunk/src/world_entities/weapons/weapon.cc
r4926 r4927 86 86 this->minCharge = 1.0; 87 87 this->maxCharge = 1.0; 88 88 89 this->energyLoaded = .0; 89 90 this->energyLoadedMax = 10.0; … … 248 249 } 249 250 250 251 251 /** 252 252 * checks and activates the Weapon. … … 268 268 } 269 269 270 271 270 /** 272 271 * checks and deactivates the Weapon … … 308 307 this->requestAction(WA_RELOAD); 309 308 } 310 311 309 } 312 310 … … 370 368 } 371 369 372 373 370 /** 374 371 * enters the requested State, plays back animations updates the timing. … … 386 383 387 384 385 386 /////////////////// 387 // WORLD-ENTITY // 388 // FUNCTIONALITY // 389 /////////////////// 388 390 /** 389 391 * tick signal for time dependent/driven stuff -
orxonox/trunk/src/world_entities/weapons/weapon.h
r4926 r4927 95 95 /** @see void setEmissionPoint(const Vector& point); */ 96 96 inline void setEmissionPoint(float x, float y, float z) { this->setEmissionPoint(Vector(x,y,z)); }; 97 /** @returns the absolute Position of the EmissionPoint */ 98 inline const Vector& getEmissionPoint() const { return this->emissionPoint.getAbsCoor(); }; 97 99 98 100 /** @param state the State to time @param duration the duration of the State */ … … 158 160 159 161 160 pr otected:162 private: 161 163 // it is all about energy 162 164 float energy; //!< The energy stored in the weapons secondary buffers (reserve) … … 171 173 // PHASES // 172 174 //////////// 173 private:174 175 SoundSource* soundSource; //!< A SoundSource to play sound from (this is connected to the PNode of the Weapon) 175 176
Note: See TracChangeset
for help on using the changeset viewer.