Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/AsteroidMining_HS17/src/modules/asteroidmining/AsteroidMinable.h @ 11664

Last change on this file since 11664 was 11664, checked in by remartin, 6 years ago

SpicedAsteroidBelt erstellt, kosmetische Veränderungen. Offener Punkt um velocity, ansonsten fehlt nur noch das dokumentieren.

File size: 3.3 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 *      Fabian 'x3n' Landau
24 *   Co-authors:
25 *      ...
26 *
27 */
28
29
30/**
31    @file AsteroidMinable.h
32
33
34*/
35
36#ifndef _AsteroidMinable_H__
37#define _AsteroidMinable_H__
38
39#include "OrxonoxPrereqs.h"
40
41#include <string>
42#include <vector>
43#include "interfaces/PickupCarrier.h"
44#include "interfaces/RadarViewable.h"
45#include "worldentities/ControllableEntity.h"
46#include "worldentities/ExplosionPart.h"
47
48#include "../../orxonox/worldentities/pawns/Pawn.h"
49
50namespace orxonox
51{
52
53
54    class _OrxonoxExport AsteroidMinable : public Pawn{ 
55
56        public:
57            AsteroidMinable(Context* context);// @brief This constructor is for XML access only!
58            AsteroidMinable(Context* c, float size, Vector3 position, Vector3 velocity, bool dS);// @brief Call this Constructor from other C-files.
59
60            virtual ~AsteroidMinable();
61            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
62            virtual void XMLEventPort(Element& xmlelement, XMLPort::Mode mode) override;
63            virtual void tick(float dt) override;
64
65            // @brief Overwrite to prevet 'self-collision' of generated stuff
66            virtual void hit(Pawn* originator, const Vector3& force, const btCollisionShape* cs, float damage, float healthdamage = 0.0f, float shielddamage = 0.0f);
67            virtual void hit(Pawn* originator, btManifoldPoint& contactpoint, const btCollisionShape* cs, float damage, float healthdamage = 0.0f, float shielddamage = 0.0f);
68
69            inline void setSize(int s){this->size = s;}
70            inline int getSize(){return this->size;}
71
72            inline void toggleShattering(bool b){this->generateSmaller = b;}
73            inline bool doesShatter(){return this->generateSmaller;}
74
75            inline void toggleDropStuff(bool b){this->dropStuff = b;}
76            inline bool doesDropStuff(){return this->dropStuff;}
77
78        protected:
79
80            Context* context;
81
82            int size;
83            bool generateSmaller;
84            bool dropStuff;
85
86            bool initialised;
87
88            virtual void death(); 
89
90
91
92        private:
93            void registerVariables();
94            virtual void spawnChildren();
95            virtual void putStuff();
96
97            // @brief Just for testing. Don-t work anyways.
98            void printArrayString(float thingy[]);
99            // @brief Just for testing. Don-t work anyways.
100            void printArrayString(int thingy[]);// Just for testing
101
102
103
104
105
106    }; // tolua_export
107} // tolua_export
108
109#endif /* _AsteroidMinable_H__ */
Note: See TracBrowser for help on using the repository browser.