| 1 | /* | 
|---|
| 2 |  * GravityBomb.h | 
|---|
| 3 |  * | 
|---|
| 4 |  *  Created on: Mar 19, 2015 | 
|---|
| 5 |  *      Author: meggiman | 
|---|
| 6 |  */ | 
|---|
| 7 |  | 
|---|
| 8 | #ifndef GravityBOMB_H_ | 
|---|
| 9 | #define GravityBOMB_H_ | 
|---|
| 10 |  | 
|---|
| 11 | #include "weapons/WeaponsPrereqs.h" | 
|---|
| 12 |  | 
|---|
| 13 | #include "tools/Timer.h" | 
|---|
| 14 |  | 
|---|
| 15 | #include "graphics/ParticleSpawner.h" | 
|---|
| 16 | #include "interfaces/RadarViewable.h" | 
|---|
| 17 | #include "objects/ForceField.h" | 
|---|
| 18 | #include "BasicProjectile.h" | 
|---|
| 19 | #include "worldentities/MovableEntity.h" | 
|---|
| 20 | #include "core/CoreIncludes.h" | 
|---|
| 21 | #include "objects/collisionshapes/SphereCollisionShape.h" | 
|---|
| 22 | #include "worldentities/WorldEntity.h" | 
|---|
| 23 | #include "GravityBombField.h" | 
|---|
| 24 | #include "sound/WorldSound.h" | 
|---|
| 25 |  | 
|---|
| 26 | namespace orxonox | 
|---|
| 27 | { | 
|---|
| 28 |     /** | 
|---|
| 29 |      * @class   GravityBomb | 
|---|
| 30 |      * | 
|---|
| 31 |      * @brief   This class implements how long the bomb flies before it places the GravityField at it's last possition. | 
|---|
| 32 |      *          The field will be created either because the timelimit of the bomb expired or it hit something. After creation of the field, | 
|---|
| 33 |      *          the projectile (this object) is destroyed. | 
|---|
| 34 |      * | 
|---|
| 35 |      * @author  Manuel Eggimann | 
|---|
| 36 |      * @date    23.05.2015 | 
|---|
| 37 |      */ | 
|---|
| 38 |     class _WeaponsExport GravityBomb : public BasicProjectile , public MovableEntity, public RadarViewable | 
|---|
| 39 |     { | 
|---|
| 40 |         public: | 
|---|
| 41 |             GravityBomb(Context* context); | 
|---|
| 42 |             virtual ~GravityBomb(); | 
|---|
| 43 |             virtual void tick(float dt); | 
|---|
| 44 |  | 
|---|
| 45 |             virtual bool collidesAgainst(WorldEntity* otherObject, const btCollisionShape* cs, btManifoldPoint& contactPoint); | 
|---|
| 46 |             void detonate(); | 
|---|
| 47 |         private: | 
|---|
| 48 |         static const float LIFETIME; | 
|---|
| 49 |  | 
|---|
| 50 |         bool hasCollided_; | 
|---|
| 51 |         float timeToLife_; //Time the bomb flies before it explodes. | 
|---|
| 52 |         WorldSound* bombSound_; | 
|---|
| 53 |     }; | 
|---|
| 54 | } | 
|---|
| 55 | #endif /* GravityBOMB_H_ */ | 
|---|