Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/spaceboundaries/src/orxonox/worldentities/SpaceBoundaries.h @ 8164

Last change on this file since 8164 was 8164, checked in by kmaurus, 13 years ago

Es wird nun erkannt, wenn das Spaceship sich zu weit entfernt. Meldung wird noch nicht angezeigt.

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 *      Maurus Kaufmann
24 *   Co-authors:
25 *      ...
26 *
27 */
28
29#ifndef _SpaceBoundaries_H__
30#define _SpaceBoundaries_H__
31
32/* Folgender Block ist Copy-Paste und somit teilweise wohl unnoetig */
33#include "OrxonoxPrereqs.h"
34#include "core/SubclassIdentifier.h"
35
36/* Einige, spezifische include-Statements */
37#include "core/CoreIncludes.h"
38#include "tools/interfaces/Tickable.h"
39#include "worldentities/StaticEntity.h"
40#include "worldentities/WorldEntity.h"
41
42#include <ColoredTextAreaOverlayElementFactory.h>
43
44#include <string>
45
46
47namespace orxonox
48{
49    class _OrxonoxExport SpaceBoundaries : public StaticEntity, public Tickable
50    {
51        public:
52            SpaceBoundaries(BaseObject* creator);
53            ~SpaceBoundaries();
54           
55            void setCenter(Vector3 r);
56            Vector3 getCenter();
57           
58            void setMaxDistance(float r);
59            float getMaxDistance();
60           
61            void setWarnDistance(float r);
62            float getWarnDistance();
63
64            void XMLPort(Element& xmlelement, XMLPort::Mode mode);
65           
66            void tick(float dt);
67
68        private:
69            Vector3 center;
70            float maxDistance;
71            float warnDistance;
72       
73            float computeDistance(WorldEntity *item); //!< Auf den Mittelpunkt 'center' bezogen.
74            void displayWarning(const std::string warnText);
75            bool isHumanPlayer(Pawn *item);
76            ColoredTextAreaOverlayElementFactory* pColoredTextAreaOverlayElementFactory;
77    };
78}
79
80#endif /* _SpaceBoundaries_H__ */
Note: See TracBrowser for help on using the repository browser.