Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/particleEffectsHS15/src/modules/weapons/projectiles/MineProjectile2.h @ 10901

Last change on this file since 10901 was 10901, checked in by holzerj, 8 years ago

Added explosions effects when the mine explodes.

File size: 2.6 KB
Line 
1/*
2 *   ORXONOX - the hottest 3D action shooter ever to exist
3 *                    > www.orxonox.net <
4 *
5 *
6 *   License notice:
7 *
8 *   This program is free software; you can redistribute it and/or
9 *   modify it under the terms of the GNU General Public License
10 *   as published by the Free Software Foundation; either version 2
11 *   of the License, or (at your option) any later version.
12 *
13 *   This program is distributed in the hope that it will be useful,
14 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
15 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 *   GNU General Public License for more details.
17 *
18 *   You should have received a copy of the GNU General Public License
19 *   along with this program; if not, write to the Free Software
20 *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
21 *
22 *   Author:
23 *      Fabien Vultier
24 *   Co-authors:
25 *      ...
26 *
27 */
28
29/**
30    @file MineProjectile.h
31    @brief Definition of the MineProjectile class.
32*/
33
34#ifndef _MineProjectile_H__
35#define _MineProjectile_H__
36
37#include "weapons/WeaponsPrereqs.h"
38#include "tools/Timer.h"
39#include "worldentities/MovableEntity.h"
40#include "objects/collisionshapes/SphereCollisionShape.h"
41#include "objects/triggers/DistanceTrigger.h"
42#include "BasicProjectile.h"
43
44namespace orxonox
45{
46
47    /**
48    @brief
49        TODO
50    @ingroup WeaponsProjectiles
51    */
52    class _WeaponsExport MineProjectile : public MovableEntity, public BasicProjectile
53    {
54        public:
55            MineProjectile(Context* context);
56            virtual ~MineProjectile();
57
58            virtual void setMaxTimeUntilExplosion(float maxTimeUntilExplosion);
59            virtual void setTimeUntilActivation(float timeUntilActivation);
60            void destructionEffect();
61
62        private:
63            bool bActive_; // The mine can only explode if it is active
64            float maxTimeUntilExplosion_;
65            float timeUntilActivation_;
66            Timer activationTimer_;
67            Timer explodeTimer_;
68            Model* modelCore_;
69            Model* modelRing1_;
70            Model* modelRing2_;
71            Model* modelRing3_;
72            Model* modelRing4_;
73            MovableEntity* rings1_;
74            MovableEntity* rings2_;
75            MovableEntity* core_;
76            ParticleEmitter* emitter_;
77
78            WeakPtr<SphereCollisionShape> collisionShape_; // The collision shape of the projectile.
79            WeakPtr<DistanceTrigger> distanceTrigger_;
80
81            virtual void Activate();
82            virtual void Explode();
83    };
84}
85
86#endif /* _MineProjectile_H__ */
Note: See TracBrowser for help on using the repository browser.