Orxonox  0.0.5 Codename: Arcturus
GravityBombField.h
Go to the documentation of this file.
1 /*
2  * GravityBombField.h
3  *
4  * Created on: Apr 2, 2015
5  * Author: meggiman
6  */
7 
8 #ifndef GRAVITYBOMBFIELD_H_
9 #define GRAVITYBOMBFIELD_H_
10 
13 #include "objects/ForceField.h"
14 #include "BasicProjectile.h"
16 #include "core/CoreIncludes.h"
17 #include "GravityBomb.h"
20 #include <stdlib.h>
21 #include <time.h>
22 #include <math.h>
23 #include "graphics/Backlight.h"
24 #include "sound/WorldSound.h"
25 
26 namespace orxonox {
27 
37 class GravityBombField: public ForceField, public RadarViewable {
38 public:
39  GravityBombField(Context* context);
40  virtual ~GravityBombField();
41  virtual void tick(float dt) override;
42  virtual void destroy();
43 
54  void setShooter(Pawn* shooter)
55  { this->shooter_ = shooter; }
56 
58  { return this->shooter_; }
59 
60 private:
61  //Set these constants inside GravityBombField.cc to alter the behaviour of the field.
62 
63  static const float FORCE_FIELD_LIFETIME;
64  static const float FORCE_SPHERE_START_RADIUS;
65  static const float FORCE_SPHERE_START_STRENGTH;
66  static const float FORCE_FIELD_EXPLOSION_DAMMAGE;
67  static const float EXPLOSION_DURATION;
68  static const float EXPLOSION_RADIUS;
69  static const float PEAK_ANGULAR_VELOCITY;
70  static const float PEAK_EXPLOSION_FORCE;
71  static const float CENTRE_MODEL_END_SIZE;
72 
75  float lifetime_;
77  Vector3 rotationVector_;
81  std::vector<Pawn*> victimsAlreadyDamaged_;
86 };
87 
88 }
89 #endif /* GRAVITYBOMBFIELD_H_ */
90 
Everything in Orxonox that has a health attribute is a Pawn.
Definition: Pawn.h:56
Backlight * centreLight_
Definition: GravityBombField.h:84
ENet time constants and macros.
The WorldSound class is to be used for sounds with position and orientation.
Definition: WorldSound.h:44
void setShooter(Pawn *shooter)
This function is used to determine save the pawn who created the field and is used inside the Gravity...
Definition: GravityBombField.h:54
static const float EXPLOSION_RADIUS
How far does the shockwave reach. All pawns which outside of a sphere witch this radius rest unharmed...
Definition: GravityBombField.h:68
This class is used by GravityBomb to place the ForceField and Visual effect to the environment...
Definition: GravityBombField.h:37
virtual void destroy()
Definition: GravityBombField.cc:170
virtual void tick(float dt) override
A method that is called every tick.
Definition: GravityBombField.cc:94
Definition: MovableEntity.h:42
Vector3 rotationVector_
Definition: GravityBombField.h:77
static const float CENTRE_MODEL_END_SIZE
Size of the 3d-model of the bomb in the fields centre.
Definition: GravityBombField.h:71
Interface for receiving window events.
Definition: RadarViewable.h:48
Definition: ParticleEmitter.h:39
ParticleEmitter * particleSphere_
Definition: GravityBombField.h:79
Pawn * getShooter()
Definition: GravityBombField.h:57
GravityBombField(Context *context)
Definition: GravityBombField.cc:26
float modelScaling_
Definition: GravityBombField.h:76
float forceStrength_
Definition: GravityBombField.h:74
float forceSphereRadius_
Definition: GravityBombField.h:73
static const float FORCE_FIELD_LIFETIME
The lifetime of the ForceField in seconds. After lifetime seconds, has already exploded and the parti...
Definition: GravityBombField.h:63
ParticleEmitter * explosionCross_
Definition: GravityBombField.h:80
Die Wagnis Klasse hat die folgenden Aufgaben:
Definition: ApplicationPaths.cc: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 s...
Definition: GravityBombField.h:66
WorldSound * explosionSound_
Definition: GravityBombField.h:85
Definition: Context.h:45
Defines several very important macros used to register objects, register classes, and to work with id...
float lifetime_
Definition: GravityBombField.h:75
virtual ~GravityBombField()
Definition: GravityBombField.cc:91
bool fieldExploded_
Definition: GravityBombField.h:78
static const float FORCE_SPHERE_START_STRENGTH
The initial Force the Field exerts on every object with non-zero mass.
Definition: GravityBombField.h:65
Implementation of the BasicProjectile class.
Definition: Backlight.h:40
Definition of the ForceField class.
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 i...
Definition: GravityBombField.h:69
static const float FORCE_SPHERE_START_RADIUS
The initial sphere radius of the Force Field. The forcefield gets smaller by time.
Definition: GravityBombField.h:64
Pawn * shooter_
Definition: GravityBombField.h:83
std::vector< Pawn * > victimsAlreadyDamaged_
Definition: GravityBombField.h:81
static const float EXPLOSION_DURATION
Determines how fast the shockwave of the Explosion expands. It takes GravityBombField::EXPLOSION_DURA...
Definition: GravityBombField.h:67
Implements a force field, that applies a force to any MobileEntity that enters its range...
Definition: ForceField.h:85
static const float PEAK_EXPLOSION_FORCE
The peak force the explosion exerts on the pawns nearby.
Definition: GravityBombField.h:70
MovableEntity * bombModel_
Definition: GravityBombField.h:82