- Timestamp:
- May 23, 2015, 7:33:37 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/weaponFS15/src/modules/weapons/projectiles/GravityBombField.h
r10435 r10455 20 20 #include <stdlib.h> 21 21 #include <time.h> 22 #include <math.h> 22 23 #include "graphics/Backlight.h" 24 #include "sound\WorldSound.h" 23 25 24 26 namespace orxonox { 27 28 /** 29 * @class GravityBombField 30 * 31 * @brief This class is used by GravityBomb to place the ForceField and Visual effect to the environment. 32 * The field has a maximum lifetime and gets smaller and stronger the more time passes. In the end, the field explodes and damages all pawns nearby. 33 * 34 * @author Manuel Eggimann 35 * @date 23.05.2015 36 */ 25 37 class GravityBombField: public ForceField, public RadarViewable { 26 38 public: … … 30 42 virtual void destroy(); 31 43 44 /** 45 * @fn void GravityBombField::setShooter(Pawn* shooter) 46 * 47 * @brief This function is used to determine save the pawn who created the field and is used inside the GravityBomb class. 48 * 49 * @author Manuel Eggimann 50 * @date 23.05.2015 51 * 52 * @param [in,out] the Pawn that created the field. 53 */ 32 54 void setShooter(Pawn* shooter) 33 55 { this->shooter_ = shooter; } … … 37 59 38 60 private: 39 static const float FORCE_FIELD_LIFETIME; 40 static const float FORCE_SPHERE_START_RADIUS; 41 static const float FORCE_SPHERE_START_STRENGTH; 42 static const float FORCE_FIELD_EXPLOSION_DAMMAGE; 43 static const float EXPLOSION_DURATION; 44 static const float EXPLOSION_RADIUS; 45 static const float PEAK_ANGULAR_VELOCITY; 46 static const float PEAK_EXPLOSION_FORCE; 61 //Set these constants inside GravityBombField.cc to alter the behaviour of the field. 62 63 static const float FORCE_FIELD_LIFETIME; ///< The lifetime of the ForceField in seconds. After lifetime seconds, has already exploded and the particle effects will start to vanish. 64 static const float FORCE_SPHERE_START_RADIUS; ///< The initial sphere radius of the Force Field. The forcefield gets smaller by time. 65 static const float FORCE_SPHERE_START_STRENGTH; ///< The initial Force the Field exerts on every object with non-zero mass. 66 static const float FORCE_FIELD_EXPLOSION_DAMMAGE; ///< The maximum dammage a pawn gets nearby an exploding field. The farer away from explosion center the smaller the dammage. 67 static const float EXPLOSION_DURATION; ///< Determines how fast the shockwave of the Explosion expands. It takes GravityBombField::EXPLOSION_DURATION seconds for the field to expand from 0 radius to GravityBombField::EXPLOSION_RADIUS. 68 static const float EXPLOSION_RADIUS; ///< How far does the shockwave reach. All pawns which outside of a sphere witch this radius rest unharmed by the explosion. 69 static const float PEAK_ANGULAR_VELOCITY; ///< The model of the bomb in the center of the Field does rotate faster and faster as time passes until it reaches PEAK_ANGULAR_VELOCITY at the fields end of life. 70 static const float PEAK_EXPLOSION_FORCE; ///< The peak force the explosion exerts on the pawns nearby. 71 static const float CENTRE_MODEL_END_SIZE; ///< Size of the 3d-model of the bomb in the fields centre. 47 72 48 73 float forceSphereRadius_; 49 74 float forceStrength_; 50 75 float lifetime_; 76 float modelScaling_; 51 77 Vector3 rotationVector_; 52 78 bool fieldExploded_; … … 56 82 MovableEntity * bombModel_; 57 83 Pawn* shooter_; 84 Backlight* centreLight_; 85 WorldSound* explosionSound_; 58 86 }; 59 87
Note: See TracChangeset
for help on using the changeset viewer.