- Timestamp:
- Sep 27, 2015, 10:03:53 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/weaponFS15/src/modules/weapons/projectiles/GravityBombField.h
r10455 r10601 27 27 28 28 /** 29 * @class 29 * @class GravityBombField 30 30 * 31 * @brief 32 * 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 33 * 34 * @author 35 * @date 34 * @author Manuel Eggimann 35 * @date 23.05.2015 36 36 */ 37 37 class GravityBombField: public ForceField, public RadarViewable { 38 38 public: 39 40 41 42 39 GravityBombField(Context* context); 40 virtual ~GravityBombField(); 41 virtual void tick(float dt); 42 virtual void destroy(); 43 43 44 45 * @fnvoid GravityBombField::setShooter(Pawn* shooter)46 47 * @briefThis function is used to determine save the pawn who created the field and is used inside the GravityBomb class.48 49 * @authorManuel Eggimann50 * @date23.05.201551 52 * @param [in,out]the Pawn that created the field.53 54 55 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 */ 54 void setShooter(Pawn* shooter) 55 { this->shooter_ = shooter; } 56 56 57 58 57 Pawn* getShooter() 58 { return this->shooter_; } 59 59 60 60 private: 61 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 65 66 67 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 70 static const float PEAK_EXPLOSION_FORCE;///< The peak force the explosion exerts on the pawns nearby.71 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. 72 72 73 74 75 76 77 78 79 80 81 82 83 84 85 73 float forceSphereRadius_; 74 float forceStrength_; 75 float lifetime_; 76 float modelScaling_; 77 Vector3 rotationVector_; 78 bool fieldExploded_; 79 ParticleEmitter * particleSphere_; 80 ParticleEmitter * explosionCross_; 81 std::vector<Pawn*> victimsAlreadyDamaged_; 82 MovableEntity * bombModel_; 83 Pawn* shooter_; 84 Backlight* centreLight_; 85 WorldSound* explosionSound_; 86 86 }; 87 87
Note: See TracChangeset
for help on using the changeset viewer.