Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/particleEffectsHS15/src/modules/weapons/projectiles/MineProjectile.h @ 10897

Last change on this file since 10897 was 10897, checked in by landauf, 8 years ago

register event-source

File size: 2.4 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 XMLEventPort(Element& xmlelement, XMLPort::Mode mode);
59
60            virtual void setMaxTimeUntilExplosion(float maxTimeUntilExplosion);
61            virtual void setTimeUntilActivation(float timeUntilActivation);
62
63        private:
64            bool bActive_; // The mine can only explode if it is active
65            float maxTimeUntilExplosion_;
66            float timeUntilActivation_;
67            Timer activationTimer_;
68            Timer explodeTimer_;
69            Model* modelCore_;
70            Model* modelRing1_;
71            Model* modelRing2_;
72            MovableEntity* rings_;
73
74            WeakPtr<SphereCollisionShape> collisionShape_; // The collision shape of the projectile.
75            WeakPtr<DistanceTrigger> distanceTrigger_;
76
77            virtual void Activate();
78            virtual void Explode();
79    };
80}
81
82#endif /* _MineProjectile_H__ */
Note: See TracBrowser for help on using the repository browser.