Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/objecthierarchy2/src/orxonox/objects/worldentities/pawns/SpaceShip.h @ 2518

Last change on this file since 2518 was 2256, checked in by landauf, 16 years ago

The SpaceShips HUD is working again (Speedbar and Radar)

  • Property svn:eol-style set to native
File size: 3.7 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#ifndef _SpaceShip_H__
30#define _SpaceShip_H__
31
32#include "OrxonoxPrereqs.h"
33
34#include "Pawn.h"
35
36namespace orxonox
37{
38    class _OrxonoxExport SpaceShip : public Pawn
39    {
40        public:
41            SpaceShip(BaseObject* creator);
42            virtual ~SpaceShip();
43
44            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
45            virtual void tick(float dt);
46            void registerVariables();
47            void setConfigValues();
48
49            virtual void moveFrontBack(const Vector2& value);
50            virtual void moveRightLeft(const Vector2& value);
51            virtual void moveUpDown(const Vector2& value);
52
53            virtual void rotateYaw(const Vector2& value);
54            virtual void rotatePitch(const Vector2& value);
55            virtual void rotateRoll(const Vector2& value);
56
57            virtual void fire();
58            virtual void boost();
59
60            void setEngine(Engine* engine);
61            inline Engine* getEngine() const
62                { return this->engine_; }
63
64            void setMaxRotation(const Degree& value)
65                { this->maxRotation_ = value; }
66            void setRotAcc(const Degree& value)
67                { this->rotationAcceleration_ = value; }
68            void setTransDamp(float value)
69                { this->translationDamping_ = value; }
70
71            inline float getMaxRotation() const
72                { return this->maxRotation_.valueDegrees(); }
73            inline float getRotAcc() const
74                { return this->rotationAcceleration_.valueDegrees(); }
75            inline float getTransDamp() const
76                { return this->translationDamping_; }
77
78            inline void setSteeringDirection(const Vector3& direction)
79                { this->steering_ = direction; }
80            inline const Vector3& getSteeringDirection() const
81                { return this->steering_; }
82
83            inline void setBoost(bool bBoost)
84                { this->bBoost_ = bBoost; }
85            inline bool getBoost() const
86                { return this->bBoost_; }
87
88            inline void setEngineTemplate(const std::string& temp)
89                { this->enginetemplate_ = temp; this->loadEngineTemplate(); }
90            inline const std::string& getEngineTemplate() const
91                { return this->enginetemplate_; }
92
93        protected:
94            bool bInvertYAxis_;
95
96            bool bBoost_;
97            Vector3 steering_;
98            float translationDamping_;
99
100            Degree maxRotation_;
101            Degree rotationAcceleration_;
102
103            Degree zeroDegree_;
104            Degree pitchRotation_;
105            Degree yawRotation_;
106            Degree rollRotation_;
107
108        private:
109            void loadEngineTemplate();
110
111            std::string enginetemplate_;
112            Engine* engine_;
113    };
114}
115
116#endif /* _SpaceShip_H__ */
Note: See TracBrowser for help on using the repository browser.